@mindbowser_inc/ui-feedback-plugin 0.3.1 → 0.3.2

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.
@@ -1,4 +1,4 @@
1
- (function(Wr,Cr){typeof exports=="object"&&typeof module<"u"?Cr(exports):typeof define=="function"&&define.amd?define(["exports"],Cr):(Wr=typeof globalThis<"u"?globalThis:Wr||self,Cr(Wr.UIFeedbackPlugin={}))})(this,function(Wr){"use strict";var H0e=Object.defineProperty;var $0e=(Wr,Cr,fn)=>Cr in Wr?H0e(Wr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:fn}):Wr[Cr]=fn;var S=(Wr,Cr,fn)=>$0e(Wr,typeof Cr!="symbol"?Cr+"":Cr,fn);var On,dn,Ii,xi,ua,Ri,eH,tH;const Cr=new Set;let fn={active:!1,userName:null,comments:[],replies:new Map,selectedCommentId:null,panelOpen:!1,filter:"open",config:{}};function ms(){return fn}function lt(t){fn={...fn,...t},Cr.forEach(e=>e(fn))}function HB(t){return Cr.add(t),()=>Cr.delete(t)}function $B(){if(fn.userName)return fn.userName;const t=localStorage.getItem("ufp_user_name");return t?(lt({userName:t}),t):null}function VB(t){localStorage.setItem("ufp_user_name",t),lt({userName:t})}function KB(t){try{const e=new URL(t);return e.origin+e.pathname}catch{return t}}function o5(t){return`
1
+ (function(Wr,Cr){typeof exports=="object"&&typeof module<"u"?Cr(exports):typeof define=="function"&&define.amd?define(["exports"],Cr):(Wr=typeof globalThis<"u"?globalThis:Wr||self,Cr(Wr.UIFeedbackPlugin={}))})(this,function(Wr){"use strict";var V0e=Object.defineProperty;var K0e=(Wr,Cr,fn)=>Cr in Wr?V0e(Wr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:fn}):Wr[Cr]=fn;var S=(Wr,Cr,fn)=>K0e(Wr,typeof Cr!="symbol"?Cr+"":Cr,fn);var On,dn,Ii,xi,ua,Ri,eH,tH;const Cr=new Set;let fn={active:!1,userName:null,comments:[],replies:new Map,selectedCommentId:null,panelOpen:!1,filter:"open",config:{}};function ms(){return fn}function lt(t){fn={...fn,...t},Cr.forEach(e=>e(fn))}function HB(t){return Cr.add(t),()=>Cr.delete(t)}function $B(){if(fn.userName)return fn.userName;const t=localStorage.getItem("ufp_user_name");return t?(lt({userName:t}),t):null}function VB(t){localStorage.setItem("ufp_user_name",t),lt({userName:t})}function KB(t){try{const e=new URL(t);return e.origin+e.pathname}catch{return t}}function o5(t){return`
2
2
  :host {
3
3
  --ufp-primary: ${t};
4
4
  --ufp-primary-dark: color-mix(in srgb, ${t} 80%, black);
@@ -762,7 +762,7 @@
762
762
  ${A.length>0?`${A.length} ${A.length===1?"reply":"replies"}`:"No replies yet — click to reply"}
763
763
  </span>
764
764
  </div>
765
- `,i.addEventListener("click",async()=>{let o=e.get(t.id)??[];try{o=await n.getReplies(t.id),e.set(t.id,o)}catch(a){console.error("[ui-feedback-plugin] Failed to fetch replies:",a)}m5(r,t,o,n,a=>{const c=ms();lt({comments:c.comments.map(l=>l.id===a?{...l,resolved:!0}:l)})},a=>{const c=ms();lt({comments:c.comments.map(l=>l.id===a?{...l,resolved:!1}:l)})},a=>{const c=ms();lt({comments:c.comments.filter(l=>l.id!==a)}),e.delete(a)},a=>{const c=e.get(t.id)??[];e.set(t.id,[...c,a]);const l=ms();lt({comments:[...l.comments]})})}),i}async function B5(){try{const t=await C5();return await E5(t)}catch{return _5()}}async function C5(){return(await Promise.resolve().then(()=>Lj)).default}async function E5(t){const e=window.scrollX,r=window.scrollY;window.scrollTo(0,0);try{return(await t(document.body,{allowTaint:!0,useCORS:!0,logging:!1,scale:Math.min(window.devicePixelRatio,2),width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight,windowWidth:document.documentElement.scrollWidth,windowHeight:document.documentElement.scrollHeight,x:0,y:0,ignoreElements:s=>s.tagName==="UI-FEEDBACK-PLUGIN"})).toDataURL("image/png")}finally{window.scrollTo(e,r)}}function _5(){const t=document.createElement("canvas");t.width=window.innerWidth,t.height=window.innerHeight;const e=t.getContext("2d");return e.fillStyle="#f3f4f6",e.fillRect(0,0,t.width,t.height),e.fillStyle="#9ca3af",e.font="16px -apple-system, sans-serif",e.textAlign="center",e.fillText("Screenshot unavailable",t.width/2,t.height/2),t.toDataURL("image/png")}const up="ui-feedback-plugin";async function b5(t){const{backend:e}=t;if(e.provider==="firebase"){const{FirebaseAdapter:r}=await Promise.resolve().then(()=>RJ),n=new r(e);return{db:n,screenshot:n}}if(e.provider==="supabase"){const{SupabaseAdapter:r}=await Promise.resolve().then(()=>QJ),n=new r(e.url,e.anonKey);return{db:n,screenshot:n}}if(e.provider==="aws"){const{AWSAdapter:r}=await Promise.resolve().then(()=>LJ),n=new r(e);return{db:n,screenshot:n}}throw new Error("[ui-feedback-plugin] Unknown backend provider")}function v5(t){var i;if(customElements.get(up))return console.warn("[ui-feedback-plugin] Already initialized."),()=>{};const e=((i=t.theme)==null?void 0:i.primaryColor)??"#6366f1",r=t.projectKey??"default",n=t.position??"bottom-right";lt({config:t});class s extends HTMLElement{constructor(){super();S(this,"shadow");S(this,"db");S(this,"screenshot");S(this,"unsubscribe",null);this.shadow=this.attachShadow({mode:"open"})}async connectedCallback(){const c=document.createElement("style");c.textContent=o5(e),this.shadow.appendChild(c);try{const l=await b5(t);this.db=l.db,this.screenshot=l.screenshot}catch(l){console.error("[ui-feedback-plugin] Failed to initialise backend:",l);return}this.mount()}disconnectedCallback(){var c;(c=this.unsubscribe)==null||c.call(this)}mount(){const c=KB(window.location.href);w5(this.shadow,this.db,()=>this.startAnnotation()),c5(this.shadow,n,()=>this.startAnnotation(),()=>lt({panelOpen:!ms().panelOpen})),this.unsubscribe=this.db.subscribeToComments(c,r,l=>{lt({comments:l})})}async startAnnotation(){let c=$B();if(!c&&(c=await l5(this.shadow),!c))return;lt({active:!0,panelOpen:!1});const l=await f5(this.shadow);if(!l){lt({active:!1});return}lt({active:!1}),this.showToast("Saving comment…","info");try{await this.saveComment(c,l.text,l.shapes),this.showToast("Comment saved!","success")}catch(h){console.error("[ui-feedback-plugin] Failed to save comment:",h),this.showToast("Failed to save — check the browser console for details.","error");return}lt({panelOpen:!0})}async saveComment(c,l,h){const d=KB(window.location.href),p={shapes:h,pageWidth:document.documentElement.scrollWidth,pageHeight:document.documentElement.scrollHeight};this.style.visibility="hidden";let w;try{w=await B5()}finally{this.style.visibility=""}const B={pageUrl:d,projectKey:r,authorName:c,text:l,screenshotUrl:"",annotation:p,resolved:!1,createdAt:Date.now()},C=await this.db.addComment(B),_=await this.screenshot.uploadScreenshot(C,w);await this.db.updateComment(C,{screenshotUrl:_})}showToast(c,l){const h=this.shadow.querySelector(".ufp-toast");h==null||h.remove();const d={info:"#6366f1",success:"#10b981",error:"#ef4444"},p=document.createElement("div");p.className="ufp-toast",p.style.cssText=`
765
+ `,i.addEventListener("click",async()=>{let o=e.get(t.id)??[];try{o=await n.getReplies(t.id),e.set(t.id,o)}catch(a){console.error("[ui-feedback-plugin] Failed to fetch replies:",a)}m5(r,t,o,n,a=>{const c=ms();lt({comments:c.comments.map(l=>l.id===a?{...l,resolved:!0}:l)})},a=>{const c=ms();lt({comments:c.comments.map(l=>l.id===a?{...l,resolved:!1}:l)})},a=>{const c=ms();lt({comments:c.comments.filter(l=>l.id!==a)}),e.delete(a)},a=>{const c=e.get(t.id)??[];e.set(t.id,[...c,a]);const l=ms();lt({comments:[...l.comments]})})}),i}async function B5(){try{const t=await C5();return await E5(t)}catch(t){return console.error("[ui-feedback-plugin] capturePageScreenshot failed:",t),_5()}}async function C5(){return(await Promise.resolve().then(()=>Lj)).default}async function E5(t){const e=window.scrollX,r=window.scrollY;window.scrollTo(0,0);try{return(await t(document.body,{allowTaint:!1,useCORS:!0,logging:!1,scale:Math.min(window.devicePixelRatio,2),width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight,windowWidth:document.documentElement.scrollWidth,windowHeight:document.documentElement.scrollHeight,x:0,y:0,ignoreElements:s=>s.tagName==="UI-FEEDBACK-PLUGIN"})).toDataURL("image/png")}finally{window.scrollTo(e,r)}}function _5(){const t=document.createElement("canvas");t.width=window.innerWidth,t.height=window.innerHeight;const e=t.getContext("2d");return e.fillStyle="#f3f4f6",e.fillRect(0,0,t.width,t.height),e.fillStyle="#9ca3af",e.font="16px -apple-system, sans-serif",e.textAlign="center",e.fillText("Screenshot unavailable",t.width/2,t.height/2),t.toDataURL("image/png")}const up="ui-feedback-plugin";async function b5(t){const{backend:e}=t;if(e.provider==="firebase"){const{FirebaseAdapter:r}=await Promise.resolve().then(()=>RJ),n=new r(e);return{db:n,screenshot:n}}if(e.provider==="supabase"){const{SupabaseAdapter:r}=await Promise.resolve().then(()=>QJ),n=new r(e.url,e.anonKey);return{db:n,screenshot:n}}if(e.provider==="aws"){const{AWSAdapter:r}=await Promise.resolve().then(()=>LJ),n=new r(e);return{db:n,screenshot:n}}if(e.provider==="local"){const{LocalAdapter:r}=await Promise.resolve().then(()=>NJ),n=new r;return{db:n,screenshot:n}}throw new Error("[ui-feedback-plugin] Unknown backend provider")}function v5(t){var i;if(customElements.get(up))return console.warn("[ui-feedback-plugin] Already initialized."),()=>{};const e=((i=t.theme)==null?void 0:i.primaryColor)??"#6366f1",r=t.projectKey??"default",n=t.position??"bottom-right";lt({config:t});class s extends HTMLElement{constructor(){super();S(this,"shadow");S(this,"db");S(this,"screenshot");S(this,"unsubscribe",null);this.shadow=this.attachShadow({mode:"open"})}async connectedCallback(){const c=document.createElement("style");c.textContent=o5(e),this.shadow.appendChild(c);try{const l=await b5(t);this.db=l.db,this.screenshot=l.screenshot}catch(l){console.error("[ui-feedback-plugin] Failed to initialise backend:",l);return}this.mount()}disconnectedCallback(){var c;(c=this.unsubscribe)==null||c.call(this)}mount(){const c=KB(window.location.href);w5(this.shadow,this.db,()=>this.startAnnotation()),c5(this.shadow,n,()=>this.startAnnotation(),()=>lt({panelOpen:!ms().panelOpen})),this.unsubscribe=this.db.subscribeToComments(c,r,l=>{lt({comments:l})})}async startAnnotation(){let c=$B();if(!c&&(c=await l5(this.shadow),!c))return;lt({active:!0,panelOpen:!1});const l=await f5(this.shadow);if(!l){lt({active:!1});return}lt({active:!1}),this.showToast("Saving comment…","info");try{await this.saveComment(c,l.text,l.shapes),this.showToast("Comment saved!","success")}catch(h){console.error("[ui-feedback-plugin] Failed to save comment:",h),this.showToast("Failed to save — check the browser console for details.","error");return}lt({panelOpen:!0})}async saveComment(c,l,h){const d=KB(window.location.href),p={shapes:h,pageWidth:document.documentElement.scrollWidth,pageHeight:document.documentElement.scrollHeight};this.style.visibility="hidden";let w;try{w=await B5()}finally{this.style.visibility=""}const B={pageUrl:d,projectKey:r,authorName:c,text:l,screenshotUrl:"",annotation:p,resolved:!1,createdAt:Date.now()},C=await this.db.addComment(B),_=await this.screenshot.uploadScreenshot(C,w);await this.db.updateComment(C,{screenshotUrl:_})}showToast(c,l){const h=this.shadow.querySelector(".ufp-toast");h==null||h.remove();const d={info:"#6366f1",success:"#10b981",error:"#ef4444"},p=document.createElement("div");p.className="ufp-toast",p.style.cssText=`
766
766
  position:fixed;bottom:80px;left:50%;transform:translateX(-50%);
767
767
  background:${d[l]};color:white;padding:10px 20px;border-radius:8px;
768
768
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
@@ -1152,15 +1152,15 @@ SPDX-License-Identifier: Apache-2.0
1152
1152
 
1153
1153
  Copyright The Closure Library Authors.
1154
1154
  SPDX-License-Identifier: Apache-2.0
1155
- */var i=i||{},o=this||self;function a(u){var g=typeof u;return g=g!="object"?g:u?Array.isArray(u)?"array":g:"null",g=="array"||g=="object"&&typeof u.length=="number"}function c(u){var g=typeof u;return g=="object"&&u!=null||g=="function"}function l(u,g,y){return u.call.apply(u.bind,arguments)}function h(u,g,y){if(!u)throw Error();if(2<arguments.length){var b=Array.prototype.slice.call(arguments,2);return function(){var Q=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(Q,b),u.apply(g,Q)}}return function(){return u.apply(g,arguments)}}function d(u,g,y){return d=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?l:h,d.apply(null,arguments)}function p(u,g){var y=Array.prototype.slice.call(arguments,1);return function(){var b=y.slice();return b.push.apply(b,arguments),u.apply(this,b)}}function w(u,g){function y(){}y.prototype=g.prototype,u.aa=g.prototype,u.prototype=new y,u.prototype.constructor=u,u.Qb=function(b,Q,M){for(var X=Array(arguments.length-2),$e=2;$e<arguments.length;$e++)X[$e-2]=arguments[$e];return g.prototype[Q].apply(b,X)}}function B(u){const g=u.length;if(0<g){const y=Array(g);for(let b=0;b<g;b++)y[b]=u[b];return y}return[]}function C(u,g){for(let y=1;y<arguments.length;y++){const b=arguments[y];if(a(b)){const Q=u.length||0,M=b.length||0;u.length=Q+M;for(let X=0;X<M;X++)u[Q+X]=b[X]}else u.push(b)}}class _{constructor(g,y){this.i=g,this.j=y,this.h=0,this.g=null}get(){let g;return 0<this.h?(this.h--,g=this.g,this.g=g.next,g.next=null):g=this.i(),g}}function T(u){return/^[\s\xa0]*$/.test(u)}function v(){var u=o.navigator;return u&&(u=u.userAgent)?u:""}function k(u){return k[" "](u),u}k[" "]=function(){};var L=v().indexOf("Gecko")!=-1&&!(v().toLowerCase().indexOf("webkit")!=-1&&v().indexOf("Edge")==-1)&&!(v().indexOf("Trident")!=-1||v().indexOf("MSIE")!=-1)&&v().indexOf("Edge")==-1;function V(u,g,y){for(const b in u)g.call(y,u[b],b,u)}function x(u,g){for(const y in u)g.call(void 0,u[y],y,u)}function I(u){const g={};for(const y in u)g[y]=u[y];return g}const R="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function P(u,g){let y,b;for(let Q=1;Q<arguments.length;Q++){b=arguments[Q];for(y in b)u[y]=b[y];for(let M=0;M<R.length;M++)y=R[M],Object.prototype.hasOwnProperty.call(b,y)&&(u[y]=b[y])}}function F(u){var g=1;u=u.split(":");const y=[];for(;0<g&&u.length;)y.push(u.shift()),g--;return u.length&&y.push(u.join(":")),y}function O(u){o.setTimeout(()=>{throw u},0)}function U(){var u=gB;let g=null;return u.g&&(g=u.g,u.g=u.g.next,u.g||(u.h=null),g.next=null),g}class Rt{constructor(){this.h=this.g=null}add(g,y){const b=Qn.get();b.set(g,y),this.h?this.h.next=b:this.g=b,this.h=b}}var Qn=new _(()=>new Ui,u=>u.reset());class Ui{constructor(){this.next=this.g=this.h=null}set(g,y){this.h=g,this.g=y,this.next=null}reset(){this.next=this.g=this.h=null}}let Eu,_u=!1,gB=new Rt,rH=()=>{const u=o.Promise.resolve(void 0);Eu=()=>{u.then(o0e)}};var o0e=()=>{for(var u;u=U();){try{u.h.call(u.g)}catch(y){O(y)}var g=Qn;g.j(u),100>g.h&&(g.h++,u.next=g.g,g.g=u)}_u=!1};function kA(){this.s=this.s,this.C=this.C}kA.prototype.s=!1,kA.prototype.ma=function(){this.s||(this.s=!0,this.N())},kA.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function mr(u,g){this.type=u,this.g=this.target=g,this.defaultPrevented=!1}mr.prototype.h=function(){this.defaultPrevented=!0};var a0e=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var u=!1,g=Object.defineProperty({},"passive",{get:function(){u=!0}});try{const y=()=>{};o.addEventListener("test",y,g),o.removeEventListener("test",y,g)}catch{}return u}();function bu(u,g){if(mr.call(this,u?u.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,u){var y=this.type=u.type,b=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=g,g=u.relatedTarget){if(L){e:{try{k(g.nodeName);var Q=!0;break e}catch{}Q=!1}Q||(g=null)}}else y=="mouseover"?g=u.fromElement:y=="mouseout"&&(g=u.toElement);this.relatedTarget=g,b?(this.clientX=b.clientX!==void 0?b.clientX:b.pageX,this.clientY=b.clientY!==void 0?b.clientY:b.pageY,this.screenX=b.screenX||0,this.screenY=b.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:c0e[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&bu.aa.h.call(this)}}w(bu,mr);var c0e={2:"touch",3:"pen",4:"mouse"};bu.prototype.h=function(){bu.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Hf="closure_listenable_"+(1e6*Math.random()|0),u0e=0;function l0e(u,g,y,b,Q){this.listener=u,this.proxy=null,this.src=g,this.type=y,this.capture=!!b,this.ha=Q,this.key=++u0e,this.da=this.fa=!1}function $f(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Vf(u){this.src=u,this.g={},this.h=0}Vf.prototype.add=function(u,g,y,b,Q){var M=u.toString();u=this.g[M],u||(u=this.g[M]=[],this.h++);var X=wB(u,g,b,Q);return-1<X?(g=u[X],y||(g.fa=!1)):(g=new l0e(g,this.src,M,!!b,Q),g.fa=y,u.push(g)),g};function mB(u,g){var y=g.type;if(y in u.g){var b=u.g[y],Q=Array.prototype.indexOf.call(b,g,void 0),M;(M=0<=Q)&&Array.prototype.splice.call(b,Q,1),M&&($f(g),u.g[y].length==0&&(delete u.g[y],u.h--))}}function wB(u,g,y,b){for(var Q=0;Q<u.length;++Q){var M=u[Q];if(!M.da&&M.listener==g&&M.capture==!!y&&M.ha==b)return Q}return-1}var yB="closure_lm_"+(1e6*Math.random()|0),BB={};function nH(u,g,y,b,Q){if(Array.isArray(g)){for(var M=0;M<g.length;M++)nH(u,g[M],y,b,Q);return null}return y=iH(y),u&&u[Hf]?u.K(g,y,c(b)?!!b.capture:!1,Q):h0e(u,g,y,!1,b,Q)}function h0e(u,g,y,b,Q,M){if(!g)throw Error("Invalid event type");var X=c(Q)?!!Q.capture:!!Q,$e=EB(u);if($e||(u[yB]=$e=new Vf(u)),y=$e.add(g,y,b,X,M),y.proxy)return y;if(b=d0e(),y.proxy=b,b.src=u,b.listener=y,u.addEventListener)a0e||(Q=X),Q===void 0&&(Q=!1),u.addEventListener(g.toString(),b,Q);else if(u.attachEvent)u.attachEvent(AH(g.toString()),b);else if(u.addListener&&u.removeListener)u.addListener(b);else throw Error("addEventListener and attachEvent are unavailable.");return y}function d0e(){function u(y){return g.call(u.src,u.listener,y)}const g=f0e;return u}function sH(u,g,y,b,Q){if(Array.isArray(g))for(var M=0;M<g.length;M++)sH(u,g[M],y,b,Q);else b=c(b)?!!b.capture:!!b,y=iH(y),u&&u[Hf]?(u=u.i,g=String(g).toString(),g in u.g&&(M=u.g[g],y=wB(M,y,b,Q),-1<y&&($f(M[y]),Array.prototype.splice.call(M,y,1),M.length==0&&(delete u.g[g],u.h--)))):u&&(u=EB(u))&&(g=u.g[g.toString()],u=-1,g&&(u=wB(g,y,b,Q)),(y=-1<u?g[u]:null)&&CB(y))}function CB(u){if(typeof u!="number"&&u&&!u.da){var g=u.src;if(g&&g[Hf])mB(g.i,u);else{var y=u.type,b=u.proxy;g.removeEventListener?g.removeEventListener(y,b,u.capture):g.detachEvent?g.detachEvent(AH(y),b):g.addListener&&g.removeListener&&g.removeListener(b),(y=EB(g))?(mB(y,u),y.h==0&&(y.src=null,g[yB]=null)):$f(u)}}}function AH(u){return u in BB?BB[u]:BB[u]="on"+u}function f0e(u,g){if(u.da)u=!0;else{g=new bu(g,this);var y=u.listener,b=u.ha||u.src;u.fa&&CB(u),u=y.call(b,g)}return u}function EB(u){return u=u[yB],u instanceof Vf?u:null}var _B="__closure_events_fn_"+(1e9*Math.random()>>>0);function iH(u){return typeof u=="function"?u:(u[_B]||(u[_B]=function(g){return u.handleEvent(g)}),u[_B])}function wr(){kA.call(this),this.i=new Vf(this),this.M=this,this.F=null}w(wr,kA),wr.prototype[Hf]=!0,wr.prototype.removeEventListener=function(u,g,y,b){sH(this,u,g,y,b)};function Rr(u,g){var y,b=u.F;if(b)for(y=[];b;b=b.F)y.push(b);if(u=u.M,b=g.type||g,typeof g=="string")g=new mr(g,u);else if(g instanceof mr)g.target=g.target||u;else{var Q=g;g=new mr(b,u),P(g,Q)}if(Q=!0,y)for(var M=y.length-1;0<=M;M--){var X=g.g=y[M];Q=Kf(X,b,!0,g)&&Q}if(X=g.g=u,Q=Kf(X,b,!0,g)&&Q,Q=Kf(X,b,!1,g)&&Q,y)for(M=0;M<y.length;M++)X=g.g=y[M],Q=Kf(X,b,!1,g)&&Q}wr.prototype.N=function(){if(wr.aa.N.call(this),this.i){var u=this.i,g;for(g in u.g){for(var y=u.g[g],b=0;b<y.length;b++)$f(y[b]);delete u.g[g],u.h--}}this.F=null},wr.prototype.K=function(u,g,y,b){return this.i.add(String(u),g,!1,y,b)},wr.prototype.L=function(u,g,y,b){return this.i.add(String(u),g,!0,y,b)};function Kf(u,g,y,b){if(g=u.i.g[String(g)],!g)return!0;g=g.concat();for(var Q=!0,M=0;M<g.length;++M){var X=g[M];if(X&&!X.da&&X.capture==y){var $e=X.listener,er=X.ha||X.src;X.fa&&mB(u.i,X),Q=$e.call(er,b)!==!1&&Q}}return Q&&!b.defaultPrevented}function oH(u,g,y){if(typeof u=="function")y&&(u=d(u,y));else if(u&&typeof u.handleEvent=="function")u=d(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(g)?-1:o.setTimeout(u,g||0)}function aH(u){u.g=oH(()=>{u.g=null,u.i&&(u.i=!1,aH(u))},u.l);const g=u.h;u.h=null,u.m.apply(null,g)}class p0e extends kA{constructor(g,y){super(),this.m=g,this.l=y,this.h=null,this.i=!1,this.g=null}j(g){this.h=arguments,this.g?this.i=!0:aH(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function vu(u){kA.call(this),this.h=u,this.g={}}w(vu,kA);var cH=[];function uH(u){V(u.g,function(g,y){this.g.hasOwnProperty(y)&&CB(g)},u),u.g={}}vu.prototype.N=function(){vu.aa.N.call(this),uH(this)},vu.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var bB=o.JSON.stringify,g0e=o.JSON.parse,m0e=class{stringify(u){return o.JSON.stringify(u,void 0)}parse(u){return o.JSON.parse(u,void 0)}};function vB(){}vB.prototype.h=null;function lH(u){return u.h||(u.h=u.i())}function hH(){}var Su={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function SB(){mr.call(this,"d")}w(SB,mr);function TB(){mr.call(this,"c")}w(TB,mr);var ki={},dH=null;function jf(){return dH=dH||new wr}ki.La="serverreachability";function fH(u){mr.call(this,ki.La,u)}w(fH,mr);function Tu(u){const g=jf();Rr(g,new fH(g))}ki.STAT_EVENT="statevent";function pH(u,g){mr.call(this,ki.STAT_EVENT,u),this.stat=g}w(pH,mr);function Ur(u){const g=jf();Rr(g,new pH(g,u))}ki.Ma="timingevent";function gH(u,g){mr.call(this,ki.Ma,u),this.size=g}w(gH,mr);function Iu(u,g){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){u()},g)}function xu(){this.g=!0}xu.prototype.xa=function(){this.g=!1};function w0e(u,g,y,b,Q,M){u.info(function(){if(u.g)if(M)for(var X="",$e=M.split("&"),er=0;er<$e.length;er++){var Ie=$e[er].split("=");if(1<Ie.length){var yr=Ie[0];Ie=Ie[1];var Br=yr.split("_");X=2<=Br.length&&Br[1]=="type"?X+(yr+"="+Ie+"&"):X+(yr+"=redacted&")}}else X=null;else X=M;return"XMLHTTP REQ ("+b+") [attempt "+Q+"]: "+g+`
1155
+ */var i=i||{},o=this||self;function a(u){var g=typeof u;return g=g!="object"?g:u?Array.isArray(u)?"array":g:"null",g=="array"||g=="object"&&typeof u.length=="number"}function c(u){var g=typeof u;return g=="object"&&u!=null||g=="function"}function l(u,g,y){return u.call.apply(u.bind,arguments)}function h(u,g,y){if(!u)throw Error();if(2<arguments.length){var b=Array.prototype.slice.call(arguments,2);return function(){var Q=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(Q,b),u.apply(g,Q)}}return function(){return u.apply(g,arguments)}}function d(u,g,y){return d=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?l:h,d.apply(null,arguments)}function p(u,g){var y=Array.prototype.slice.call(arguments,1);return function(){var b=y.slice();return b.push.apply(b,arguments),u.apply(this,b)}}function w(u,g){function y(){}y.prototype=g.prototype,u.aa=g.prototype,u.prototype=new y,u.prototype.constructor=u,u.Qb=function(b,Q,M){for(var X=Array(arguments.length-2),$e=2;$e<arguments.length;$e++)X[$e-2]=arguments[$e];return g.prototype[Q].apply(b,X)}}function B(u){const g=u.length;if(0<g){const y=Array(g);for(let b=0;b<g;b++)y[b]=u[b];return y}return[]}function C(u,g){for(let y=1;y<arguments.length;y++){const b=arguments[y];if(a(b)){const Q=u.length||0,M=b.length||0;u.length=Q+M;for(let X=0;X<M;X++)u[Q+X]=b[X]}else u.push(b)}}class _{constructor(g,y){this.i=g,this.j=y,this.h=0,this.g=null}get(){let g;return 0<this.h?(this.h--,g=this.g,this.g=g.next,g.next=null):g=this.i(),g}}function T(u){return/^[\s\xa0]*$/.test(u)}function v(){var u=o.navigator;return u&&(u=u.userAgent)?u:""}function k(u){return k[" "](u),u}k[" "]=function(){};var L=v().indexOf("Gecko")!=-1&&!(v().toLowerCase().indexOf("webkit")!=-1&&v().indexOf("Edge")==-1)&&!(v().indexOf("Trident")!=-1||v().indexOf("MSIE")!=-1)&&v().indexOf("Edge")==-1;function V(u,g,y){for(const b in u)g.call(y,u[b],b,u)}function x(u,g){for(const y in u)g.call(void 0,u[y],y,u)}function I(u){const g={};for(const y in u)g[y]=u[y];return g}const R="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function P(u,g){let y,b;for(let Q=1;Q<arguments.length;Q++){b=arguments[Q];for(y in b)u[y]=b[y];for(let M=0;M<R.length;M++)y=R[M],Object.prototype.hasOwnProperty.call(b,y)&&(u[y]=b[y])}}function F(u){var g=1;u=u.split(":");const y=[];for(;0<g&&u.length;)y.push(u.shift()),g--;return u.length&&y.push(u.join(":")),y}function O(u){o.setTimeout(()=>{throw u},0)}function U(){var u=gB;let g=null;return u.g&&(g=u.g,u.g=u.g.next,u.g||(u.h=null),g.next=null),g}class Rt{constructor(){this.h=this.g=null}add(g,y){const b=Qn.get();b.set(g,y),this.h?this.h.next=b:this.g=b,this.h=b}}var Qn=new _(()=>new Ui,u=>u.reset());class Ui{constructor(){this.next=this.g=this.h=null}set(g,y){this.h=g,this.g=y,this.next=null}reset(){this.next=this.g=this.h=null}}let Eu,_u=!1,gB=new Rt,rH=()=>{const u=o.Promise.resolve(void 0);Eu=()=>{u.then(c0e)}};var c0e=()=>{for(var u;u=U();){try{u.h.call(u.g)}catch(y){O(y)}var g=Qn;g.j(u),100>g.h&&(g.h++,u.next=g.g,g.g=u)}_u=!1};function kA(){this.s=this.s,this.C=this.C}kA.prototype.s=!1,kA.prototype.ma=function(){this.s||(this.s=!0,this.N())},kA.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function mr(u,g){this.type=u,this.g=this.target=g,this.defaultPrevented=!1}mr.prototype.h=function(){this.defaultPrevented=!0};var u0e=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var u=!1,g=Object.defineProperty({},"passive",{get:function(){u=!0}});try{const y=()=>{};o.addEventListener("test",y,g),o.removeEventListener("test",y,g)}catch{}return u}();function bu(u,g){if(mr.call(this,u?u.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,u){var y=this.type=u.type,b=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=g,g=u.relatedTarget){if(L){e:{try{k(g.nodeName);var Q=!0;break e}catch{}Q=!1}Q||(g=null)}}else y=="mouseover"?g=u.fromElement:y=="mouseout"&&(g=u.toElement);this.relatedTarget=g,b?(this.clientX=b.clientX!==void 0?b.clientX:b.pageX,this.clientY=b.clientY!==void 0?b.clientY:b.pageY,this.screenX=b.screenX||0,this.screenY=b.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:l0e[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&bu.aa.h.call(this)}}w(bu,mr);var l0e={2:"touch",3:"pen",4:"mouse"};bu.prototype.h=function(){bu.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Hf="closure_listenable_"+(1e6*Math.random()|0),h0e=0;function d0e(u,g,y,b,Q){this.listener=u,this.proxy=null,this.src=g,this.type=y,this.capture=!!b,this.ha=Q,this.key=++h0e,this.da=this.fa=!1}function $f(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Vf(u){this.src=u,this.g={},this.h=0}Vf.prototype.add=function(u,g,y,b,Q){var M=u.toString();u=this.g[M],u||(u=this.g[M]=[],this.h++);var X=wB(u,g,b,Q);return-1<X?(g=u[X],y||(g.fa=!1)):(g=new d0e(g,this.src,M,!!b,Q),g.fa=y,u.push(g)),g};function mB(u,g){var y=g.type;if(y in u.g){var b=u.g[y],Q=Array.prototype.indexOf.call(b,g,void 0),M;(M=0<=Q)&&Array.prototype.splice.call(b,Q,1),M&&($f(g),u.g[y].length==0&&(delete u.g[y],u.h--))}}function wB(u,g,y,b){for(var Q=0;Q<u.length;++Q){var M=u[Q];if(!M.da&&M.listener==g&&M.capture==!!y&&M.ha==b)return Q}return-1}var yB="closure_lm_"+(1e6*Math.random()|0),BB={};function nH(u,g,y,b,Q){if(Array.isArray(g)){for(var M=0;M<g.length;M++)nH(u,g[M],y,b,Q);return null}return y=iH(y),u&&u[Hf]?u.K(g,y,c(b)?!!b.capture:!1,Q):f0e(u,g,y,!1,b,Q)}function f0e(u,g,y,b,Q,M){if(!g)throw Error("Invalid event type");var X=c(Q)?!!Q.capture:!!Q,$e=EB(u);if($e||(u[yB]=$e=new Vf(u)),y=$e.add(g,y,b,X,M),y.proxy)return y;if(b=p0e(),y.proxy=b,b.src=u,b.listener=y,u.addEventListener)u0e||(Q=X),Q===void 0&&(Q=!1),u.addEventListener(g.toString(),b,Q);else if(u.attachEvent)u.attachEvent(AH(g.toString()),b);else if(u.addListener&&u.removeListener)u.addListener(b);else throw Error("addEventListener and attachEvent are unavailable.");return y}function p0e(){function u(y){return g.call(u.src,u.listener,y)}const g=g0e;return u}function sH(u,g,y,b,Q){if(Array.isArray(g))for(var M=0;M<g.length;M++)sH(u,g[M],y,b,Q);else b=c(b)?!!b.capture:!!b,y=iH(y),u&&u[Hf]?(u=u.i,g=String(g).toString(),g in u.g&&(M=u.g[g],y=wB(M,y,b,Q),-1<y&&($f(M[y]),Array.prototype.splice.call(M,y,1),M.length==0&&(delete u.g[g],u.h--)))):u&&(u=EB(u))&&(g=u.g[g.toString()],u=-1,g&&(u=wB(g,y,b,Q)),(y=-1<u?g[u]:null)&&CB(y))}function CB(u){if(typeof u!="number"&&u&&!u.da){var g=u.src;if(g&&g[Hf])mB(g.i,u);else{var y=u.type,b=u.proxy;g.removeEventListener?g.removeEventListener(y,b,u.capture):g.detachEvent?g.detachEvent(AH(y),b):g.addListener&&g.removeListener&&g.removeListener(b),(y=EB(g))?(mB(y,u),y.h==0&&(y.src=null,g[yB]=null)):$f(u)}}}function AH(u){return u in BB?BB[u]:BB[u]="on"+u}function g0e(u,g){if(u.da)u=!0;else{g=new bu(g,this);var y=u.listener,b=u.ha||u.src;u.fa&&CB(u),u=y.call(b,g)}return u}function EB(u){return u=u[yB],u instanceof Vf?u:null}var _B="__closure_events_fn_"+(1e9*Math.random()>>>0);function iH(u){return typeof u=="function"?u:(u[_B]||(u[_B]=function(g){return u.handleEvent(g)}),u[_B])}function wr(){kA.call(this),this.i=new Vf(this),this.M=this,this.F=null}w(wr,kA),wr.prototype[Hf]=!0,wr.prototype.removeEventListener=function(u,g,y,b){sH(this,u,g,y,b)};function Rr(u,g){var y,b=u.F;if(b)for(y=[];b;b=b.F)y.push(b);if(u=u.M,b=g.type||g,typeof g=="string")g=new mr(g,u);else if(g instanceof mr)g.target=g.target||u;else{var Q=g;g=new mr(b,u),P(g,Q)}if(Q=!0,y)for(var M=y.length-1;0<=M;M--){var X=g.g=y[M];Q=Kf(X,b,!0,g)&&Q}if(X=g.g=u,Q=Kf(X,b,!0,g)&&Q,Q=Kf(X,b,!1,g)&&Q,y)for(M=0;M<y.length;M++)X=g.g=y[M],Q=Kf(X,b,!1,g)&&Q}wr.prototype.N=function(){if(wr.aa.N.call(this),this.i){var u=this.i,g;for(g in u.g){for(var y=u.g[g],b=0;b<y.length;b++)$f(y[b]);delete u.g[g],u.h--}}this.F=null},wr.prototype.K=function(u,g,y,b){return this.i.add(String(u),g,!1,y,b)},wr.prototype.L=function(u,g,y,b){return this.i.add(String(u),g,!0,y,b)};function Kf(u,g,y,b){if(g=u.i.g[String(g)],!g)return!0;g=g.concat();for(var Q=!0,M=0;M<g.length;++M){var X=g[M];if(X&&!X.da&&X.capture==y){var $e=X.listener,er=X.ha||X.src;X.fa&&mB(u.i,X),Q=$e.call(er,b)!==!1&&Q}}return Q&&!b.defaultPrevented}function oH(u,g,y){if(typeof u=="function")y&&(u=d(u,y));else if(u&&typeof u.handleEvent=="function")u=d(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(g)?-1:o.setTimeout(u,g||0)}function aH(u){u.g=oH(()=>{u.g=null,u.i&&(u.i=!1,aH(u))},u.l);const g=u.h;u.h=null,u.m.apply(null,g)}class m0e extends kA{constructor(g,y){super(),this.m=g,this.l=y,this.h=null,this.i=!1,this.g=null}j(g){this.h=arguments,this.g?this.i=!0:aH(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function vu(u){kA.call(this),this.h=u,this.g={}}w(vu,kA);var cH=[];function uH(u){V(u.g,function(g,y){this.g.hasOwnProperty(y)&&CB(g)},u),u.g={}}vu.prototype.N=function(){vu.aa.N.call(this),uH(this)},vu.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var bB=o.JSON.stringify,w0e=o.JSON.parse,y0e=class{stringify(u){return o.JSON.stringify(u,void 0)}parse(u){return o.JSON.parse(u,void 0)}};function vB(){}vB.prototype.h=null;function lH(u){return u.h||(u.h=u.i())}function hH(){}var Su={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function SB(){mr.call(this,"d")}w(SB,mr);function TB(){mr.call(this,"c")}w(TB,mr);var ki={},dH=null;function jf(){return dH=dH||new wr}ki.La="serverreachability";function fH(u){mr.call(this,ki.La,u)}w(fH,mr);function Tu(u){const g=jf();Rr(g,new fH(g))}ki.STAT_EVENT="statevent";function pH(u,g){mr.call(this,ki.STAT_EVENT,u),this.stat=g}w(pH,mr);function Ur(u){const g=jf();Rr(g,new pH(g,u))}ki.Ma="timingevent";function gH(u,g){mr.call(this,ki.Ma,u),this.size=g}w(gH,mr);function Iu(u,g){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){u()},g)}function xu(){this.g=!0}xu.prototype.xa=function(){this.g=!1};function B0e(u,g,y,b,Q,M){u.info(function(){if(u.g)if(M)for(var X="",$e=M.split("&"),er=0;er<$e.length;er++){var Ie=$e[er].split("=");if(1<Ie.length){var yr=Ie[0];Ie=Ie[1];var Br=yr.split("_");X=2<=Br.length&&Br[1]=="type"?X+(yr+"="+Ie+"&"):X+(yr+"=redacted&")}}else X=null;else X=M;return"XMLHTTP REQ ("+b+") [attempt "+Q+"]: "+g+`
1156
1156
  `+y+`
1157
- `+X})}function y0e(u,g,y,b,Q,M,X){u.info(function(){return"XMLHTTP RESP ("+b+") [ attempt "+Q+"]: "+g+`
1157
+ `+X})}function C0e(u,g,y,b,Q,M,X){u.info(function(){return"XMLHTTP RESP ("+b+") [ attempt "+Q+"]: "+g+`
1158
1158
  `+y+`
1159
- `+M+" "+X})}function la(u,g,y,b){u.info(function(){return"XMLHTTP TEXT ("+g+"): "+C0e(u,y)+(b?" "+b:"")})}function B0e(u,g){u.info(function(){return"TIMEOUT: "+g})}xu.prototype.info=function(){};function C0e(u,g){if(!u.g)return g;if(!g)return null;try{var y=JSON.parse(g);if(y){for(u=0;u<y.length;u++)if(Array.isArray(y[u])){var b=y[u];if(!(2>b.length)){var Q=b[1];if(Array.isArray(Q)&&!(1>Q.length)){var M=Q[0];if(M!="noop"&&M!="stop"&&M!="close")for(var X=1;X<Q.length;X++)Q[X]=""}}}}return bB(y)}catch{return g}}var Gf={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},mH={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},IB;function zf(){}w(zf,vB),zf.prototype.g=function(){return new XMLHttpRequest},zf.prototype.i=function(){return{}},IB=new zf;function FA(u,g,y,b){this.j=u,this.i=g,this.l=y,this.R=b||1,this.U=new vu(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new wH}function wH(){this.i=null,this.g="",this.h=!1}var yH={},xB={};function RB(u,g,y){u.L=1,u.v=Xf(Ks(g)),u.m=y,u.P=!0,BH(u,null)}function BH(u,g){u.F=Date.now(),qf(u),u.A=Ks(u.v);var y=u.A,b=u.R;Array.isArray(b)||(b=[String(b)]),PH(y.i,"t",b),u.C=0,y=u.j.J,u.h=new wH,u.g=YH(u.j,y?g:null,!u.m),0<u.O&&(u.M=new p0e(d(u.Y,u,u.g),u.O)),g=u.U,y=u.g,b=u.ca;var Q="readystatechange";Array.isArray(Q)||(Q&&(cH[0]=Q.toString()),Q=cH);for(var M=0;M<Q.length;M++){var X=nH(y,Q[M],b||g.handleEvent,!1,g.h||g);if(!X)break;g.g[X.key]=X}g=u.H?I(u.H):{},u.m?(u.u||(u.u="POST"),g["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.A,u.u,u.m,g)):(u.u="GET",u.g.ea(u.A,u.u,null,g)),Tu(),w0e(u.i,u.u,u.A,u.l,u.R,u.m)}FA.prototype.ca=function(u){u=u.target;const g=this.M;g&&js(u)==3?g.j():this.Y(u)},FA.prototype.Y=function(u){try{if(u==this.g)e:{const Br=js(this.g);var g=this.g.Ba();const fa=this.g.Z();if(!(3>Br)&&(Br!=3||this.g&&(this.h.h||this.g.oa()||HH(this.g)))){this.J||Br!=4||g==7||(g==8||0>=fa?Tu(3):Tu(2)),UB(this);var y=this.g.Z();this.X=y;t:if(CH(this)){var b=HH(this.g);u="";var Q=b.length,M=js(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Fi(this),Ru(this);var X="";break t}this.h.i=new o.TextDecoder}for(g=0;g<Q;g++)this.h.h=!0,u+=this.h.i.decode(b[g],{stream:!(M&&g==Q-1)});b.length=0,this.h.g+=u,this.C=0,X=this.h.g}else X=this.g.oa();if(this.o=y==200,y0e(this.i,this.u,this.A,this.l,this.R,Br,y),this.o){if(this.T&&!this.K){t:{if(this.g){var $e,er=this.g;if(($e=er.g?er.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!T($e)){var Ie=$e;break t}}Ie=null}if(y=Ie)la(this.i,this.l,y,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,kB(this,y);else{this.o=!1,this.s=3,Ur(12),Fi(this),Ru(this);break e}}if(this.P){y=!0;let Dn;for(;!this.J&&this.C<X.length;)if(Dn=E0e(this,X),Dn==xB){Br==4&&(this.s=4,Ur(14),y=!1),la(this.i,this.l,null,"[Incomplete Response]");break}else if(Dn==yH){this.s=4,Ur(15),la(this.i,this.l,X,"[Invalid Chunk]"),y=!1;break}else la(this.i,this.l,Dn,null),kB(this,Dn);if(CH(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Br!=4||X.length!=0||this.h.h||(this.s=1,Ur(16),y=!1),this.o=this.o&&y,!y)la(this.i,this.l,X,"[Invalid Chunked Response]"),Fi(this),Ru(this);else if(0<X.length&&!this.W){this.W=!0;var yr=this.j;yr.g==this&&yr.ba&&!yr.M&&(yr.j.info("Great, no buffering proxy detected. Bytes received: "+X.length),LB(yr),yr.M=!0,Ur(11))}}else la(this.i,this.l,X,null),kB(this,X);Br==4&&Fi(this),this.o&&!this.J&&(Br==4?qH(this.j,this):(this.o=!1,qf(this)))}else M0e(this.g),y==400&&0<X.indexOf("Unknown SID")?(this.s=3,Ur(12)):(this.s=0,Ur(13)),Fi(this),Ru(this)}}}catch{}finally{}};function CH(u){return u.g?u.u=="GET"&&u.L!=2&&u.j.Ca:!1}function E0e(u,g){var y=u.C,b=g.indexOf(`
1160
- `,y);return b==-1?xB:(y=Number(g.substring(y,b)),isNaN(y)?yH:(b+=1,b+y>g.length?xB:(g=g.slice(b,b+y),u.C=b+y,g)))}FA.prototype.cancel=function(){this.J=!0,Fi(this)};function qf(u){u.S=Date.now()+u.I,EH(u,u.I)}function EH(u,g){if(u.B!=null)throw Error("WatchDog timer not null");u.B=Iu(d(u.ba,u),g)}function UB(u){u.B&&(o.clearTimeout(u.B),u.B=null)}FA.prototype.ba=function(){this.B=null;const u=Date.now();0<=u-this.S?(B0e(this.i,this.A),this.L!=2&&(Tu(),Ur(17)),Fi(this),this.s=2,Ru(this)):EH(this,this.S-u)};function Ru(u){u.j.G==0||u.J||qH(u.j,u)}function Fi(u){UB(u);var g=u.M;g&&typeof g.ma=="function"&&g.ma(),u.M=null,uH(u.U),u.g&&(g=u.g,u.g=null,g.abort(),g.ma())}function kB(u,g){try{var y=u.j;if(y.G!=0&&(y.g==u||FB(y.h,u))){if(!u.K&&FB(y.h,u)&&y.G==3){try{var b=y.Da.g.parse(g)}catch{b=null}if(Array.isArray(b)&&b.length==3){var Q=b;if(Q[0]==0){e:if(!y.u){if(y.g)if(y.g.F+3e3<u.F)np(y),tp(y);else break e;DB(y),Ur(18)}}else y.za=Q[1],0<y.za-y.T&&37500>Q[2]&&y.F&&y.v==0&&!y.C&&(y.C=Iu(d(y.Za,y),6e3));if(1>=vH(y.h)&&y.ca){try{y.ca()}catch{}y.ca=void 0}}else Oi(y,11)}else if((u.K||y.g==u)&&np(y),!T(g))for(Q=y.Da.g.parse(g),g=0;g<Q.length;g++){let Ie=Q[g];if(y.T=Ie[0],Ie=Ie[1],y.G==2)if(Ie[0]=="c"){y.K=Ie[1],y.ia=Ie[2];const yr=Ie[3];yr!=null&&(y.la=yr,y.j.info("VER="+y.la));const Br=Ie[4];Br!=null&&(y.Aa=Br,y.j.info("SVER="+y.Aa));const fa=Ie[5];fa!=null&&typeof fa=="number"&&0<fa&&(b=1.5*fa,y.L=b,y.j.info("backChannelRequestTimeoutMs_="+b)),b=y;const Dn=u.g;if(Dn){const Ap=Dn.g?Dn.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Ap){var M=b.h;M.g||Ap.indexOf("spdy")==-1&&Ap.indexOf("quic")==-1&&Ap.indexOf("h2")==-1||(M.j=M.l,M.g=new Set,M.h&&(PB(M,M.h),M.h=null))}if(b.D){const MB=Dn.g?Dn.g.getResponseHeader("X-HTTP-Session-Id"):null;MB&&(b.ya=MB,Ge(b.I,b.D,MB))}}y.G=3,y.l&&y.l.ua(),y.ba&&(y.R=Date.now()-u.F,y.j.info("Handshake RTT: "+y.R+"ms")),b=y;var X=u;if(b.qa=XH(b,b.J?b.ia:null,b.W),X.K){SH(b.h,X);var $e=X,er=b.L;er&&($e.I=er),$e.B&&(UB($e),qf($e)),b.g=X}else GH(b);0<y.i.length&&rp(y)}else Ie[0]!="stop"&&Ie[0]!="close"||Oi(y,7);else y.G==3&&(Ie[0]=="stop"||Ie[0]=="close"?Ie[0]=="stop"?Oi(y,7):QB(y):Ie[0]!="noop"&&y.l&&y.l.ta(Ie),y.v=0)}}Tu(4)}catch{}}var _0e=class{constructor(u,g){this.g=u,this.map=g}};function _H(u){this.l=u||10,o.PerformanceNavigationTiming?(u=o.performance.getEntriesByType("navigation"),u=0<u.length&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function bH(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function vH(u){return u.h?1:u.g?u.g.size:0}function FB(u,g){return u.h?u.h==g:u.g?u.g.has(g):!1}function PB(u,g){u.g?u.g.add(g):u.h=g}function SH(u,g){u.h&&u.h==g?u.h=null:u.g&&u.g.has(g)&&u.g.delete(g)}_H.prototype.cancel=function(){if(this.i=TH(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const u of this.g.values())u.cancel();this.g.clear()}};function TH(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let g=u.i;for(const y of u.g.values())g=g.concat(y.D);return g}return B(u.i)}function b0e(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map<"u"&&u instanceof Map||typeof Set<"u"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(a(u)){for(var g=[],y=u.length,b=0;b<y;b++)g.push(u[b]);return g}g=[],y=0;for(b in u)g[y++]=u[b];return g}function v0e(u){if(u.na&&typeof u.na=="function")return u.na();if(!u.V||typeof u.V!="function"){if(typeof Map<"u"&&u instanceof Map)return Array.from(u.keys());if(!(typeof Set<"u"&&u instanceof Set)){if(a(u)||typeof u=="string"){var g=[];u=u.length;for(var y=0;y<u;y++)g.push(y);return g}g=[],y=0;for(const b in u)g[y++]=b;return g}}}function IH(u,g){if(u.forEach&&typeof u.forEach=="function")u.forEach(g,void 0);else if(a(u)||typeof u=="string")Array.prototype.forEach.call(u,g,void 0);else for(var y=v0e(u),b=b0e(u),Q=b.length,M=0;M<Q;M++)g.call(void 0,b[M],y&&y[M],u)}var xH=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function S0e(u,g){if(u){u=u.split("&");for(var y=0;y<u.length;y++){var b=u[y].indexOf("="),Q=null;if(0<=b){var M=u[y].substring(0,b);Q=u[y].substring(b+1)}else M=u[y];g(M,Q?decodeURIComponent(Q.replace(/\+/g," ")):"")}}}function Pi(u){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,u instanceof Pi){this.h=u.h,Wf(this,u.j),this.o=u.o,this.g=u.g,Jf(this,u.s),this.l=u.l;var g=u.i,y=new Fu;y.i=g.i,g.g&&(y.g=new Map(g.g),y.h=g.h),RH(this,y),this.m=u.m}else u&&(g=String(u).match(xH))?(this.h=!1,Wf(this,g[1]||"",!0),this.o=Uu(g[2]||""),this.g=Uu(g[3]||"",!0),Jf(this,g[4]),this.l=Uu(g[5]||"",!0),RH(this,g[6]||"",!0),this.m=Uu(g[7]||"")):(this.h=!1,this.i=new Fu(null,this.h))}Pi.prototype.toString=function(){var u=[],g=this.j;g&&u.push(ku(g,UH,!0),":");var y=this.g;return(y||g=="file")&&(u.push("//"),(g=this.o)&&u.push(ku(g,UH,!0),"@"),u.push(encodeURIComponent(String(y)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),y=this.s,y!=null&&u.push(":",String(y))),(y=this.l)&&(this.g&&y.charAt(0)!="/"&&u.push("/"),u.push(ku(y,y.charAt(0)=="/"?x0e:I0e,!0))),(y=this.i.toString())&&u.push("?",y),(y=this.m)&&u.push("#",ku(y,U0e)),u.join("")};function Ks(u){return new Pi(u)}function Wf(u,g,y){u.j=y?Uu(g,!0):g,u.j&&(u.j=u.j.replace(/:$/,""))}function Jf(u,g){if(g){if(g=Number(g),isNaN(g)||0>g)throw Error("Bad port number "+g);u.s=g}else u.s=null}function RH(u,g,y){g instanceof Fu?(u.i=g,k0e(u.i,u.h)):(y||(g=ku(g,R0e)),u.i=new Fu(g,u.h))}function Ge(u,g,y){u.i.set(g,y)}function Xf(u){return Ge(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function Uu(u,g){return u?g?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function ku(u,g,y){return typeof u=="string"?(u=encodeURI(u).replace(g,T0e),y&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function T0e(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var UH=/[#\/\?@]/g,I0e=/[#\?:]/g,x0e=/[#\?]/g,R0e=/[#\?@]/g,U0e=/#/g;function Fu(u,g){this.h=this.g=null,this.i=u||null,this.j=!!g}function PA(u){u.g||(u.g=new Map,u.h=0,u.i&&S0e(u.i,function(g,y){u.add(decodeURIComponent(g.replace(/\+/g," ")),y)}))}t=Fu.prototype,t.add=function(u,g){PA(this),this.i=null,u=ha(this,u);var y=this.g.get(u);return y||this.g.set(u,y=[]),y.push(g),this.h+=1,this};function kH(u,g){PA(u),g=ha(u,g),u.g.has(g)&&(u.i=null,u.h-=u.g.get(g).length,u.g.delete(g))}function FH(u,g){return PA(u),g=ha(u,g),u.g.has(g)}t.forEach=function(u,g){PA(this),this.g.forEach(function(y,b){y.forEach(function(Q){u.call(g,Q,b,this)},this)},this)},t.na=function(){PA(this);const u=Array.from(this.g.values()),g=Array.from(this.g.keys()),y=[];for(let b=0;b<g.length;b++){const Q=u[b];for(let M=0;M<Q.length;M++)y.push(g[b])}return y},t.V=function(u){PA(this);let g=[];if(typeof u=="string")FH(this,u)&&(g=g.concat(this.g.get(ha(this,u))));else{u=Array.from(this.g.values());for(let y=0;y<u.length;y++)g=g.concat(u[y])}return g},t.set=function(u,g){return PA(this),this.i=null,u=ha(this,u),FH(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[g]),this.h+=1,this},t.get=function(u,g){return u?(u=this.V(u),0<u.length?String(u[0]):g):g};function PH(u,g,y){kH(u,g),0<y.length&&(u.i=null,u.g.set(ha(u,g),B(y)),u.h+=y.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const u=[],g=Array.from(this.g.keys());for(var y=0;y<g.length;y++){var b=g[y];const M=encodeURIComponent(String(b)),X=this.V(b);for(b=0;b<X.length;b++){var Q=M;X[b]!==""&&(Q+="="+encodeURIComponent(String(X[b]))),u.push(Q)}}return this.i=u.join("&")};function ha(u,g){return g=String(g),u.j&&(g=g.toLowerCase()),g}function k0e(u,g){g&&!u.j&&(PA(u),u.i=null,u.g.forEach(function(y,b){var Q=b.toLowerCase();b!=Q&&(kH(this,b),PH(this,Q,y))},u)),u.j=g}function F0e(u,g){const y=new xu;if(o.Image){const b=new Image;b.onload=p(OA,y,"TestLoadImage: loaded",!0,g,b),b.onerror=p(OA,y,"TestLoadImage: error",!1,g,b),b.onabort=p(OA,y,"TestLoadImage: abort",!1,g,b),b.ontimeout=p(OA,y,"TestLoadImage: timeout",!1,g,b),o.setTimeout(function(){b.ontimeout&&b.ontimeout()},1e4),b.src=u}else g(!1)}function P0e(u,g){const y=new xu,b=new AbortController,Q=setTimeout(()=>{b.abort(),OA(y,"TestPingServer: timeout",!1,g)},1e4);fetch(u,{signal:b.signal}).then(M=>{clearTimeout(Q),M.ok?OA(y,"TestPingServer: ok",!0,g):OA(y,"TestPingServer: server error",!1,g)}).catch(()=>{clearTimeout(Q),OA(y,"TestPingServer: error",!1,g)})}function OA(u,g,y,b,Q){try{Q&&(Q.onload=null,Q.onerror=null,Q.onabort=null,Q.ontimeout=null),b(y)}catch{}}function O0e(){this.g=new m0e}function Q0e(u,g,y){const b=y||"";try{IH(u,function(Q,M){let X=Q;c(Q)&&(X=bB(Q)),g.push(b+M+"="+encodeURIComponent(X))})}catch(Q){throw g.push(b+"type="+encodeURIComponent("_badmap")),Q}}function Yf(u){this.l=u.Ub||null,this.j=u.eb||!1}w(Yf,vB),Yf.prototype.g=function(){return new Zf(this.l,this.j)},Yf.prototype.i=function(u){return function(){return u}}({});function Zf(u,g){wr.call(this),this.D=u,this.o=g,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}w(Zf,wr),t=Zf.prototype,t.open=function(u,g){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=g,this.readyState=1,Ou(this)},t.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const g={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(g.body=u),(this.D||o).fetch(new Request(this.A,g)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Pu(this)),this.readyState=0},t.Sa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,Ou(this)),this.g&&(this.readyState=3,Ou(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in u){if(this.j=u.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;OH(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function OH(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}t.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var g=u.value?u.value:new Uint8Array(0);(g=this.v.decode(g,{stream:!u.done}))&&(this.response=this.responseText+=g)}u.done?Pu(this):Ou(this),this.readyState==3&&OH(this)}},t.Ra=function(u){this.g&&(this.response=this.responseText=u,Pu(this))},t.Qa=function(u){this.g&&(this.response=u,Pu(this))},t.ga=function(){this.g&&Pu(this)};function Pu(u){u.readyState=4,u.l=null,u.j=null,u.v=null,Ou(u)}t.setRequestHeader=function(u,g){this.u.append(u,g)},t.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const u=[],g=this.h.entries();for(var y=g.next();!y.done;)y=y.value,u.push(y[0]+": "+y[1]),y=g.next();return u.join(`\r
1159
+ `+M+" "+X})}function la(u,g,y,b){u.info(function(){return"XMLHTTP TEXT ("+g+"): "+_0e(u,y)+(b?" "+b:"")})}function E0e(u,g){u.info(function(){return"TIMEOUT: "+g})}xu.prototype.info=function(){};function _0e(u,g){if(!u.g)return g;if(!g)return null;try{var y=JSON.parse(g);if(y){for(u=0;u<y.length;u++)if(Array.isArray(y[u])){var b=y[u];if(!(2>b.length)){var Q=b[1];if(Array.isArray(Q)&&!(1>Q.length)){var M=Q[0];if(M!="noop"&&M!="stop"&&M!="close")for(var X=1;X<Q.length;X++)Q[X]=""}}}}return bB(y)}catch{return g}}var Gf={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},mH={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},IB;function zf(){}w(zf,vB),zf.prototype.g=function(){return new XMLHttpRequest},zf.prototype.i=function(){return{}},IB=new zf;function FA(u,g,y,b){this.j=u,this.i=g,this.l=y,this.R=b||1,this.U=new vu(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new wH}function wH(){this.i=null,this.g="",this.h=!1}var yH={},xB={};function RB(u,g,y){u.L=1,u.v=Xf(Ks(g)),u.m=y,u.P=!0,BH(u,null)}function BH(u,g){u.F=Date.now(),qf(u),u.A=Ks(u.v);var y=u.A,b=u.R;Array.isArray(b)||(b=[String(b)]),PH(y.i,"t",b),u.C=0,y=u.j.J,u.h=new wH,u.g=YH(u.j,y?g:null,!u.m),0<u.O&&(u.M=new m0e(d(u.Y,u,u.g),u.O)),g=u.U,y=u.g,b=u.ca;var Q="readystatechange";Array.isArray(Q)||(Q&&(cH[0]=Q.toString()),Q=cH);for(var M=0;M<Q.length;M++){var X=nH(y,Q[M],b||g.handleEvent,!1,g.h||g);if(!X)break;g.g[X.key]=X}g=u.H?I(u.H):{},u.m?(u.u||(u.u="POST"),g["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.A,u.u,u.m,g)):(u.u="GET",u.g.ea(u.A,u.u,null,g)),Tu(),B0e(u.i,u.u,u.A,u.l,u.R,u.m)}FA.prototype.ca=function(u){u=u.target;const g=this.M;g&&js(u)==3?g.j():this.Y(u)},FA.prototype.Y=function(u){try{if(u==this.g)e:{const Br=js(this.g);var g=this.g.Ba();const fa=this.g.Z();if(!(3>Br)&&(Br!=3||this.g&&(this.h.h||this.g.oa()||HH(this.g)))){this.J||Br!=4||g==7||(g==8||0>=fa?Tu(3):Tu(2)),UB(this);var y=this.g.Z();this.X=y;t:if(CH(this)){var b=HH(this.g);u="";var Q=b.length,M=js(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Fi(this),Ru(this);var X="";break t}this.h.i=new o.TextDecoder}for(g=0;g<Q;g++)this.h.h=!0,u+=this.h.i.decode(b[g],{stream:!(M&&g==Q-1)});b.length=0,this.h.g+=u,this.C=0,X=this.h.g}else X=this.g.oa();if(this.o=y==200,C0e(this.i,this.u,this.A,this.l,this.R,Br,y),this.o){if(this.T&&!this.K){t:{if(this.g){var $e,er=this.g;if(($e=er.g?er.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!T($e)){var Ie=$e;break t}}Ie=null}if(y=Ie)la(this.i,this.l,y,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,kB(this,y);else{this.o=!1,this.s=3,Ur(12),Fi(this),Ru(this);break e}}if(this.P){y=!0;let Dn;for(;!this.J&&this.C<X.length;)if(Dn=b0e(this,X),Dn==xB){Br==4&&(this.s=4,Ur(14),y=!1),la(this.i,this.l,null,"[Incomplete Response]");break}else if(Dn==yH){this.s=4,Ur(15),la(this.i,this.l,X,"[Invalid Chunk]"),y=!1;break}else la(this.i,this.l,Dn,null),kB(this,Dn);if(CH(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Br!=4||X.length!=0||this.h.h||(this.s=1,Ur(16),y=!1),this.o=this.o&&y,!y)la(this.i,this.l,X,"[Invalid Chunked Response]"),Fi(this),Ru(this);else if(0<X.length&&!this.W){this.W=!0;var yr=this.j;yr.g==this&&yr.ba&&!yr.M&&(yr.j.info("Great, no buffering proxy detected. Bytes received: "+X.length),LB(yr),yr.M=!0,Ur(11))}}else la(this.i,this.l,X,null),kB(this,X);Br==4&&Fi(this),this.o&&!this.J&&(Br==4?qH(this.j,this):(this.o=!1,qf(this)))}else H0e(this.g),y==400&&0<X.indexOf("Unknown SID")?(this.s=3,Ur(12)):(this.s=0,Ur(13)),Fi(this),Ru(this)}}}catch{}finally{}};function CH(u){return u.g?u.u=="GET"&&u.L!=2&&u.j.Ca:!1}function b0e(u,g){var y=u.C,b=g.indexOf(`
1160
+ `,y);return b==-1?xB:(y=Number(g.substring(y,b)),isNaN(y)?yH:(b+=1,b+y>g.length?xB:(g=g.slice(b,b+y),u.C=b+y,g)))}FA.prototype.cancel=function(){this.J=!0,Fi(this)};function qf(u){u.S=Date.now()+u.I,EH(u,u.I)}function EH(u,g){if(u.B!=null)throw Error("WatchDog timer not null");u.B=Iu(d(u.ba,u),g)}function UB(u){u.B&&(o.clearTimeout(u.B),u.B=null)}FA.prototype.ba=function(){this.B=null;const u=Date.now();0<=u-this.S?(E0e(this.i,this.A),this.L!=2&&(Tu(),Ur(17)),Fi(this),this.s=2,Ru(this)):EH(this,this.S-u)};function Ru(u){u.j.G==0||u.J||qH(u.j,u)}function Fi(u){UB(u);var g=u.M;g&&typeof g.ma=="function"&&g.ma(),u.M=null,uH(u.U),u.g&&(g=u.g,u.g=null,g.abort(),g.ma())}function kB(u,g){try{var y=u.j;if(y.G!=0&&(y.g==u||FB(y.h,u))){if(!u.K&&FB(y.h,u)&&y.G==3){try{var b=y.Da.g.parse(g)}catch{b=null}if(Array.isArray(b)&&b.length==3){var Q=b;if(Q[0]==0){e:if(!y.u){if(y.g)if(y.g.F+3e3<u.F)np(y),tp(y);else break e;DB(y),Ur(18)}}else y.za=Q[1],0<y.za-y.T&&37500>Q[2]&&y.F&&y.v==0&&!y.C&&(y.C=Iu(d(y.Za,y),6e3));if(1>=vH(y.h)&&y.ca){try{y.ca()}catch{}y.ca=void 0}}else Oi(y,11)}else if((u.K||y.g==u)&&np(y),!T(g))for(Q=y.Da.g.parse(g),g=0;g<Q.length;g++){let Ie=Q[g];if(y.T=Ie[0],Ie=Ie[1],y.G==2)if(Ie[0]=="c"){y.K=Ie[1],y.ia=Ie[2];const yr=Ie[3];yr!=null&&(y.la=yr,y.j.info("VER="+y.la));const Br=Ie[4];Br!=null&&(y.Aa=Br,y.j.info("SVER="+y.Aa));const fa=Ie[5];fa!=null&&typeof fa=="number"&&0<fa&&(b=1.5*fa,y.L=b,y.j.info("backChannelRequestTimeoutMs_="+b)),b=y;const Dn=u.g;if(Dn){const Ap=Dn.g?Dn.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Ap){var M=b.h;M.g||Ap.indexOf("spdy")==-1&&Ap.indexOf("quic")==-1&&Ap.indexOf("h2")==-1||(M.j=M.l,M.g=new Set,M.h&&(PB(M,M.h),M.h=null))}if(b.D){const MB=Dn.g?Dn.g.getResponseHeader("X-HTTP-Session-Id"):null;MB&&(b.ya=MB,Ge(b.I,b.D,MB))}}y.G=3,y.l&&y.l.ua(),y.ba&&(y.R=Date.now()-u.F,y.j.info("Handshake RTT: "+y.R+"ms")),b=y;var X=u;if(b.qa=XH(b,b.J?b.ia:null,b.W),X.K){SH(b.h,X);var $e=X,er=b.L;er&&($e.I=er),$e.B&&(UB($e),qf($e)),b.g=X}else GH(b);0<y.i.length&&rp(y)}else Ie[0]!="stop"&&Ie[0]!="close"||Oi(y,7);else y.G==3&&(Ie[0]=="stop"||Ie[0]=="close"?Ie[0]=="stop"?Oi(y,7):QB(y):Ie[0]!="noop"&&y.l&&y.l.ta(Ie),y.v=0)}}Tu(4)}catch{}}var v0e=class{constructor(u,g){this.g=u,this.map=g}};function _H(u){this.l=u||10,o.PerformanceNavigationTiming?(u=o.performance.getEntriesByType("navigation"),u=0<u.length&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function bH(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function vH(u){return u.h?1:u.g?u.g.size:0}function FB(u,g){return u.h?u.h==g:u.g?u.g.has(g):!1}function PB(u,g){u.g?u.g.add(g):u.h=g}function SH(u,g){u.h&&u.h==g?u.h=null:u.g&&u.g.has(g)&&u.g.delete(g)}_H.prototype.cancel=function(){if(this.i=TH(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const u of this.g.values())u.cancel();this.g.clear()}};function TH(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let g=u.i;for(const y of u.g.values())g=g.concat(y.D);return g}return B(u.i)}function S0e(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map<"u"&&u instanceof Map||typeof Set<"u"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(a(u)){for(var g=[],y=u.length,b=0;b<y;b++)g.push(u[b]);return g}g=[],y=0;for(b in u)g[y++]=u[b];return g}function T0e(u){if(u.na&&typeof u.na=="function")return u.na();if(!u.V||typeof u.V!="function"){if(typeof Map<"u"&&u instanceof Map)return Array.from(u.keys());if(!(typeof Set<"u"&&u instanceof Set)){if(a(u)||typeof u=="string"){var g=[];u=u.length;for(var y=0;y<u;y++)g.push(y);return g}g=[],y=0;for(const b in u)g[y++]=b;return g}}}function IH(u,g){if(u.forEach&&typeof u.forEach=="function")u.forEach(g,void 0);else if(a(u)||typeof u=="string")Array.prototype.forEach.call(u,g,void 0);else for(var y=T0e(u),b=S0e(u),Q=b.length,M=0;M<Q;M++)g.call(void 0,b[M],y&&y[M],u)}var xH=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function I0e(u,g){if(u){u=u.split("&");for(var y=0;y<u.length;y++){var b=u[y].indexOf("="),Q=null;if(0<=b){var M=u[y].substring(0,b);Q=u[y].substring(b+1)}else M=u[y];g(M,Q?decodeURIComponent(Q.replace(/\+/g," ")):"")}}}function Pi(u){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,u instanceof Pi){this.h=u.h,Wf(this,u.j),this.o=u.o,this.g=u.g,Jf(this,u.s),this.l=u.l;var g=u.i,y=new Fu;y.i=g.i,g.g&&(y.g=new Map(g.g),y.h=g.h),RH(this,y),this.m=u.m}else u&&(g=String(u).match(xH))?(this.h=!1,Wf(this,g[1]||"",!0),this.o=Uu(g[2]||""),this.g=Uu(g[3]||"",!0),Jf(this,g[4]),this.l=Uu(g[5]||"",!0),RH(this,g[6]||"",!0),this.m=Uu(g[7]||"")):(this.h=!1,this.i=new Fu(null,this.h))}Pi.prototype.toString=function(){var u=[],g=this.j;g&&u.push(ku(g,UH,!0),":");var y=this.g;return(y||g=="file")&&(u.push("//"),(g=this.o)&&u.push(ku(g,UH,!0),"@"),u.push(encodeURIComponent(String(y)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),y=this.s,y!=null&&u.push(":",String(y))),(y=this.l)&&(this.g&&y.charAt(0)!="/"&&u.push("/"),u.push(ku(y,y.charAt(0)=="/"?U0e:R0e,!0))),(y=this.i.toString())&&u.push("?",y),(y=this.m)&&u.push("#",ku(y,F0e)),u.join("")};function Ks(u){return new Pi(u)}function Wf(u,g,y){u.j=y?Uu(g,!0):g,u.j&&(u.j=u.j.replace(/:$/,""))}function Jf(u,g){if(g){if(g=Number(g),isNaN(g)||0>g)throw Error("Bad port number "+g);u.s=g}else u.s=null}function RH(u,g,y){g instanceof Fu?(u.i=g,P0e(u.i,u.h)):(y||(g=ku(g,k0e)),u.i=new Fu(g,u.h))}function Ge(u,g,y){u.i.set(g,y)}function Xf(u){return Ge(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function Uu(u,g){return u?g?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function ku(u,g,y){return typeof u=="string"?(u=encodeURI(u).replace(g,x0e),y&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function x0e(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var UH=/[#\/\?@]/g,R0e=/[#\?:]/g,U0e=/[#\?]/g,k0e=/[#\?@]/g,F0e=/#/g;function Fu(u,g){this.h=this.g=null,this.i=u||null,this.j=!!g}function PA(u){u.g||(u.g=new Map,u.h=0,u.i&&I0e(u.i,function(g,y){u.add(decodeURIComponent(g.replace(/\+/g," ")),y)}))}t=Fu.prototype,t.add=function(u,g){PA(this),this.i=null,u=ha(this,u);var y=this.g.get(u);return y||this.g.set(u,y=[]),y.push(g),this.h+=1,this};function kH(u,g){PA(u),g=ha(u,g),u.g.has(g)&&(u.i=null,u.h-=u.g.get(g).length,u.g.delete(g))}function FH(u,g){return PA(u),g=ha(u,g),u.g.has(g)}t.forEach=function(u,g){PA(this),this.g.forEach(function(y,b){y.forEach(function(Q){u.call(g,Q,b,this)},this)},this)},t.na=function(){PA(this);const u=Array.from(this.g.values()),g=Array.from(this.g.keys()),y=[];for(let b=0;b<g.length;b++){const Q=u[b];for(let M=0;M<Q.length;M++)y.push(g[b])}return y},t.V=function(u){PA(this);let g=[];if(typeof u=="string")FH(this,u)&&(g=g.concat(this.g.get(ha(this,u))));else{u=Array.from(this.g.values());for(let y=0;y<u.length;y++)g=g.concat(u[y])}return g},t.set=function(u,g){return PA(this),this.i=null,u=ha(this,u),FH(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[g]),this.h+=1,this},t.get=function(u,g){return u?(u=this.V(u),0<u.length?String(u[0]):g):g};function PH(u,g,y){kH(u,g),0<y.length&&(u.i=null,u.g.set(ha(u,g),B(y)),u.h+=y.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const u=[],g=Array.from(this.g.keys());for(var y=0;y<g.length;y++){var b=g[y];const M=encodeURIComponent(String(b)),X=this.V(b);for(b=0;b<X.length;b++){var Q=M;X[b]!==""&&(Q+="="+encodeURIComponent(String(X[b]))),u.push(Q)}}return this.i=u.join("&")};function ha(u,g){return g=String(g),u.j&&(g=g.toLowerCase()),g}function P0e(u,g){g&&!u.j&&(PA(u),u.i=null,u.g.forEach(function(y,b){var Q=b.toLowerCase();b!=Q&&(kH(this,b),PH(this,Q,y))},u)),u.j=g}function O0e(u,g){const y=new xu;if(o.Image){const b=new Image;b.onload=p(OA,y,"TestLoadImage: loaded",!0,g,b),b.onerror=p(OA,y,"TestLoadImage: error",!1,g,b),b.onabort=p(OA,y,"TestLoadImage: abort",!1,g,b),b.ontimeout=p(OA,y,"TestLoadImage: timeout",!1,g,b),o.setTimeout(function(){b.ontimeout&&b.ontimeout()},1e4),b.src=u}else g(!1)}function Q0e(u,g){const y=new xu,b=new AbortController,Q=setTimeout(()=>{b.abort(),OA(y,"TestPingServer: timeout",!1,g)},1e4);fetch(u,{signal:b.signal}).then(M=>{clearTimeout(Q),M.ok?OA(y,"TestPingServer: ok",!0,g):OA(y,"TestPingServer: server error",!1,g)}).catch(()=>{clearTimeout(Q),OA(y,"TestPingServer: error",!1,g)})}function OA(u,g,y,b,Q){try{Q&&(Q.onload=null,Q.onerror=null,Q.onabort=null,Q.ontimeout=null),b(y)}catch{}}function D0e(){this.g=new y0e}function L0e(u,g,y){const b=y||"";try{IH(u,function(Q,M){let X=Q;c(Q)&&(X=bB(Q)),g.push(b+M+"="+encodeURIComponent(X))})}catch(Q){throw g.push(b+"type="+encodeURIComponent("_badmap")),Q}}function Yf(u){this.l=u.Ub||null,this.j=u.eb||!1}w(Yf,vB),Yf.prototype.g=function(){return new Zf(this.l,this.j)},Yf.prototype.i=function(u){return function(){return u}}({});function Zf(u,g){wr.call(this),this.D=u,this.o=g,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}w(Zf,wr),t=Zf.prototype,t.open=function(u,g){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=g,this.readyState=1,Ou(this)},t.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const g={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(g.body=u),(this.D||o).fetch(new Request(this.A,g)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Pu(this)),this.readyState=0},t.Sa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,Ou(this)),this.g&&(this.readyState=3,Ou(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in u){if(this.j=u.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;OH(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function OH(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}t.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var g=u.value?u.value:new Uint8Array(0);(g=this.v.decode(g,{stream:!u.done}))&&(this.response=this.responseText+=g)}u.done?Pu(this):Ou(this),this.readyState==3&&OH(this)}},t.Ra=function(u){this.g&&(this.response=this.responseText=u,Pu(this))},t.Qa=function(u){this.g&&(this.response=u,Pu(this))},t.ga=function(){this.g&&Pu(this)};function Pu(u){u.readyState=4,u.l=null,u.j=null,u.v=null,Ou(u)}t.setRequestHeader=function(u,g){this.u.append(u,g)},t.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const u=[],g=this.h.entries();for(var y=g.next();!y.done;)y=y.value,u.push(y[0]+": "+y[1]),y=g.next();return u.join(`\r
1161
1161
  `)};function Ou(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(Zf.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function QH(u){let g="";return V(u,function(y,b){g+=b,g+=":",g+=y,g+=`\r
1162
- `}),g}function OB(u,g,y){e:{for(b in y){var b=!1;break e}b=!0}b||(y=QH(y),typeof u=="string"?y!=null&&encodeURIComponent(String(y)):Ge(u,g,y))}function tt(u){wr.call(this),this.headers=new Map,this.o=u||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}w(tt,wr);var D0e=/^https?$/i,L0e=["POST","PUT"];t=tt.prototype,t.Ha=function(u){this.J=u},t.ea=function(u,g,y,b){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);g=g?g.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():IB.g(),this.v=this.o?lH(this.o):lH(IB),this.g.onreadystatechange=d(this.Ea,this);try{this.B=!0,this.g.open(g,String(u),!0),this.B=!1}catch(M){DH(this,M);return}if(u=y||"",y=new Map(this.headers),b)if(Object.getPrototypeOf(b)===Object.prototype)for(var Q in b)y.set(Q,b[Q]);else if(typeof b.keys=="function"&&typeof b.get=="function")for(const M of b.keys())y.set(M,b.get(M));else throw Error("Unknown input type for opt_headers: "+String(b));b=Array.from(y.keys()).find(M=>M.toLowerCase()=="content-type"),Q=o.FormData&&u instanceof o.FormData,!(0<=Array.prototype.indexOf.call(L0e,g,void 0))||b||Q||y.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[M,X]of y)this.g.setRequestHeader(M,X);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{NH(this),this.u=!0,this.g.send(u),this.u=!1}catch(M){DH(this,M)}};function DH(u,g){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=g,u.m=5,LH(u),ep(u)}function LH(u){u.A||(u.A=!0,Rr(u,"complete"),Rr(u,"error"))}t.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,Rr(this,"complete"),Rr(this,"abort"),ep(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),ep(this,!0)),tt.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?MH(this):this.bb())},t.bb=function(){MH(this)};function MH(u){if(u.h&&typeof i<"u"&&(!u.v[1]||js(u)!=4||u.Z()!=2)){if(u.u&&js(u)==4)oH(u.Ea,0,u);else if(Rr(u,"readystatechange"),js(u)==4){u.h=!1;try{const X=u.Z();e:switch(X){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var y;if(!(y=g)){var b;if(b=X===0){var Q=String(u.D).match(xH)[1]||null;!Q&&o.self&&o.self.location&&(Q=o.self.location.protocol.slice(0,-1)),b=!D0e.test(Q?Q.toLowerCase():"")}y=b}if(y)Rr(u,"complete"),Rr(u,"success");else{u.m=6;try{var M=2<js(u)?u.g.statusText:""}catch{M=""}u.l=M+" ["+u.Z()+"]",LH(u)}}finally{ep(u)}}}}function ep(u,g){if(u.g){NH(u);const y=u.g,b=u.v[0]?()=>{}:null;u.g=null,u.v=null,g||Rr(u,"ready");try{y.onreadystatechange=b}catch{}}}function NH(u){u.I&&(o.clearTimeout(u.I),u.I=null)}t.isActive=function(){return!!this.g};function js(u){return u.g?u.g.readyState:0}t.Z=function(){try{return 2<js(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(u){if(this.g){var g=this.g.responseText;return u&&g.indexOf(u)==0&&(g=g.substring(u.length)),g0e(g)}};function HH(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.H){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function M0e(u){const g={};u=(u.g&&2<=js(u)&&u.g.getAllResponseHeaders()||"").split(`\r
1163
- `);for(let b=0;b<u.length;b++){if(T(u[b]))continue;var y=F(u[b]);const Q=y[0];if(y=y[1],typeof y!="string")continue;y=y.trim();const M=g[Q]||[];g[Q]=M,M.push(y)}x(g,function(b){return b.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Qu(u,g,y){return y&&y.internalChannelParams&&y.internalChannelParams[u]||g}function $H(u){this.Aa=0,this.i=[],this.j=new xu,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Qu("failFast",!1,u),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Qu("baseRetryDelayMs",5e3,u),this.cb=Qu("retryDelaySeedMs",1e4,u),this.Wa=Qu("forwardChannelMaxRetries",2,u),this.wa=Qu("forwardChannelRequestTimeoutMs",2e4,u),this.pa=u&&u.xmlHttpFactory||void 0,this.Xa=u&&u.Tb||void 0,this.Ca=u&&u.useFetchStreams||!1,this.L=void 0,this.J=u&&u.supportsCrossDomainXhr||!1,this.K="",this.h=new _H(u&&u.concurrentRequestLimit),this.Da=new O0e,this.P=u&&u.fastHandshake||!1,this.O=u&&u.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=u&&u.Rb||!1,u&&u.xa&&this.j.xa(),u&&u.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&u&&u.detectBufferingProxy||!1,this.ja=void 0,u&&u.longPollingTimeout&&0<u.longPollingTimeout&&(this.ja=u.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=$H.prototype,t.la=8,t.G=1,t.connect=function(u,g,y,b){Ur(0),this.W=u,this.H=g||{},y&&b!==void 0&&(this.H.OSID=y,this.H.OAID=b),this.F=this.X,this.I=XH(this,null,this.W),rp(this)};function QB(u){if(VH(u),u.G==3){var g=u.U++,y=Ks(u.I);if(Ge(y,"SID",u.K),Ge(y,"RID",g),Ge(y,"TYPE","terminate"),Du(u,y),g=new FA(u,u.j,g),g.L=2,g.v=Xf(Ks(y)),y=!1,o.navigator&&o.navigator.sendBeacon)try{y=o.navigator.sendBeacon(g.v.toString(),"")}catch{}!y&&o.Image&&(new Image().src=g.v,y=!0),y||(g.g=YH(g.j,null),g.g.ea(g.v)),g.F=Date.now(),qf(g)}JH(u)}function tp(u){u.g&&(LB(u),u.g.cancel(),u.g=null)}function VH(u){tp(u),u.u&&(o.clearTimeout(u.u),u.u=null),np(u),u.h.cancel(),u.s&&(typeof u.s=="number"&&o.clearTimeout(u.s),u.s=null)}function rp(u){if(!bH(u.h)&&!u.s){u.s=!0;var g=u.Ga;Eu||rH(),_u||(Eu(),_u=!0),gB.add(g,u),u.B=0}}function N0e(u,g){return vH(u.h)>=u.h.j-(u.s?1:0)?!1:u.s?(u.i=g.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=Iu(d(u.Ga,u,g),WH(u,u.B)),u.B++,!0)}t.Ga=function(u){if(this.s)if(this.s=null,this.G==1){if(!u){this.U=Math.floor(1e5*Math.random()),u=this.U++;const Q=new FA(this,this.j,u);let M=this.o;if(this.S&&(M?(M=I(M),P(M,this.S)):M=this.S),this.m!==null||this.O||(Q.H=M,M=null),this.P)e:{for(var g=0,y=0;y<this.i.length;y++){t:{var b=this.i[y];if("__data__"in b.map&&(b=b.map.__data__,typeof b=="string")){b=b.length;break t}b=void 0}if(b===void 0)break;if(g+=b,4096<g){g=y;break e}if(g===4096||y===this.i.length-1){g=y+1;break e}}g=1e3}else g=1e3;g=jH(this,Q,g),y=Ks(this.I),Ge(y,"RID",u),Ge(y,"CVER",22),this.D&&Ge(y,"X-HTTP-Session-Id",this.D),Du(this,y),M&&(this.O?g="headers="+encodeURIComponent(String(QH(M)))+"&"+g:this.m&&OB(y,this.m,M)),PB(this.h,Q),this.Ua&&Ge(y,"TYPE","init"),this.P?(Ge(y,"$req",g),Ge(y,"SID","null"),Q.T=!0,RB(Q,y,null)):RB(Q,y,g),this.G=2}}else this.G==3&&(u?KH(this,u):this.i.length==0||bH(this.h)||KH(this))};function KH(u,g){var y;g?y=g.l:y=u.U++;const b=Ks(u.I);Ge(b,"SID",u.K),Ge(b,"RID",y),Ge(b,"AID",u.T),Du(u,b),u.m&&u.o&&OB(b,u.m,u.o),y=new FA(u,u.j,y,u.B+1),u.m===null&&(y.H=u.o),g&&(u.i=g.D.concat(u.i)),g=jH(u,y,1e3),y.I=Math.round(.5*u.wa)+Math.round(.5*u.wa*Math.random()),PB(u.h,y),RB(y,b,g)}function Du(u,g){u.H&&V(u.H,function(y,b){Ge(g,b,y)}),u.l&&IH({},function(y,b){Ge(g,b,y)})}function jH(u,g,y){y=Math.min(u.i.length,y);var b=u.l?d(u.l.Na,u.l,u):null;e:{var Q=u.i;let M=-1;for(;;){const X=["count="+y];M==-1?0<y?(M=Q[0].g,X.push("ofs="+M)):M=0:X.push("ofs="+M);let $e=!0;for(let er=0;er<y;er++){let Ie=Q[er].g;const yr=Q[er].map;if(Ie-=M,0>Ie)M=Math.max(0,Q[er].g-100),$e=!1;else try{Q0e(yr,X,"req"+Ie+"_")}catch{b&&b(yr)}}if($e){b=X.join("&");break e}}}return u=u.i.splice(0,y),g.D=u,b}function GH(u){if(!u.g&&!u.u){u.Y=1;var g=u.Fa;Eu||rH(),_u||(Eu(),_u=!0),gB.add(g,u),u.v=0}}function DB(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=Iu(d(u.Fa,u),WH(u,u.v)),u.v++,!0)}t.Fa=function(){if(this.u=null,zH(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var u=2*this.R;this.j.info("BP detection timer enabled: "+u),this.A=Iu(d(this.ab,this),u)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Ur(10),tp(this),zH(this))};function LB(u){u.A!=null&&(o.clearTimeout(u.A),u.A=null)}function zH(u){u.g=new FA(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var g=Ks(u.qa);Ge(g,"RID","rpc"),Ge(g,"SID",u.K),Ge(g,"AID",u.T),Ge(g,"CI",u.F?"0":"1"),!u.F&&u.ja&&Ge(g,"TO",u.ja),Ge(g,"TYPE","xmlhttp"),Du(u,g),u.m&&u.o&&OB(g,u.m,u.o),u.L&&(u.g.I=u.L);var y=u.g;u=u.ia,y.L=1,y.v=Xf(Ks(g)),y.m=null,y.P=!0,BH(y,u)}t.Za=function(){this.C!=null&&(this.C=null,tp(this),DB(this),Ur(19))};function np(u){u.C!=null&&(o.clearTimeout(u.C),u.C=null)}function qH(u,g){var y=null;if(u.g==g){np(u),LB(u),u.g=null;var b=2}else if(FB(u.h,g))y=g.D,SH(u.h,g),b=1;else return;if(u.G!=0){if(g.o)if(b==1){y=g.m?g.m.length:0,g=Date.now()-g.F;var Q=u.B;b=jf(),Rr(b,new gH(b,y)),rp(u)}else GH(u);else if(Q=g.s,Q==3||Q==0&&0<g.X||!(b==1&&N0e(u,g)||b==2&&DB(u)))switch(y&&0<y.length&&(g=u.h,g.i=g.i.concat(y)),Q){case 1:Oi(u,5);break;case 4:Oi(u,10);break;case 3:Oi(u,6);break;default:Oi(u,2)}}}function WH(u,g){let y=u.Ta+Math.floor(Math.random()*u.cb);return u.isActive()||(y*=2),y*g}function Oi(u,g){if(u.j.info("Error code "+g),g==2){var y=d(u.fb,u),b=u.Xa;const Q=!b;b=new Pi(b||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Wf(b,"https"),Xf(b),Q?F0e(b.toString(),y):P0e(b.toString(),y)}else Ur(2);u.G=0,u.l&&u.l.sa(g),JH(u),VH(u)}t.fb=function(u){u?(this.j.info("Successfully pinged google.com"),Ur(2)):(this.j.info("Failed to ping google.com"),Ur(1))};function JH(u){if(u.G=0,u.ka=[],u.l){const g=TH(u.h);(g.length!=0||u.i.length!=0)&&(C(u.ka,g),C(u.ka,u.i),u.h.i.length=0,B(u.i),u.i.length=0),u.l.ra()}}function XH(u,g,y){var b=y instanceof Pi?Ks(y):new Pi(y);if(b.g!="")g&&(b.g=g+"."+b.g),Jf(b,b.s);else{var Q=o.location;b=Q.protocol,g=g?g+"."+Q.hostname:Q.hostname,Q=+Q.port;var M=new Pi(null);b&&Wf(M,b),g&&(M.g=g),Q&&Jf(M,Q),y&&(M.l=y),b=M}return y=u.D,g=u.ya,y&&g&&Ge(b,y,g),Ge(b,"VER",u.la),Du(u,b),b}function YH(u,g,y){if(g&&!u.J)throw Error("Can't create secondary domain capable XhrIo object.");return g=u.Ca&&!u.pa?new tt(new Yf({eb:y})):new tt(u.pa),g.Ha(u.J),g}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function ZH(){}t=ZH.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function sp(){}sp.prototype.g=function(u,g){return new qr(u,g)};function qr(u,g){wr.call(this),this.g=new $H(g),this.l=u,this.h=g&&g.messageUrlParams||null,u=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(u?u["X-WebChannel-Content-Type"]=g.messageContentType:u={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.va&&(u?u["X-WebChannel-Client-Profile"]=g.va:u={"X-WebChannel-Client-Profile":g.va}),this.g.S=u,(u=g&&g.Sb)&&!T(u)&&(this.g.m=u),this.v=g&&g.supportsCrossDomainXhr||!1,this.u=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!T(g)&&(this.g.D=g,u=this.h,u!==null&&g in u&&(u=this.h,g in u&&delete u[g])),this.j=new da(this)}w(qr,wr),qr.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},qr.prototype.close=function(){QB(this.g)},qr.prototype.o=function(u){var g=this.g;if(typeof u=="string"){var y={};y.__data__=u,u=y}else this.u&&(y={},y.__data__=bB(u),u=y);g.i.push(new _0e(g.Ya++,u)),g.G==3&&rp(g)},qr.prototype.N=function(){this.g.l=null,delete this.j,QB(this.g),delete this.g,qr.aa.N.call(this)};function e5(u){SB.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var g=u.__sm__;if(g){e:{for(const y in g){u=y;break e}u=void 0}(this.i=u)&&(u=this.i,g=g!==null&&u in g?g[u]:void 0),this.data=g}else this.data=u}w(e5,SB);function t5(){TB.call(this),this.status=1}w(t5,TB);function da(u){this.g=u}w(da,ZH),da.prototype.ua=function(){Rr(this.g,"a")},da.prototype.ta=function(u){Rr(this.g,new e5(u))},da.prototype.sa=function(u){Rr(this.g,new t5)},da.prototype.ra=function(){Rr(this.g,"b")},sp.prototype.createWebChannel=sp.prototype.g,qr.prototype.send=qr.prototype.o,qr.prototype.open=qr.prototype.m,qr.prototype.close=qr.prototype.close,z_=function(){return new sp},G_=function(){return jf()},j_=ki,bg={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Gf.NO_ERROR=0,Gf.TIMEOUT=8,Gf.HTTP_ERROR=6,Ol=Gf,mH.COMPLETE="complete",K_=mH,hH.EventType=Su,Su.OPEN="a",Su.CLOSE="b",Su.ERROR="c",Su.MESSAGE="d",wr.prototype.listen=wr.prototype.K,$a=hH,tt.prototype.listenOnce=tt.prototype.L,tt.prototype.getLastError=tt.prototype.Ka,tt.prototype.getLastErrorCode=tt.prototype.Ba,tt.prototype.getStatus=tt.prototype.Z,tt.prototype.getResponseJson=tt.prototype.Oa,tt.prototype.getResponseText=tt.prototype.oa,tt.prototype.send=tt.prototype.ea,tt.prototype.setWithCredentials=tt.prototype.Ha,V_=tt}).apply(typeof Pl<"u"?Pl:typeof self<"u"?self:typeof window<"u"?window:{});const q_="@firebase/firestore";/**
1162
+ `}),g}function OB(u,g,y){e:{for(b in y){var b=!1;break e}b=!0}b||(y=QH(y),typeof u=="string"?y!=null&&encodeURIComponent(String(y)):Ge(u,g,y))}function tt(u){wr.call(this),this.headers=new Map,this.o=u||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}w(tt,wr);var M0e=/^https?$/i,N0e=["POST","PUT"];t=tt.prototype,t.Ha=function(u){this.J=u},t.ea=function(u,g,y,b){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);g=g?g.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():IB.g(),this.v=this.o?lH(this.o):lH(IB),this.g.onreadystatechange=d(this.Ea,this);try{this.B=!0,this.g.open(g,String(u),!0),this.B=!1}catch(M){DH(this,M);return}if(u=y||"",y=new Map(this.headers),b)if(Object.getPrototypeOf(b)===Object.prototype)for(var Q in b)y.set(Q,b[Q]);else if(typeof b.keys=="function"&&typeof b.get=="function")for(const M of b.keys())y.set(M,b.get(M));else throw Error("Unknown input type for opt_headers: "+String(b));b=Array.from(y.keys()).find(M=>M.toLowerCase()=="content-type"),Q=o.FormData&&u instanceof o.FormData,!(0<=Array.prototype.indexOf.call(N0e,g,void 0))||b||Q||y.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[M,X]of y)this.g.setRequestHeader(M,X);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{NH(this),this.u=!0,this.g.send(u),this.u=!1}catch(M){DH(this,M)}};function DH(u,g){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=g,u.m=5,LH(u),ep(u)}function LH(u){u.A||(u.A=!0,Rr(u,"complete"),Rr(u,"error"))}t.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,Rr(this,"complete"),Rr(this,"abort"),ep(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),ep(this,!0)),tt.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?MH(this):this.bb())},t.bb=function(){MH(this)};function MH(u){if(u.h&&typeof i<"u"&&(!u.v[1]||js(u)!=4||u.Z()!=2)){if(u.u&&js(u)==4)oH(u.Ea,0,u);else if(Rr(u,"readystatechange"),js(u)==4){u.h=!1;try{const X=u.Z();e:switch(X){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var y;if(!(y=g)){var b;if(b=X===0){var Q=String(u.D).match(xH)[1]||null;!Q&&o.self&&o.self.location&&(Q=o.self.location.protocol.slice(0,-1)),b=!M0e.test(Q?Q.toLowerCase():"")}y=b}if(y)Rr(u,"complete"),Rr(u,"success");else{u.m=6;try{var M=2<js(u)?u.g.statusText:""}catch{M=""}u.l=M+" ["+u.Z()+"]",LH(u)}}finally{ep(u)}}}}function ep(u,g){if(u.g){NH(u);const y=u.g,b=u.v[0]?()=>{}:null;u.g=null,u.v=null,g||Rr(u,"ready");try{y.onreadystatechange=b}catch{}}}function NH(u){u.I&&(o.clearTimeout(u.I),u.I=null)}t.isActive=function(){return!!this.g};function js(u){return u.g?u.g.readyState:0}t.Z=function(){try{return 2<js(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(u){if(this.g){var g=this.g.responseText;return u&&g.indexOf(u)==0&&(g=g.substring(u.length)),w0e(g)}};function HH(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.H){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function H0e(u){const g={};u=(u.g&&2<=js(u)&&u.g.getAllResponseHeaders()||"").split(`\r
1163
+ `);for(let b=0;b<u.length;b++){if(T(u[b]))continue;var y=F(u[b]);const Q=y[0];if(y=y[1],typeof y!="string")continue;y=y.trim();const M=g[Q]||[];g[Q]=M,M.push(y)}x(g,function(b){return b.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Qu(u,g,y){return y&&y.internalChannelParams&&y.internalChannelParams[u]||g}function $H(u){this.Aa=0,this.i=[],this.j=new xu,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Qu("failFast",!1,u),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Qu("baseRetryDelayMs",5e3,u),this.cb=Qu("retryDelaySeedMs",1e4,u),this.Wa=Qu("forwardChannelMaxRetries",2,u),this.wa=Qu("forwardChannelRequestTimeoutMs",2e4,u),this.pa=u&&u.xmlHttpFactory||void 0,this.Xa=u&&u.Tb||void 0,this.Ca=u&&u.useFetchStreams||!1,this.L=void 0,this.J=u&&u.supportsCrossDomainXhr||!1,this.K="",this.h=new _H(u&&u.concurrentRequestLimit),this.Da=new D0e,this.P=u&&u.fastHandshake||!1,this.O=u&&u.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=u&&u.Rb||!1,u&&u.xa&&this.j.xa(),u&&u.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&u&&u.detectBufferingProxy||!1,this.ja=void 0,u&&u.longPollingTimeout&&0<u.longPollingTimeout&&(this.ja=u.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=$H.prototype,t.la=8,t.G=1,t.connect=function(u,g,y,b){Ur(0),this.W=u,this.H=g||{},y&&b!==void 0&&(this.H.OSID=y,this.H.OAID=b),this.F=this.X,this.I=XH(this,null,this.W),rp(this)};function QB(u){if(VH(u),u.G==3){var g=u.U++,y=Ks(u.I);if(Ge(y,"SID",u.K),Ge(y,"RID",g),Ge(y,"TYPE","terminate"),Du(u,y),g=new FA(u,u.j,g),g.L=2,g.v=Xf(Ks(y)),y=!1,o.navigator&&o.navigator.sendBeacon)try{y=o.navigator.sendBeacon(g.v.toString(),"")}catch{}!y&&o.Image&&(new Image().src=g.v,y=!0),y||(g.g=YH(g.j,null),g.g.ea(g.v)),g.F=Date.now(),qf(g)}JH(u)}function tp(u){u.g&&(LB(u),u.g.cancel(),u.g=null)}function VH(u){tp(u),u.u&&(o.clearTimeout(u.u),u.u=null),np(u),u.h.cancel(),u.s&&(typeof u.s=="number"&&o.clearTimeout(u.s),u.s=null)}function rp(u){if(!bH(u.h)&&!u.s){u.s=!0;var g=u.Ga;Eu||rH(),_u||(Eu(),_u=!0),gB.add(g,u),u.B=0}}function $0e(u,g){return vH(u.h)>=u.h.j-(u.s?1:0)?!1:u.s?(u.i=g.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=Iu(d(u.Ga,u,g),WH(u,u.B)),u.B++,!0)}t.Ga=function(u){if(this.s)if(this.s=null,this.G==1){if(!u){this.U=Math.floor(1e5*Math.random()),u=this.U++;const Q=new FA(this,this.j,u);let M=this.o;if(this.S&&(M?(M=I(M),P(M,this.S)):M=this.S),this.m!==null||this.O||(Q.H=M,M=null),this.P)e:{for(var g=0,y=0;y<this.i.length;y++){t:{var b=this.i[y];if("__data__"in b.map&&(b=b.map.__data__,typeof b=="string")){b=b.length;break t}b=void 0}if(b===void 0)break;if(g+=b,4096<g){g=y;break e}if(g===4096||y===this.i.length-1){g=y+1;break e}}g=1e3}else g=1e3;g=jH(this,Q,g),y=Ks(this.I),Ge(y,"RID",u),Ge(y,"CVER",22),this.D&&Ge(y,"X-HTTP-Session-Id",this.D),Du(this,y),M&&(this.O?g="headers="+encodeURIComponent(String(QH(M)))+"&"+g:this.m&&OB(y,this.m,M)),PB(this.h,Q),this.Ua&&Ge(y,"TYPE","init"),this.P?(Ge(y,"$req",g),Ge(y,"SID","null"),Q.T=!0,RB(Q,y,null)):RB(Q,y,g),this.G=2}}else this.G==3&&(u?KH(this,u):this.i.length==0||bH(this.h)||KH(this))};function KH(u,g){var y;g?y=g.l:y=u.U++;const b=Ks(u.I);Ge(b,"SID",u.K),Ge(b,"RID",y),Ge(b,"AID",u.T),Du(u,b),u.m&&u.o&&OB(b,u.m,u.o),y=new FA(u,u.j,y,u.B+1),u.m===null&&(y.H=u.o),g&&(u.i=g.D.concat(u.i)),g=jH(u,y,1e3),y.I=Math.round(.5*u.wa)+Math.round(.5*u.wa*Math.random()),PB(u.h,y),RB(y,b,g)}function Du(u,g){u.H&&V(u.H,function(y,b){Ge(g,b,y)}),u.l&&IH({},function(y,b){Ge(g,b,y)})}function jH(u,g,y){y=Math.min(u.i.length,y);var b=u.l?d(u.l.Na,u.l,u):null;e:{var Q=u.i;let M=-1;for(;;){const X=["count="+y];M==-1?0<y?(M=Q[0].g,X.push("ofs="+M)):M=0:X.push("ofs="+M);let $e=!0;for(let er=0;er<y;er++){let Ie=Q[er].g;const yr=Q[er].map;if(Ie-=M,0>Ie)M=Math.max(0,Q[er].g-100),$e=!1;else try{L0e(yr,X,"req"+Ie+"_")}catch{b&&b(yr)}}if($e){b=X.join("&");break e}}}return u=u.i.splice(0,y),g.D=u,b}function GH(u){if(!u.g&&!u.u){u.Y=1;var g=u.Fa;Eu||rH(),_u||(Eu(),_u=!0),gB.add(g,u),u.v=0}}function DB(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=Iu(d(u.Fa,u),WH(u,u.v)),u.v++,!0)}t.Fa=function(){if(this.u=null,zH(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var u=2*this.R;this.j.info("BP detection timer enabled: "+u),this.A=Iu(d(this.ab,this),u)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Ur(10),tp(this),zH(this))};function LB(u){u.A!=null&&(o.clearTimeout(u.A),u.A=null)}function zH(u){u.g=new FA(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var g=Ks(u.qa);Ge(g,"RID","rpc"),Ge(g,"SID",u.K),Ge(g,"AID",u.T),Ge(g,"CI",u.F?"0":"1"),!u.F&&u.ja&&Ge(g,"TO",u.ja),Ge(g,"TYPE","xmlhttp"),Du(u,g),u.m&&u.o&&OB(g,u.m,u.o),u.L&&(u.g.I=u.L);var y=u.g;u=u.ia,y.L=1,y.v=Xf(Ks(g)),y.m=null,y.P=!0,BH(y,u)}t.Za=function(){this.C!=null&&(this.C=null,tp(this),DB(this),Ur(19))};function np(u){u.C!=null&&(o.clearTimeout(u.C),u.C=null)}function qH(u,g){var y=null;if(u.g==g){np(u),LB(u),u.g=null;var b=2}else if(FB(u.h,g))y=g.D,SH(u.h,g),b=1;else return;if(u.G!=0){if(g.o)if(b==1){y=g.m?g.m.length:0,g=Date.now()-g.F;var Q=u.B;b=jf(),Rr(b,new gH(b,y)),rp(u)}else GH(u);else if(Q=g.s,Q==3||Q==0&&0<g.X||!(b==1&&$0e(u,g)||b==2&&DB(u)))switch(y&&0<y.length&&(g=u.h,g.i=g.i.concat(y)),Q){case 1:Oi(u,5);break;case 4:Oi(u,10);break;case 3:Oi(u,6);break;default:Oi(u,2)}}}function WH(u,g){let y=u.Ta+Math.floor(Math.random()*u.cb);return u.isActive()||(y*=2),y*g}function Oi(u,g){if(u.j.info("Error code "+g),g==2){var y=d(u.fb,u),b=u.Xa;const Q=!b;b=new Pi(b||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Wf(b,"https"),Xf(b),Q?O0e(b.toString(),y):Q0e(b.toString(),y)}else Ur(2);u.G=0,u.l&&u.l.sa(g),JH(u),VH(u)}t.fb=function(u){u?(this.j.info("Successfully pinged google.com"),Ur(2)):(this.j.info("Failed to ping google.com"),Ur(1))};function JH(u){if(u.G=0,u.ka=[],u.l){const g=TH(u.h);(g.length!=0||u.i.length!=0)&&(C(u.ka,g),C(u.ka,u.i),u.h.i.length=0,B(u.i),u.i.length=0),u.l.ra()}}function XH(u,g,y){var b=y instanceof Pi?Ks(y):new Pi(y);if(b.g!="")g&&(b.g=g+"."+b.g),Jf(b,b.s);else{var Q=o.location;b=Q.protocol,g=g?g+"."+Q.hostname:Q.hostname,Q=+Q.port;var M=new Pi(null);b&&Wf(M,b),g&&(M.g=g),Q&&Jf(M,Q),y&&(M.l=y),b=M}return y=u.D,g=u.ya,y&&g&&Ge(b,y,g),Ge(b,"VER",u.la),Du(u,b),b}function YH(u,g,y){if(g&&!u.J)throw Error("Can't create secondary domain capable XhrIo object.");return g=u.Ca&&!u.pa?new tt(new Yf({eb:y})):new tt(u.pa),g.Ha(u.J),g}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function ZH(){}t=ZH.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function sp(){}sp.prototype.g=function(u,g){return new qr(u,g)};function qr(u,g){wr.call(this),this.g=new $H(g),this.l=u,this.h=g&&g.messageUrlParams||null,u=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(u?u["X-WebChannel-Content-Type"]=g.messageContentType:u={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.va&&(u?u["X-WebChannel-Client-Profile"]=g.va:u={"X-WebChannel-Client-Profile":g.va}),this.g.S=u,(u=g&&g.Sb)&&!T(u)&&(this.g.m=u),this.v=g&&g.supportsCrossDomainXhr||!1,this.u=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!T(g)&&(this.g.D=g,u=this.h,u!==null&&g in u&&(u=this.h,g in u&&delete u[g])),this.j=new da(this)}w(qr,wr),qr.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},qr.prototype.close=function(){QB(this.g)},qr.prototype.o=function(u){var g=this.g;if(typeof u=="string"){var y={};y.__data__=u,u=y}else this.u&&(y={},y.__data__=bB(u),u=y);g.i.push(new v0e(g.Ya++,u)),g.G==3&&rp(g)},qr.prototype.N=function(){this.g.l=null,delete this.j,QB(this.g),delete this.g,qr.aa.N.call(this)};function e5(u){SB.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var g=u.__sm__;if(g){e:{for(const y in g){u=y;break e}u=void 0}(this.i=u)&&(u=this.i,g=g!==null&&u in g?g[u]:void 0),this.data=g}else this.data=u}w(e5,SB);function t5(){TB.call(this),this.status=1}w(t5,TB);function da(u){this.g=u}w(da,ZH),da.prototype.ua=function(){Rr(this.g,"a")},da.prototype.ta=function(u){Rr(this.g,new e5(u))},da.prototype.sa=function(u){Rr(this.g,new t5)},da.prototype.ra=function(){Rr(this.g,"b")},sp.prototype.createWebChannel=sp.prototype.g,qr.prototype.send=qr.prototype.o,qr.prototype.open=qr.prototype.m,qr.prototype.close=qr.prototype.close,z_=function(){return new sp},G_=function(){return jf()},j_=ki,bg={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Gf.NO_ERROR=0,Gf.TIMEOUT=8,Gf.HTTP_ERROR=6,Ol=Gf,mH.COMPLETE="complete",K_=mH,hH.EventType=Su,Su.OPEN="a",Su.CLOSE="b",Su.ERROR="c",Su.MESSAGE="d",wr.prototype.listen=wr.prototype.K,$a=hH,tt.prototype.listenOnce=tt.prototype.L,tt.prototype.getLastError=tt.prototype.Ka,tt.prototype.getLastErrorCode=tt.prototype.Ba,tt.prototype.getStatus=tt.prototype.Z,tt.prototype.getResponseJson=tt.prototype.Oa,tt.prototype.getResponseText=tt.prototype.oa,tt.prototype.send=tt.prototype.ea,tt.prototype.setWithCredentials=tt.prototype.Ha,V_=tt}).apply(typeof Pl<"u"?Pl:typeof self<"u"?self:typeof window<"u"?window:{});const q_="@firebase/firestore";/**
1164
1164
  * @license
1165
1165
  * Copyright 2017 Google LLC
1166
1166
  *
@@ -2977,20 +2977,20 @@ Content-Type: `+c.contentType+`\r
2977
2977
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2978
2978
  * See the License for the specific language governing permissions and
2979
2979
  * limitations under the License.
2980
- */const BS="storage";function EJ(t,e,r,n){return t=Or(t),pJ(t,e,r,n)}function _J(t){return t=Or(t),gJ(t)}function bJ(t,e){return t=Or(t),BJ(t,e)}function vJ(t=O_(),e){t=Or(t);const n=k_(t,BS).getImmediate({identifier:e}),s=y_("storage");return s&&SJ(n,...s),n}function SJ(t,e,r,n={}){CJ(t,e,r,n)}function TJ(t,{instanceIdentifier:e}){const r=t.getProvider("app").getImmediate(),n=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new Qm(r,n,s,e,F_)}function IJ(){Na(new zi(BS,TJ,"PUBLIC").setMultipleInstances(!0)),rA(wS,yS,""),rA(wS,yS,"esm2017")}IJ();class xJ{constructor(e){S(this,"db");S(this,"storage");const{provider:r,...n}=e;let s;const A=t7().find(i=>i.name==="ui-feedback-plugin");A?s=A:s=P_(n,"ui-feedback-plugin"),this.db=Jq(s),this.storage=vJ(s)}async addComment(e){return(await Xv(cc(this.db,"ufp_comments"),e)).id}async getComments(e,r){const n=Kv(cc(this.db,"ufp_comments"),lh("pageUrl","==",e),lh("projectKey","==",r));return(await Jv(n)).docs.map(i=>({id:i.id,...i.data()})).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,r){await lW(fm(this.db,"ufp_comments",e),r)}async deleteComment(e){await hW(fm(this.db,"ufp_comments",e))}async addReply(e){return(await Xv(cc(this.db,"ufp_comments",e.commentId,"replies"),e)).id}async getReplies(e){return(await Jv(cc(this.db,"ufp_comments",e,"replies"))).docs.map(s=>({id:s.id,...s.data()})).sort((s,A)=>s.createdAt-A.createdAt)}subscribeToComments(e,r,n){const s=Kv(cc(this.db,"ufp_comments"),lh("pageUrl","==",e),lh("projectKey","==",r));return dW(s,A=>{const i=A.docs.map(o=>({id:o.id,...o.data()})).sort((o,a)=>a.createdAt-o.createdAt);n(i)},A=>{console.error("[ui-feedback-plugin] Firestore listener error:",A)})}async uploadScreenshot(e,r){const n=bJ(this.storage,`ufp_screenshots/${e}.png`);return await EJ(n,r,"data_url"),_J(n)}}const RJ=Object.freeze(Object.defineProperty({__proto__:null,FirebaseAdapter:xJ},Symbol.toStringTag,{value:"Module"}));function UJ(t){return{id:t.id,pageUrl:t.page_url,projectKey:t.project_key,authorName:t.author_name,text:t.text,screenshotUrl:t.screenshot_url??"",annotation:t.annotation,resolved:t.resolved,createdAt:t.created_at}}function kJ(t){return{page_url:t.pageUrl,project_key:t.projectKey,author_name:t.authorName,text:t.text,screenshot_url:t.screenshotUrl,annotation:t.annotation,resolved:t.resolved,created_at:t.createdAt}}function FJ(t){return{id:t.id,commentId:t.comment_id,authorName:t.author_name,text:t.text,createdAt:t.created_at}}function PJ(t){return{comment_id:t.commentId,author_name:t.authorName,text:t.text,created_at:t.createdAt}}class OJ{constructor(e,r){S(this,"client");S(this,"_url");S(this,"_key");S(this,"_client",null);this._url=e,this._key=r}async _getClient(){if(this._client)return this._client;try{const{createClient:e}=await Promise.resolve().then(()=>RZ);return this._client=e(this._url,this._key),this._client}catch{throw new Error("[ui-feedback-plugin] @supabase/supabase-js is not installed. Run: npm install @supabase/supabase-js")}}async addComment(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_comments").insert(kJ(e)).select("id").single();if(s)throw s;return n.id}async getComments(e,r){const n=await this._getClient(),{data:s,error:A}=await n.from("ufp_comments").select("*").eq("page_url",e).eq("project_key",r);if(A)throw A;return(s??[]).map(UJ).sort((o,a)=>a.createdAt-o.createdAt)}async updateComment(e,r){const n=await this._getClient(),s={};r.resolved!==void 0&&(s.resolved=r.resolved),r.screenshotUrl!==void 0&&(s.screenshot_url=r.screenshotUrl),r.text!==void 0&&(s.text=r.text),r.annotation!==void 0&&(s.annotation=r.annotation);const{error:A}=await n.from("ufp_comments").update(s).eq("id",e);if(A)throw A}async deleteComment(e){const r=await this._getClient(),{error:n}=await r.from("ufp_comments").delete().eq("id",e);if(n)throw n}async addReply(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_replies").insert(PJ(e)).select("id").single();if(s)throw s;return n.id}async getReplies(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_replies").select("*").eq("comment_id",e);if(s)throw s;return(n??[]).map(FJ).sort((i,o)=>i.createdAt-o.createdAt)}subscribeToComments(e,r,n){let s=null,A=!0;const i=async()=>{if(A)try{const o=await this.getComments(e,r);A&&n(o)}catch(o){console.error("[ui-feedback-plugin] Supabase fetch error:",o)}};return i(),this._getClient().then(o=>{A&&(s=o.channel("ufp-comments").on("postgres_changes",{event:"*",schema:"public",table:"ufp_comments"},()=>{i()}).subscribe())}).catch(console.error),()=>{A=!1,s&&this._getClient().then(o=>o.removeChannel(s)).catch(()=>{})}}async uploadScreenshot(e,r){var p;const n=await this._getClient(),[s,A]=r.split(","),i=((p=s.match(/:(.*?);/))==null?void 0:p[1])??"image/png",o=atob(A),a=new Uint8Array(o.length);for(let w=0;w<o.length;w++)a[w]=o.charCodeAt(w);const c=new Blob([a],{type:i}),l=`${e}.png`,{error:h}=await n.storage.from("ufp-screenshots").upload(l,c,{contentType:"image/png",upsert:!0});if(h)throw h;const{data:d}=n.storage.from("ufp-screenshots").getPublicUrl(l);return d.publicUrl}}const QJ=Object.freeze(Object.defineProperty({__proto__:null,SupabaseAdapter:OJ},Symbol.toStringTag,{value:"Module"}));class DJ{constructor(e){S(this,"cfg");S(this,"_s3",null);this.cfg=e}async s3(){if(this._s3)return this._s3;const[{S3Client:e},{fromCognitoIdentityPool:r}]=await Promise.all([Promise.resolve().then(()=>Of),Promise.resolve().then(()=>Wwe)]);return this._s3=new e({region:this.cfg.region,credentials:r({identityPoolId:this.cfg.identityPoolId,clientConfig:{region:this.cfg.region}})}),this._s3}async pageHash(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("").slice(0,16)}async put(e,r,n){const{PutObjectCommand:s}=await Promise.resolve().then(()=>Of);await(await this.s3()).send(new s({Bucket:this.cfg.bucket,Key:e,Body:r,ContentType:n}))}async getJson(e){const{GetObjectCommand:r}=await Promise.resolve().then(()=>Of),A=await(await(await this.s3()).send(new r({Bucket:this.cfg.bucket,Key:e}))).Body.transformToString();return JSON.parse(A)}async listKeys(e){const{ListObjectsV2Command:r}=await Promise.resolve().then(()=>Of),n=await this.s3(),s=[];let A;do{const i=await n.send(new r({Bucket:this.cfg.bucket,Prefix:e,ContinuationToken:A}));for(const o of i.Contents??[])o.Key&&s.push(o.Key);A=i.NextContinuationToken}while(A);return s}indexKey(e){return`ufp/_index/${e}.json`}async lookupComment(e){const{p:r,h:n}=await this.getJson(this.indexKey(e));return{key:`ufp/${r}/${n}/comments/${e}.json`}}async addComment(e){const r=await this.pageHash(e.pageUrl),n=crypto.randomUUID();return await Promise.all([this.put(`ufp/${e.projectKey}/${r}/comments/${n}.json`,JSON.stringify({id:n,...e}),"application/json"),this.put(this.indexKey(n),JSON.stringify({p:e.projectKey,h:r}),"application/json")]),n}async getComments(e,r){const n=await this.pageHash(e),s=await this.listKeys(`ufp/${r}/${n}/comments/`);return(await Promise.all(s.map(i=>this.getJson(i).catch(()=>null)))).filter(i=>i!==null&&!i.deleted).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,r){const{key:n}=await this.lookupComment(e),s=await this.getJson(n);await this.put(n,JSON.stringify({...s,...r}),"application/json")}async deleteComment(e){const{key:r}=await this.lookupComment(e),n=await this.getJson(r);await this.put(r,JSON.stringify({...n,deleted:!0}),"application/json")}async addReply(e){const r=crypto.randomUUID();return await this.put(`ufp/replies/${e.commentId}/${r}.json`,JSON.stringify({id:r,...e}),"application/json"),r}async getReplies(e){const r=await this.listKeys(`ufp/replies/${e}/`);return(await Promise.all(r.map(s=>this.getJson(s).catch(()=>null)))).filter(s=>s!==null).sort((s,A)=>s.createdAt-A.createdAt)}subscribeToComments(e,r,n){let s=!0;const A=this.cfg.pollInterval??5e3,i=async()=>{if(s){try{const o=await this.getComments(e,r);s&&n(o)}catch(o){console.error("[ui-feedback-plugin] AWS poll error:",o)}s&&setTimeout(i,A)}};return i(),()=>{s=!1}}async uploadScreenshot(e,r){const{p:n,h:s}=await this.getJson(this.indexKey(e)),A=`ufp/${n}/${s}/screenshots/${e}.png`,i=r.split(",")[1],o=atob(i),a=new Uint8Array(o.length);for(let c=0;c<o.length;c++)a[c]=o.charCodeAt(c);return await this.put(A,a,"image/png"),`https://${this.cfg.bucket}.s3.${this.cfg.region}.amazonaws.com/${A}`}}const LJ=Object.freeze(Object.defineProperty({__proto__:null,AWSAdapter:DJ},Symbol.toStringTag,{value:"Module"}));function ph(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function gh(t,e,r,n){function s(A){return A instanceof r?A:new r(function(i){i(A)})}return new(r||(r=Promise))(function(A,i){function o(l){try{c(n.next(l))}catch(h){i(h)}}function a(l){try{c(n.throw(l))}catch(h){i(h)}}function c(l){l.done?A(l.value):s(l.value).then(o,a)}c((n=n.apply(t,e||[])).next())})}function Dm(t,e){var r={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},n,s,A,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(c){return function(l){return a([c,l])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(r=0)),r;)try{if(n=1,s&&(A=c[0]&2?s.return:c[0]?s.throw||((A=s.return)&&A.call(s),0):s.next)&&!(A=A.call(s,c[1])).done)return A;switch(s=0,A&&(c=[c[0]&2,A.value]),c[0]){case 0:case 1:A=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(A=r.trys,!(A=A.length>0&&A[A.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!A||c[1]>A[0]&&c[1]<A[3])){r.label=c[1];break}if(c[0]===6&&r.label<A[1]){r.label=A[1],A=c;break}if(A&&r.label<A[2]){r.label=A[2],r.ops.push(c);break}A[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],s=0}finally{n=A=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function CS(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}typeof SuppressedError=="function"&&SuppressedError;const MJ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class mh extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class ES extends mh{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Lm extends mh{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Mm extends mh{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var wh;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(wh||(wh={}));class NJ{constructor(e,{headers:r={},customFetch:n,region:s=wh.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=MJ(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return gh(this,arguments,void 0,function*(r,n={}){var s;let A,i;try{const{headers:o,method:a,body:c,signal:l,timeout:h}=n;let d={},{region:p}=n;p||(p=this.region);const w=new URL(`${this.url}/${r}`);p&&p!=="any"&&(d["x-region"]=p,w.searchParams.set("forceFunctionRegion",p));let B;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",B=c):typeof c=="string"?(d["Content-Type"]="text/plain",B=c):typeof FormData<"u"&&c instanceof FormData?B=c:(d["Content-Type"]="application/json",B=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?B=JSON.stringify(c):B=c;let C=l;h&&(i=new AbortController,A=setTimeout(()=>i.abort(),h),l?(C=i.signal,l.addEventListener("abort",()=>i.abort())):C=i.signal);const _=yield this.fetch(w.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),o),body:B,signal:C}).catch(L=>{throw new ES(L)}),T=_.headers.get("x-relay-error");if(T&&T==="true")throw new Lm(_);if(!_.ok)throw new Mm(_);let v=((s=_.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return v==="application/json"?k=yield _.json():v==="application/octet-stream"||v==="application/pdf"?k=yield _.blob():v==="text/event-stream"?k=_:v==="multipart/form-data"?k=yield _.formData():k=yield _.text(),{data:k,error:null,response:_}}catch(o){return{data:null,error:o,response:o instanceof Mm||o instanceof Lm?o.context:void 0}}finally{A&&clearTimeout(A)}})}}const _S=3,bS=t=>Math.min(1e3*2**t,3e4),HJ=[520,503],vS=["GET","HEAD","OPTIONS"];var Nm=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function SS(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function $J(t,e,r,n){return!(!n||r>=_S||!vS.includes(t)||!HJ.includes(e))}var VJ=class{constructor(t){var e,r,n,s,A;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(A=t.retry)!==null&&A!==void 0?A:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let A=(async()=>{let i=0;for(;;){const c={};r.headers.forEach((h,d)=>{c[d]=h}),i>0&&(c["X-Retry-Count"]=String(i));let l;try{l=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(h,d)=>typeof d=="bigint"?d.toString():d),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!vS.includes(r.method))throw h;if(r.retryEnabled&&i<_S){const d=bS(i);i++,await SS(d,r.signal);continue}throw h}if($J(r.method,l.status,i,r.retryEnabled)){var o,a;const h=(o=(a=l.headers)===null||a===void 0?void 0:a.get("Retry-After"))!==null&&o!==void 0?o:null,d=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:bS(i);await l.text(),i++,await SS(d,r.signal);continue}return await r.processResponse(l)}})();return this.shouldThrowOnError||(A=A.catch(i=>{var o;let a="",c="",l="";const h=i==null?void 0:i.cause;if(h){var d,p,w,B;const T=(d=h==null?void 0:h.message)!==null&&d!==void 0?d:"",v=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";a=`${(w=i==null?void 0:i.name)!==null&&w!==void 0?w:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
2980
+ */const BS="storage";function EJ(t,e,r,n){return t=Or(t),pJ(t,e,r,n)}function _J(t){return t=Or(t),gJ(t)}function bJ(t,e){return t=Or(t),BJ(t,e)}function vJ(t=O_(),e){t=Or(t);const n=k_(t,BS).getImmediate({identifier:e}),s=y_("storage");return s&&SJ(n,...s),n}function SJ(t,e,r,n={}){CJ(t,e,r,n)}function TJ(t,{instanceIdentifier:e}){const r=t.getProvider("app").getImmediate(),n=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new Qm(r,n,s,e,F_)}function IJ(){Na(new zi(BS,TJ,"PUBLIC").setMultipleInstances(!0)),rA(wS,yS,""),rA(wS,yS,"esm2017")}IJ();class xJ{constructor(e){S(this,"db");S(this,"storage");const{provider:r,...n}=e;let s;const A=t7().find(i=>i.name==="ui-feedback-plugin");A?s=A:s=P_(n,"ui-feedback-plugin"),this.db=Jq(s),this.storage=vJ(s)}async addComment(e){return(await Xv(cc(this.db,"ufp_comments"),e)).id}async getComments(e,r){const n=Kv(cc(this.db,"ufp_comments"),lh("pageUrl","==",e),lh("projectKey","==",r));return(await Jv(n)).docs.map(i=>({id:i.id,...i.data()})).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,r){await lW(fm(this.db,"ufp_comments",e),r)}async deleteComment(e){await hW(fm(this.db,"ufp_comments",e))}async addReply(e){return(await Xv(cc(this.db,"ufp_comments",e.commentId,"replies"),e)).id}async getReplies(e){return(await Jv(cc(this.db,"ufp_comments",e,"replies"))).docs.map(s=>({id:s.id,...s.data()})).sort((s,A)=>s.createdAt-A.createdAt)}subscribeToComments(e,r,n){const s=Kv(cc(this.db,"ufp_comments"),lh("pageUrl","==",e),lh("projectKey","==",r));return dW(s,A=>{const i=A.docs.map(o=>({id:o.id,...o.data()})).sort((o,a)=>a.createdAt-o.createdAt);n(i)},A=>{console.error("[ui-feedback-plugin] Firestore listener error:",A)})}async uploadScreenshot(e,r){const n=bJ(this.storage,`ufp_screenshots/${e}.png`);return await EJ(n,r,"data_url"),_J(n)}}const RJ=Object.freeze(Object.defineProperty({__proto__:null,FirebaseAdapter:xJ},Symbol.toStringTag,{value:"Module"}));function UJ(t){return{id:t.id,pageUrl:t.page_url,projectKey:t.project_key,authorName:t.author_name,text:t.text,screenshotUrl:t.screenshot_url??"",annotation:t.annotation,resolved:t.resolved,createdAt:t.created_at}}function kJ(t){return{page_url:t.pageUrl,project_key:t.projectKey,author_name:t.authorName,text:t.text,screenshot_url:t.screenshotUrl,annotation:t.annotation,resolved:t.resolved,created_at:t.createdAt}}function FJ(t){return{id:t.id,commentId:t.comment_id,authorName:t.author_name,text:t.text,createdAt:t.created_at}}function PJ(t){return{comment_id:t.commentId,author_name:t.authorName,text:t.text,created_at:t.createdAt}}class OJ{constructor(e,r){S(this,"client");S(this,"_url");S(this,"_key");S(this,"_client",null);this._url=e,this._key=r}async _getClient(){if(this._client)return this._client;try{const{createClient:e}=await Promise.resolve().then(()=>kZ);return this._client=e(this._url,this._key),this._client}catch{throw new Error("[ui-feedback-plugin] @supabase/supabase-js is not installed. Run: npm install @supabase/supabase-js")}}async addComment(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_comments").insert(kJ(e)).select("id").single();if(s)throw s;return n.id}async getComments(e,r){const n=await this._getClient(),{data:s,error:A}=await n.from("ufp_comments").select("*").eq("page_url",e).eq("project_key",r);if(A)throw A;return(s??[]).map(UJ).sort((o,a)=>a.createdAt-o.createdAt)}async updateComment(e,r){const n=await this._getClient(),s={};r.resolved!==void 0&&(s.resolved=r.resolved),r.screenshotUrl!==void 0&&(s.screenshot_url=r.screenshotUrl),r.text!==void 0&&(s.text=r.text),r.annotation!==void 0&&(s.annotation=r.annotation);const{error:A}=await n.from("ufp_comments").update(s).eq("id",e);if(A)throw A}async deleteComment(e){const r=await this._getClient(),{error:n}=await r.from("ufp_comments").delete().eq("id",e);if(n)throw n}async addReply(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_replies").insert(PJ(e)).select("id").single();if(s)throw s;return n.id}async getReplies(e){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_replies").select("*").eq("comment_id",e);if(s)throw s;return(n??[]).map(FJ).sort((i,o)=>i.createdAt-o.createdAt)}subscribeToComments(e,r,n){let s=null,A=!0;const i=async()=>{if(A)try{const o=await this.getComments(e,r);A&&n(o)}catch(o){console.error("[ui-feedback-plugin] Supabase fetch error:",o)}};return i(),this._getClient().then(o=>{A&&(s=o.channel("ufp-comments").on("postgres_changes",{event:"*",schema:"public",table:"ufp_comments"},()=>{i()}).subscribe())}).catch(console.error),()=>{A=!1,s&&this._getClient().then(o=>o.removeChannel(s)).catch(()=>{})}}async uploadScreenshot(e,r){var p;const n=await this._getClient(),[s,A]=r.split(","),i=((p=s.match(/:(.*?);/))==null?void 0:p[1])??"image/png",o=atob(A),a=new Uint8Array(o.length);for(let w=0;w<o.length;w++)a[w]=o.charCodeAt(w);const c=new Blob([a],{type:i}),l=`${e}.png`,{error:h}=await n.storage.from("ufp-screenshots").upload(l,c,{contentType:"image/png",upsert:!0});if(h)throw h;const{data:d}=n.storage.from("ufp-screenshots").getPublicUrl(l);return d.publicUrl}}const QJ=Object.freeze(Object.defineProperty({__proto__:null,SupabaseAdapter:OJ},Symbol.toStringTag,{value:"Module"}));class DJ{constructor(e){S(this,"cfg");S(this,"_s3",null);this.cfg=e}async s3(){if(this._s3)return this._s3;const[{S3Client:e},{fromCognitoIdentityPool:r}]=await Promise.all([Promise.resolve().then(()=>Of),Promise.resolve().then(()=>Xwe)]);return this._s3=new e({region:this.cfg.region,credentials:r({identityPoolId:this.cfg.identityPoolId,clientConfig:{region:this.cfg.region}})}),this._s3}async pageHash(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("").slice(0,16)}async put(e,r,n){const{PutObjectCommand:s}=await Promise.resolve().then(()=>Of);await(await this.s3()).send(new s({Bucket:this.cfg.bucket,Key:e,Body:r,ContentType:n}))}async getJson(e){const{GetObjectCommand:r}=await Promise.resolve().then(()=>Of),A=await(await(await this.s3()).send(new r({Bucket:this.cfg.bucket,Key:e}))).Body.transformToString();return JSON.parse(A)}async listKeys(e){const{ListObjectsV2Command:r}=await Promise.resolve().then(()=>Of),n=await this.s3(),s=[];let A;do{const i=await n.send(new r({Bucket:this.cfg.bucket,Prefix:e,ContinuationToken:A}));for(const o of i.Contents??[])o.Key&&s.push(o.Key);A=i.NextContinuationToken}while(A);return s}indexKey(e){return`ufp/_index/${e}.json`}async lookupComment(e){const{p:r,h:n}=await this.getJson(this.indexKey(e));return{key:`ufp/${r}/${n}/comments/${e}.json`}}async addComment(e){const r=await this.pageHash(e.pageUrl),n=crypto.randomUUID();return await Promise.all([this.put(`ufp/${e.projectKey}/${r}/comments/${n}.json`,JSON.stringify({id:n,...e}),"application/json"),this.put(this.indexKey(n),JSON.stringify({p:e.projectKey,h:r}),"application/json")]),n}async getComments(e,r){const n=await this.pageHash(e),s=await this.listKeys(`ufp/${r}/${n}/comments/`);return(await Promise.all(s.map(i=>this.getJson(i).catch(()=>null)))).filter(i=>i!==null&&!i.deleted).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,r){const{key:n}=await this.lookupComment(e),s=await this.getJson(n);await this.put(n,JSON.stringify({...s,...r}),"application/json")}async deleteComment(e){const{key:r}=await this.lookupComment(e),n=await this.getJson(r);await this.put(r,JSON.stringify({...n,deleted:!0}),"application/json")}async addReply(e){const r=crypto.randomUUID();return await this.put(`ufp/replies/${e.commentId}/${r}.json`,JSON.stringify({id:r,...e}),"application/json"),r}async getReplies(e){const r=await this.listKeys(`ufp/replies/${e}/`);return(await Promise.all(r.map(s=>this.getJson(s).catch(()=>null)))).filter(s=>s!==null).sort((s,A)=>s.createdAt-A.createdAt)}subscribeToComments(e,r,n){let s=!0;const A=this.cfg.pollInterval??5e3,i=async()=>{if(s){try{const o=await this.getComments(e,r);s&&n(o)}catch(o){console.error("[ui-feedback-plugin] AWS poll error:",o)}s&&setTimeout(i,A)}};return i(),()=>{s=!1}}async uploadScreenshot(e,r){const{p:n,h:s}=await this.getJson(this.indexKey(e)),A=`ufp/${n}/${s}/screenshots/${e}.png`,i=r.split(",")[1],o=atob(i),a=new Uint8Array(o.length);for(let c=0;c<o.length;c++)a[c]=o.charCodeAt(c);return await this.put(A,a,"image/png"),`https://${this.cfg.bucket}.s3.${this.cfg.region}.amazonaws.com/${A}`}}const LJ=Object.freeze(Object.defineProperty({__proto__:null,AWSAdapter:DJ},Symbol.toStringTag,{value:"Module"}));class MJ{constructor(){S(this,"listeners",new Set)}getCommentsFromStorage(){const e=sessionStorage.getItem("ufp_comments");return e?JSON.parse(e):[]}saveCommentsToStorage(e){sessionStorage.setItem("ufp_comments",JSON.stringify(e)),this.notifyListeners()}getRepliesFromStorage(){const e=sessionStorage.getItem("ufp_replies");return e?JSON.parse(e):[]}saveRepliesToStorage(e){sessionStorage.setItem("ufp_replies",JSON.stringify(e))}notifyListeners(){const e=this.getCommentsFromStorage();for(const r of this.listeners)r(e)}async addComment(e){const r=this.getCommentsFromStorage(),n=Math.random().toString(36).substring(2,9),s={...e,id:n};return r.push(s),this.saveCommentsToStorage(r),n}async getComments(e,r){return this.getCommentsFromStorage().filter(s=>s.pageUrl===e&&s.projectKey===r)}async updateComment(e,r){const n=this.getCommentsFromStorage(),s=n.findIndex(A=>A.id===e);s!==-1&&(n[s]={...n[s],...r},this.saveCommentsToStorage(n))}async deleteComment(e){const n=this.getCommentsFromStorage().filter(i=>i.id!==e);this.saveCommentsToStorage(n);const A=this.getRepliesFromStorage().filter(i=>i.commentId!==e);this.saveRepliesToStorage(A)}async addReply(e){const r=this.getRepliesFromStorage(),n=Math.random().toString(36).substring(2,9),s={...e,id:n};return r.push(s),this.saveRepliesToStorage(r),n}async getReplies(e){return this.getRepliesFromStorage().filter(n=>n.commentId===e)}subscribeToComments(e,r,n){const s=A=>{n(A.filter(i=>i.pageUrl===e&&i.projectKey===r))};return this.listeners.add(s),s(this.getCommentsFromStorage()),()=>{this.listeners.delete(s)}}async uploadScreenshot(e,r){return r}}const NJ=Object.freeze(Object.defineProperty({__proto__:null,LocalAdapter:MJ},Symbol.toStringTag,{value:"Module"}));function ph(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function gh(t,e,r,n){function s(A){return A instanceof r?A:new r(function(i){i(A)})}return new(r||(r=Promise))(function(A,i){function o(l){try{c(n.next(l))}catch(h){i(h)}}function a(l){try{c(n.throw(l))}catch(h){i(h)}}function c(l){l.done?A(l.value):s(l.value).then(o,a)}c((n=n.apply(t,e||[])).next())})}function Dm(t,e){var r={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},n,s,A,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(c){return function(l){return a([c,l])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(r=0)),r;)try{if(n=1,s&&(A=c[0]&2?s.return:c[0]?s.throw||((A=s.return)&&A.call(s),0):s.next)&&!(A=A.call(s,c[1])).done)return A;switch(s=0,A&&(c=[c[0]&2,A.value]),c[0]){case 0:case 1:A=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,s=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(A=r.trys,!(A=A.length>0&&A[A.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!A||c[1]>A[0]&&c[1]<A[3])){r.label=c[1];break}if(c[0]===6&&r.label<A[1]){r.label=A[1],A=c;break}if(A&&r.label<A[2]){r.label=A[2],r.ops.push(c);break}A[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],s=0}finally{n=A=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function CS(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}typeof SuppressedError=="function"&&SuppressedError;const HJ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class mh extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class ES extends mh{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Lm extends mh{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Mm extends mh{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var wh;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(wh||(wh={}));class $J{constructor(e,{headers:r={},customFetch:n,region:s=wh.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=HJ(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return gh(this,arguments,void 0,function*(r,n={}){var s;let A,i;try{const{headers:o,method:a,body:c,signal:l,timeout:h}=n;let d={},{region:p}=n;p||(p=this.region);const w=new URL(`${this.url}/${r}`);p&&p!=="any"&&(d["x-region"]=p,w.searchParams.set("forceFunctionRegion",p));let B;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",B=c):typeof c=="string"?(d["Content-Type"]="text/plain",B=c):typeof FormData<"u"&&c instanceof FormData?B=c:(d["Content-Type"]="application/json",B=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?B=JSON.stringify(c):B=c;let C=l;h&&(i=new AbortController,A=setTimeout(()=>i.abort(),h),l?(C=i.signal,l.addEventListener("abort",()=>i.abort())):C=i.signal);const _=yield this.fetch(w.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),o),body:B,signal:C}).catch(L=>{throw new ES(L)}),T=_.headers.get("x-relay-error");if(T&&T==="true")throw new Lm(_);if(!_.ok)throw new Mm(_);let v=((s=_.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return v==="application/json"?k=yield _.json():v==="application/octet-stream"||v==="application/pdf"?k=yield _.blob():v==="text/event-stream"?k=_:v==="multipart/form-data"?k=yield _.formData():k=yield _.text(),{data:k,error:null,response:_}}catch(o){return{data:null,error:o,response:o instanceof Mm||o instanceof Lm?o.context:void 0}}finally{A&&clearTimeout(A)}})}}const _S=3,bS=t=>Math.min(1e3*2**t,3e4),VJ=[520,503],vS=["GET","HEAD","OPTIONS"];var Nm=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function SS(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function KJ(t,e,r,n){return!(!n||r>=_S||!vS.includes(t)||!VJ.includes(e))}var jJ=class{constructor(t){var e,r,n,s,A;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(A=t.retry)!==null&&A!==void 0?A:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let A=(async()=>{let i=0;for(;;){const c={};r.headers.forEach((h,d)=>{c[d]=h}),i>0&&(c["X-Retry-Count"]=String(i));let l;try{l=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(h,d)=>typeof d=="bigint"?d.toString():d),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!vS.includes(r.method))throw h;if(r.retryEnabled&&i<_S){const d=bS(i);i++,await SS(d,r.signal);continue}throw h}if(KJ(r.method,l.status,i,r.retryEnabled)){var o,a;const h=(o=(a=l.headers)===null||a===void 0?void 0:a.get("Retry-After"))!==null&&o!==void 0?o:null,d=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:bS(i);await l.text(),i++,await SS(d,r.signal);continue}return await r.processResponse(l)}})();return this.shouldThrowOnError||(A=A.catch(i=>{var o;let a="",c="",l="";const h=i==null?void 0:i.cause;if(h){var d,p,w,B;const T=(d=h==null?void 0:h.message)!==null&&d!==void 0?d:"",v=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";a=`${(w=i==null?void 0:i.name)!==null&&w!==void 0?w:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
2981
2981
 
2982
2982
  Caused by: ${(B=h==null?void 0:h.name)!==null&&B!==void 0?B:"Error"}: ${T}`,v&&(a+=` (${v})`),h!=null&&h.stack&&(a+=`
2983
- ${h.stack}`)}else{var C;a=(C=i==null?void 0:i.stack)!==null&&C!==void 0?C:""}const _=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(l="",c="Request was aborted (timeout or manual cancellation)",_>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${_} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(l="",c="HTTP headers exceeded server limits (typically 16KB)",_>this.urlLengthLimit&&(c+=`. Your request URL is ${_} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:c,code:l},data:null,count:null,status:0,statusText:""}})),A.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,A=t.status,i=t.statusText;if(t.ok){var o,a;if(e.method!=="HEAD"){var c;const d=await t.text();if(d!=="")if(e.headers.get("Accept")==="text/csv")n=d;else if(e.headers.get("Accept")&&(!((c=e.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text")))n=d;else try{n=JSON.parse(d)}catch{if(r={message:d},n=null,e.shouldThrowOnError)throw new Nm({message:d,details:"",hint:"",code:""})}}const l=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),h=(a=t.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");l&&h&&h.length>1&&(s=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,A=406,i="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const l=await t.text();try{r=JSON.parse(l),Array.isArray(r)&&t.status===404&&(n=[],r=null,A=200,i="OK")}catch{t.status===404&&l===""?(A=204,i="No Content"):r={message:l}}if(r&&e.shouldThrowOnError)throw new Nm(r)}return{success:r===null,error:r,data:n,count:s,status:A,statusText:i}}returns(){return this}overrideTypes(){return this}},KJ=class extends VJ{throwOnError(){return super.throwOnError()}select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const A=s?`${s}.order`:"order",i=this.url.searchParams.get(A);return this.url.searchParams.set(A,`${i?`${i},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,A=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(A,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:A="text"}={}){var i;const o=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),a=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${A}; for="${a}"; options=${o};`),A==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const TS=new RegExp("[,()]");var ao=class extends KJ{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&TS.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&TS.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const A=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${A}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},jJ=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:A}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=A}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let A=!1;const i=(t??"*").split("").map(c=>/\s/.test(c)&&!A?"":(c==='"'&&(A=!A),c)).join(""),{url:o,headers:a}=this.cloneRequestState();return o.searchParams.set("select",i),n&&a.append("Prefer",`count=${n}`),new ao({method:s,url:o,headers:a,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:A,headers:i}=this.cloneRequestState();if(e&&i.append("Prefer",`count=${e}`),r||i.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((a,c)=>a.concat(Object.keys(c)),[]);if(o.length>0){const a=[...new Set(o)].map(c=>`"${c}"`);A.searchParams.set("columns",a.join(","))}}return new ao({method:s,url:A,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var A;const i="POST",{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),n&&a.append("Prefer",`count=${n}`),s||a.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((l,h)=>l.concat(Object.keys(h)),[]);if(c.length>0){const l=[...new Set(c)].map(h=>`"${h}"`);o.searchParams.set("columns",l.join(","))}}return new ao({method:i,url:o,headers:a,schema:this.schema,body:t,fetch:(A=this.fetch)!==null&&A!==void 0?A:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:A}=this.cloneRequestState();return e&&A.append("Prefer",`count=${e}`),new ao({method:n,url:s,headers:A,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new ao({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function fc(t){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fc(t)}function GJ(t,e){if(fc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zJ(t){var e=GJ(t,"string");return fc(e)=="symbol"?e:e+""}function qJ(t,e,r){return(e=zJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function yh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IS(Object(r),!0).forEach(function(n){qJ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var WJ=class A5{constructor(e,{headers:r={},schema:n,fetch:s,timeout:A,urlLengthLimit:i=8e3,retry:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const a=s??globalThis.fetch;A!==void 0&&A>0?this.fetch=(c,l)=>{const h=new AbortController,d=setTimeout(()=>h.abort(),A),p=l==null?void 0:l.signal;if(p){if(p.aborted)return clearTimeout(d),a(c,l);const w=()=>{clearTimeout(d),h.abort()};return p.addEventListener("abort",w,{once:!0}),a(c,yh(yh({},l),{},{signal:h.signal})).finally(()=>{clearTimeout(d),p.removeEventListener("abort",w)})}return a(c,yh(yh({},l),{},{signal:h.signal})).finally(()=>clearTimeout(d))}:this.fetch=a,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new jJ(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new A5(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:A}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let c;const l=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(l)),h=n&&Object.values(r).some(l);h?(o="POST",c=r):n||s?(o=n?"HEAD":"GET",Object.entries(r).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{a.searchParams.append(p,w)})):(o="POST",c=r);const d=new Headers(this.headers);return h?d.set("Prefer",A?`count=${A},return=minimal`:"return=minimal"):A&&d.set("Prefer",`count=${A}`),new ao({method:o,url:a,headers:d,schema:this.schemaName,body:c,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class xS{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const A=s.versions;if(A&&A.node){const i=A.node,o=parseInt(i.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
2983
+ ${h.stack}`)}else{var C;a=(C=i==null?void 0:i.stack)!==null&&C!==void 0?C:""}const _=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(l="",c="Request was aborted (timeout or manual cancellation)",_>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${_} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(l="",c="HTTP headers exceeded server limits (typically 16KB)",_>this.urlLengthLimit&&(c+=`. Your request URL is ${_} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:c,code:l},data:null,count:null,status:0,statusText:""}})),A.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,A=t.status,i=t.statusText;if(t.ok){var o,a;if(e.method!=="HEAD"){var c;const d=await t.text();if(d!=="")if(e.headers.get("Accept")==="text/csv")n=d;else if(e.headers.get("Accept")&&(!((c=e.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text")))n=d;else try{n=JSON.parse(d)}catch{if(r={message:d},n=null,e.shouldThrowOnError)throw new Nm({message:d,details:"",hint:"",code:""})}}const l=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),h=(a=t.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");l&&h&&h.length>1&&(s=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,A=406,i="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const l=await t.text();try{r=JSON.parse(l),Array.isArray(r)&&t.status===404&&(n=[],r=null,A=200,i="OK")}catch{t.status===404&&l===""?(A=204,i="No Content"):r={message:l}}if(r&&e.shouldThrowOnError)throw new Nm(r)}return{success:r===null,error:r,data:n,count:s,status:A,statusText:i}}returns(){return this}overrideTypes(){return this}},GJ=class extends jJ{throwOnError(){return super.throwOnError()}select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const A=s?`${s}.order`:"order",i=this.url.searchParams.get(A);return this.url.searchParams.set(A,`${i?`${i},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,A=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(A,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:A="text"}={}){var i;const o=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),a=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${A}; for="${a}"; options=${o};`),A==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const TS=new RegExp("[,()]");var ao=class extends GJ{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&TS.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&TS.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const A=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${A}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},zJ=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:A}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=A}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let A=!1;const i=(t??"*").split("").map(c=>/\s/.test(c)&&!A?"":(c==='"'&&(A=!A),c)).join(""),{url:o,headers:a}=this.cloneRequestState();return o.searchParams.set("select",i),n&&a.append("Prefer",`count=${n}`),new ao({method:s,url:o,headers:a,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:A,headers:i}=this.cloneRequestState();if(e&&i.append("Prefer",`count=${e}`),r||i.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((a,c)=>a.concat(Object.keys(c)),[]);if(o.length>0){const a=[...new Set(o)].map(c=>`"${c}"`);A.searchParams.set("columns",a.join(","))}}return new ao({method:s,url:A,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var A;const i="POST",{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),n&&a.append("Prefer",`count=${n}`),s||a.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((l,h)=>l.concat(Object.keys(h)),[]);if(c.length>0){const l=[...new Set(c)].map(h=>`"${h}"`);o.searchParams.set("columns",l.join(","))}}return new ao({method:i,url:o,headers:a,schema:this.schema,body:t,fetch:(A=this.fetch)!==null&&A!==void 0?A:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:A}=this.cloneRequestState();return e&&A.append("Prefer",`count=${e}`),new ao({method:n,url:s,headers:A,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new ao({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function fc(t){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fc(t)}function qJ(t,e){if(fc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WJ(t){var e=qJ(t,"string");return fc(e)=="symbol"?e:e+""}function JJ(t,e,r){return(e=WJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function yh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IS(Object(r),!0).forEach(function(n){JJ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var XJ=class A5{constructor(e,{headers:r={},schema:n,fetch:s,timeout:A,urlLengthLimit:i=8e3,retry:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const a=s??globalThis.fetch;A!==void 0&&A>0?this.fetch=(c,l)=>{const h=new AbortController,d=setTimeout(()=>h.abort(),A),p=l==null?void 0:l.signal;if(p){if(p.aborted)return clearTimeout(d),a(c,l);const w=()=>{clearTimeout(d),h.abort()};return p.addEventListener("abort",w,{once:!0}),a(c,yh(yh({},l),{},{signal:h.signal})).finally(()=>{clearTimeout(d),p.removeEventListener("abort",w)})}return a(c,yh(yh({},l),{},{signal:h.signal})).finally(()=>clearTimeout(d))}:this.fetch=a,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new zJ(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new A5(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:A}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let c;const l=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(l)),h=n&&Object.values(r).some(l);h?(o="POST",c=r):n||s?(o=n?"HEAD":"GET",Object.entries(r).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{a.searchParams.append(p,w)})):(o="POST",c=r);const d=new Headers(this.headers);return h?d.set("Prefer",A?`count=${A},return=minimal`:"return=minimal"):A&&d.set("Prefer",`count=${A}`),new ao({method:o,url:a,headers:d,schema:this.schemaName,body:c,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class xS{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const A=s.versions;if(A&&A.node){const i=A.node,o=parseInt(i.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
2984
2984
  import ws from "ws"
2985
2985
  new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
2986
2986
 
2987
- Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const JJ="realtime-js/2.108.2",XJ="1.0.0",RS="2.0.0",YJ=RS,ZJ=1e4,eX=100,vs={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},US={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Hm={connecting:"connecting",closing:"closing",closed:"closed"};class tX{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,r,n){var s,A;const i=e.topic,o=(s=e.ref)!==null&&s!==void 0?s:"",a=(A=e.join_ref)!==null&&A!==void 0?A:"",c=e.payload.event,l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(l).length===0?"":JSON.stringify(l);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+c.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+d);let w=new DataView(p),B=0;w.setUint8(B++,this.KINDS.userBroadcastPush),w.setUint8(B++,a.length),w.setUint8(B++,o.length),w.setUint8(B++,i.length),w.setUint8(B++,c.length),w.setUint8(B++,h.length),w.setUint8(B++,r),Array.from(a,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(o,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(i,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(c,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(h,_=>w.setUint8(B++,_.charCodeAt(0)));var C=new Uint8Array(p.byteLength+n.byteLength);return C.set(new Uint8Array(p),0),C.set(new Uint8Array(n),p.byteLength),C.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,A,i,o,a]=n;return r({join_ref:s,ref:A,topic:i,event:o,payload:a})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),A=r.getUint8(2),i=r.getUint8(3),o=r.getUint8(4);let a=this.HEADER_LENGTH+4;const c=n.decode(e.slice(a,a+s));a=a+s;const l=n.decode(e.slice(a,a+A));a=a+A;const h=n.decode(e.slice(a,a+i));a=a+i;const d=e.slice(a,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,w={type:this.BROADCAST_EVENT,event:l,payload:p};return i>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var Ve;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Ve||(Ve={}));const kS=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((A,i)=>(A[i]=rX(i,t,e,s),A),{}):{}},rX=(t,e,r,n)=>{const s=e.find(o=>o.name===t),A=s==null?void 0:s.type,i=r[t];return A&&!n.includes(A)?FS(A,i):$m(i)},FS=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return iX(e,r)}switch(t){case Ve.bool:return nX(e);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return sX(e);case Ve.json:case Ve.jsonb:return AX(e);case Ve.timestamp:return oX(e);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return $m(e);default:return $m(e)}},$m=t=>t,nX=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},sX=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},AX=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},iX=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let A;const i=t.slice(1,r);try{A=JSON.parse("["+i+"]")}catch{A=i?i.split(","):[]}return A.map(o=>FS(e,o))}return t},oX=t=>typeof t=="string"?t.replace(" ","T"):t,PS=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var pc=t=>typeof t=="function"?t:function(){return t},aX=typeof self<"u"?self:null,co=typeof window<"u"?window:null,zn=aX||co||globalThis,cX="2.0.0",uX=1e4,lX=1e3,qn={connecting:0,open:1,closing:2,closed:3},Lr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ss={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Vm={longpoll:"longpoll",websocket:"websocket"},hX={complete:4},Km="base64url.bearer.phx.",Bh=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},OS=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},dX=class{constructor(t,e,r){this.state=Lr.closed,this.topic=t,this.params=pc(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Bh(this,Ss.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new OS(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Lr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Lr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Lr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Bh(this,Ss.leave,pc({}),this.timeout).send(),this.state=Lr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ss.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Lr.closed,this.bindings=[]}onClose(t){this.on(Ss.close,t)}onError(t){return this.on(Ss.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Bh(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ss.close,"leave")},r=new Bh(this,Ss.leave,pc({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lr.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let A=this.bindings.filter(i=>i.event===t&&this.filterBindings(i,e,r));for(let i=0;i<A.length;i++)A[i].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Lr.closed}isErrored(){return this.state===Lr.errored}isJoined(){return this.state===Lr.joined}isJoining(){return this.state===Lr.joining}isLeaving(){return this.state===Lr.leaving}},Ch=class{static request(t,e,r,n,s,A,i){if(zn.XDomainRequest){let o=new zn.XDomainRequest;return this.xdomainRequest(o,t,e,n,s,A,i)}else if(zn.XMLHttpRequest){let o=new zn.XMLHttpRequest;return this.xhrRequest(o,t,e,r,n,s,A,i)}else{if(zn.fetch&&zn.AbortController)return this.fetchRequest(t,e,r,n,s,A,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,A,i){let o={method:t,headers:r,body:n},a=null;return s&&(a=new AbortController,setTimeout(()=>a.abort(),s),o.signal=a.signal),zn.fetch(e,o).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>i&&i(c)).catch(c=>{c.name==="AbortError"&&A?A():i&&i(null)}),a}static xdomainRequest(t,e,r,n,s,A,i){return t.timeout=s,t.open(e,r),t.onload=()=>{let o=this.parseJSON(t.responseText);i&&i(o)},A&&(t.ontimeout=A),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,A,i,o){t.open(e,r,!0),t.timeout=A;for(let[a,c]of Object.entries(n))t.setRequestHeader(a,c);return t.onerror=()=>o&&o(null),t.onreadystatechange=()=>{if(t.readyState===hX.complete&&o){let a=this.parseJSON(t.responseText);o(a)}},i&&(t.ontimeout=i),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,A=t[n];typeof A=="object"?r.push(this.serialize(A,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(A))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},fX=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},uo=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Km)&&(this.authToken=atob(e[1].slice(Km.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=qn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Vm.websocket),"$1/"+Vm.longpoll)}endpointURL(){return Ch.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=qn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===qn.open||this.readyState===qn.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(A=>{setTimeout(()=>this.onmessage({data:A}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=qn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=fX(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
2988
- `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=qn.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let A,i=()=>{this.reqs.delete(A),n()};A=Ch.request(t,this.endpointURL(),e,r,this.timeout,i,o=>{this.reqs.delete(A),this.isActive()&&s(o)}),this.reqs.add(A)}},pX=class Mu{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:A,onLeave:i,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Mu.syncState(this.state,s,A,i),this.pendingDiffs.forEach(a=>{this.state=Mu.syncDiff(this.state,a,A,i)}),this.pendingDiffs=[],o()}),this.channel.on(n.diff,s=>{let{onJoin:A,onLeave:i,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Mu.syncDiff(this.state,s,A,i),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Mu.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let A=this.clone(e),i={},o={};return this.map(A,(a,c)=>{r[a]||(o[a]=c)}),this.map(r,(a,c)=>{let l=A[a];if(l){let h=c.metas.map(B=>B.phx_ref),d=l.metas.map(B=>B.phx_ref),p=c.metas.filter(B=>d.indexOf(B.phx_ref)<0),w=l.metas.filter(B=>h.indexOf(B.phx_ref)<0);p.length>0&&(i[a]=c,i[a].metas=p),w.length>0&&(o[a]=this.clone(l),o[a].metas=w)}else i[a]=c}),this.syncDiff(A,{joins:i,leaves:o},n,s)}static syncDiff(e,r,n,s){let{joins:A,leaves:i}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(A,(o,a)=>{let c=e[o];if(e[o]=this.clone(a),c){let l=e[o].metas.map(d=>d.phx_ref),h=c.metas.filter(d=>l.indexOf(d.phx_ref)<0);e[o].metas.unshift(...h)}n(o,c,a)}),this.map(i,(o,a)=>{let c=e[o];if(!c)return;let l=a.metas.map(h=>h.phx_ref);c.metas=c.metas.filter(h=>l.indexOf(h.phx_ref)<0),s(o,c,a),c.metas.length===0&&delete e[o]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Eh={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,A,i]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:A,payload:i})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:A}=t,i=this.META_LENGTH+e.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+i),a=new DataView(o),c=0;a.setUint8(c++,this.KINDS.push),a.setUint8(c++,e.length),a.setUint8(c++,r.length),a.setUint8(c++,s.length),a.setUint8(c++,n.length),Array.from(e,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(r,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(s,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(n,h=>a.setUint8(c++,h.charCodeAt(0)));var l=new Uint8Array(o.byteLength+A.byteLength);return l.set(new Uint8Array(o),0),l.set(new Uint8Array(A),o.byteLength),l.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=e.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(t.slice(i,i+n));i=i+n;let a=r.decode(t.slice(i,i+s));i=i+s;let c=r.decode(t.slice(i,i+A));i=i+A;let l=t.slice(i,t.byteLength);return{join_ref:o,ref:null,topic:a,event:c,payload:l}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=e.getUint8(3),i=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=r.decode(t.slice(o,o+n));o=o+n;let c=r.decode(t.slice(o,o+s));o=o+s;let l=r.decode(t.slice(o,o+A));o=o+A;let h=r.decode(t.slice(o,o+i));o=o+i;let d=t.slice(o,t.byteLength),p={status:h,response:d};return{join_ref:a,ref:c,topic:l,event:Ss.reply,payload:p}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=this.HEADER_LENGTH+2,i=r.decode(t.slice(A,A+n));A=A+n;let o=r.decode(t.slice(A,A+s));A=A+s;let a=t.slice(A,t.byteLength);return{join_ref:null,ref:null,topic:i,event:o,payload:a}}},gX=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||uX,this.transport=e.transport||zn.WebSocket||uo,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=zn&&zn.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Eh.encode.bind(Eh),this.defaultDecoder=Eh.decode.bind(Eh),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==uo?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;co&&co.addEventListener&&(co.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),co.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),co.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,A,i)=>{console.log(`${s}: ${A}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=pc(e.params||{}),this.endPoint=`${t}/${Vm.websocket}`,this.vsn=e.vsn||cX,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new OS(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return uo}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Ch.appendParams(Ch.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=pc(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==uo?this.connectWithFallback(uo,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case uo:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Km}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,A,i=this.transportName(t),o=a=>{this.log("transport",`falling back to ${i}...`,a),this.off([s,A]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),A=this.onError(a=>{this.log("transport","error",a),n&&!r&&(clearTimeout(this.fallbackTimer),o(a))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let a=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${a}`,"true"),this.log("transport",`established ${a} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(a=>{this.log("transport","connected to primary after",a),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),lX,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===qn.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ss.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case qn.connecting:return"connecting";case qn.open:return"open";case qn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new dX(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:A}=t;this.log("push",`${e} ${r} (${A}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:A,join_ref:i}=e;if(A&&A===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",o)}catch(a){this.log("error","error in heartbeat callback",a)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${A&&"("+A+")"||""}`.trim(),s);for(let o=0;o<this.channels.length;o++){const a=this.channels[o];a.isMember(r,n,s,i)&&a.trigger(n,s,A,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class gc{constructor(e,r){const n=wX(r);this.presence=new pX(e.getChannel(),n),this.presence.onJoin((s,A,i)=>{const o=gc.onJoinPayload(s,A,i);e.getChannel().trigger("presence",o)}),this.presence.onLeave((s,A,i)=>{const o=gc.onLeavePayload(s,A,i);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return gc.transformState(this.presence.state)}static transformState(e){return e=mX(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=_h(s),r},{})}static onJoinPayload(e,r,n){const s=QS(r),A=_h(n);return{event:"join",key:e,currentPresences:s,newPresences:A}}static onLeavePayload(e,r,n){const s=QS(r),A=_h(n);return{event:"leave",key:e,currentPresences:s,leftPresences:A}}}function _h(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function mX(t){return JSON.parse(JSON.stringify(t))}function wX(t){return(t==null?void 0:t.events)&&{events:t.events}}function QS(t){return t!=null&&t.metas?_h(t):[]}var jm;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(jm||(jm={}));class DS{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new gc(this.channel.channelAdapter,r)}}function yX(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class BX{constructor(e,r,n){const s=CX(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>eX){const A=this.channel.pushBuffer.shift();A.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${A.event}`,A.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===vs.joined}isJoined(){return this.state===vs.joined}isJoining(){return this.state===vs.joining}isClosed(){return this.state===vs.closed}isLeaving(){return this.state===vs.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function CX(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Gm;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Gm||(Gm={}));var ii;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(ii||(ii={}));var Wn;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Wn||(Wn={}));const EX=vs;class lo{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,A;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new BX(this.socket.socketAdapter,e,this.params),this.presence=new DS(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=PS(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((A=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||A===void 0)&&A.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,s,A;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:o,private:a}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&s!==void 0?s:[],l=!!this.bindings[ii.PRESENCE]&&this.bindings[ii.PRESENCE].length>0||((A=this.params.config.presence)===null||A===void 0?void 0:A.enabled)===!0,h={},d={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:l}),postgres_changes:c,private:a};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(Wn.CHANNEL_ERROR,yX(p))}),this._onClose(()=>e==null?void 0:e(Wn.CLOSED)),this.updateJoinPayload(Object.assign({config:d},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(Wn.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=vs.errored;const w=Object.values(p).join(", ")||"error";e==null||e(Wn.CHANNEL_ERROR,new Error(w,{cause:p}))}).receive("timeout",()=>{e==null||e(Wn.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,A=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,i=[];for(let o=0;o<A;o++){const a=s[o],{filter:{event:c,schema:l,table:h,filter:d}}=a,p=e&&e[o];if(p&&p.event===c&&lo.isFilterValueEqual(p.schema,l)&&lo.isFilterValueEqual(p.table,h)&&lo.isFilterValueEqual(p.filter,d))i.push(Object.assign(Object.assign({},a),{id:p.id}));else{this.unsubscribe(),this.state=vs.errored,r==null||r(Wn.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=vs.errored&&r&&r(Wn.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),A=e===ii.PRESENCE||e===ii.POSTGRES_CHANGES;if(s&&A)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const A=r instanceof ArrayBuffer||ArrayBuffer.isView(r),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":A?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");const a={method:"POST",headers:i,body:A?r:JSON.stringify(r)},c=await this._fetchWithTimeout(o.toString(),a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(c.status===202)return{success:!0};if(c.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let l=c.statusText;try{const h=await c.json();l=h.error||h.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:A,payload:i}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:A,payload:i,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c instanceof Error&&c.name==="AbortError"?"timed out":"error"}}else return new Promise(A=>{var i,o,a;const c=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((a=(o=(i=this.params)===null||i===void 0?void 0:i.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.ack)&&A("ok"),c.receive("ok",()=>A("ok")),c.receive("error",()=>A("error")),c.receive("timeout",()=>A("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const s=new AbortController,A=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(A),i}_on(e,r,n){const s=e.toLocaleLowerCase(),A=this.channelAdapter.on(e,n),i={type:s,filter:r,callback:n,ref:A};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,A,i,o,a,c,l;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const d=(s=this.bindings[h])===null||s===void 0?void 0:s.find(p=>p.ref===e.ref);if(!d)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in d){const p=d.id,w=(A=d.filter)===null||A===void 0?void 0:A.event;return p&&((i=r.ids)===null||i===void 0?void 0:i.includes(p))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((o=r.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const p=(c=(a=d==null?void 0:d.filter)===null||a===void 0?void 0:a.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return p==="*"||p===((l=r==null?void 0:r.event)===null||l===void 0?void 0:l.toLocaleLowerCase())}else return d.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:A,join:i}=US;return r&&[n,s,A,i].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:A,table:i,commit_timestamp:o,type:a,errors:c}=s;return Object.assign(Object.assign({},{schema:A,table:i,commit_timestamp:o,eventType:a,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=kS(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=kS(e.columns,e.old_record)),r}}class _X{constructor(e,r){this.socket=new gX(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(A=>{setTimeout(()=>A("timeout"),s),this.socket.disconnect(()=>{e(),A("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Hm.connecting}isDisconnecting(){return this.socket.connectionState()==Hm.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const LS={HEARTBEAT_INTERVAL:25e3},bX=[1e3,2e3,5e3,1e4],vX=1e4;function SX(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function TX(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return SX()}const IX=`
2987
+ Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const YJ="realtime-js/2.108.2",ZJ="1.0.0",RS="2.0.0",eX=RS,tX=1e4,rX=100,vs={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},US={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Hm={connecting:"connecting",closing:"closing",closed:"closed"};class nX{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,r,n){var s,A;const i=e.topic,o=(s=e.ref)!==null&&s!==void 0?s:"",a=(A=e.join_ref)!==null&&A!==void 0?A:"",c=e.payload.event,l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(l).length===0?"":JSON.stringify(l);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+c.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+d);let w=new DataView(p),B=0;w.setUint8(B++,this.KINDS.userBroadcastPush),w.setUint8(B++,a.length),w.setUint8(B++,o.length),w.setUint8(B++,i.length),w.setUint8(B++,c.length),w.setUint8(B++,h.length),w.setUint8(B++,r),Array.from(a,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(o,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(i,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(c,_=>w.setUint8(B++,_.charCodeAt(0))),Array.from(h,_=>w.setUint8(B++,_.charCodeAt(0)));var C=new Uint8Array(p.byteLength+n.byteLength);return C.set(new Uint8Array(p),0),C.set(new Uint8Array(n),p.byteLength),C.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,A,i,o,a]=n;return r({join_ref:s,ref:A,topic:i,event:o,payload:a})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),A=r.getUint8(2),i=r.getUint8(3),o=r.getUint8(4);let a=this.HEADER_LENGTH+4;const c=n.decode(e.slice(a,a+s));a=a+s;const l=n.decode(e.slice(a,a+A));a=a+A;const h=n.decode(e.slice(a,a+i));a=a+i;const d=e.slice(a,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,w={type:this.BROADCAST_EVENT,event:l,payload:p};return i>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var Ve;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Ve||(Ve={}));const kS=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((A,i)=>(A[i]=sX(i,t,e,s),A),{}):{}},sX=(t,e,r,n)=>{const s=e.find(o=>o.name===t),A=s==null?void 0:s.type,i=r[t];return A&&!n.includes(A)?FS(A,i):$m(i)},FS=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return aX(e,r)}switch(t){case Ve.bool:return AX(e);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return iX(e);case Ve.json:case Ve.jsonb:return oX(e);case Ve.timestamp:return cX(e);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return $m(e);default:return $m(e)}},$m=t=>t,AX=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},iX=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},oX=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},aX=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let A;const i=t.slice(1,r);try{A=JSON.parse("["+i+"]")}catch{A=i?i.split(","):[]}return A.map(o=>FS(e,o))}return t},cX=t=>typeof t=="string"?t.replace(" ","T"):t,PS=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var pc=t=>typeof t=="function"?t:function(){return t},uX=typeof self<"u"?self:null,co=typeof window<"u"?window:null,zn=uX||co||globalThis,lX="2.0.0",hX=1e4,dX=1e3,qn={connecting:0,open:1,closing:2,closed:3},Lr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ss={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Vm={longpoll:"longpoll",websocket:"websocket"},fX={complete:4},Km="base64url.bearer.phx.",Bh=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},OS=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},pX=class{constructor(t,e,r){this.state=Lr.closed,this.topic=t,this.params=pc(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Bh(this,Ss.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new OS(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Lr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Lr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Lr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Bh(this,Ss.leave,pc({}),this.timeout).send(),this.state=Lr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ss.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Lr.closed,this.bindings=[]}onClose(t){this.on(Ss.close,t)}onError(t){return this.on(Ss.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Bh(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ss.close,"leave")},r=new Bh(this,Ss.leave,pc({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lr.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let A=this.bindings.filter(i=>i.event===t&&this.filterBindings(i,e,r));for(let i=0;i<A.length;i++)A[i].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Lr.closed}isErrored(){return this.state===Lr.errored}isJoined(){return this.state===Lr.joined}isJoining(){return this.state===Lr.joining}isLeaving(){return this.state===Lr.leaving}},Ch=class{static request(t,e,r,n,s,A,i){if(zn.XDomainRequest){let o=new zn.XDomainRequest;return this.xdomainRequest(o,t,e,n,s,A,i)}else if(zn.XMLHttpRequest){let o=new zn.XMLHttpRequest;return this.xhrRequest(o,t,e,r,n,s,A,i)}else{if(zn.fetch&&zn.AbortController)return this.fetchRequest(t,e,r,n,s,A,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,A,i){let o={method:t,headers:r,body:n},a=null;return s&&(a=new AbortController,setTimeout(()=>a.abort(),s),o.signal=a.signal),zn.fetch(e,o).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>i&&i(c)).catch(c=>{c.name==="AbortError"&&A?A():i&&i(null)}),a}static xdomainRequest(t,e,r,n,s,A,i){return t.timeout=s,t.open(e,r),t.onload=()=>{let o=this.parseJSON(t.responseText);i&&i(o)},A&&(t.ontimeout=A),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,A,i,o){t.open(e,r,!0),t.timeout=A;for(let[a,c]of Object.entries(n))t.setRequestHeader(a,c);return t.onerror=()=>o&&o(null),t.onreadystatechange=()=>{if(t.readyState===fX.complete&&o){let a=this.parseJSON(t.responseText);o(a)}},i&&(t.ontimeout=i),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,A=t[n];typeof A=="object"?r.push(this.serialize(A,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(A))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},gX=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},uo=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Km)&&(this.authToken=atob(e[1].slice(Km.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=qn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Vm.websocket),"$1/"+Vm.longpoll)}endpointURL(){return Ch.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=qn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===qn.open||this.readyState===qn.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(A=>{setTimeout(()=>this.onmessage({data:A}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=qn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=gX(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
2988
+ `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=qn.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let A,i=()=>{this.reqs.delete(A),n()};A=Ch.request(t,this.endpointURL(),e,r,this.timeout,i,o=>{this.reqs.delete(A),this.isActive()&&s(o)}),this.reqs.add(A)}},mX=class Mu{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:A,onLeave:i,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Mu.syncState(this.state,s,A,i),this.pendingDiffs.forEach(a=>{this.state=Mu.syncDiff(this.state,a,A,i)}),this.pendingDiffs=[],o()}),this.channel.on(n.diff,s=>{let{onJoin:A,onLeave:i,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Mu.syncDiff(this.state,s,A,i),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Mu.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let A=this.clone(e),i={},o={};return this.map(A,(a,c)=>{r[a]||(o[a]=c)}),this.map(r,(a,c)=>{let l=A[a];if(l){let h=c.metas.map(B=>B.phx_ref),d=l.metas.map(B=>B.phx_ref),p=c.metas.filter(B=>d.indexOf(B.phx_ref)<0),w=l.metas.filter(B=>h.indexOf(B.phx_ref)<0);p.length>0&&(i[a]=c,i[a].metas=p),w.length>0&&(o[a]=this.clone(l),o[a].metas=w)}else i[a]=c}),this.syncDiff(A,{joins:i,leaves:o},n,s)}static syncDiff(e,r,n,s){let{joins:A,leaves:i}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(A,(o,a)=>{let c=e[o];if(e[o]=this.clone(a),c){let l=e[o].metas.map(d=>d.phx_ref),h=c.metas.filter(d=>l.indexOf(d.phx_ref)<0);e[o].metas.unshift(...h)}n(o,c,a)}),this.map(i,(o,a)=>{let c=e[o];if(!c)return;let l=a.metas.map(h=>h.phx_ref);c.metas=c.metas.filter(h=>l.indexOf(h.phx_ref)<0),s(o,c,a),c.metas.length===0&&delete e[o]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Eh={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,A,i]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:A,payload:i})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:A}=t,i=this.META_LENGTH+e.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+i),a=new DataView(o),c=0;a.setUint8(c++,this.KINDS.push),a.setUint8(c++,e.length),a.setUint8(c++,r.length),a.setUint8(c++,s.length),a.setUint8(c++,n.length),Array.from(e,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(r,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(s,h=>a.setUint8(c++,h.charCodeAt(0))),Array.from(n,h=>a.setUint8(c++,h.charCodeAt(0)));var l=new Uint8Array(o.byteLength+A.byteLength);return l.set(new Uint8Array(o),0),l.set(new Uint8Array(A),o.byteLength),l.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=e.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(t.slice(i,i+n));i=i+n;let a=r.decode(t.slice(i,i+s));i=i+s;let c=r.decode(t.slice(i,i+A));i=i+A;let l=t.slice(i,t.byteLength);return{join_ref:o,ref:null,topic:a,event:c,payload:l}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=e.getUint8(3),i=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=r.decode(t.slice(o,o+n));o=o+n;let c=r.decode(t.slice(o,o+s));o=o+s;let l=r.decode(t.slice(o,o+A));o=o+A;let h=r.decode(t.slice(o,o+i));o=o+i;let d=t.slice(o,t.byteLength),p={status:h,response:d};return{join_ref:a,ref:c,topic:l,event:Ss.reply,payload:p}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),A=this.HEADER_LENGTH+2,i=r.decode(t.slice(A,A+n));A=A+n;let o=r.decode(t.slice(A,A+s));A=A+s;let a=t.slice(A,t.byteLength);return{join_ref:null,ref:null,topic:i,event:o,payload:a}}},wX=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||hX,this.transport=e.transport||zn.WebSocket||uo,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=zn&&zn.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Eh.encode.bind(Eh),this.defaultDecoder=Eh.decode.bind(Eh),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==uo?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;co&&co.addEventListener&&(co.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),co.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),co.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,A,i)=>{console.log(`${s}: ${A}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=pc(e.params||{}),this.endPoint=`${t}/${Vm.websocket}`,this.vsn=e.vsn||lX,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new OS(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return uo}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Ch.appendParams(Ch.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=pc(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==uo?this.connectWithFallback(uo,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case uo:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Km}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,A,i=this.transportName(t),o=a=>{this.log("transport",`falling back to ${i}...`,a),this.off([s,A]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),A=this.onError(a=>{this.log("transport","error",a),n&&!r&&(clearTimeout(this.fallbackTimer),o(a))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let a=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${a}`,"true"),this.log("transport",`established ${a} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(a=>{this.log("transport","connected to primary after",a),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),dX,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===qn.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ss.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case qn.connecting:return"connecting";case qn.open:return"open";case qn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new pX(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:A}=t;this.log("push",`${e} ${r} (${A}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:A,join_ref:i}=e;if(A&&A===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",o)}catch(a){this.log("error","error in heartbeat callback",a)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${A&&"("+A+")"||""}`.trim(),s);for(let o=0;o<this.channels.length;o++){const a=this.channels[o];a.isMember(r,n,s,i)&&a.trigger(n,s,A,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class gc{constructor(e,r){const n=BX(r);this.presence=new mX(e.getChannel(),n),this.presence.onJoin((s,A,i)=>{const o=gc.onJoinPayload(s,A,i);e.getChannel().trigger("presence",o)}),this.presence.onLeave((s,A,i)=>{const o=gc.onLeavePayload(s,A,i);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return gc.transformState(this.presence.state)}static transformState(e){return e=yX(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=_h(s),r},{})}static onJoinPayload(e,r,n){const s=QS(r),A=_h(n);return{event:"join",key:e,currentPresences:s,newPresences:A}}static onLeavePayload(e,r,n){const s=QS(r),A=_h(n);return{event:"leave",key:e,currentPresences:s,leftPresences:A}}}function _h(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function yX(t){return JSON.parse(JSON.stringify(t))}function BX(t){return(t==null?void 0:t.events)&&{events:t.events}}function QS(t){return t!=null&&t.metas?_h(t):[]}var jm;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(jm||(jm={}));class DS{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new gc(this.channel.channelAdapter,r)}}function CX(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class EX{constructor(e,r,n){const s=_X(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>rX){const A=this.channel.pushBuffer.shift();A.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${A.event}`,A.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===vs.joined}isJoined(){return this.state===vs.joined}isJoining(){return this.state===vs.joining}isClosed(){return this.state===vs.closed}isLeaving(){return this.state===vs.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function _X(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Gm;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Gm||(Gm={}));var ii;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(ii||(ii={}));var Wn;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Wn||(Wn={}));const bX=vs;class lo{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,A;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new EX(this.socket.socketAdapter,e,this.params),this.presence=new DS(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=PS(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((A=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||A===void 0)&&A.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,s,A;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:o,private:a}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&s!==void 0?s:[],l=!!this.bindings[ii.PRESENCE]&&this.bindings[ii.PRESENCE].length>0||((A=this.params.config.presence)===null||A===void 0?void 0:A.enabled)===!0,h={},d={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:l}),postgres_changes:c,private:a};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(Wn.CHANNEL_ERROR,CX(p))}),this._onClose(()=>e==null?void 0:e(Wn.CLOSED)),this.updateJoinPayload(Object.assign({config:d},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(Wn.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=vs.errored;const w=Object.values(p).join(", ")||"error";e==null||e(Wn.CHANNEL_ERROR,new Error(w,{cause:p}))}).receive("timeout",()=>{e==null||e(Wn.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,A=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,i=[];for(let o=0;o<A;o++){const a=s[o],{filter:{event:c,schema:l,table:h,filter:d}}=a,p=e&&e[o];if(p&&p.event===c&&lo.isFilterValueEqual(p.schema,l)&&lo.isFilterValueEqual(p.table,h)&&lo.isFilterValueEqual(p.filter,d))i.push(Object.assign(Object.assign({},a),{id:p.id}));else{this.unsubscribe(),this.state=vs.errored,r==null||r(Wn.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=vs.errored&&r&&r(Wn.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),A=e===ii.PRESENCE||e===ii.POSTGRES_CHANGES;if(s&&A)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const A=r instanceof ArrayBuffer||ArrayBuffer.isView(r),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":A?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");const a={method:"POST",headers:i,body:A?r:JSON.stringify(r)},c=await this._fetchWithTimeout(o.toString(),a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(c.status===202)return{success:!0};if(c.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let l=c.statusText;try{const h=await c.json();l=h.error||h.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:A,payload:i}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:A,payload:i,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c instanceof Error&&c.name==="AbortError"?"timed out":"error"}}else return new Promise(A=>{var i,o,a;const c=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((a=(o=(i=this.params)===null||i===void 0?void 0:i.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.ack)&&A("ok"),c.receive("ok",()=>A("ok")),c.receive("error",()=>A("error")),c.receive("timeout",()=>A("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const s=new AbortController,A=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(A),i}_on(e,r,n){const s=e.toLocaleLowerCase(),A=this.channelAdapter.on(e,n),i={type:s,filter:r,callback:n,ref:A};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,A,i,o,a,c,l;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const d=(s=this.bindings[h])===null||s===void 0?void 0:s.find(p=>p.ref===e.ref);if(!d)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in d){const p=d.id,w=(A=d.filter)===null||A===void 0?void 0:A.event;return p&&((i=r.ids)===null||i===void 0?void 0:i.includes(p))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((o=r.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const p=(c=(a=d==null?void 0:d.filter)===null||a===void 0?void 0:a.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return p==="*"||p===((l=r==null?void 0:r.event)===null||l===void 0?void 0:l.toLocaleLowerCase())}else return d.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:A,join:i}=US;return r&&[n,s,A,i].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:A,table:i,commit_timestamp:o,type:a,errors:c}=s;return Object.assign(Object.assign({},{schema:A,table:i,commit_timestamp:o,eventType:a,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=kS(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=kS(e.columns,e.old_record)),r}}class vX{constructor(e,r){this.socket=new wX(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(A=>{setTimeout(()=>A("timeout"),s),this.socket.disconnect(()=>{e(),A("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Hm.connecting}isDisconnecting(){return this.socket.connectionState()==Hm.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const LS={HEARTBEAT_INTERVAL:25e3},SX=[1e3,2e3,5e3,1e4],TX=1e4;function IX(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function xX(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return IX()}const RX=`
2989
2989
  addEventListener("message", (e) => {
2990
2990
  if (e.data.event === "start") {
2991
2991
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
2992
2992
  }
2993
- });`;class MS{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new tX,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=A=>A?(...i)=>A(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new _X(e,s),this.httpEndpoint=PS(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
2993
+ });`;class MS{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new nX,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=A=>A?(...i)=>A(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new vX(e,s),this.httpEndpoint=PS(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
2994
2994
 
2995
2995
  To use Realtime in Node.js, you need to provide a WebSocket implementation:
2996
2996
 
@@ -3003,8 +3003,8 @@ Option 2: Install and provide the "ws" package:
3003
3003
  const client = new RealtimeClient(url, {
3004
3004
  ...options,
3005
3005
  transport: ws
3006
- })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||Hm.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(A=>A.topic===n);if(s)return s;{const A=new lo(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(A),A}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const A={access_token:r,version:JJ};r&&s.updateJoinPayload(A),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(US.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([IX],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,A,i,o,a,c,l,h,d,p;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const w={};w.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:ZJ,w.heartbeatIntervalMs=(A=e==null?void 0:e.heartbeatIntervalMs)!==null&&A!==void 0?A:LS.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:LS.HEARTBEAT_INTERVAL),w.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:xS.getWebSocketConstructor(),w.params=e==null?void 0:e.params,w.logger=e==null?void 0:e.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),w.sessionStorage=(c=e==null?void 0:e.sessionStorage)!==null&&c!==void 0?c:TX(),w.reconnectAfterMs=(l=e==null?void 0:e.reconnectAfterMs)!==null&&l!==void 0?l:T=>bX[T-1]||vX;let B,C;const _=(h=e==null?void 0:e.vsn)!==null&&h!==void 0?h:YJ;switch(_){case XJ:B=(T,v)=>v(JSON.stringify(T)),C=(T,v)=>v(JSON.parse(T));break;case RS:B=this.serializer.encode.bind(this.serializer),C=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=_,w.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:B,w.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:C,w.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var mc=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function xX(t,e,r){const n=new URL(e,t);if(r)for(const[s,A]of Object.entries(r))A!==void 0&&n.searchParams.set(s,A);return n.toString()}async function RX(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function UX(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:A,headers:i}){const o=xX(t.baseUrl,n,s),a=await RX(t.auth),c=await e(o,{method:r,headers:{...A?{"Content-Type":"application/json"}:{},...a,...i},body:A?JSON.stringify(A):void 0}),l=await c.text(),h=(c.headers.get("content-type")||"").includes("application/json"),d=h&&l?JSON.parse(l):l;if(!c.ok){const p=h?d:void 0,w=p==null?void 0:p.error;throw new mc((w==null?void 0:w.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:c.status,headers:c.headers,data:d}}}}function bh(t){return t.join("")}var kX=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:bh(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bh(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bh(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bh(t.namespace)}`}),!0}catch(e){if(e instanceof mc&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof mc&&r.status===409)return;throw r}}};function ho(t){return t.join("")}var FX=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof mc&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof mc&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},PX=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=UX({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new kX(this.client,e),this.tableOps=new FX(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function wc(t){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wc(t)}function OX(t,e){if(wc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QX(t){var e=OX(t,"string");return wc(e)=="symbol"?e:e+""}function DX(t,e,r){return(e=QX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function oe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?NS(Object(r),!0).forEach(function(n){DX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):NS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var vh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Sh(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Th=class extends vh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return oe({},super.toJSON())}},HS=class extends vh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Ih(t,e,r){const n=oe({},t),s=e.toLowerCase();for(const A of Object.keys(n))A.toLowerCase()===s&&delete n[A];return n[s]=r,n}function LX(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const MX=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),NX=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zm=t=>{if(Array.isArray(t))return t.map(r=>zm(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,A=>A.toUpperCase().replace(/[-_]/g,""));e[s]=zm(n)}),e},HX=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),$S=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},$X=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const s=t;let A=parseInt(String(s.status),10);Number.isFinite(A)||(A=500),s.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||A+"";e(new Th($S(i),A,o,n))}).catch(()=>{const i=A+"";e(new Th(s.statusText||`HTTP ${A} error`,A,i,n))})}else e(new HS($S(t),t,n))},VX=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return oe(oe({},s),r);if(NX(n)){var A;const i=(e==null?void 0:e.headers)||{};let o;for(const[a,c]of Object.entries(i))a.toLowerCase()==="content-type"&&(o=c);s.headers=Ih(i,"Content-Type",(A=o)!==null&&A!==void 0?A:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),oe(oe({},s),r)};async function yc(t,e,r,n,s,A,i){return new Promise((o,a)=>{t(r,VX(e,n,s,A)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(i==="vectors"){const l=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!l||!l.includes("application/json"))return{}}return c.json()}).then(c=>o(c)).catch(c=>$X(c,a,n,i))})}function VS(t="storage"){return{get:async(e,r,n,s)=>yc(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,A)=>yc(e,"POST",r,s,A,n,t),put:async(e,r,n,s,A)=>yc(e,"PUT",r,s,A,n,t),head:async(e,r,n,s)=>yc(e,"HEAD",r,oe(oe({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,A)=>yc(e,"DELETE",r,s,A,n,t)}}const KX=VS("storage"),{get:Bc,post:En,put:qm,head:jX,remove:Wm}=KX,Vr=VS("vectors");var fo=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=LX(e),this.fetch=MX(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Ih(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Sh(r))return{data:null,error:r};throw r}}};let KS;KS=Symbol.toStringTag;var GX=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[KS]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sh(e))return{data:null,error:e};throw e}}};let jS;jS=Symbol.toStringTag;var zX=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[jS]="BlobDownloadBuilder",this.promise=null}asStream(){return new GX(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sh(e))return{data:null,error:e};throw e}}};const qX={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},GS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var WX=class extends fo{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let A;const i=oe(oe({},GS),n);let o=oe(oe({},s.headers),t==="POST"&&{"x-upsert":String(i.upsert)});const a=i.metadata;if(typeof Blob<"u"&&r instanceof Blob?(A=new FormData,A.append("cacheControl",i.cacheControl),a&&A.append("metadata",s.encodeMetadata(a)),A.append("",r)):typeof FormData<"u"&&r instanceof FormData?(A=r,A.has("cacheControl")||A.append("cacheControl",i.cacheControl),a&&!A.has("metadata")&&A.append("metadata",s.encodeMetadata(a))):(A=r,o["cache-control"]=`max-age=${i.cacheControl}`,o["content-type"]=i.contentType,a&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(a))),(typeof ReadableStream<"u"&&A instanceof ReadableStream||A&&typeof A=="object"&&"pipe"in A&&typeof A.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers)for(const[d,p]of Object.entries(n.headers))o=Ih(o,d,p);const c=s._removeEmptyFolders(e),l=s._getFinalPath(c),h=await(t=="PUT"?qm:En)(s.fetch,`${s.url}/object/${l}`,A,oe({headers:o},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:c,id:h.Id,fullPath:h.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;const A=s._removeEmptyFolders(t),i=s._getFinalPath(A),o=new URL(s.url+`/object/upload/sign/${i}`);return o.searchParams.set("token",e),s.handleOperation(async()=>{let a;const c=oe(oe({},GS),n);let l=oe(oe({},s.headers),{"x-upsert":String(c.upsert)});const h=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",c.cacheControl),h&&a.append("metadata",s.encodeMetadata(h)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",c.cacheControl),h&&!a.has("metadata")&&a.append("metadata",s.encodeMetadata(h))):(a=r,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType,h&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!c.duplex&&(c.duplex="half")),n!=null&&n.headers)for(const[d,p]of Object.entries(n.headers))l=Ih(l,d,p);return{path:A,fullPath:(await qm(s.fetch,o.toString(),a,oe({headers:l},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=oe({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const A=await En(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+A.url),o=i.searchParams.get("token");if(!o)throw new vh("No token returned by API");return{signedUrl:i.toString(),path:t,token:o}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await En(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await En(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const A=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let i=await En(n.fetch,`${n.url}/object/sign/${s}`,oe({expiresIn:e},A?{transform:r.transform}:{}),{headers:n.headers});const o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const a=o.toString();return{signedUrl:encodeURI(`${n.url}${i.signedURL}${a?`&${a}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await En(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),A=new URLSearchParams;r!=null&&r.download&&A.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&A.set("cacheNonce",String(r.cacheNonce));const i=A.toString();return s.map(o=>oe(oe({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${i?`&${i}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const A=s.toString(),i=this._getFinalPath(t),o=()=>Bc(this.fetch,`${this.url}/${n}/${i}${A?`?${A}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new zX(o,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>zm(await Bc(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await jX(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Sh(s)){var n;const A=s instanceof Th?s.status:s instanceof HS?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(A!==void 0&&[400,404].includes(A))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),A=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${A}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=oe(oe(oe({},qX),e),{},{prefix:t||""});return await En(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=oe({},t);return await En(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Cc={"X-Client-Info":"storage-js/2.108.2"};var JX=class extends fo{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const A=s.href.replace(/\/$/,""),i=oe(oe({},Cc),e);super(A,i,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await Bc(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Bc(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await En(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await qm(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await En(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},XX=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await En(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await Bc(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!HX(t))throw new vh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new PX({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,A){const i=s[A];return typeof i!="function"?i:async(...o)=>{try{return{data:await i.apply(s,o),error:null}}catch(a){if(n)throw a;return{data:null,error:a}}}}})}},YX=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},ZX=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},eY=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},tY=class extends eY{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new rY(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},rY=class extends YX{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new nY(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},nY=class extends ZX{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},sY=class extends JX{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new WX(this.url,this.headers,t,this.fetch)}get vectors(){return new tY(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new XX(this.url+"/iceberg",this.headers,this.fetch)}};const zS="2.108.2",Ts=30*1e3,Ec=3,Jm=Ec*Ts,AY=2*Ts,iY="http://localhost:9999",oY="supabase.auth.token",aY={"X-Client-Info":`gotrue-js/${zS}`},Xm="X-Supabase-Api-Version",qS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},cY=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,uY=10*60*1e3;class po extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Y(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class WS extends po{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function JS(t){return Y(t)&&t.name==="AuthApiError"}class en extends po{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class _n extends po{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class Et extends _n{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function _c(t){return Y(t)&&t.name==="AuthSessionMissingError"}class oi extends _n{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class bc extends _n{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class vc extends _n{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function XS(t){return Y(t)&&t.name==="AuthImplicitGrantRedirectError"}class Ym extends _n{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class YS extends _n{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}function lY(t){return Y(t)&&t.name==="AuthPKCECodeVerifierMissingError"}class xh extends _n{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Zm(t){return Y(t)&&t.name==="AuthRetryableFetchError"}class ew extends _n{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function ZS(t){return Y(t)&&t.name==="AuthRefreshDiscardedError"}class tw extends _n{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}function hY(t){return Y(t)&&t.name==="AuthWeakPasswordError"}class Sc extends _n{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),eT=`
3007
- \r=`.split(""),dY=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<eT.length;e+=1)t[eT[e].charCodeAt(0)]=-2;for(let e=0;e<Rh.length;e+=1)t[Rh[e].charCodeAt(0)]=e;return t})();function tT(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Rh[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Rh[n]),e.queuedBits-=6}}function rT(t,e,r){const n=dY[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function nT(t){const e=[],r=i=>{e.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},A=i=>{gY(i,n,r)};for(let i=0;i<t.length;i+=1)rT(t.charCodeAt(i),s,A);return e.join("")}function fY(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function pY(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}fY(n,e)}}function gY(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function go(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)rT(t.charCodeAt(s),r,n);return new Uint8Array(e)}function mY(t){const e=[];return pY(t,r=>e.push(r)),new Uint8Array(e)}function ai(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>tT(s,r,n)),tT(null,r,n),e.join("")}function wY(t){return Math.round(Date.now()/1e3)+t}function yY(){return Symbol("auth-callback")}const Ar=()=>typeof window<"u"&&typeof document<"u",ci={tested:!1,writable:!1},sT=()=>{if(!Ar())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ci.tested)return ci.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ci.tested=!0,ci.writable=!0}catch{ci.tested=!0,ci.writable=!1}return ci.writable};function BY(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,A)=>{e[A]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const AT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),CY=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",mo=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},bn=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},it=async(t,e)=>{await t.removeItem(e)};class Uh{constructor(){this.promise=new Uh.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Uh.promiseConstructor=Promise;function kh(t){const e=t.split(".");if(e.length!==3)throw new Sc("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!cY.test(e[n]))throw new Sc("JWT not in base64url format");return{header:JSON.parse(nT(e[0])),payload:JSON.parse(nT(e[1])),signature:go(e[2]),raw:{header:e[0],payload:e[1]}}}async function EY(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function _Y(t,e){return new Promise((n,s)=>{(async()=>{for(let A=0;A<1/0;A++)try{const i=await t(A);if(!e(A,null,i)){n(i);return}}catch(i){if(!e(A,i)){s(i);return}}})()})}function bY(t){return("0"+t.toString(16)).substr(-2)}function vY(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let A=0;A<56;A++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,bY).join("")}async function SY(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(A=>String.fromCharCode(A)).join("")}async function TY(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await SY(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ui(t,e,r=!1){const n=vY();let s=n;r&&(s+="/recovery"),await mo(t,`${e}-code-verifier`,s);const A=await TY(n);return[A,n===A?"plain":"s256"]}const IY=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function xY(t){const e=t.headers.get(Xm);if(!e||!e.match(IY))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function RY(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function UY(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const kY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Is(t){if(!kY.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function vn(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function rw(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function FY(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const A=n.toString();if(A==="Symbol(Symbol.toPrimitive)"||A==="Symbol(Symbol.toStringTag)"||A==="Symbol(util.inspect.custom)"||A==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function iT(t){return JSON.parse(JSON.stringify(t))}const li=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},PY=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function oT(t){var e;if(!CY(t))throw new xh(li(t),0);if(PY.includes(t.status))throw new xh(li(t),t.status);let r;try{r=await t.json()}catch(A){throw new en(li(A),A)}let n;const s=xY(t);if(s&&s.getTime()>=qS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new tw(li(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Et}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((A,i)=>A&&typeof i=="string",!0))throw new tw(li(r),t.status,r.weak_password.reasons);throw new WS(li(r),t.status||500,n)}const OY=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function re(t,e,r,n){var s;const A=Object.assign({},n==null?void 0:n.headers);A[Xm]||(A[Xm]=qS["2024-01-01"].name),n!=null&&n.jwt&&(A.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const o=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",a=await QY(t,e,r+o,{headers:A,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(a):{data:Object.assign({},a),error:null}}async function QY(t,e,r,n,s,A){const i=OY(e,n,s,A);let o;try{o=await t(r,Object.assign({},i))}catch(a){throw console.error(a),new xh(li(a),0)}if(o.ok||await oT(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(a){await oT(a)}}function tn(t){var e;let r=null;MY(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=wY(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function aT(t){const e=tn(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function lA(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function DY(t){return{data:t,error:null}}function LY(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:A}=t,i=ph(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:A},a=Object.assign({},i);return{data:{properties:o,user:a},error:null}}function cT(t){return t}function MY(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Fh=["global","local","others"];class nw{constructor({url:e="",headers:r={},fetch:n,experimental:s}){this.url=e,this.headers=r,this.fetch=AT(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Fh[0]){if(Fh.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Fh.join(", ")}`);try{return await re(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Y(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await re(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=ph(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await re(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:LY,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Y(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await re(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:lA})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,A,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await re(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(A=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&A!==void 0?A:""},xform:cT});if(l.error)throw l.error;const h=await l.json(),d=(i=l.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=l.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const B=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(w.split(";")[1].split("=")[1]);c[`${C}Page`]=B}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(Y(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Is(e);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:lA})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Is(e);try{return await re(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Is(e);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Is(e.userId);try{const{data:r,error:n}=await re(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Is(e.userId),Is(e.id);try{return{data:await re(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,A,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await re(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(A=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&A!==void 0?A:""},xform:cT});if(l.error)throw l.error;const h=await l.json(),d=(i=l.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=l.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const B=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(w.split(";")[1].split("=")[1]);c[`${C}Page`]=B}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(Y(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await re(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await re(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await re(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await re(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(Y(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await re(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await re(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await re(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await re(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){vn(this.experimental),Is(e.userId);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){vn(this.experimental),Is(e.userId),Is(e.passkeyId);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}}function uT(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Sn={debug:!!(globalThis&&sT()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Tc extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class sw extends Tc{}class NY extends Tc{}async function HY(t,e,r){Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{n.abort(),Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async A=>{if(A){clearTimeout(s),Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,A.name);try{return await r()}finally{Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,A.name)}}else{if(e===0)throw Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new sw(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Sn.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await r()}})}catch(A){if(e>0&&clearTimeout(s),A!==null&&typeof A=="object"&&"name"in A&&A.name==="AbortError"&&e>0){if(n.signal.aborted)return Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async i=>{if(i){Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,i.name);try{return await r()}finally{Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new sw(`Lock "${t}" was released because another request stole it`)}throw A}}const lT={};async function $Y(t,e,r){var n;const s=(n=lT[t])!==null&&n!==void 0?n:Promise.resolve(),A=(async()=>{try{return await s,null}catch{return null}})(),i=(async()=>{let o=null;try{const a=e>=0?new Promise((c,l)=>{o=setTimeout(()=>{console.warn(`@supabase/gotrue-js: Lock "${t}" acquisition timed out after ${e}ms. This may be caused by another operation holding the lock. Consider increasing lockAcquireTimeout or checking for stuck operations.`),l(new NY(`Acquiring process lock with name "${t}" timed out`))},e)}):null;await Promise.race([A,a].filter(c=>c)),o!==null&&clearTimeout(o)}catch(a){if(o!==null&&clearTimeout(o),a instanceof Tc)throw a}return await r()})();return lT[t]=(async()=>{try{return await i}catch(o){if(o instanceof Tc){try{await s}catch{}return null}throw o}})(),await i}function VY(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function hT(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function KY(t){return parseInt(t,16)}function jY(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function GY(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:A=new Date,nonce:i,notBefore:o,requestId:a,resources:c,scheme:l,uri:h,version:d}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
3006
+ })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||Hm.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(A=>A.topic===n);if(s)return s;{const A=new lo(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(A),A}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const A={access_token:r,version:YJ};r&&s.updateJoinPayload(A),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(US.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([RX],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,A,i,o,a,c,l,h,d,p;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const w={};w.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:tX,w.heartbeatIntervalMs=(A=e==null?void 0:e.heartbeatIntervalMs)!==null&&A!==void 0?A:LS.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:LS.HEARTBEAT_INTERVAL),w.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:xS.getWebSocketConstructor(),w.params=e==null?void 0:e.params,w.logger=e==null?void 0:e.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),w.sessionStorage=(c=e==null?void 0:e.sessionStorage)!==null&&c!==void 0?c:xX(),w.reconnectAfterMs=(l=e==null?void 0:e.reconnectAfterMs)!==null&&l!==void 0?l:T=>SX[T-1]||TX;let B,C;const _=(h=e==null?void 0:e.vsn)!==null&&h!==void 0?h:eX;switch(_){case ZJ:B=(T,v)=>v(JSON.stringify(T)),C=(T,v)=>v(JSON.parse(T));break;case RS:B=this.serializer.encode.bind(this.serializer),C=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=_,w.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:B,w.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:C,w.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var mc=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function UX(t,e,r){const n=new URL(e,t);if(r)for(const[s,A]of Object.entries(r))A!==void 0&&n.searchParams.set(s,A);return n.toString()}async function kX(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function FX(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:A,headers:i}){const o=UX(t.baseUrl,n,s),a=await kX(t.auth),c=await e(o,{method:r,headers:{...A?{"Content-Type":"application/json"}:{},...a,...i},body:A?JSON.stringify(A):void 0}),l=await c.text(),h=(c.headers.get("content-type")||"").includes("application/json"),d=h&&l?JSON.parse(l):l;if(!c.ok){const p=h?d:void 0,w=p==null?void 0:p.error;throw new mc((w==null?void 0:w.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:c.status,headers:c.headers,data:d}}}}function bh(t){return t.join("")}var PX=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:bh(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bh(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bh(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bh(t.namespace)}`}),!0}catch(e){if(e instanceof mc&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof mc&&r.status===409)return;throw r}}};function ho(t){return t.join("")}var OX=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ho(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof mc&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof mc&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},QX=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=FX({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new PX(this.client,e),this.tableOps=new OX(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function wc(t){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wc(t)}function DX(t,e){if(wc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LX(t){var e=DX(t,"string");return wc(e)=="symbol"?e:e+""}function MX(t,e,r){return(e=LX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function oe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?NS(Object(r),!0).forEach(function(n){MX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):NS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var vh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Sh(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Th=class extends vh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return oe({},super.toJSON())}},HS=class extends vh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Ih(t,e,r){const n=oe({},t),s=e.toLowerCase();for(const A of Object.keys(n))A.toLowerCase()===s&&delete n[A];return n[s]=r,n}function NX(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const HX=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),$X=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zm=t=>{if(Array.isArray(t))return t.map(r=>zm(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,A=>A.toUpperCase().replace(/[-_]/g,""));e[s]=zm(n)}),e},VX=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),$S=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},KX=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const s=t;let A=parseInt(String(s.status),10);Number.isFinite(A)||(A=500),s.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||A+"";e(new Th($S(i),A,o,n))}).catch(()=>{const i=A+"";e(new Th(s.statusText||`HTTP ${A} error`,A,i,n))})}else e(new HS($S(t),t,n))},jX=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return oe(oe({},s),r);if($X(n)){var A;const i=(e==null?void 0:e.headers)||{};let o;for(const[a,c]of Object.entries(i))a.toLowerCase()==="content-type"&&(o=c);s.headers=Ih(i,"Content-Type",(A=o)!==null&&A!==void 0?A:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),oe(oe({},s),r)};async function yc(t,e,r,n,s,A,i){return new Promise((o,a)=>{t(r,jX(e,n,s,A)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(i==="vectors"){const l=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!l||!l.includes("application/json"))return{}}return c.json()}).then(c=>o(c)).catch(c=>KX(c,a,n,i))})}function VS(t="storage"){return{get:async(e,r,n,s)=>yc(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,A)=>yc(e,"POST",r,s,A,n,t),put:async(e,r,n,s,A)=>yc(e,"PUT",r,s,A,n,t),head:async(e,r,n,s)=>yc(e,"HEAD",r,oe(oe({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,A)=>yc(e,"DELETE",r,s,A,n,t)}}const GX=VS("storage"),{get:Bc,post:En,put:qm,head:zX,remove:Wm}=GX,Vr=VS("vectors");var fo=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=NX(e),this.fetch=HX(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Ih(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Sh(r))return{data:null,error:r};throw r}}};let KS;KS=Symbol.toStringTag;var qX=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[KS]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sh(e))return{data:null,error:e};throw e}}};let jS;jS=Symbol.toStringTag;var WX=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[jS]="BlobDownloadBuilder",this.promise=null}asStream(){return new qX(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sh(e))return{data:null,error:e};throw e}}};const JX={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},GS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var XX=class extends fo{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let A;const i=oe(oe({},GS),n);let o=oe(oe({},s.headers),t==="POST"&&{"x-upsert":String(i.upsert)});const a=i.metadata;if(typeof Blob<"u"&&r instanceof Blob?(A=new FormData,A.append("cacheControl",i.cacheControl),a&&A.append("metadata",s.encodeMetadata(a)),A.append("",r)):typeof FormData<"u"&&r instanceof FormData?(A=r,A.has("cacheControl")||A.append("cacheControl",i.cacheControl),a&&!A.has("metadata")&&A.append("metadata",s.encodeMetadata(a))):(A=r,o["cache-control"]=`max-age=${i.cacheControl}`,o["content-type"]=i.contentType,a&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(a))),(typeof ReadableStream<"u"&&A instanceof ReadableStream||A&&typeof A=="object"&&"pipe"in A&&typeof A.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers)for(const[d,p]of Object.entries(n.headers))o=Ih(o,d,p);const c=s._removeEmptyFolders(e),l=s._getFinalPath(c),h=await(t=="PUT"?qm:En)(s.fetch,`${s.url}/object/${l}`,A,oe({headers:o},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:c,id:h.Id,fullPath:h.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;const A=s._removeEmptyFolders(t),i=s._getFinalPath(A),o=new URL(s.url+`/object/upload/sign/${i}`);return o.searchParams.set("token",e),s.handleOperation(async()=>{let a;const c=oe(oe({},GS),n);let l=oe(oe({},s.headers),{"x-upsert":String(c.upsert)});const h=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",c.cacheControl),h&&a.append("metadata",s.encodeMetadata(h)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",c.cacheControl),h&&!a.has("metadata")&&a.append("metadata",s.encodeMetadata(h))):(a=r,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType,h&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!c.duplex&&(c.duplex="half")),n!=null&&n.headers)for(const[d,p]of Object.entries(n.headers))l=Ih(l,d,p);return{path:A,fullPath:(await qm(s.fetch,o.toString(),a,oe({headers:l},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=oe({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const A=await En(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+A.url),o=i.searchParams.get("token");if(!o)throw new vh("No token returned by API");return{signedUrl:i.toString(),path:t,token:o}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await En(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await En(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const A=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let i=await En(n.fetch,`${n.url}/object/sign/${s}`,oe({expiresIn:e},A?{transform:r.transform}:{}),{headers:n.headers});const o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const a=o.toString();return{signedUrl:encodeURI(`${n.url}${i.signedURL}${a?`&${a}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await En(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),A=new URLSearchParams;r!=null&&r.download&&A.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&A.set("cacheNonce",String(r.cacheNonce));const i=A.toString();return s.map(o=>oe(oe({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${i?`&${i}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const A=s.toString(),i=this._getFinalPath(t),o=()=>Bc(this.fetch,`${this.url}/${n}/${i}${A?`?${A}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new WX(o,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>zm(await Bc(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await zX(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Sh(s)){var n;const A=s instanceof Th?s.status:s instanceof HS?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(A!==void 0&&[400,404].includes(A))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),A=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${A}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=oe(oe(oe({},JX),e),{},{prefix:t||""});return await En(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=oe({},t);return await En(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Cc={"X-Client-Info":"storage-js/2.108.2"};var YX=class extends fo{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const A=s.href.replace(/\/$/,""),i=oe(oe({},Cc),e);super(A,i,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await Bc(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Bc(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await En(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await qm(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await En(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},ZX=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await En(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await Bc(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Wm(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!VX(t))throw new vh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new QX({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,A){const i=s[A];return typeof i!="function"?i:async(...o)=>{try{return{data:await i.apply(s,o),error:null}}catch(a){if(n)throw a;return{data:null,error:a}}}}})}},eY=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},tY=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},rY=class extends fo{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=oe(oe({},Cc),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},nY=class extends rY{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new sY(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},sY=class extends eY{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new AY(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},AY=class extends tY{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,oe(oe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},iY=class extends YX{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new XX(this.url,this.headers,t,this.fetch)}get vectors(){return new nY(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new ZX(this.url+"/iceberg",this.headers,this.fetch)}};const zS="2.108.2",Ts=30*1e3,Ec=3,Jm=Ec*Ts,oY=2*Ts,aY="http://localhost:9999",cY="supabase.auth.token",uY={"X-Client-Info":`gotrue-js/${zS}`},Xm="X-Supabase-Api-Version",qS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},lY=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hY=10*60*1e3;class po extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Y(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class WS extends po{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function JS(t){return Y(t)&&t.name==="AuthApiError"}class en extends po{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class _n extends po{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class Et extends _n{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function _c(t){return Y(t)&&t.name==="AuthSessionMissingError"}class oi extends _n{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class bc extends _n{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class vc extends _n{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function XS(t){return Y(t)&&t.name==="AuthImplicitGrantRedirectError"}class Ym extends _n{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class YS extends _n{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}function dY(t){return Y(t)&&t.name==="AuthPKCECodeVerifierMissingError"}class xh extends _n{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Zm(t){return Y(t)&&t.name==="AuthRetryableFetchError"}class ew extends _n{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function ZS(t){return Y(t)&&t.name==="AuthRefreshDiscardedError"}class tw extends _n{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}function fY(t){return Y(t)&&t.name==="AuthWeakPasswordError"}class Sc extends _n{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),eT=`
3007
+ \r=`.split(""),pY=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<eT.length;e+=1)t[eT[e].charCodeAt(0)]=-2;for(let e=0;e<Rh.length;e+=1)t[Rh[e].charCodeAt(0)]=e;return t})();function tT(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Rh[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Rh[n]),e.queuedBits-=6}}function rT(t,e,r){const n=pY[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function nT(t){const e=[],r=i=>{e.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},A=i=>{wY(i,n,r)};for(let i=0;i<t.length;i+=1)rT(t.charCodeAt(i),s,A);return e.join("")}function gY(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function mY(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}gY(n,e)}}function wY(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function go(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)rT(t.charCodeAt(s),r,n);return new Uint8Array(e)}function yY(t){const e=[];return mY(t,r=>e.push(r)),new Uint8Array(e)}function ai(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>tT(s,r,n)),tT(null,r,n),e.join("")}function BY(t){return Math.round(Date.now()/1e3)+t}function CY(){return Symbol("auth-callback")}const Ar=()=>typeof window<"u"&&typeof document<"u",ci={tested:!1,writable:!1},sT=()=>{if(!Ar())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ci.tested)return ci.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ci.tested=!0,ci.writable=!0}catch{ci.tested=!0,ci.writable=!1}return ci.writable};function EY(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,A)=>{e[A]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const AT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_Y=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",mo=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},bn=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},it=async(t,e)=>{await t.removeItem(e)};class Uh{constructor(){this.promise=new Uh.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Uh.promiseConstructor=Promise;function kh(t){const e=t.split(".");if(e.length!==3)throw new Sc("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!lY.test(e[n]))throw new Sc("JWT not in base64url format");return{header:JSON.parse(nT(e[0])),payload:JSON.parse(nT(e[1])),signature:go(e[2]),raw:{header:e[0],payload:e[1]}}}async function bY(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function vY(t,e){return new Promise((n,s)=>{(async()=>{for(let A=0;A<1/0;A++)try{const i=await t(A);if(!e(A,null,i)){n(i);return}}catch(i){if(!e(A,i)){s(i);return}}})()})}function SY(t){return("0"+t.toString(16)).substr(-2)}function TY(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let A=0;A<56;A++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,SY).join("")}async function IY(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(A=>String.fromCharCode(A)).join("")}async function xY(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await IY(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ui(t,e,r=!1){const n=TY();let s=n;r&&(s+="/recovery"),await mo(t,`${e}-code-verifier`,s);const A=await xY(n);return[A,n===A?"plain":"s256"]}const RY=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function UY(t){const e=t.headers.get(Xm);if(!e||!e.match(RY))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function kY(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function FY(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const PY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Is(t){if(!PY.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function vn(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function rw(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function OY(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const A=n.toString();if(A==="Symbol(Symbol.toPrimitive)"||A==="Symbol(Symbol.toStringTag)"||A==="Symbol(util.inspect.custom)"||A==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function iT(t){return JSON.parse(JSON.stringify(t))}const li=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},QY=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function oT(t){var e;if(!_Y(t))throw new xh(li(t),0);if(QY.includes(t.status))throw new xh(li(t),t.status);let r;try{r=await t.json()}catch(A){throw new en(li(A),A)}let n;const s=UY(t);if(s&&s.getTime()>=qS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new tw(li(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Et}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((A,i)=>A&&typeof i=="string",!0))throw new tw(li(r),t.status,r.weak_password.reasons);throw new WS(li(r),t.status||500,n)}const DY=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function re(t,e,r,n){var s;const A=Object.assign({},n==null?void 0:n.headers);A[Xm]||(A[Xm]=qS["2024-01-01"].name),n!=null&&n.jwt&&(A.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const o=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",a=await LY(t,e,r+o,{headers:A,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(a):{data:Object.assign({},a),error:null}}async function LY(t,e,r,n,s,A){const i=DY(e,n,s,A);let o;try{o=await t(r,Object.assign({},i))}catch(a){throw console.error(a),new xh(li(a),0)}if(o.ok||await oT(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(a){await oT(a)}}function tn(t){var e;let r=null;HY(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=BY(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function aT(t){const e=tn(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function lA(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function MY(t){return{data:t,error:null}}function NY(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:A}=t,i=ph(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:A},a=Object.assign({},i);return{data:{properties:o,user:a},error:null}}function cT(t){return t}function HY(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Fh=["global","local","others"];class nw{constructor({url:e="",headers:r={},fetch:n,experimental:s}){this.url=e,this.headers=r,this.fetch=AT(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Fh[0]){if(Fh.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Fh.join(", ")}`);try{return await re(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Y(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await re(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=ph(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await re(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:NY,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Y(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await re(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:lA})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,A,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await re(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(A=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&A!==void 0?A:""},xform:cT});if(l.error)throw l.error;const h=await l.json(),d=(i=l.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=l.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const B=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(w.split(";")[1].split("=")[1]);c[`${C}Page`]=B}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(Y(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Is(e);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:lA})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Is(e);try{return await re(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Is(e);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:lA})}catch(n){if(Y(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Is(e.userId);try{const{data:r,error:n}=await re(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Is(e.userId),Is(e.id);try{return{data:await re(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,A,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await re(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(A=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&A!==void 0?A:""},xform:cT});if(l.error)throw l.error;const h=await l.json(),d=(i=l.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=l.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const B=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(w.split(";")[1].split("=")[1]);c[`${C}Page`]=B}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(Y(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await re(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await re(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await re(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await re(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(Y(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await re(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await re(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await re(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await re(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){vn(this.experimental),Is(e.userId);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){vn(this.experimental),Is(e.userId),Is(e.passkeyId);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}}function uT(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Sn={debug:!!(globalThis&&sT()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Tc extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class sw extends Tc{}class $Y extends Tc{}async function VY(t,e,r){Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{n.abort(),Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async A=>{if(A){clearTimeout(s),Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,A.name);try{return await r()}finally{Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,A.name)}}else{if(e===0)throw Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new sw(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Sn.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await r()}})}catch(A){if(e>0&&clearTimeout(s),A!==null&&typeof A=="object"&&"name"in A&&A.name==="AbortError"&&e>0){if(n.signal.aborted)return Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async i=>{if(i){Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,i.name);try{return await r()}finally{Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new sw(`Lock "${t}" was released because another request stole it`)}throw A}}const lT={};async function KY(t,e,r){var n;const s=(n=lT[t])!==null&&n!==void 0?n:Promise.resolve(),A=(async()=>{try{return await s,null}catch{return null}})(),i=(async()=>{let o=null;try{const a=e>=0?new Promise((c,l)=>{o=setTimeout(()=>{console.warn(`@supabase/gotrue-js: Lock "${t}" acquisition timed out after ${e}ms. This may be caused by another operation holding the lock. Consider increasing lockAcquireTimeout or checking for stuck operations.`),l(new $Y(`Acquiring process lock with name "${t}" timed out`))},e)}):null;await Promise.race([A,a].filter(c=>c)),o!==null&&clearTimeout(o)}catch(a){if(o!==null&&clearTimeout(o),a instanceof Tc)throw a}return await r()})();return lT[t]=(async()=>{try{return await i}catch(o){if(o instanceof Tc){try{await s}catch{}return null}throw o}})(),await i}function jY(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function hT(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function GY(t){return parseInt(t,16)}function zY(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function qY(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:A=new Date,nonce:i,notBefore:o,requestId:a,resources:c,scheme:l,uri:h,version:d}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
3008
3008
  `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=hT(t.address),w=l?`${l}://${n}`:n,B=t.statement?`${t.statement}
3009
3009
  `:"",C=`${w} wants you to sign in with your Ethereum account:
3010
3010
  ${p}
@@ -3019,21 +3019,21 @@ Not Before: ${o.toISOString()}`),a&&(_+=`
3019
3019
  Request ID: ${a}`),c){let T=`
3020
3020
  Resources:`;for(const v of c){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);T+=`
3021
3021
  - ${v}`}_+=T}return`${C}
3022
- ${_}`}class pt extends Error{constructor({message:e,code:r,cause:n,name:s}){var A;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(A=s??(n instanceof Error?n.name:void 0))!==null&&A!==void 0?A:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ph extends pt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function zY({error:t,options:e}){var r,n,s;const{publicKey:A}=e;if(!A)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new pt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=A.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new pt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=A.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new pt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=A.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new pt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new pt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new pt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return A.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new pt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new pt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=window.location.hostname;if(mT(i)){if(A.rp.id!==i)return new pt({message:`The RP ID "${A.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new pt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(A.user.id.byteLength<1||A.user.id.byteLength>64)return new pt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new pt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new pt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function qY({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new pt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new pt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(mT(n)){if(r.rpId!==n)return new pt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new pt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new pt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new pt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class WY{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Aw=new WY;function dT(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=ph(t,["challenge","user","excludeCredentials"]),A=go(e).buffer,i=Object.assign(Object.assign({},r),{id:go(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:A,user:i});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const c=n[a];o.excludeCredentials[a]=Object.assign(Object.assign({},c),{id:go(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function fT(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=ph(t,["challenge","allowCredentials"]),s=go(e).buffer,A=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){A.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const o=r[i];A.allowCredentials[i]=Object.assign(Object.assign({},o),{id:go(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return A}function pT(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:ai(new Uint8Array(t.response.attestationObject)),clientDataJSON:ai(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function gT(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:ai(new Uint8Array(s.authenticatorData)),clientDataJSON:ai(new Uint8Array(s.clientDataJSON)),signature:ai(new Uint8Array(s.signature)),userHandle:s.userHandle?ai(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function mT(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Oh(){var t,e;return!!(Ar()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function wT(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",e)}:{data:null,error:new Ph("Empty credential response",e)}}catch(e){return{data:null,error:zY({error:e,options:t})}}}async function yT(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",e)}:{data:null,error:new Ph("Empty credential response",e)}}catch(e){return{data:null,error:qY({error:e,options:t})}}}const JY={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},XY={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Qh(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const A in s){const i=s[A];if(i!==void 0)if(Array.isArray(i))n[A]=i;else if(r(i))n[A]=i;else if(e(i)){const o=n[A];e(o)?n[A]=Qh(o,i):n[A]=Qh(i)}else n[A]=i}return n}function YY(t,e){return Qh(JY,t,e||{})}function ZY(t,e){return Qh(XY,t,e||{})}class eZ{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},A){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:a};const c=s??Aw.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:l}=o.webauthn.credential_options.publicKey;if(!l.name){const h=n;if(h)l.name=`${l.id}:${h}`;else{const p=(await this.client.getUser()).data.user,w=((i=p==null?void 0:p.user_metadata)===null||i===void 0?void 0:i.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";l.name=`${l.id}:${w}`}}l.displayName||(l.displayName=l.name)}switch(o.webauthn.type){case"create":{const l=YY(o.webauthn.credential_options.publicKey,A==null?void 0:A.create),{data:h,error:d}=await wT({publicKey:l,signal:c});return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}case"request":{const l=ZY(o.webauthn.credential_options.publicKey,A==null?void 0:A.request),{data:h,error:d}=await yT(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:l,signal:c}));return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}}}catch(o){return Y(o)?{data:null,error:o}:{data:null,error:new en("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},A){if(!r)return{data:null,error:new po("rpId is required for WebAuthn authentication")};try{if(!Oh())return{data:null,error:new en("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:A});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:r,rpOrigins:n,credential_response:a.credential_response}})}catch(i){return Y(i)?{data:null,error:i}:{data:null,error:new en("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},A){if(!r)return{data:null,error:new po("rpId is required for WebAuthn registration")};try{if(!Oh())return{data:null,error:new en("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(l=>{var h;return(h=l.data)===null||h===void 0?void 0:h.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===e&&d.status!=="unverified")}).then(l=>l?this.client.mfa.unenroll({factorId:l==null?void 0:l.id}):void 0),{data:null,error:o};const{data:a,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:A});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:r,rpOrigins:n,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:c}}catch(i){return Y(i)?{data:null,error:i}:{data:null,error:new en("Unexpected error in register",i)}}}}VY();const tZ={url:iY,storageKey:oY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:aY,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},wo={};class yo{get jwks(){var e,r;return(r=(e=wo[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){wo[this.storageKey]=Object.assign(Object.assign({},wo[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=wo[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){wo[this.storageKey]=Object.assign(Object.assign({},wo[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const A=Object.assign(Object.assign({},tZ),e);if(this.storageKey=A.storageKey,this.instanceID=(r=yo.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,yo.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!A.debug,typeof A.debug=="function"&&(this.logger=A.debug),this.instanceID>0&&Ar()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=A.persistSession,this.autoRefreshToken=A.autoRefreshToken,this.experimental=(n=A.experimental)!==null&&n!==void 0?n:{},this.admin=new nw({url:A.url,headers:A.headers,fetch:A.fetch,experimental:this.experimental}),this.url=A.url,this.headers=A.headers,this.fetch=AT(A.fetch),this.detectSessionInUrl=A.detectSessionInUrl,this.flowType=A.flowType,this.hasCustomAuthorizationHeader=A.hasCustomAuthorizationHeader,this.throwOnError=A.throwOnError,this.lockAcquireTimeout=A.lockAcquireTimeout,A.lock!=null&&(this.lock=A.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new eZ(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(A.storage?this.storage=A.storage:sT()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=uT(this.memoryStorage)),A.userStorage&&(this.userStorage=A.userStorage)):(this.memoryStorage={},this.storage=uT(this.memoryStorage)),Ar()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}A.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${zS}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Ar()&&(r=BY(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Ar()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:A}=await this._getSessionFromURL(r,n);if(A){if(this._debug("#_initialize()","error detecting session from URL",A),XS(A)){const a=(e=A.details)===null||e===void 0?void 0:e.code;if(a==="identity_already_exists"||a==="identity_not_found"||a==="single_identity_not_deletable")return{error:A}}return{error:A}}const{session:i,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Y(r)?this._returnResult({error:r}):this._returnResult({error:new en("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:tn}),{data:i,error:o}=A;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(A){if(Y(A))return this._returnResult({data:{user:null,session:null},error:A});throw A}}async signUp(e){var r,n,s;try{let A;if("email"in e){const{email:l,password:h,options:d}=e;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await ui(this.storage,this.storageKey)),A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:l,password:h,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:p,code_challenge_method:w},xform:tn})}else if("phone"in e){const{phone:l,password:h,options:d}=e;A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:h,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(s=d==null?void 0:d.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:tn})}else throw new bc("You must provide either an email or phone number and a password");const{data:i,error:o}=A;if(o||!i)return await it(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:{user:null,session:null},error:A});throw A}}async signInWithPassword(e){try{let r;if("email"in e){const{email:A,password:i,options:o}=e;r=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:A,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:aT})}else if("phone"in e){const{phone:A,password:i,options:o}=e;r=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:A,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:aT})}else throw new bc("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const A=new oi;return this._returnResult({data:{user:null,session:null},error:A})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,A;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(A=e.options)===null||A===void 0?void 0:A.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,A,i,o,a,c,l,h,d;let p,w;if("message"in e)p=e.message,w=e.signature;else{const{chain:B,wallet:C,statement:_,options:T}=e;let v;if(Ar())if(typeof C=="object")v=C;else{const R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")v=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!(T!=null&&T.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=C}const k=new URL((r=T==null?void 0:T.url)!==null&&r!==void 0?r:window.location.href),L=await v.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!L||L.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const V=hT(L[0]);let x=(n=T==null?void 0:T.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!x){const R=await v.request({method:"eth_chainId"});x=KY(R)}const I={domain:k.host,address:V,statement:_,uri:k.href,version:"1",chainId:x,nonce:(s=T==null?void 0:T.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(A=T==null?void 0:T.signInWithEthereum)===null||A===void 0?void 0:A.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(o=T==null?void 0:T.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(a=T==null?void 0:T.signInWithEthereum)===null||a===void 0?void 0:a.notBefore,requestId:(c=T==null?void 0:T.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(l=T==null?void 0:T.signInWithEthereum)===null||l===void 0?void 0:l.resources};p=GY(I),w=await v.request({method:"personal_sign",params:[jY(p),V]})}try{const{data:B,error:C}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:tn});if(C)throw C;if(!B||!B.session||!B.user){const _=new oi;return this._returnResult({data:{user:null,session:null},error:_})}return B.session&&(await this._saveSession(B.session),await this._notifyAllSubscribers("SIGNED_IN",B.session)),this._returnResult({data:Object.assign({},B),error:C})}catch(B){if(Y(B))return this._returnResult({data:{user:null,session:null},error:B});throw B}}async signInWithSolana(e){var r,n,s,A,i,o,a,c,l,h,d,p;let w,B;if("message"in e)w=e.message,B=e.signature;else{const{chain:C,wallet:_,statement:T,options:v}=e;let k;if(Ar())if(typeof _=="object")k=_;else{const V=window;if("solana"in V&&typeof V.solana=="object"&&("signIn"in V.solana&&typeof V.solana.signIn=="function"||"signMessage"in V.solana&&typeof V.solana.signMessage=="function"))k=V.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof _!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=_}const L=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in k&&k.signIn){const V=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),T?{statement:T}:null));let x;if(Array.isArray(V)&&V[0]&&typeof V[0]=="object")x=V[0];else if(V&&typeof V=="object"&&"signedMessage"in V&&"signature"in V)x=V;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in x&&"signature"in x&&(typeof x.signedMessage=="string"||x.signedMessage instanceof Uint8Array)&&x.signature instanceof Uint8Array)w=typeof x.signedMessage=="string"?x.signedMessage:new TextDecoder().decode(x.signedMessage),B=x.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${L.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...T?["",T,""]:[""],"Version: 1",`URI: ${L.href}`,`Issued At: ${(s=(n=v==null?void 0:v.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((A=v==null?void 0:v.signInWithSolana)===null||A===void 0)&&A.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((a=v==null?void 0:v.signInWithSolana)===null||a===void 0)&&a.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((c=v==null?void 0:v.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((h=(l=v==null?void 0:v.signInWithSolana)===null||l===void 0?void 0:l.resources)===null||h===void 0)&&h.length?["Resources",...v.signInWithSolana.resources.map(x=>`- ${x}`)]:[]].join(`
3023
- `);const V=await k.signMessage(new TextEncoder().encode(w),"utf8");if(!V||!(V instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");B=V}}try{const{data:C,error:_}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:ai(B)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:tn});if(_)throw _;if(!C||!C.session||!C.user){const T=new oi;return this._returnResult({data:{user:null,session:null},error:T})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:_})}catch(C){if(Y(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(e){const r=await bn(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new YS;const{data:A,error:i}=await re(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:tn});if(await it(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!A||!A.session||!A.user){const o=new oi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",A.session)),this._returnResult({data:Object.assign(Object.assign({},A),{redirectType:s??null}),error:i})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:{user:null,session:null,redirectType:null},error:A});throw A}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:A,nonce:i}=e,o=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:A,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:tn}),{data:a,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a||!a.session||!a.user){const l=new oi;return this._returnResult({data:{user:null,session:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:c})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,A,i;try{if("email"in e){const{email:o,options:a}=e;let c=null,l=null;this.flowType==="pkce"&&([c,l]=await ui(this.storage,this.storageKey));const{error:h}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=a==null?void 0:a.data)!==null&&r!==void 0?r:{},create_user:(n=a==null?void 0:a.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:o,options:a}=e,{data:c,error:l}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=a==null?void 0:a.data)!==null&&s!==void 0?s:{},create_user:(A=a==null?void 0:a.shouldCreateUser)!==null&&A!==void 0?A:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},channel:(i=a==null?void 0:a.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:l})}throw new bc("You must provide either an email or phone number.")}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var r,n;try{let s,A;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,A=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:o}=await re(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:A}}),redirectTo:s,xform:tn});if(o)throw o;if(!i)throw new Error("An error occurred on token verification.");const a=i.session,c=i.user;return a!=null&&a.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(s){if(Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,A,i;try{let o=null,a=null;this.flowType==="pkce"&&([o,a]=await ui(this.storage,this.storageKey));const c=await re(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:DY});return!((A=c.data)===null||A===void 0)&&A.url&&Ar()&&!(!((i=e.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Et;const{error:s}=await re(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:A}=e;let i=null,o=null;this.flowType==="pkce"&&([i,o]=await ui(this.storage,this.storageKey));const{error:a}=await re(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:A==null?void 0:A.emailRedirectTo});return a&&await it(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:n,type:s,options:A}=e,{data:i,error:o}=await re(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:o})}throw new bc("You must provide either an email or phone number and a type")}catch(r){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await bn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Jm:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const i=await bn(this.userStorage,this.storageKey+"-user");i!=null&&i.user?e.user=i.user:e.user=rw()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};e.user=FY(e.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:A}=await this._callRefreshToken(e.refresh_token);if(A){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const o=await bn(this.storage,this.storageKey);if(o&&o.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:A})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:lA}):await this._useSession(async r=>{var n,s,A;const{data:i,error:o}=r;if(o)throw o;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Et}:await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(A=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&A!==void 0?A:void 0,xform:lA})})}catch(r){if(Y(r))return _c(r)&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r)):await this._updateUser(e,r)}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:A}=n;if(A)throw A;if(!s.session)throw new Et;const i=s.session;let o=null,a=null;this.flowType==="pkce"&&e.email!=null&&([o,a]=await ui(this.storage,this.storageKey));const{data:c,error:l}=await re(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:lA});if(l)throw l;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Et;const r=Date.now()/1e3;let n=r,s=!0,A=null;const{payload:i}=kh(e.access_token);if(i.exp&&(n=i.exp,s=n<=r),s){const{data:o,error:a}=await this._callRefreshToken(e.refresh_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o)return{data:{user:null,session:null},error:null};A=o}else{const{data:o,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});A={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(A),await this._notifyAllSubscribers("SIGNED_IN",A)}return this._returnResult({data:{user:A.user,session:A},error:null})}catch(r){if(Y(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:i,error:o}=r;if(o)throw o;e=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Et;const{data:s,error:A}=await this._callRefreshToken(e.refresh_token);return A?this._returnResult({data:{user:null,session:null},error:A}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!Ar())throw new vc("No browser detected.");if(e.error||e.error_description||e.error_code)throw new vc(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Ym("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new vc("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Ym("No code detected.");const{data:v,error:k}=await this._exchangeCodeForSession(e.code);if(k)throw k;const L=new URL(window.location.href);return L.searchParams.delete("code"),window.history.replaceState(window.history.state,"",L.toString()),{data:{session:v.session,redirectType:(n=v.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:A,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:l}=e;if(!i||!a||!o||!l)throw new vc("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(a);let p=h+d;c&&(p=parseInt(c));const w=p-h;w*1e3<=Ts&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${d}s`);const B=p-d;h-B>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",B,p,h):h-B<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",B,p,h);const{data:C,error:_}=await this._getUser(i);if(_)throw _;const T={provider_token:s,provider_refresh_token:A,access_token:i,expires_in:d,expires_at:p,refresh_token:o,token_type:l,user:C.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:T,redirectType:e.type},error:null})}catch(s){if(Y(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const r=await bn(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:A}=r;if(A&&!_c(A))return this._returnResult({error:A});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:o}=await this.admin.signOut(i,e);if(o&&!(JS(o)&&(o.status===404||o.status===401||o.status===403)||_c(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=yY(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:A},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",A)),this._debug("INITIAL_SESSION","callback id",e,"session",A)}catch(A){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",A),_c(A)?console.warn(A):console.error(A)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ui(this.storage,this.storageKey,!0));try{return await re(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:null,error:A});throw A}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async A=>{var i,o,a,c,l;const{data:h,error:d}=A;if(d)throw d;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:!0});return await re(this.fetch,"GET",p,{headers:this.headers,jwt:(l=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(s)throw s;return Ar()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Y(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:A}}=r;if(s)throw s;const{options:i,provider:o,token:a,access_token:c,nonce:l}=e,h=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=A==null?void 0:A.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:a,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:tn}),{data:d,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new oi}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:p}))}catch(s){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:A,error:i}=r;if(i)throw i;return await re(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=A.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await _Y(async s=>(s>0&&await EY(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await re(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:tn})),(s,A)=>{const i=200*Math.pow(2,s);return A&&Zm(A)&&Date.now()+i-n<Ts})}catch(n){if(this._debug(r,"error",n),Y(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Ar()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await bn(this.storage,this.storageKey);if(s&&this.userStorage){let i=await bn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await mo(this.userStorage,this.storageKey+"-user",i)),s.user=(e=i==null?void 0:i.user)!==null&&e!==void 0?e:rw()}else if(s&&!s.user&&!s.user){const i=await bn(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await it(this.storage,this.storageKey+"-user"),await mo(this.storage,this.storageKey,s)):s.user=rw()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const A=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Jm;if(this._debug(n,`session has${A?"":" not"} expired with margin of ${Jm}s`),A){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(ZS(i)?this._debug(n,"refresh discarded by commit guard",i):this._debug(n,"refresh failed",i))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:o}=await this._getUser(s.access_token);!o&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Et;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new Uh;const A=await bn(this.storage,this.storageKey),{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Et;const a=await bn(this.storage,this.storageKey);if(A!==null&&(a===null||a.refresh_token!==A.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:a?"replaced":"cleared"});const d={data:null,error:new ew};return this.refreshingDeferred.resolve(d),d}const l=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==l){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await it(this.storage,this.storageKey),this.userStorage&&await it(this.userStorage,this.storageKey+"-user");const d={data:null,error:new ew};return this.refreshingDeferred.resolve(d),d}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const h={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(h),h}catch(A){if(this._debug(s,"error",A),Y(A)){const i={data:null,error:A};if(!Zm(A)){const o=await bn(this.storage,this.storageKey);!!(o!=null&&o.expires_at&&o.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:i,expiresAt:Date.now()+AY},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(A),A}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const A=[],i=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,r)}catch(a){A.push(a)}});if(await Promise.all(i),A.length>0){for(let o=0;o<A.length;o+=1)console.error(A[o]);throw A[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await it(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await mo(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const A=iT(s);await mo(this.storage,this.storageKey,A)}else{const s=iT(r);await mo(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await it(this.storage,this.storageKey),await it(this.storage,this.storageKey+"-code-verifier"),await it(this.storage,this.storageKey+"-user"),this.userStorage&&await it(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Ar()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Ts);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Ts);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ts}ms, refresh threshold is ${Ec} ticks`),s<=Ec&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof Tc)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Ts);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ts}ms, refresh threshold is ${Ec} ticks`),s<=Ec&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ar()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[A,i]=await ui(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(A)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(o.toString())}if(n!=null&&n.queryParams){const A=new URLSearchParams(n.queryParams);s.push(A.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:A}=r;return A?this._returnResult({data:null,error:A}):await re(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:A,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:a,error:c}=await re(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=A==null?void 0:A.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&a.type==="totp"&&(!((s=a==null?void 0:a.totp)===null||s===void 0)&&s.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:A,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?pT(e.webauthn.credential_response):gT(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:c}=await re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=A==null?void 0:A.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:c}))})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:A,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(s=A==null?void 0:A.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:dT(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:fT(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const A of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(A),A.status==="verified"&&s[A.factor_type].push(A);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,s,A;if(e)try{const{payload:p}=kh(e);let w=null;p.aal&&(w=p.aal);let B=w;const{data:{user:C},error:_}=await this.getUser(e);if(_)return this._returnResult({data:null,error:_});((n=(r=C==null?void 0:C.factors)===null||r===void 0?void 0:r.filter(k=>k.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(B="aal2");const v=p.amr||[];return{data:{currentLevel:w,nextLevel:B,currentAuthenticationMethods:v},error:null}}catch(p){if(Y(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=kh(i.access_token);let c=null;a.aal&&(c=a.aal);let l=c;((A=(s=i.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&A!==void 0?A:[]).length>0&&(l="aal2");const d=a.amr||[];return{data:{currentLevel:c,nextLevel:l,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await re(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:A=>({data:A,error:null})}):this._returnResult({data:null,error:new Et})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:A}=n;if(A)return this._returnResult({data:null,error:A});if(!s)return this._returnResult({data:null,error:new Et});const i=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Ar()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:A}=n;if(A)return this._returnResult({data:null,error:A});if(!s)return this._returnResult({data:null,error:new Et});const i=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Ar()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await re(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Et})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await re(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Et})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(o=>o.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+uY>s)return n;const{data:A,error:i}=await re(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!A.keys||A.keys.length===0||(this.jwks=A,this.jwks_cached_at=s,n=A.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:p,error:w}=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});n=p.session.access_token}const{header:s,payload:A,signature:i,raw:{header:o,payload:a}}=kh(n);if(!(r!=null&&r.allowExpired))try{RY(A.exp)}catch(p){throw new Sc(p instanceof Error?p.message:"JWT validation failed")}const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:A,header:s,signature:i},error:null}}const l=UY(s.alg),h=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!await crypto.subtle.verify(l,h,i,mY(`${o}.${a}`)))throw new Sc("Invalid JWT signature");return{data:{claims:A,header:s,signature:i},error:null}}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,s;vn(this.experimental);try{if(!Oh())return this._returnResult({data:null,error:new en("Browser does not support WebAuthn",null)});const{data:A,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(i||!A)return this._returnResult({data:null,error:i});const o=fT(A.options),a=(s=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:Aw.createNewAbortSignal(),{data:c,error:l}=await yT({publicKey:o,signal:a});if(l||!c)return this._returnResult({data:null,error:l??new en("WebAuthn ceremony failed",null)});const h=gT(c);return this._verifyPasskeyAuthentication({challengeId:A.challenge_id,credential:h})}catch(A){if(Y(A))return this._returnResult({data:null,error:A});throw A}}async registerPasskey(e){var r,n;vn(this.experimental);try{if(!Oh())return this._returnResult({data:null,error:new en("Browser does not support WebAuthn",null)});const{data:s,error:A}=await this._startPasskeyRegistration();if(A||!s)return this._returnResult({data:null,error:A});const i=dT(s.options),o=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:Aw.createNewAbortSignal(),{data:a,error:c}=await wT({publicKey:i,signal:o});if(c||!a)return this._returnResult({data:null,error:c??new en("WebAuthn ceremony failed",null)});const l=pT(a);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:l})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){vn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Et});const{data:s,error:A}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return A?this._returnResult({data:null,error:A}):this._returnResult({data:s,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{data:A,error:i}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:A,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;vn(this.experimental);try{const{data:n,error:s}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){vn(this.experimental);try{const{data:r,error:n}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:tn});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){vn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Et});const{data:s,error:A}=await re(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})});return A?this._returnResult({data:null,error:A}):this._returnResult({data:s,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{data:A,error:i}=await re(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:A,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{error:A}=await re(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return A?this._returnResult({data:null,error:A}):this._returnResult({data:null,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}}yo.nextInstanceID={};const rZ=nw,BT=yo,nZ="2.108.2";let Ic="",Dh;if(typeof Deno<"u"){var iw;Ic="deno",Dh=(iw=Deno.version)===null||iw===void 0?void 0:iw.deno}else if(typeof document<"u")Ic="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Ic="react-native";else{var ow;Ic="node",Dh=typeof process<"u"?(ow=process.version)===null||ow===void 0?void 0:ow.replace(/^v/,""):void 0}const CT=[`runtime=${Ic}`];Dh&&CT.push(`runtime-version=${Dh}`);const sZ={headers:{"X-Client-Info":`supabase-js/${nZ}; ${CT.join("; ")}`}},AZ={schema:"public"},iZ={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},oZ={},aZ={enabled:!1,respectSamplingDecision:!0};function cZ(t,e,r,n){function s(A){return A instanceof r?A:new r(function(i){i(A)})}return new(r||(r=Promise))(function(A,i){function o(l){try{c(n.next(l))}catch(h){i(h)}}function a(l){try{c(n.throw(l))}catch(h){i(h)}}function c(l){l.done?A(l.value):s(l.value).then(o,a)}c((n=n.apply(t,[])).next())})}let aw=null;const uZ="@opentelemetry/api";function lZ(){return aw===null&&(aw=import(uZ).catch(()=>null)),aw}function hZ(){return cZ(this,void 0,void 0,function*(){try{const t=yield lZ();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function dZ(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,s,A]=e;if(r.length!==2||n.length!==32||s.length!==16||A.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(r)||!i.test(n)||!i.test(s)||!i.test(A)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:A,isSampled:(parseInt(A,16)&1)===1}}function fZ(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(pZ(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function pZ(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function gZ(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function xc(t){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xc(t)}function mZ(t,e){if(xc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wZ(t){var e=mZ(t,"string");return xc(e)=="symbol"?e:e+""}function yZ(t,e,r){return(e=wZ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ET(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Ze(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ET(Object(r),!0).forEach(function(n){yZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ET(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const BZ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),CZ=()=>Headers,EZ=(t,e,r,n,s)=>{const A=BZ(n),i=CZ(),o=(s==null?void 0:s.enabled)===!0,a=(s==null?void 0:s.respectSamplingDecision)!==!1,c=o?gZ(e):null;return async(l,h)=>{var d;const p=(d=await r())!==null&&d!==void 0?d:t;let w=new i(h==null?void 0:h.headers);if(w.has("apikey")||w.set("apikey",t),w.has("Authorization")||w.set("Authorization",`Bearer ${p}`),c){const B=await _Z(l,c,a);B&&(B.traceparent&&!w.has("traceparent")&&w.set("traceparent",B.traceparent),B.tracestate&&!w.has("tracestate")&&w.set("tracestate",B.tracestate),B.baggage&&!w.has("baggage")&&w.set("baggage",B.baggage))}return A(l,Ze(Ze({},h),{},{headers:w}))}};async function _Z(t,e,r){if(!fZ(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await hZ();if(!n||!n.traceparent)return null;if(r){const s=dZ(n.traceparent);if(s&&!s.isSampled)return null}return n}function _T(t){return typeof t=="boolean"?{enabled:t}:t}function bZ(t){return t.endsWith("/")?t:t+"/"}function vZ(t,e){var r,n,s,A,i,o;const{db:a,auth:c,realtime:l,global:h}=t,{db:d,auth:p,realtime:w,global:B}=e,C=_T(t.tracePropagation),_=_T(e.tracePropagation),T={db:Ze(Ze({},d),a),auth:Ze(Ze({},p),c),realtime:Ze(Ze({},w),l),storage:{},global:Ze(Ze(Ze({},B),h),{},{headers:Ze(Ze({},(r=B==null?void 0:B.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(A=C==null?void 0:C.enabled)!==null&&A!==void 0?A:_==null?void 0:_.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(i=(o=C==null?void 0:C.respectSamplingDecision)!==null&&o!==void 0?o:_==null?void 0:_.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return t.accessToken?T.accessToken=t.accessToken:delete T.accessToken,T}function SZ(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(bZ(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var TZ=class extends BT{constructor(t){super(t)}},bT=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const A=SZ(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",A),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",A),this.storageUrl=new URL("storage/v1",A),this.functionsUrl=new URL("functions/v1",A);const i=`sb-${A.hostname.split(".")[0]}-auth-token`,o={db:AZ,realtime:oZ,auth:Ze(Ze({},iZ),{},{storageKey:i}),global:sZ,tracePropagation:aZ},a=vZ(r??{},o);if(this.settings=a,this.storageKey=(n=a.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=a.global.headers)!==null&&s!==void 0?s:{},a.accessToken)this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(l,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=a.auth)!==null&&c!==void 0?c:{},this.headers,a.global.fetch)}this.fetch=EZ(e,t,this._getAccessToken.bind(this),a.global.fetch,a.tracePropagation),this.realtime=this._initRealtimeClient(Ze({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(l=>this.realtime.setAuth(l)).catch(l=>console.warn("Failed to set initial Realtime auth token:",l)),this.rest=new WJ(new URL("rest/v1",A).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new sY(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new NJ(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:A,flowType:i,lock:o,debug:a,throwOnError:c,experimental:l,lockAcquireTimeout:h,skipAutoInitialize:d},p,w){const B={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new TZ({url:this.authUrl.href,headers:Ze(Ze({},B),p),storageKey:A,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:o,debug:a,throwOnError:c,experimental:l,fetch:w,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(C=>C.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new MS(this.realtimeUrl.href,Ze(Ze({},t),{},{params:Ze(Ze({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const IZ=(t,e,r)=>new bT(t,e,r);function xZ(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}xZ()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const RZ=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:rZ,AuthApiError:WS,AuthClient:BT,AuthError:po,AuthImplicitGrantRedirectError:vc,AuthInvalidCredentialsError:bc,AuthInvalidJwtError:Sc,AuthInvalidTokenResponseError:oi,AuthPKCECodeVerifierMissingError:YS,AuthPKCEGrantCodeExchangeError:Ym,AuthRefreshDiscardedError:ew,AuthRetryableFetchError:xh,AuthSessionMissingError:Et,AuthUnknownError:en,AuthWeakPasswordError:tw,CustomAuthError:_n,get FunctionRegion(){return wh},FunctionsError:mh,FunctionsFetchError:ES,FunctionsHttpError:Mm,FunctionsRelayError:Lm,GoTrueAdminApi:nw,GoTrueClient:yo,NavigatorLockAcquireTimeoutError:sw,PostgrestError:Nm,REALTIME_CHANNEL_STATES:EX,get REALTIME_LISTEN_TYPES(){return ii},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return Gm},get REALTIME_PRESENCE_LISTEN_EVENTS(){return jm},get REALTIME_SUBSCRIBE_STATES(){return Wn},RealtimeChannel:lo,RealtimeClient:MS,RealtimePresence:DS,SIGN_OUT_SCOPES:Fh,StorageApiError:Th,SupabaseClient:bT,WebSocketFactory:xS,createClient:IZ,isAuthApiError:JS,isAuthError:Y,isAuthImplicitGrantRedirectError:XS,isAuthPKCECodeVerifierMissingError:lY,isAuthRefreshDiscardedError:ZS,isAuthRetryableFetchError:Zm,isAuthSessionMissingError:_c,isAuthWeakPasswordError:hY,lockInternals:Sn,navigatorLock:HY,processLock:$Y},Symbol.toStringTag,{value:"Module"}));function UZ(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}const kZ=t=>(t==null?void 0:t.body)instanceof ReadableStream,hi=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const n of e)r.push(n);return r},hA=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Lh=()=>{let t=[],e=[],r=!1;const n=new Set,s=h=>h.sort((d,p)=>vT[p.step]-vT[d.step]||ST[p.priority||"normal"]-ST[d.priority||"normal"]),A=h=>{let d=!1;const p=w=>{const B=hi(w.name,w.aliases);if(B.includes(h)){d=!0;for(const C of B)n.delete(C);return!1}return!0};return t=t.filter(p),e=e.filter(p),d},i=h=>{let d=!1;const p=w=>{if(w.middleware===h){d=!0;for(const B of hi(w.name,w.aliases))n.delete(B);return!1}return!0};return t=t.filter(p),e=e.filter(p),d},o=h=>{var d;return t.forEach(p=>{h.add(p.middleware,{...p})}),e.forEach(p=>{h.addRelativeTo(p.middleware,{...p})}),(d=h.identifyOnResolve)==null||d.call(h,l.identifyOnResolve()),h},a=h=>{const d=[];return h.before.forEach(p=>{p.before.length===0&&p.after.length===0?d.push(p):d.push(...a(p))}),d.push(h),h.after.reverse().forEach(p=>{p.before.length===0&&p.after.length===0?d.push(p):d.push(...a(p))}),d},c=(h=!1)=>{const d=[],p=[],w={};return t.forEach(C=>{const _={...C,before:[],after:[]};for(const T of hi(_.name,_.aliases))w[T]=_;d.push(_)}),e.forEach(C=>{const _={...C,before:[],after:[]};for(const T of hi(_.name,_.aliases))w[T]=_;p.push(_)}),p.forEach(C=>{if(C.toMiddleware){const _=w[C.toMiddleware];if(_===void 0){if(h)return;throw new Error(`${C.toMiddleware} is not found when adding ${hA(C.name,C.aliases)} middleware ${C.relation} ${C.toMiddleware}`)}C.relation==="after"&&_.after.push(C),C.relation==="before"&&_.before.push(C)}}),s(d).map(a).reduce((C,_)=>(C.push(..._),C),[])},l={add:(h,d={})=>{const{name:p,override:w,aliases:B}=d,C={step:"initialize",priority:"normal",middleware:h,...d},_=hi(p,B);if(_.length>0){if(_.some(T=>n.has(T))){if(!w)throw new Error(`Duplicate middleware name '${hA(p,B)}'`);for(const T of _){const v=t.findIndex(L=>{var V;return L.name===T||((V=L.aliases)==null?void 0:V.some(x=>x===T))});if(v===-1)continue;const k=t[v];if(k.step!==C.step||C.priority!==k.priority)throw new Error(`"${hA(k.name,k.aliases)}" middleware with ${k.priority} priority in ${k.step} step cannot be overridden by "${hA(p,B)}" middleware with ${C.priority} priority in ${C.step} step.`);t.splice(v,1)}}for(const T of _)n.add(T)}t.push(C)},addRelativeTo:(h,d)=>{const{name:p,override:w,aliases:B}=d,C={middleware:h,...d},_=hi(p,B);if(_.length>0){if(_.some(T=>n.has(T))){if(!w)throw new Error(`Duplicate middleware name '${hA(p,B)}'`);for(const T of _){const v=e.findIndex(L=>{var V;return L.name===T||((V=L.aliases)==null?void 0:V.some(x=>x===T))});if(v===-1)continue;const k=e[v];if(k.toMiddleware!==C.toMiddleware||k.relation!==C.relation)throw new Error(`"${hA(k.name,k.aliases)}" middleware ${k.relation} "${k.toMiddleware}" middleware cannot be overridden by "${hA(p,B)}" middleware ${C.relation} "${C.toMiddleware}" middleware.`);e.splice(v,1)}}for(const T of _)n.add(T)}e.push(C)},clone:()=>o(Lh()),use:h=>{h.applyToStack(l)},remove:h=>typeof h=="string"?A(h):i(h),removeByTag:h=>{let d=!1;const p=w=>{const{tags:B,name:C,aliases:_}=w;if(B&&B.includes(h)){const T=hi(C,_);for(const v of T)n.delete(v);return d=!0,!1}return!0};return t=t.filter(p),e=e.filter(p),d},concat:h=>{var p;const d=o(Lh());return d.use(h),d.identifyOnResolve(r||d.identifyOnResolve()||(((p=h.identifyOnResolve)==null?void 0:p.call(h))??!1)),d},applyToStack:o,identify:()=>c(!0).map(h=>{const d=h.step??h.relation+" "+h.toMiddleware;return hA(h.name,h.aliases)+" - "+d}),identifyOnResolve(h){return typeof h=="boolean"&&(r=h),r},resolve:(h,d)=>{for(const p of c().map(w=>w.middleware).reverse())h=p(h,d);return r&&console.log(l.identify()),h}};return l},vT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ST={high:3,normal:2,low:1};var Rc;(function(t){t.HTTP="http",t.HTTPS="https"})(Rc||(Rc={}));var Uc;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Uc||(Uc={}));const cw="__smithy_context",xs=t=>t[cw]||(t[cw]={});class ot{constructor(e){S(this,"method");S(this,"protocol");S(this,"hostname");S(this,"port");S(this,"path");S(this,"query");S(this,"headers");S(this,"username");S(this,"password");S(this,"fragment");S(this,"body");this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const r=new ot({...e,headers:{...e.headers}});return r.query&&(r.query=FZ(r.query)),r}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return ot.clone(this)}}function FZ(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}class dA{constructor(e){S(this,"statusCode");S(this,"reason");S(this,"headers");S(this,"body");this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const PZ=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Mh=(t,e=!1)=>{if(!e)return PZ.test(t);const r=t.split(".");for(const n of r)if(!Mh(n))return!1;return!0},Kr=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e};function OZ(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[n,s=null]=r.split("=");n=decodeURIComponent(n),s&&(s=decodeURIComponent(s)),n in e?Array.isArray(e[n])?e[n].push(s):e[n]=[e[n],s]:e[n]=s}return e}const kc=t=>{if(typeof t=="string")return kc(new URL(t));const{hostname:e,pathname:r,port:n,protocol:s,search:A}=t;let i;return A&&(i=OZ(A)),{hostname:e,port:n?parseInt(n):void 0,protocol:s,path:r,query:i}},uw=t=>{if(typeof t=="object"){if("url"in t){const e=kc(t.url);if(t.headers){e.headers={};for(const r in t.headers)e.headers[r.toLowerCase()]=t.headers[r].join(", ")}return e}return t}return kc(t)},TT=t=>()=>Promise.reject(t),Nh=()=>{const t=new WeakSet;return(e,r)=>{if(typeof r=="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r}},QZ=t=>new Promise(e=>setTimeout(e,t*1e3)),DZ={minDelay:2,maxDelay:120};var _t;(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(_t||(_t={}));const Hh=t=>{if(t.state===_t.ABORTED){const e=new Error(`${JSON.stringify({...t,reason:"Request was aborted"},Nh())}`);throw e.name="AbortError",e}else if(t.state===_t.TIMEOUT){const e=new Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},Nh())}`);throw e.name="TimeoutError",e}else if(t.state!==_t.SUCCESS)throw new Error(`${JSON.stringify(t,Nh())}`);return t},LZ=async({minDelay:t,maxDelay:e,maxWaitTime:r,abortController:n,client:s,abortSignal:A},i,o)=>{var B;const a={},[c,l]=[t*1e3,e*1e3];let h=0;const d=Date.now()+r*1e3,p=Date.now()+6e4;let w=!1;for(;;){if(h>0){const T=HZ(c,l,h,d);if((B=n==null?void 0:n.signal)!=null&&B.aborted||A!=null&&A.aborted){const v="AbortController signal aborted.";return a[v]|=0,a[v]+=1,{state:_t.ABORTED,observedResponses:a}}if(Date.now()+T>d)return{state:_t.TIMEOUT,observedResponses:a};await QZ(T/1e3)}const{state:C,reason:_}=await o(s,i);if(_){const T=NZ(_);a[T]|=0,a[T]+=1}if(C!==_t.RETRY)return{state:C,reason:_,final:_,observedResponses:a};h+=1,!w&&Date.now()>=p&&(MZ(a,s),w=!0)}},MZ=(t={},e)=>{var i,o,a,c,l;const r=Object.keys(t);let n=0;for(const h of r){const d=t[h]|0;h.startsWith("403:")&&(n+=d)}const s=(i=e==null?void 0:e.config)==null?void 0:i.logger,A=typeof(s==null?void 0:s.warn)=="function"&&!((c=(a=(o=s.constructor)==null?void 0:o.name)==null?void 0:a.includes)!=null&&c.call(a,"NoOpLogger"))?s:console;(n>=3||(l=r[r.length-1])!=null&&l.startsWith("403:"))&&A.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},NZ=t=>{var r,n;const e=((r=t==null?void 0:t.$response)==null?void 0:r.statusCode)??((n=t==null?void 0:t.$metadata)==null?void 0:n.httpStatusCode);return t!=null&&t.$responseBodyText?`${e?e+": ":""}Deserialization error for body: ${t.$responseBodyText}`:e?t!=null&&t.$response||t!=null&&t.message?`${e??"Unknown"}: ${t==null?void 0:t.message}`:`${e}: OK`:String((t==null?void 0:t.message)??JSON.stringify(t,Nh())??"Unknown")},HZ=(t,e,r,n)=>{const s=Math.log(e/t)/Math.log(2)+1;if(r>s)return e;const A=t*2**(r-1),i=Math.min(A,e),o=$Z(t,i);if(Date.now()+o>n){const a=n-Date.now();return Math.max(0,a-500)}return o},$Z=(t,e)=>t+Math.random()*(e-t),VZ=t=>{if(t.maxWaitTime<=0)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(t.minDelay<=0)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(t.maxDelay<=0)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(t.maxWaitTime<=t.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);if(t.maxDelay<t.minDelay)throw new Error(`WaiterConfiguration.maxDelay [${t.maxDelay}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`)},IT=t=>{let e;const r=new Promise(n=>{e=()=>n({state:_t.ABORTED}),typeof t.addEventListener=="function"?t.addEventListener("abort",e):t.onabort=e});return{clearListener(){typeof t.removeEventListener=="function"&&t.removeEventListener("abort",e)},aborted:r}},fA=async(t,e,r)=>{var i;const n={...DZ,...t};VZ(n);const s=[LZ(n,e,r)],A=[];if(t.abortSignal){const{aborted:o,clearListener:a}=IT(t.abortSignal);A.push(a),s.push(o)}if((i=t.abortController)!=null&&i.signal){const{aborted:o,clearListener:a}=IT(t.abortController.signal);A.push(a),s.push(o)}return Promise.race(s).then(o=>{for(const a of A)a();return o})};class lw{constructor(e){S(this,"config");S(this,"middlewareStack",Lh());S(this,"initConfig");S(this,"handlers");this.config=e;const{protocol:r,protocolSettings:n}=e;n&&typeof r=="function"&&(e.protocol=new r(n))}send(e,r,n){const s=typeof r!="function"?r:void 0,A=typeof r=="function"?r:n,i=s===void 0&&this.config.cacheMiddleware===!0;let o;if(i){this.handlers||(this.handlers=new WeakMap);const a=this.handlers;a.has(e.constructor)?o=a.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,s),a.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,s);if(A)o(e).then(a=>A(null,a.output),a=>A(a)).catch(()=>{});else return o(e).then(a=>a.output)}destroy(){var e,r,n;(n=(r=(e=this.config)==null?void 0:e.requestHandler)==null?void 0:r.destroy)==null||n.call(r),delete this.handlers}}const $h=t=>typeof t=="function"?t():t,xT=(t,e,r,n,s)=>({name:e,namespace:t,traits:r,input:n,output:s}),KZ=t=>(e,r)=>async n=>{var h,d,p,w;const{response:s}=await e(n),{operationSchema:A}=xs(r),[,i,o,a,c,l]=A??[];try{const B=await t.protocol.deserializeResponse(xT(i,o,a,c,l),{...t,...r},s);return{response:s,output:B}}catch(B){if(Object.defineProperty(B,"$response",{value:s,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in B)){const C="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{B.message+=`
3024
- `+C}catch{!r.logger||((d=(h=r.logger)==null?void 0:h.constructor)==null?void 0:d.name)==="NoOpLogger"?console.warn(C):(w=(p=r.logger)==null?void 0:p.warn)==null||w.call(p,C)}typeof B.$responseBodyText<"u"&&B.$response&&(B.$response.body=B.$responseBodyText);try{if(dA.isInstance(s)){const{headers:_={},statusCode:T}=s,v=Object.entries(_);B.$metadata={httpStatusCode:T,requestId:hw(/^x-[\w-]+-request-?id$/,v),extendedRequestId:hw(/^x-[\w-]+-id-2$/,v),cfId:hw(/^x-[\w-]+-cf-id$/,v)}}}catch{}}throw B}},hw=(t,e)=>(e.find(([r])=>r.match(t))||[void 0,void 0])[1],jZ=t=>(e,r)=>async n=>{const{operationSchema:s}=xs(r),[,A,i,o,a,c]=s??[],l=r.endpointV2?async()=>uw(r.endpointV2):t.endpoint,h=await t.protocol.serializeRequest(xT(A,i,o,a,c),n.input,{...t,...r,endpoint:l});return e({...n,request:h})},GZ={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},zZ={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function RT(t){return{applyToStack:e=>{e.add(jZ(t),zZ),e.add(KZ(t),GZ),t.protocol.setSerdeContext(t)}}}const dw=[];function Bo(t){if(typeof t=="object")return t;if(t=t|0,dw[t])return dw[t];const e={};let r=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>r++&1)===1&&(e[n]=1);return dw[t]=e}const Fc={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},fw=[],pw={},RA=class RA{constructor(e,r){S(this,"ref");S(this,"memberName");S(this,"symbol",RA.symbol);S(this,"name");S(this,"schema");S(this,"_isMemberSchema");S(this,"traits");S(this,"memberTraits");S(this,"normalizedTraits");this.ref=e,this.memberName=r;const n=[];let s=e,A=e;for(this._isMemberSchema=!1;gw(s);)n.push(s[1]),s=s[0],A=$h(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){const o=n[i];Object.assign(this.memberTraits,Bo(o))}}else this.memberTraits=0;if(A instanceof RA){const i=this.memberTraits;Object.assign(this,A),this.memberTraits=Object.assign({},i,A.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??A.memberName;return}if(this.schema=$h(A),qZ(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(A),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const r=this.prototype.isPrototypeOf(e);return!r&&typeof e=="object"&&e!==null?e.symbol===this.symbol:r}static of(e){const r=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(fw[e])return fw[e]}else if(typeof e=="string"){if(pw[e])return pw[e]}else if(r&&e[Fc.ns])return e[Fc.ns];const n=$h(e);if(n instanceof RA)return n;if(gw(n)){const[A,i]=n;if(A instanceof RA)return Object.assign(A.getMergedTraits(),Bo(i)),A;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const s=new RA(n);return r?e[Fc.ns]=s:typeof n=="string"?pw[n]=s:typeof n=="number"?fw[n]=s:s}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:r}=this;return!e&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const e=this.getSchema();if(typeof e!="object")return!1;const r=e[0];return r===3||r===-3||r===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Bo(this.memberTraits)}getOwnTraits(){return Bo(this.traits)}getKeySchema(){const[e,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),s=e?15:n[4]??0;return Pc([s,0],"key")}getValueSchema(){const e=this.getSchema(),[r,n,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],A=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||s)?e[3+e[0]]:r?15:void 0;if(A!=null)return Pc([A,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(e)){const n=r[4].indexOf(e),s=r[5][n];return Pc(gw(s)?s:[s,0],e)}if(this.isDocumentSchema())return Pc([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[r,n]of this.structIterator())e[r]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),r=e[4].length;let n=e[Fc.it];if(n&&r===n.length){yield*n;return}n=Array(r);for(let s=0;s<r;++s){const A=e[4][s],i=Pc([e[5][s],0],A);yield n[s]=[A,i]}e[Fc.it]=n}};S(RA,"symbol",Symbol.for("@smithy/nor"));let Oe=RA;function Pc(t,e){if(t instanceof Oe)return Object.assign(t,{memberName:e,_isMemberSchema:!0});const r=Oe;return new r(t,e)}const gw=t=>Array.isArray(t)&&t.length===2,qZ=t=>Array.isArray(t)&&t.length>=5,gs=class gs{constructor(e,r=new Map,n=new Map){S(this,"namespace");S(this,"schemas");S(this,"exceptions");this.namespace=e,this.schemas=r,this.exceptions=n}static for(e){return gs.registries.has(e)||gs.registries.set(e,new gs(e)),gs.registries.get(e)}copyFrom(e){const{schemas:r,exceptions:n}=this;for(const[s,A]of e.schemas)r.has(s)||r.set(s,A);for(const[s,A]of e.exceptions)n.has(s)||n.set(s,A)}register(e,r){const n=this.normalizeShapeId(e);for(const s of[this,gs.for(n.split("#")[0])])s.schemas.set(n,r)}getSchema(e){const r=this.normalizeShapeId(e);if(!this.schemas.has(r)){if(!e.includes("#")){const n="#"+e,s=[];for(const[A,i]of this.schemas.entries())A.endsWith(n)&&s.push(i);if(s.length===1)return s[0]}throw new Error(`@smithy/core/schema - schema not found for ${r}`)}return this.schemas.get(r)}registerError(e,r){const n=e,s=n[1];for(const A of[this,gs.for(s)])A.schemas.set(s+"#"+n[2],n),A.exceptions.set(n,r)}getErrorCtor(e){const r=e;return this.exceptions.has(r)?this.exceptions.get(r):gs.for(r[1]).exceptions.get(r)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,r,n]=e,s=r+"#"+n;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}}find(e){for(const r of this.schemas.values())if(e(r))return r}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}};S(gs,"registries",new Map);let Rs=gs;const mw="***SensitiveInformation***";function ww(t,e){if(e==null)return e;const r=Oe.of(t);if(r.getMergedTraits().sensitive)return mw;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return mw}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return mw}else if(r.isStructSchema()&&typeof e=="object"){const n=e,s={};for(const[A,i]of r.structIterator())n[A]!=null&&(s[A]=ww(i,n[A]));return s}return e}class H{constructor(){S(this,"middlewareStack",Lh());S(this,"schema")}static classBuilder(){return new WZ}resolveMiddlewareWithContext(e,r,n,{middlewareFn:s,clientName:A,commandName:i,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:l,CommandCtor:h}){for(const _ of s.bind(this)(h,e,r,n))this.middlewareStack.use(_);const d=e.concat(this.middlewareStack),{logger:p}=r,w={logger:p,clientName:A,commandName:i,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,[cw]:{commandInstance:this,...c},...l},{requestHandler:B}=r;let C=n??{};return c.eventStream&&(C={isEventStream:!0,...C}),d.resolve(_=>B.handle(_.request,C),w)}}class WZ{constructor(){S(this,"_init",()=>{});S(this,"_ep",{});S(this,"_middlewareFn",()=>[]);S(this,"_commandName","");S(this,"_clientName","");S(this,"_additionalContext",{});S(this,"_smithyContext",{});S(this,"_inputFilterSensitiveLog");S(this,"_outputFilterSensitiveLog");S(this,"_serializer",null);S(this,"_deserializer",null);S(this,"_operationSchema")}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,n={}){return this._smithyContext={service:e,operation:r,...n},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=n=>n,r=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let r;return r=class extends H{constructor(...[s]){super();S(this,"input");S(this,"serialize",e._serializer);S(this,"deserialize",e._deserializer);this.input=s??{},e._init(this),this.schema=e._operationSchema}static getEndpointParameterInstructions(){return e._ep}resolveMiddleware(s,A,i){const o=e._operationSchema,a=(o==null?void 0:o[4])??(o==null?void 0:o.input),c=(o==null?void 0:o[5])??(o==null?void 0:o.output);return this.resolveMiddlewareWithContext(s,A,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?ww.bind(null,a):l=>l),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?ww.bind(null,c):l=>l),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const JZ=(t,e,r)=>{for(const[A,i]of Object.entries(t)){const o=async function(c,l,h){const d=new i(c);if(typeof l=="function")this.send(d,l);else if(typeof h=="function"){if(typeof l!="object")throw new Error(`Expected http options but got ${typeof l}`);this.send(d,l||{},h)}else return this.send(d,l)},a=(A[0].toLowerCase()+A.slice(1)).replace(/Command$/,"");e.prototype[a]=o}const{paginators:n={},waiters:s={}}=r??{};for(const[A,i]of Object.entries(n))e.prototype[A]===void 0&&(e.prototype[A]=function(o={},a,...c){return i({...a,client:this},o,...c)});for(const[A,i]of Object.entries(s))e.prototype[A]===void 0&&(e.prototype[A]=async function(o={},a,...c){let l=a;return typeof a=="number"&&(l={maxWaitTime:a}),i({...l,client:this},o,...c)})};class di extends Error{constructor(r){super(r.message);S(this,"$fault");S(this,"$response");S(this,"$retryable");S(this,"$metadata");Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=r.name,this.$fault=r.$fault,this.$metadata=r.$metadata}static isInstance(r){if(!r)return!1;const n=r;return di.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](r){if(!r)return!1;const n=r;return this===di?di.isInstance(r):di.isInstance(r)?n.name&&this.name?this.prototype.isPrototypeOf(r)||n.name===this.name:this.prototype.isPrototypeOf(r):!1}}const UT=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,s])=>{(t[n]==null||t[n]==="")&&(t[n]=s)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},kT=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},FT=Object.values(Uc),XZ=t=>{const e=[];for(const r in Uc){const n=Uc[r];t[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}for(const[r,n]of Object.entries(t.checksumAlgorithms??{}))e.push({algorithmId:()=>r,checksumConstructor:()=>n});return{addChecksumAlgorithm(r){t.checksumAlgorithms=t.checksumAlgorithms??{};const n=r.algorithmId(),s=r.checksumConstructor();FT.includes(n)?t.checksumAlgorithms[n.toUpperCase()]=s:t.checksumAlgorithms[n]=s,e.push(r)},checksumAlgorithms(){return e}}},YZ=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{const n=r.algorithmId();FT.includes(n)&&(e[n]=r.checksumConstructor())}),e},ZZ=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),eee=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},PT=t=>Object.assign(XZ(t),ZZ(t)),OT=t=>Object.assign(YZ(t),eee(t)),QT=t=>{const e="#text";for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r][e]!==void 0?t[r]=t[r][e]:typeof t[r]=="object"&&t[r]!==null&&(t[r]=QT(t[r]));return t};class Vh{trace(){}debug(){}info(){}warn(){}error(){}}const DT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LT=Object.entries(DT).reduce((t,[e,r])=>(t[r]=Number(e),t),{}),tee=DT.split(""),Co=6,Oc=8,ree=63,Us=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;const r=new ArrayBuffer(e),n=new DataView(r);for(let s=0;s<t.length;s+=4){let A=0,i=0;for(let c=s,l=s+3;c<=l;c++)if(t[c]!=="="){if(!(t[c]in LT))throw new TypeError(`Invalid character ${t[c]} in base64 string.`);A|=LT[t[c]]<<(l-c)*Co,i+=Co}else A>>=Co;const o=s/4*3;A>>=i%Oc;const a=Math.floor(i/Oc);for(let c=0;c<a;c++){const l=(a-c-1)*Oc;n.setUint8(o+c,(A&255<<l)>>l)}}return new Uint8Array(r)},Jn=t=>new TextEncoder().encode(t);function Xn(t){let e;typeof t=="string"?e=Jn(t):e=t;const r=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let A=0;A<e.length;A+=3){let i=0,o=0;for(let c=A,l=Math.min(A+3,e.length);c<l;c++)i|=e[c]<<(l-c-1)*Oc,o+=Oc;const a=Math.ceil(o/Co);i<<=a*Co-o;for(let c=1;c<=a;c++){const l=(a-c)*Co;s+=tee[(i&ree<<l)>>l]}s+="==".slice(0,4-a)}return s}function nee(t,e,r,n){return class op extends Uint8Array{static fromString(A,i="utf-8"){if(typeof A=="string")return i==="base64"?op.mutate(n(A)):op.mutate(e(A));throw new Error(`Unsupported conversion from ${typeof A} to Uint8ArrayBlobAdapter.`)}static mutate(A){return Object.setPrototypeOf(A,op.prototype),A}transformToString(A="utf-8"){return A==="base64"?r(this):t(this)}}}const ks=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)},ir=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function see(t){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{const e=new Uint8Array(16);return t(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,ir[e[0]]+ir[e[1]]+ir[e[2]]+ir[e[3]]+"-"+ir[e[4]]+ir[e[5]]+"-"+ir[e[6]]+ir[e[7]]+"-"+ir[e[8]]+ir[e[9]]+"-"+ir[e[10]]+ir[e[11]]+ir[e[12]]+ir[e[13]]+ir[e[14]]+ir[e[15]]}}const yw=t=>{if(t!=null){if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&dee.warn(hee(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},Aee=Math.ceil(2**127*(2-2**-23)),MT=t=>{const e=yw(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>Aee)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},iee=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}},NT=t=>$T(t,16),HT=t=>$T(t,8),$T=(t,e)=>{const r=iee(t);if(r!==void 0&&oee(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},oee=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},aee=t=>yw(typeof t=="string"?Kh(t):t),cee=t=>MT(typeof t=="string"?Kh(t):t),uee=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Kh=t=>{const e=t.match(uee);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)},jh=t=>NT(typeof t=="string"?Kh(t):t),lee=t=>HT(typeof t=="string"?Kh(t):t),hee=t=>String(new TypeError(t).stack||t).split(`
3022
+ ${_}`}class pt extends Error{constructor({message:e,code:r,cause:n,name:s}){var A;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(A=s??(n instanceof Error?n.name:void 0))!==null&&A!==void 0?A:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ph extends pt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function WY({error:t,options:e}){var r,n,s;const{publicKey:A}=e;if(!A)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new pt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=A.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new pt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=A.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new pt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=A.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new pt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new pt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new pt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return A.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new pt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new pt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=window.location.hostname;if(mT(i)){if(A.rp.id!==i)return new pt({message:`The RP ID "${A.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new pt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(A.user.id.byteLength<1||A.user.id.byteLength>64)return new pt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new pt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new pt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function JY({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new pt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new pt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(mT(n)){if(r.rpId!==n)return new pt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new pt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new pt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new pt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class XY{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Aw=new XY;function dT(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=ph(t,["challenge","user","excludeCredentials"]),A=go(e).buffer,i=Object.assign(Object.assign({},r),{id:go(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:A,user:i});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const c=n[a];o.excludeCredentials[a]=Object.assign(Object.assign({},c),{id:go(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function fT(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=ph(t,["challenge","allowCredentials"]),s=go(e).buffer,A=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){A.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const o=r[i];A.allowCredentials[i]=Object.assign(Object.assign({},o),{id:go(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return A}function pT(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:ai(new Uint8Array(t.response.attestationObject)),clientDataJSON:ai(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function gT(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:ai(new Uint8Array(s.authenticatorData)),clientDataJSON:ai(new Uint8Array(s.clientDataJSON)),signature:ai(new Uint8Array(s.signature)),userHandle:s.userHandle?ai(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function mT(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Oh(){var t,e;return!!(Ar()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function wT(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",e)}:{data:null,error:new Ph("Empty credential response",e)}}catch(e){return{data:null,error:WY({error:e,options:t})}}}async function yT(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",e)}:{data:null,error:new Ph("Empty credential response",e)}}catch(e){return{data:null,error:JY({error:e,options:t})}}}const YY={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},ZY={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Qh(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const A in s){const i=s[A];if(i!==void 0)if(Array.isArray(i))n[A]=i;else if(r(i))n[A]=i;else if(e(i)){const o=n[A];e(o)?n[A]=Qh(o,i):n[A]=Qh(i)}else n[A]=i}return n}function eZ(t,e){return Qh(YY,t,e||{})}function tZ(t,e){return Qh(ZY,t,e||{})}class rZ{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},A){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:a};const c=s??Aw.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:l}=o.webauthn.credential_options.publicKey;if(!l.name){const h=n;if(h)l.name=`${l.id}:${h}`;else{const p=(await this.client.getUser()).data.user,w=((i=p==null?void 0:p.user_metadata)===null||i===void 0?void 0:i.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";l.name=`${l.id}:${w}`}}l.displayName||(l.displayName=l.name)}switch(o.webauthn.type){case"create":{const l=eZ(o.webauthn.credential_options.publicKey,A==null?void 0:A.create),{data:h,error:d}=await wT({publicKey:l,signal:c});return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}case"request":{const l=tZ(o.webauthn.credential_options.publicKey,A==null?void 0:A.request),{data:h,error:d}=await yT(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:l,signal:c}));return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}}}catch(o){return Y(o)?{data:null,error:o}:{data:null,error:new en("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},A){if(!r)return{data:null,error:new po("rpId is required for WebAuthn authentication")};try{if(!Oh())return{data:null,error:new en("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:A});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:r,rpOrigins:n,credential_response:a.credential_response}})}catch(i){return Y(i)?{data:null,error:i}:{data:null,error:new en("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},A){if(!r)return{data:null,error:new po("rpId is required for WebAuthn registration")};try{if(!Oh())return{data:null,error:new en("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(l=>{var h;return(h=l.data)===null||h===void 0?void 0:h.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===e&&d.status!=="unverified")}).then(l=>l?this.client.mfa.unenroll({factorId:l==null?void 0:l.id}):void 0),{data:null,error:o};const{data:a,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:A});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:r,rpOrigins:n,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:c}}catch(i){return Y(i)?{data:null,error:i}:{data:null,error:new en("Unexpected error in register",i)}}}}jY();const nZ={url:aY,storageKey:cY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:uY,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},wo={};class yo{get jwks(){var e,r;return(r=(e=wo[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){wo[this.storageKey]=Object.assign(Object.assign({},wo[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=wo[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){wo[this.storageKey]=Object.assign(Object.assign({},wo[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const A=Object.assign(Object.assign({},nZ),e);if(this.storageKey=A.storageKey,this.instanceID=(r=yo.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,yo.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!A.debug,typeof A.debug=="function"&&(this.logger=A.debug),this.instanceID>0&&Ar()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=A.persistSession,this.autoRefreshToken=A.autoRefreshToken,this.experimental=(n=A.experimental)!==null&&n!==void 0?n:{},this.admin=new nw({url:A.url,headers:A.headers,fetch:A.fetch,experimental:this.experimental}),this.url=A.url,this.headers=A.headers,this.fetch=AT(A.fetch),this.detectSessionInUrl=A.detectSessionInUrl,this.flowType=A.flowType,this.hasCustomAuthorizationHeader=A.hasCustomAuthorizationHeader,this.throwOnError=A.throwOnError,this.lockAcquireTimeout=A.lockAcquireTimeout,A.lock!=null&&(this.lock=A.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new rZ(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(A.storage?this.storage=A.storage:sT()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=uT(this.memoryStorage)),A.userStorage&&(this.userStorage=A.userStorage)):(this.memoryStorage={},this.storage=uT(this.memoryStorage)),Ar()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}A.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${zS}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Ar()&&(r=EY(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Ar()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:A}=await this._getSessionFromURL(r,n);if(A){if(this._debug("#_initialize()","error detecting session from URL",A),XS(A)){const a=(e=A.details)===null||e===void 0?void 0:e.code;if(a==="identity_already_exists"||a==="identity_not_found"||a==="single_identity_not_deletable")return{error:A}}return{error:A}}const{session:i,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Y(r)?this._returnResult({error:r}):this._returnResult({error:new en("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:tn}),{data:i,error:o}=A;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(A){if(Y(A))return this._returnResult({data:{user:null,session:null},error:A});throw A}}async signUp(e){var r,n,s;try{let A;if("email"in e){const{email:l,password:h,options:d}=e;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await ui(this.storage,this.storageKey)),A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:l,password:h,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:p,code_challenge_method:w},xform:tn})}else if("phone"in e){const{phone:l,password:h,options:d}=e;A=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:h,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(s=d==null?void 0:d.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:tn})}else throw new bc("You must provide either an email or phone number and a password");const{data:i,error:o}=A;if(o||!i)return await it(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:{user:null,session:null},error:A});throw A}}async signInWithPassword(e){try{let r;if("email"in e){const{email:A,password:i,options:o}=e;r=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:A,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:aT})}else if("phone"in e){const{phone:A,password:i,options:o}=e;r=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:A,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:aT})}else throw new bc("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const A=new oi;return this._returnResult({data:{user:null,session:null},error:A})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,A;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(A=e.options)===null||A===void 0?void 0:A.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,A,i,o,a,c,l,h,d;let p,w;if("message"in e)p=e.message,w=e.signature;else{const{chain:B,wallet:C,statement:_,options:T}=e;let v;if(Ar())if(typeof C=="object")v=C;else{const R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")v=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!(T!=null&&T.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=C}const k=new URL((r=T==null?void 0:T.url)!==null&&r!==void 0?r:window.location.href),L=await v.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!L||L.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const V=hT(L[0]);let x=(n=T==null?void 0:T.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!x){const R=await v.request({method:"eth_chainId"});x=GY(R)}const I={domain:k.host,address:V,statement:_,uri:k.href,version:"1",chainId:x,nonce:(s=T==null?void 0:T.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(A=T==null?void 0:T.signInWithEthereum)===null||A===void 0?void 0:A.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(o=T==null?void 0:T.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(a=T==null?void 0:T.signInWithEthereum)===null||a===void 0?void 0:a.notBefore,requestId:(c=T==null?void 0:T.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(l=T==null?void 0:T.signInWithEthereum)===null||l===void 0?void 0:l.resources};p=qY(I),w=await v.request({method:"personal_sign",params:[zY(p),V]})}try{const{data:B,error:C}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:tn});if(C)throw C;if(!B||!B.session||!B.user){const _=new oi;return this._returnResult({data:{user:null,session:null},error:_})}return B.session&&(await this._saveSession(B.session),await this._notifyAllSubscribers("SIGNED_IN",B.session)),this._returnResult({data:Object.assign({},B),error:C})}catch(B){if(Y(B))return this._returnResult({data:{user:null,session:null},error:B});throw B}}async signInWithSolana(e){var r,n,s,A,i,o,a,c,l,h,d,p;let w,B;if("message"in e)w=e.message,B=e.signature;else{const{chain:C,wallet:_,statement:T,options:v}=e;let k;if(Ar())if(typeof _=="object")k=_;else{const V=window;if("solana"in V&&typeof V.solana=="object"&&("signIn"in V.solana&&typeof V.solana.signIn=="function"||"signMessage"in V.solana&&typeof V.solana.signMessage=="function"))k=V.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof _!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=_}const L=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in k&&k.signIn){const V=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),T?{statement:T}:null));let x;if(Array.isArray(V)&&V[0]&&typeof V[0]=="object")x=V[0];else if(V&&typeof V=="object"&&"signedMessage"in V&&"signature"in V)x=V;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in x&&"signature"in x&&(typeof x.signedMessage=="string"||x.signedMessage instanceof Uint8Array)&&x.signature instanceof Uint8Array)w=typeof x.signedMessage=="string"?x.signedMessage:new TextDecoder().decode(x.signedMessage),B=x.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${L.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...T?["",T,""]:[""],"Version: 1",`URI: ${L.href}`,`Issued At: ${(s=(n=v==null?void 0:v.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((A=v==null?void 0:v.signInWithSolana)===null||A===void 0)&&A.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((a=v==null?void 0:v.signInWithSolana)===null||a===void 0)&&a.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((c=v==null?void 0:v.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((h=(l=v==null?void 0:v.signInWithSolana)===null||l===void 0?void 0:l.resources)===null||h===void 0)&&h.length?["Resources",...v.signInWithSolana.resources.map(x=>`- ${x}`)]:[]].join(`
3023
+ `);const V=await k.signMessage(new TextEncoder().encode(w),"utf8");if(!V||!(V instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");B=V}}try{const{data:C,error:_}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:ai(B)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:tn});if(_)throw _;if(!C||!C.session||!C.user){const T=new oi;return this._returnResult({data:{user:null,session:null},error:T})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:_})}catch(C){if(Y(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(e){const r=await bn(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new YS;const{data:A,error:i}=await re(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:tn});if(await it(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!A||!A.session||!A.user){const o=new oi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",A.session)),this._returnResult({data:Object.assign(Object.assign({},A),{redirectType:s??null}),error:i})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:{user:null,session:null,redirectType:null},error:A});throw A}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:A,nonce:i}=e,o=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:A,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:tn}),{data:a,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a||!a.session||!a.user){const l=new oi;return this._returnResult({data:{user:null,session:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:c})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,A,i;try{if("email"in e){const{email:o,options:a}=e;let c=null,l=null;this.flowType==="pkce"&&([c,l]=await ui(this.storage,this.storageKey));const{error:h}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=a==null?void 0:a.data)!==null&&r!==void 0?r:{},create_user:(n=a==null?void 0:a.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:o,options:a}=e,{data:c,error:l}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=a==null?void 0:a.data)!==null&&s!==void 0?s:{},create_user:(A=a==null?void 0:a.shouldCreateUser)!==null&&A!==void 0?A:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},channel:(i=a==null?void 0:a.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:l})}throw new bc("You must provide either an email or phone number.")}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var r,n;try{let s,A;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,A=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:o}=await re(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:A}}),redirectTo:s,xform:tn});if(o)throw o;if(!i)throw new Error("An error occurred on token verification.");const a=i.session,c=i.user;return a!=null&&a.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(s){if(Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,A,i;try{let o=null,a=null;this.flowType==="pkce"&&([o,a]=await ui(this.storage,this.storageKey));const c=await re(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:MY});return!((A=c.data)===null||A===void 0)&&A.url&&Ar()&&!(!((i=e.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Et;const{error:s}=await re(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:A}=e;let i=null,o=null;this.flowType==="pkce"&&([i,o]=await ui(this.storage,this.storageKey));const{error:a}=await re(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:A==null?void 0:A.emailRedirectTo});return a&&await it(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:n,type:s,options:A}=e,{data:i,error:o}=await re(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:o})}throw new bc("You must provide either an email or phone number and a type")}catch(r){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await bn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Jm:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const i=await bn(this.userStorage,this.storageKey+"-user");i!=null&&i.user?e.user=i.user:e.user=rw()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};e.user=OY(e.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:A}=await this._callRefreshToken(e.refresh_token);if(A){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const o=await bn(this.storage,this.storageKey);if(o&&o.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:A})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:lA}):await this._useSession(async r=>{var n,s,A;const{data:i,error:o}=r;if(o)throw o;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Et}:await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(A=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&A!==void 0?A:void 0,xform:lA})})}catch(r){if(Y(r))return _c(r)&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r)):await this._updateUser(e,r)}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:A}=n;if(A)throw A;if(!s.session)throw new Et;const i=s.session;let o=null,a=null;this.flowType==="pkce"&&e.email!=null&&([o,a]=await ui(this.storage,this.storageKey));const{data:c,error:l}=await re(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:lA});if(l)throw l;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Et;const r=Date.now()/1e3;let n=r,s=!0,A=null;const{payload:i}=kh(e.access_token);if(i.exp&&(n=i.exp,s=n<=r),s){const{data:o,error:a}=await this._callRefreshToken(e.refresh_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o)return{data:{user:null,session:null},error:null};A=o}else{const{data:o,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});A={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(A),await this._notifyAllSubscribers("SIGNED_IN",A)}return this._returnResult({data:{user:A.user,session:A},error:null})}catch(r){if(Y(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:i,error:o}=r;if(o)throw o;e=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Et;const{data:s,error:A}=await this._callRefreshToken(e.refresh_token);return A?this._returnResult({data:{user:null,session:null},error:A}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!Ar())throw new vc("No browser detected.");if(e.error||e.error_description||e.error_code)throw new vc(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Ym("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new vc("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Ym("No code detected.");const{data:v,error:k}=await this._exchangeCodeForSession(e.code);if(k)throw k;const L=new URL(window.location.href);return L.searchParams.delete("code"),window.history.replaceState(window.history.state,"",L.toString()),{data:{session:v.session,redirectType:(n=v.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:A,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:l}=e;if(!i||!a||!o||!l)throw new vc("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(a);let p=h+d;c&&(p=parseInt(c));const w=p-h;w*1e3<=Ts&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${d}s`);const B=p-d;h-B>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",B,p,h):h-B<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",B,p,h);const{data:C,error:_}=await this._getUser(i);if(_)throw _;const T={provider_token:s,provider_refresh_token:A,access_token:i,expires_in:d,expires_at:p,refresh_token:o,token_type:l,user:C.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:T,redirectType:e.type},error:null})}catch(s){if(Y(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const r=await bn(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:A}=r;if(A&&!_c(A))return this._returnResult({error:A});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:o}=await this.admin.signOut(i,e);if(o&&!(JS(o)&&(o.status===404||o.status===401||o.status===403)||_c(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await it(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=CY(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:A},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",A)),this._debug("INITIAL_SESSION","callback id",e,"session",A)}catch(A){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",A),_c(A)?console.warn(A):console.error(A)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ui(this.storage,this.storageKey,!0));try{return await re(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(A){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(A))return this._returnResult({data:null,error:A});throw A}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async A=>{var i,o,a,c,l;const{data:h,error:d}=A;if(d)throw d;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:!0});return await re(this.fetch,"GET",p,{headers:this.headers,jwt:(l=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(s)throw s;return Ar()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Y(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:A}}=r;if(s)throw s;const{options:i,provider:o,token:a,access_token:c,nonce:l}=e,h=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=A==null?void 0:A.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:a,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:tn}),{data:d,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new oi}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:p}))}catch(s){if(await it(this.storage,`${this.storageKey}-code-verifier`),Y(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:A,error:i}=r;if(i)throw i;return await re(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=A.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await vY(async s=>(s>0&&await bY(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await re(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:tn})),(s,A)=>{const i=200*Math.pow(2,s);return A&&Zm(A)&&Date.now()+i-n<Ts})}catch(n){if(this._debug(r,"error",n),Y(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Ar()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await bn(this.storage,this.storageKey);if(s&&this.userStorage){let i=await bn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await mo(this.userStorage,this.storageKey+"-user",i)),s.user=(e=i==null?void 0:i.user)!==null&&e!==void 0?e:rw()}else if(s&&!s.user&&!s.user){const i=await bn(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await it(this.storage,this.storageKey+"-user"),await mo(this.storage,this.storageKey,s)):s.user=rw()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const A=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Jm;if(this._debug(n,`session has${A?"":" not"} expired with margin of ${Jm}s`),A){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(ZS(i)?this._debug(n,"refresh discarded by commit guard",i):this._debug(n,"refresh failed",i))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:o}=await this._getUser(s.access_token);!o&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Et;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new Uh;const A=await bn(this.storage,this.storageKey),{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Et;const a=await bn(this.storage,this.storageKey);if(A!==null&&(a===null||a.refresh_token!==A.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:a?"replaced":"cleared"});const d={data:null,error:new ew};return this.refreshingDeferred.resolve(d),d}const l=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==l){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await it(this.storage,this.storageKey),this.userStorage&&await it(this.userStorage,this.storageKey+"-user");const d={data:null,error:new ew};return this.refreshingDeferred.resolve(d),d}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const h={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(h),h}catch(A){if(this._debug(s,"error",A),Y(A)){const i={data:null,error:A};if(!Zm(A)){const o=await bn(this.storage,this.storageKey);!!(o!=null&&o.expires_at&&o.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:i,expiresAt:Date.now()+oY},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(A),A}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const A=[],i=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,r)}catch(a){A.push(a)}});if(await Promise.all(i),A.length>0){for(let o=0;o<A.length;o+=1)console.error(A[o]);throw A[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await it(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await mo(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const A=iT(s);await mo(this.storage,this.storageKey,A)}else{const s=iT(r);await mo(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await it(this.storage,this.storageKey),await it(this.storage,this.storageKey+"-code-verifier"),await it(this.storage,this.storageKey+"-user"),this.userStorage&&await it(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Ar()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Ts);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Ts);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ts}ms, refresh threshold is ${Ec} ticks`),s<=Ec&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof Tc)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Ts);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ts}ms, refresh threshold is ${Ec} ticks`),s<=Ec&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ar()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[A,i]=await ui(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(A)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(o.toString())}if(n!=null&&n.queryParams){const A=new URLSearchParams(n.queryParams);s.push(A.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:A}=r;return A?this._returnResult({data:null,error:A}):await re(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:A,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:a,error:c}=await re(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=A==null?void 0:A.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&a.type==="totp"&&(!((s=a==null?void 0:a.totp)===null||s===void 0)&&s.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:A,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?pT(e.webauthn.credential_response):gT(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:c}=await re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=A==null?void 0:A.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:c}))})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:A,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(s=A==null?void 0:A.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:dT(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:fT(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const A of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(A),A.status==="verified"&&s[A.factor_type].push(A);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,s,A;if(e)try{const{payload:p}=kh(e);let w=null;p.aal&&(w=p.aal);let B=w;const{data:{user:C},error:_}=await this.getUser(e);if(_)return this._returnResult({data:null,error:_});((n=(r=C==null?void 0:C.factors)===null||r===void 0?void 0:r.filter(k=>k.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(B="aal2");const v=p.amr||[];return{data:{currentLevel:w,nextLevel:B,currentAuthenticationMethods:v},error:null}}catch(p){if(Y(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=kh(i.access_token);let c=null;a.aal&&(c=a.aal);let l=c;((A=(s=i.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&A!==void 0?A:[]).length>0&&(l="aal2");const d=a.amr||[];return{data:{currentLevel:c,nextLevel:l,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await re(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:A=>({data:A,error:null})}):this._returnResult({data:null,error:new Et})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:A}=n;if(A)return this._returnResult({data:null,error:A});if(!s)return this._returnResult({data:null,error:new Et});const i=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Ar()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:A}=n;if(A)return this._returnResult({data:null,error:A});if(!s)return this._returnResult({data:null,error:new Et});const i=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Ar()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await re(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Et})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await re(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Et})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(o=>o.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+hY>s)return n;const{data:A,error:i}=await re(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!A.keys||A.keys.length===0||(this.jwks=A,this.jwks_cached_at=s,n=A.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:p,error:w}=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});n=p.session.access_token}const{header:s,payload:A,signature:i,raw:{header:o,payload:a}}=kh(n);if(!(r!=null&&r.allowExpired))try{kY(A.exp)}catch(p){throw new Sc(p instanceof Error?p.message:"JWT validation failed")}const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:A,header:s,signature:i},error:null}}const l=FY(s.alg),h=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!await crypto.subtle.verify(l,h,i,yY(`${o}.${a}`)))throw new Sc("Invalid JWT signature");return{data:{claims:A,header:s,signature:i},error:null}}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,s;vn(this.experimental);try{if(!Oh())return this._returnResult({data:null,error:new en("Browser does not support WebAuthn",null)});const{data:A,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(i||!A)return this._returnResult({data:null,error:i});const o=fT(A.options),a=(s=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:Aw.createNewAbortSignal(),{data:c,error:l}=await yT({publicKey:o,signal:a});if(l||!c)return this._returnResult({data:null,error:l??new en("WebAuthn ceremony failed",null)});const h=gT(c);return this._verifyPasskeyAuthentication({challengeId:A.challenge_id,credential:h})}catch(A){if(Y(A))return this._returnResult({data:null,error:A});throw A}}async registerPasskey(e){var r,n;vn(this.experimental);try{if(!Oh())return this._returnResult({data:null,error:new en("Browser does not support WebAuthn",null)});const{data:s,error:A}=await this._startPasskeyRegistration();if(A||!s)return this._returnResult({data:null,error:A});const i=dT(s.options),o=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:Aw.createNewAbortSignal(),{data:a,error:c}=await wT({publicKey:i,signal:o});if(c||!a)return this._returnResult({data:null,error:c??new en("WebAuthn ceremony failed",null)});const l=pT(a);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:l})}catch(s){if(Y(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){vn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Et});const{data:s,error:A}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return A?this._returnResult({data:null,error:A}):this._returnResult({data:s,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{data:A,error:i}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:A,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;vn(this.experimental);try{const{data:n,error:s}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){vn(this.experimental);try{const{data:r,error:n}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:tn});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){vn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Et});const{data:s,error:A}=await re(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})});return A?this._returnResult({data:null,error:A}):this._returnResult({data:s,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{data:A,error:i}=await re(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:A,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){vn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Et});const{error:A}=await re(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return A?this._returnResult({data:null,error:A}):this._returnResult({data:null,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}}yo.nextInstanceID={};const sZ=nw,BT=yo,AZ="2.108.2";let Ic="",Dh;if(typeof Deno<"u"){var iw;Ic="deno",Dh=(iw=Deno.version)===null||iw===void 0?void 0:iw.deno}else if(typeof document<"u")Ic="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Ic="react-native";else{var ow;Ic="node",Dh=typeof process<"u"?(ow=process.version)===null||ow===void 0?void 0:ow.replace(/^v/,""):void 0}const CT=[`runtime=${Ic}`];Dh&&CT.push(`runtime-version=${Dh}`);const iZ={headers:{"X-Client-Info":`supabase-js/${AZ}; ${CT.join("; ")}`}},oZ={schema:"public"},aZ={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},cZ={},uZ={enabled:!1,respectSamplingDecision:!0};function lZ(t,e,r,n){function s(A){return A instanceof r?A:new r(function(i){i(A)})}return new(r||(r=Promise))(function(A,i){function o(l){try{c(n.next(l))}catch(h){i(h)}}function a(l){try{c(n.throw(l))}catch(h){i(h)}}function c(l){l.done?A(l.value):s(l.value).then(o,a)}c((n=n.apply(t,[])).next())})}let aw=null;const hZ="@opentelemetry/api";function dZ(){return aw===null&&(aw=import(hZ).catch(()=>null)),aw}function fZ(){return lZ(this,void 0,void 0,function*(){try{const t=yield dZ();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function pZ(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,s,A]=e;if(r.length!==2||n.length!==32||s.length!==16||A.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(r)||!i.test(n)||!i.test(s)||!i.test(A)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:A,isSampled:(parseInt(A,16)&1)===1}}function gZ(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(mZ(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function mZ(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function wZ(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function xc(t){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xc(t)}function yZ(t,e){if(xc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BZ(t){var e=yZ(t,"string");return xc(e)=="symbol"?e:e+""}function CZ(t,e,r){return(e=BZ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ET(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Ze(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ET(Object(r),!0).forEach(function(n){CZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ET(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const EZ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_Z=()=>Headers,bZ=(t,e,r,n,s)=>{const A=EZ(n),i=_Z(),o=(s==null?void 0:s.enabled)===!0,a=(s==null?void 0:s.respectSamplingDecision)!==!1,c=o?wZ(e):null;return async(l,h)=>{var d;const p=(d=await r())!==null&&d!==void 0?d:t;let w=new i(h==null?void 0:h.headers);if(w.has("apikey")||w.set("apikey",t),w.has("Authorization")||w.set("Authorization",`Bearer ${p}`),c){const B=await vZ(l,c,a);B&&(B.traceparent&&!w.has("traceparent")&&w.set("traceparent",B.traceparent),B.tracestate&&!w.has("tracestate")&&w.set("tracestate",B.tracestate),B.baggage&&!w.has("baggage")&&w.set("baggage",B.baggage))}return A(l,Ze(Ze({},h),{},{headers:w}))}};async function vZ(t,e,r){if(!gZ(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await fZ();if(!n||!n.traceparent)return null;if(r){const s=pZ(n.traceparent);if(s&&!s.isSampled)return null}return n}function _T(t){return typeof t=="boolean"?{enabled:t}:t}function SZ(t){return t.endsWith("/")?t:t+"/"}function TZ(t,e){var r,n,s,A,i,o;const{db:a,auth:c,realtime:l,global:h}=t,{db:d,auth:p,realtime:w,global:B}=e,C=_T(t.tracePropagation),_=_T(e.tracePropagation),T={db:Ze(Ze({},d),a),auth:Ze(Ze({},p),c),realtime:Ze(Ze({},w),l),storage:{},global:Ze(Ze(Ze({},B),h),{},{headers:Ze(Ze({},(r=B==null?void 0:B.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(A=C==null?void 0:C.enabled)!==null&&A!==void 0?A:_==null?void 0:_.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(i=(o=C==null?void 0:C.respectSamplingDecision)!==null&&o!==void 0?o:_==null?void 0:_.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return t.accessToken?T.accessToken=t.accessToken:delete T.accessToken,T}function IZ(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(SZ(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var xZ=class extends BT{constructor(t){super(t)}},bT=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const A=IZ(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",A),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",A),this.storageUrl=new URL("storage/v1",A),this.functionsUrl=new URL("functions/v1",A);const i=`sb-${A.hostname.split(".")[0]}-auth-token`,o={db:oZ,realtime:cZ,auth:Ze(Ze({},aZ),{},{storageKey:i}),global:iZ,tracePropagation:uZ},a=TZ(r??{},o);if(this.settings=a,this.storageKey=(n=a.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=a.global.headers)!==null&&s!==void 0?s:{},a.accessToken)this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(l,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=a.auth)!==null&&c!==void 0?c:{},this.headers,a.global.fetch)}this.fetch=bZ(e,t,this._getAccessToken.bind(this),a.global.fetch,a.tracePropagation),this.realtime=this._initRealtimeClient(Ze({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(l=>this.realtime.setAuth(l)).catch(l=>console.warn("Failed to set initial Realtime auth token:",l)),this.rest=new XJ(new URL("rest/v1",A).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new iY(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new $J(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:A,flowType:i,lock:o,debug:a,throwOnError:c,experimental:l,lockAcquireTimeout:h,skipAutoInitialize:d},p,w){const B={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new xZ({url:this.authUrl.href,headers:Ze(Ze({},B),p),storageKey:A,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:o,debug:a,throwOnError:c,experimental:l,fetch:w,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(C=>C.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new MS(this.realtimeUrl.href,Ze(Ze({},t),{},{params:Ze(Ze({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const RZ=(t,e,r)=>new bT(t,e,r);function UZ(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}UZ()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const kZ=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:sZ,AuthApiError:WS,AuthClient:BT,AuthError:po,AuthImplicitGrantRedirectError:vc,AuthInvalidCredentialsError:bc,AuthInvalidJwtError:Sc,AuthInvalidTokenResponseError:oi,AuthPKCECodeVerifierMissingError:YS,AuthPKCEGrantCodeExchangeError:Ym,AuthRefreshDiscardedError:ew,AuthRetryableFetchError:xh,AuthSessionMissingError:Et,AuthUnknownError:en,AuthWeakPasswordError:tw,CustomAuthError:_n,get FunctionRegion(){return wh},FunctionsError:mh,FunctionsFetchError:ES,FunctionsHttpError:Mm,FunctionsRelayError:Lm,GoTrueAdminApi:nw,GoTrueClient:yo,NavigatorLockAcquireTimeoutError:sw,PostgrestError:Nm,REALTIME_CHANNEL_STATES:bX,get REALTIME_LISTEN_TYPES(){return ii},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return Gm},get REALTIME_PRESENCE_LISTEN_EVENTS(){return jm},get REALTIME_SUBSCRIBE_STATES(){return Wn},RealtimeChannel:lo,RealtimeClient:MS,RealtimePresence:DS,SIGN_OUT_SCOPES:Fh,StorageApiError:Th,SupabaseClient:bT,WebSocketFactory:xS,createClient:RZ,isAuthApiError:JS,isAuthError:Y,isAuthImplicitGrantRedirectError:XS,isAuthPKCECodeVerifierMissingError:dY,isAuthRefreshDiscardedError:ZS,isAuthRetryableFetchError:Zm,isAuthSessionMissingError:_c,isAuthWeakPasswordError:fY,lockInternals:Sn,navigatorLock:VY,processLock:KY},Symbol.toStringTag,{value:"Module"}));function FZ(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}const PZ=t=>(t==null?void 0:t.body)instanceof ReadableStream,hi=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const n of e)r.push(n);return r},hA=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Lh=()=>{let t=[],e=[],r=!1;const n=new Set,s=h=>h.sort((d,p)=>vT[p.step]-vT[d.step]||ST[p.priority||"normal"]-ST[d.priority||"normal"]),A=h=>{let d=!1;const p=w=>{const B=hi(w.name,w.aliases);if(B.includes(h)){d=!0;for(const C of B)n.delete(C);return!1}return!0};return t=t.filter(p),e=e.filter(p),d},i=h=>{let d=!1;const p=w=>{if(w.middleware===h){d=!0;for(const B of hi(w.name,w.aliases))n.delete(B);return!1}return!0};return t=t.filter(p),e=e.filter(p),d},o=h=>{var d;return t.forEach(p=>{h.add(p.middleware,{...p})}),e.forEach(p=>{h.addRelativeTo(p.middleware,{...p})}),(d=h.identifyOnResolve)==null||d.call(h,l.identifyOnResolve()),h},a=h=>{const d=[];return h.before.forEach(p=>{p.before.length===0&&p.after.length===0?d.push(p):d.push(...a(p))}),d.push(h),h.after.reverse().forEach(p=>{p.before.length===0&&p.after.length===0?d.push(p):d.push(...a(p))}),d},c=(h=!1)=>{const d=[],p=[],w={};return t.forEach(C=>{const _={...C,before:[],after:[]};for(const T of hi(_.name,_.aliases))w[T]=_;d.push(_)}),e.forEach(C=>{const _={...C,before:[],after:[]};for(const T of hi(_.name,_.aliases))w[T]=_;p.push(_)}),p.forEach(C=>{if(C.toMiddleware){const _=w[C.toMiddleware];if(_===void 0){if(h)return;throw new Error(`${C.toMiddleware} is not found when adding ${hA(C.name,C.aliases)} middleware ${C.relation} ${C.toMiddleware}`)}C.relation==="after"&&_.after.push(C),C.relation==="before"&&_.before.push(C)}}),s(d).map(a).reduce((C,_)=>(C.push(..._),C),[])},l={add:(h,d={})=>{const{name:p,override:w,aliases:B}=d,C={step:"initialize",priority:"normal",middleware:h,...d},_=hi(p,B);if(_.length>0){if(_.some(T=>n.has(T))){if(!w)throw new Error(`Duplicate middleware name '${hA(p,B)}'`);for(const T of _){const v=t.findIndex(L=>{var V;return L.name===T||((V=L.aliases)==null?void 0:V.some(x=>x===T))});if(v===-1)continue;const k=t[v];if(k.step!==C.step||C.priority!==k.priority)throw new Error(`"${hA(k.name,k.aliases)}" middleware with ${k.priority} priority in ${k.step} step cannot be overridden by "${hA(p,B)}" middleware with ${C.priority} priority in ${C.step} step.`);t.splice(v,1)}}for(const T of _)n.add(T)}t.push(C)},addRelativeTo:(h,d)=>{const{name:p,override:w,aliases:B}=d,C={middleware:h,...d},_=hi(p,B);if(_.length>0){if(_.some(T=>n.has(T))){if(!w)throw new Error(`Duplicate middleware name '${hA(p,B)}'`);for(const T of _){const v=e.findIndex(L=>{var V;return L.name===T||((V=L.aliases)==null?void 0:V.some(x=>x===T))});if(v===-1)continue;const k=e[v];if(k.toMiddleware!==C.toMiddleware||k.relation!==C.relation)throw new Error(`"${hA(k.name,k.aliases)}" middleware ${k.relation} "${k.toMiddleware}" middleware cannot be overridden by "${hA(p,B)}" middleware ${C.relation} "${C.toMiddleware}" middleware.`);e.splice(v,1)}}for(const T of _)n.add(T)}e.push(C)},clone:()=>o(Lh()),use:h=>{h.applyToStack(l)},remove:h=>typeof h=="string"?A(h):i(h),removeByTag:h=>{let d=!1;const p=w=>{const{tags:B,name:C,aliases:_}=w;if(B&&B.includes(h)){const T=hi(C,_);for(const v of T)n.delete(v);return d=!0,!1}return!0};return t=t.filter(p),e=e.filter(p),d},concat:h=>{var p;const d=o(Lh());return d.use(h),d.identifyOnResolve(r||d.identifyOnResolve()||(((p=h.identifyOnResolve)==null?void 0:p.call(h))??!1)),d},applyToStack:o,identify:()=>c(!0).map(h=>{const d=h.step??h.relation+" "+h.toMiddleware;return hA(h.name,h.aliases)+" - "+d}),identifyOnResolve(h){return typeof h=="boolean"&&(r=h),r},resolve:(h,d)=>{for(const p of c().map(w=>w.middleware).reverse())h=p(h,d);return r&&console.log(l.identify()),h}};return l},vT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ST={high:3,normal:2,low:1};var Rc;(function(t){t.HTTP="http",t.HTTPS="https"})(Rc||(Rc={}));var Uc;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Uc||(Uc={}));const cw="__smithy_context",xs=t=>t[cw]||(t[cw]={});class ot{constructor(e){S(this,"method");S(this,"protocol");S(this,"hostname");S(this,"port");S(this,"path");S(this,"query");S(this,"headers");S(this,"username");S(this,"password");S(this,"fragment");S(this,"body");this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const r=new ot({...e,headers:{...e.headers}});return r.query&&(r.query=OZ(r.query)),r}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return ot.clone(this)}}function OZ(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}class dA{constructor(e){S(this,"statusCode");S(this,"reason");S(this,"headers");S(this,"body");this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const QZ=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Mh=(t,e=!1)=>{if(!e)return QZ.test(t);const r=t.split(".");for(const n of r)if(!Mh(n))return!1;return!0},Kr=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e};function DZ(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[n,s=null]=r.split("=");n=decodeURIComponent(n),s&&(s=decodeURIComponent(s)),n in e?Array.isArray(e[n])?e[n].push(s):e[n]=[e[n],s]:e[n]=s}return e}const kc=t=>{if(typeof t=="string")return kc(new URL(t));const{hostname:e,pathname:r,port:n,protocol:s,search:A}=t;let i;return A&&(i=DZ(A)),{hostname:e,port:n?parseInt(n):void 0,protocol:s,path:r,query:i}},uw=t=>{if(typeof t=="object"){if("url"in t){const e=kc(t.url);if(t.headers){e.headers={};for(const r in t.headers)e.headers[r.toLowerCase()]=t.headers[r].join(", ")}return e}return t}return kc(t)},TT=t=>()=>Promise.reject(t),Nh=()=>{const t=new WeakSet;return(e,r)=>{if(typeof r=="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r}},LZ=t=>new Promise(e=>setTimeout(e,t*1e3)),MZ={minDelay:2,maxDelay:120};var _t;(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(_t||(_t={}));const Hh=t=>{if(t.state===_t.ABORTED){const e=new Error(`${JSON.stringify({...t,reason:"Request was aborted"},Nh())}`);throw e.name="AbortError",e}else if(t.state===_t.TIMEOUT){const e=new Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},Nh())}`);throw e.name="TimeoutError",e}else if(t.state!==_t.SUCCESS)throw new Error(`${JSON.stringify(t,Nh())}`);return t},NZ=async({minDelay:t,maxDelay:e,maxWaitTime:r,abortController:n,client:s,abortSignal:A},i,o)=>{var B;const a={},[c,l]=[t*1e3,e*1e3];let h=0;const d=Date.now()+r*1e3,p=Date.now()+6e4;let w=!1;for(;;){if(h>0){const T=VZ(c,l,h,d);if((B=n==null?void 0:n.signal)!=null&&B.aborted||A!=null&&A.aborted){const v="AbortController signal aborted.";return a[v]|=0,a[v]+=1,{state:_t.ABORTED,observedResponses:a}}if(Date.now()+T>d)return{state:_t.TIMEOUT,observedResponses:a};await LZ(T/1e3)}const{state:C,reason:_}=await o(s,i);if(_){const T=$Z(_);a[T]|=0,a[T]+=1}if(C!==_t.RETRY)return{state:C,reason:_,final:_,observedResponses:a};h+=1,!w&&Date.now()>=p&&(HZ(a,s),w=!0)}},HZ=(t={},e)=>{var i,o,a,c,l;const r=Object.keys(t);let n=0;for(const h of r){const d=t[h]|0;h.startsWith("403:")&&(n+=d)}const s=(i=e==null?void 0:e.config)==null?void 0:i.logger,A=typeof(s==null?void 0:s.warn)=="function"&&!((c=(a=(o=s.constructor)==null?void 0:o.name)==null?void 0:a.includes)!=null&&c.call(a,"NoOpLogger"))?s:console;(n>=3||(l=r[r.length-1])!=null&&l.startsWith("403:"))&&A.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},$Z=t=>{var r,n;const e=((r=t==null?void 0:t.$response)==null?void 0:r.statusCode)??((n=t==null?void 0:t.$metadata)==null?void 0:n.httpStatusCode);return t!=null&&t.$responseBodyText?`${e?e+": ":""}Deserialization error for body: ${t.$responseBodyText}`:e?t!=null&&t.$response||t!=null&&t.message?`${e??"Unknown"}: ${t==null?void 0:t.message}`:`${e}: OK`:String((t==null?void 0:t.message)??JSON.stringify(t,Nh())??"Unknown")},VZ=(t,e,r,n)=>{const s=Math.log(e/t)/Math.log(2)+1;if(r>s)return e;const A=t*2**(r-1),i=Math.min(A,e),o=KZ(t,i);if(Date.now()+o>n){const a=n-Date.now();return Math.max(0,a-500)}return o},KZ=(t,e)=>t+Math.random()*(e-t),jZ=t=>{if(t.maxWaitTime<=0)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(t.minDelay<=0)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(t.maxDelay<=0)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(t.maxWaitTime<=t.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);if(t.maxDelay<t.minDelay)throw new Error(`WaiterConfiguration.maxDelay [${t.maxDelay}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`)},IT=t=>{let e;const r=new Promise(n=>{e=()=>n({state:_t.ABORTED}),typeof t.addEventListener=="function"?t.addEventListener("abort",e):t.onabort=e});return{clearListener(){typeof t.removeEventListener=="function"&&t.removeEventListener("abort",e)},aborted:r}},fA=async(t,e,r)=>{var i;const n={...MZ,...t};jZ(n);const s=[NZ(n,e,r)],A=[];if(t.abortSignal){const{aborted:o,clearListener:a}=IT(t.abortSignal);A.push(a),s.push(o)}if((i=t.abortController)!=null&&i.signal){const{aborted:o,clearListener:a}=IT(t.abortController.signal);A.push(a),s.push(o)}return Promise.race(s).then(o=>{for(const a of A)a();return o})};class lw{constructor(e){S(this,"config");S(this,"middlewareStack",Lh());S(this,"initConfig");S(this,"handlers");this.config=e;const{protocol:r,protocolSettings:n}=e;n&&typeof r=="function"&&(e.protocol=new r(n))}send(e,r,n){const s=typeof r!="function"?r:void 0,A=typeof r=="function"?r:n,i=s===void 0&&this.config.cacheMiddleware===!0;let o;if(i){this.handlers||(this.handlers=new WeakMap);const a=this.handlers;a.has(e.constructor)?o=a.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,s),a.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,s);if(A)o(e).then(a=>A(null,a.output),a=>A(a)).catch(()=>{});else return o(e).then(a=>a.output)}destroy(){var e,r,n;(n=(r=(e=this.config)==null?void 0:e.requestHandler)==null?void 0:r.destroy)==null||n.call(r),delete this.handlers}}const $h=t=>typeof t=="function"?t():t,xT=(t,e,r,n,s)=>({name:e,namespace:t,traits:r,input:n,output:s}),GZ=t=>(e,r)=>async n=>{var h,d,p,w;const{response:s}=await e(n),{operationSchema:A}=xs(r),[,i,o,a,c,l]=A??[];try{const B=await t.protocol.deserializeResponse(xT(i,o,a,c,l),{...t,...r},s);return{response:s,output:B}}catch(B){if(Object.defineProperty(B,"$response",{value:s,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in B)){const C="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{B.message+=`
3024
+ `+C}catch{!r.logger||((d=(h=r.logger)==null?void 0:h.constructor)==null?void 0:d.name)==="NoOpLogger"?console.warn(C):(w=(p=r.logger)==null?void 0:p.warn)==null||w.call(p,C)}typeof B.$responseBodyText<"u"&&B.$response&&(B.$response.body=B.$responseBodyText);try{if(dA.isInstance(s)){const{headers:_={},statusCode:T}=s,v=Object.entries(_);B.$metadata={httpStatusCode:T,requestId:hw(/^x-[\w-]+-request-?id$/,v),extendedRequestId:hw(/^x-[\w-]+-id-2$/,v),cfId:hw(/^x-[\w-]+-cf-id$/,v)}}}catch{}}throw B}},hw=(t,e)=>(e.find(([r])=>r.match(t))||[void 0,void 0])[1],zZ=t=>(e,r)=>async n=>{const{operationSchema:s}=xs(r),[,A,i,o,a,c]=s??[],l=r.endpointV2?async()=>uw(r.endpointV2):t.endpoint,h=await t.protocol.serializeRequest(xT(A,i,o,a,c),n.input,{...t,...r,endpoint:l});return e({...n,request:h})},qZ={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},WZ={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function RT(t){return{applyToStack:e=>{e.add(zZ(t),WZ),e.add(GZ(t),qZ),t.protocol.setSerdeContext(t)}}}const dw=[];function Bo(t){if(typeof t=="object")return t;if(t=t|0,dw[t])return dw[t];const e={};let r=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>r++&1)===1&&(e[n]=1);return dw[t]=e}const Fc={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},fw=[],pw={},RA=class RA{constructor(e,r){S(this,"ref");S(this,"memberName");S(this,"symbol",RA.symbol);S(this,"name");S(this,"schema");S(this,"_isMemberSchema");S(this,"traits");S(this,"memberTraits");S(this,"normalizedTraits");this.ref=e,this.memberName=r;const n=[];let s=e,A=e;for(this._isMemberSchema=!1;gw(s);)n.push(s[1]),s=s[0],A=$h(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){const o=n[i];Object.assign(this.memberTraits,Bo(o))}}else this.memberTraits=0;if(A instanceof RA){const i=this.memberTraits;Object.assign(this,A),this.memberTraits=Object.assign({},i,A.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??A.memberName;return}if(this.schema=$h(A),JZ(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(A),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const r=this.prototype.isPrototypeOf(e);return!r&&typeof e=="object"&&e!==null?e.symbol===this.symbol:r}static of(e){const r=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(fw[e])return fw[e]}else if(typeof e=="string"){if(pw[e])return pw[e]}else if(r&&e[Fc.ns])return e[Fc.ns];const n=$h(e);if(n instanceof RA)return n;if(gw(n)){const[A,i]=n;if(A instanceof RA)return Object.assign(A.getMergedTraits(),Bo(i)),A;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const s=new RA(n);return r?e[Fc.ns]=s:typeof n=="string"?pw[n]=s:typeof n=="number"?fw[n]=s:s}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:r}=this;return!e&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const e=this.getSchema();if(typeof e!="object")return!1;const r=e[0];return r===3||r===-3||r===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Bo(this.memberTraits)}getOwnTraits(){return Bo(this.traits)}getKeySchema(){const[e,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),s=e?15:n[4]??0;return Pc([s,0],"key")}getValueSchema(){const e=this.getSchema(),[r,n,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],A=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||s)?e[3+e[0]]:r?15:void 0;if(A!=null)return Pc([A,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(e)){const n=r[4].indexOf(e),s=r[5][n];return Pc(gw(s)?s:[s,0],e)}if(this.isDocumentSchema())return Pc([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[r,n]of this.structIterator())e[r]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),r=e[4].length;let n=e[Fc.it];if(n&&r===n.length){yield*n;return}n=Array(r);for(let s=0;s<r;++s){const A=e[4][s],i=Pc([e[5][s],0],A);yield n[s]=[A,i]}e[Fc.it]=n}};S(RA,"symbol",Symbol.for("@smithy/nor"));let Oe=RA;function Pc(t,e){if(t instanceof Oe)return Object.assign(t,{memberName:e,_isMemberSchema:!0});const r=Oe;return new r(t,e)}const gw=t=>Array.isArray(t)&&t.length===2,JZ=t=>Array.isArray(t)&&t.length>=5,gs=class gs{constructor(e,r=new Map,n=new Map){S(this,"namespace");S(this,"schemas");S(this,"exceptions");this.namespace=e,this.schemas=r,this.exceptions=n}static for(e){return gs.registries.has(e)||gs.registries.set(e,new gs(e)),gs.registries.get(e)}copyFrom(e){const{schemas:r,exceptions:n}=this;for(const[s,A]of e.schemas)r.has(s)||r.set(s,A);for(const[s,A]of e.exceptions)n.has(s)||n.set(s,A)}register(e,r){const n=this.normalizeShapeId(e);for(const s of[this,gs.for(n.split("#")[0])])s.schemas.set(n,r)}getSchema(e){const r=this.normalizeShapeId(e);if(!this.schemas.has(r)){if(!e.includes("#")){const n="#"+e,s=[];for(const[A,i]of this.schemas.entries())A.endsWith(n)&&s.push(i);if(s.length===1)return s[0]}throw new Error(`@smithy/core/schema - schema not found for ${r}`)}return this.schemas.get(r)}registerError(e,r){const n=e,s=n[1];for(const A of[this,gs.for(s)])A.schemas.set(s+"#"+n[2],n),A.exceptions.set(n,r)}getErrorCtor(e){const r=e;return this.exceptions.has(r)?this.exceptions.get(r):gs.for(r[1]).exceptions.get(r)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,r,n]=e,s=r+"#"+n;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}}find(e){for(const r of this.schemas.values())if(e(r))return r}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}};S(gs,"registries",new Map);let Rs=gs;const mw="***SensitiveInformation***";function ww(t,e){if(e==null)return e;const r=Oe.of(t);if(r.getMergedTraits().sensitive)return mw;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return mw}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return mw}else if(r.isStructSchema()&&typeof e=="object"){const n=e,s={};for(const[A,i]of r.structIterator())n[A]!=null&&(s[A]=ww(i,n[A]));return s}return e}class H{constructor(){S(this,"middlewareStack",Lh());S(this,"schema")}static classBuilder(){return new XZ}resolveMiddlewareWithContext(e,r,n,{middlewareFn:s,clientName:A,commandName:i,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:l,CommandCtor:h}){for(const _ of s.bind(this)(h,e,r,n))this.middlewareStack.use(_);const d=e.concat(this.middlewareStack),{logger:p}=r,w={logger:p,clientName:A,commandName:i,inputFilterSensitiveLog:o,outputFilterSensitiveLog:a,[cw]:{commandInstance:this,...c},...l},{requestHandler:B}=r;let C=n??{};return c.eventStream&&(C={isEventStream:!0,...C}),d.resolve(_=>B.handle(_.request,C),w)}}class XZ{constructor(){S(this,"_init",()=>{});S(this,"_ep",{});S(this,"_middlewareFn",()=>[]);S(this,"_commandName","");S(this,"_clientName","");S(this,"_additionalContext",{});S(this,"_smithyContext",{});S(this,"_inputFilterSensitiveLog");S(this,"_outputFilterSensitiveLog");S(this,"_serializer",null);S(this,"_deserializer",null);S(this,"_operationSchema")}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,n={}){return this._smithyContext={service:e,operation:r,...n},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=n=>n,r=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let r;return r=class extends H{constructor(...[s]){super();S(this,"input");S(this,"serialize",e._serializer);S(this,"deserialize",e._deserializer);this.input=s??{},e._init(this),this.schema=e._operationSchema}static getEndpointParameterInstructions(){return e._ep}resolveMiddleware(s,A,i){const o=e._operationSchema,a=(o==null?void 0:o[4])??(o==null?void 0:o.input),c=(o==null?void 0:o[5])??(o==null?void 0:o.output);return this.resolveMiddlewareWithContext(s,A,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?ww.bind(null,a):l=>l),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?ww.bind(null,c):l=>l),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const YZ=(t,e,r)=>{for(const[A,i]of Object.entries(t)){const o=async function(c,l,h){const d=new i(c);if(typeof l=="function")this.send(d,l);else if(typeof h=="function"){if(typeof l!="object")throw new Error(`Expected http options but got ${typeof l}`);this.send(d,l||{},h)}else return this.send(d,l)},a=(A[0].toLowerCase()+A.slice(1)).replace(/Command$/,"");e.prototype[a]=o}const{paginators:n={},waiters:s={}}=r??{};for(const[A,i]of Object.entries(n))e.prototype[A]===void 0&&(e.prototype[A]=function(o={},a,...c){return i({...a,client:this},o,...c)});for(const[A,i]of Object.entries(s))e.prototype[A]===void 0&&(e.prototype[A]=async function(o={},a,...c){let l=a;return typeof a=="number"&&(l={maxWaitTime:a}),i({...l,client:this},o,...c)})};class di extends Error{constructor(r){super(r.message);S(this,"$fault");S(this,"$response");S(this,"$retryable");S(this,"$metadata");Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=r.name,this.$fault=r.$fault,this.$metadata=r.$metadata}static isInstance(r){if(!r)return!1;const n=r;return di.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault==="client"||n.$fault==="server")}static[Symbol.hasInstance](r){if(!r)return!1;const n=r;return this===di?di.isInstance(r):di.isInstance(r)?n.name&&this.name?this.prototype.isPrototypeOf(r)||n.name===this.name:this.prototype.isPrototypeOf(r):!1}}const UT=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,s])=>{(t[n]==null||t[n]==="")&&(t[n]=s)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},kT=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},FT=Object.values(Uc),ZZ=t=>{const e=[];for(const r in Uc){const n=Uc[r];t[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}for(const[r,n]of Object.entries(t.checksumAlgorithms??{}))e.push({algorithmId:()=>r,checksumConstructor:()=>n});return{addChecksumAlgorithm(r){t.checksumAlgorithms=t.checksumAlgorithms??{};const n=r.algorithmId(),s=r.checksumConstructor();FT.includes(n)?t.checksumAlgorithms[n.toUpperCase()]=s:t.checksumAlgorithms[n]=s,e.push(r)},checksumAlgorithms(){return e}}},eee=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{const n=r.algorithmId();FT.includes(n)&&(e[n]=r.checksumConstructor())}),e},tee=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),ree=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},PT=t=>Object.assign(ZZ(t),tee(t)),OT=t=>Object.assign(eee(t),ree(t)),QT=t=>{const e="#text";for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r][e]!==void 0?t[r]=t[r][e]:typeof t[r]=="object"&&t[r]!==null&&(t[r]=QT(t[r]));return t};class Vh{trace(){}debug(){}info(){}warn(){}error(){}}const DT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LT=Object.entries(DT).reduce((t,[e,r])=>(t[r]=Number(e),t),{}),nee=DT.split(""),Co=6,Oc=8,see=63,Us=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;const r=new ArrayBuffer(e),n=new DataView(r);for(let s=0;s<t.length;s+=4){let A=0,i=0;for(let c=s,l=s+3;c<=l;c++)if(t[c]!=="="){if(!(t[c]in LT))throw new TypeError(`Invalid character ${t[c]} in base64 string.`);A|=LT[t[c]]<<(l-c)*Co,i+=Co}else A>>=Co;const o=s/4*3;A>>=i%Oc;const a=Math.floor(i/Oc);for(let c=0;c<a;c++){const l=(a-c-1)*Oc;n.setUint8(o+c,(A&255<<l)>>l)}}return new Uint8Array(r)},Jn=t=>new TextEncoder().encode(t);function Xn(t){let e;typeof t=="string"?e=Jn(t):e=t;const r=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let A=0;A<e.length;A+=3){let i=0,o=0;for(let c=A,l=Math.min(A+3,e.length);c<l;c++)i|=e[c]<<(l-c-1)*Oc,o+=Oc;const a=Math.ceil(o/Co);i<<=a*Co-o;for(let c=1;c<=a;c++){const l=(a-c)*Co;s+=nee[(i&see<<l)>>l]}s+="==".slice(0,4-a)}return s}function Aee(t,e,r,n){return class op extends Uint8Array{static fromString(A,i="utf-8"){if(typeof A=="string")return i==="base64"?op.mutate(n(A)):op.mutate(e(A));throw new Error(`Unsupported conversion from ${typeof A} to Uint8ArrayBlobAdapter.`)}static mutate(A){return Object.setPrototypeOf(A,op.prototype),A}transformToString(A="utf-8"){return A==="base64"?r(this):t(this)}}}const ks=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)},ir=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function iee(t){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{const e=new Uint8Array(16);return t(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,ir[e[0]]+ir[e[1]]+ir[e[2]]+ir[e[3]]+"-"+ir[e[4]]+ir[e[5]]+"-"+ir[e[6]]+ir[e[7]]+"-"+ir[e[8]]+ir[e[9]]+"-"+ir[e[10]]+ir[e[11]]+ir[e[12]]+ir[e[13]]+ir[e[14]]+ir[e[15]]}}const yw=t=>{if(t!=null){if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&pee.warn(fee(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},oee=Math.ceil(2**127*(2-2**-23)),MT=t=>{const e=yw(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>oee)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},aee=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}},NT=t=>$T(t,16),HT=t=>$T(t,8),$T=(t,e)=>{const r=aee(t);if(r!==void 0&&cee(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},cee=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},uee=t=>yw(typeof t=="string"?Kh(t):t),lee=t=>MT(typeof t=="string"?Kh(t):t),hee=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Kh=t=>{const e=t.match(hee);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)},jh=t=>NT(typeof t=="string"?Kh(t):t),dee=t=>HT(typeof t=="string"?Kh(t):t),fee=t=>String(new TypeError(t).stack||t).split(`
3025
3025
  `).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
3026
- `),dee={warn:console.warn},fee=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Bw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gh(t){const e=t.getUTCFullYear(),r=t.getUTCMonth(),n=t.getUTCDay(),s=t.getUTCDate(),A=t.getUTCHours(),i=t.getUTCMinutes(),o=t.getUTCSeconds(),a=s<10?`0${s}`:`${s}`,c=A<10?`0${A}`:`${A}`,l=i<10?`0${i}`:`${i}`,h=o<10?`0${o}`:`${o}`;return`${fee[n]}, ${a} ${Bw[r]} ${e} ${c}:${l}:${h} GMT`}const pee=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),gee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=pee.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,A,i,o,a,c,l]=e,h=jh(Qc(n)),d=pA(s,"month",1,12),p=pA(A,"day",1,31),w=zh(h,d,p,{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c});return l.toUpperCase()!="Z"&&w.setTime(w.getTime()-Iee(l)),w},mee=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),wee=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),yee=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Cw=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=mee.exec(t);if(e){const[r,n,s,A,i,o,a,c]=e;return zh(jh(Qc(A)),Ew(s),pA(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c})}if(e=wee.exec(t),e){const[r,n,s,A,i,o,a,c]=e;return _ee(zh(Cee(A),Ew(s),pA(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c}))}if(e=yee.exec(t),e){const[r,n,s,A,i,o,a,c]=e;return zh(jh(Qc(c)),Ew(n),pA(s.trimLeft(),"day",1,31),{hours:A,minutes:i,seconds:o,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},Bee=t=>{if(t==null)return;let e;if(typeof t=="number")e=t;else if(typeof t=="string")e=aee(t);else if(typeof t=="object"&&t.tag===1)e=t.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},zh=(t,e,r,n)=>{const s=e-1;return vee(t,s,r),new Date(Date.UTC(t,s,r,pA(n.hours,"hour",0,23),pA(n.minutes,"minute",0,59),pA(n.seconds,"seconds",0,60),Tee(n.fractionalMilliseconds)))},Cee=t=>{const e=new Date().getUTCFullYear(),r=Math.floor(e/100)*100+jh(Qc(t));return r<e?r+100:r},Eee=50*365*24*60*60*1e3,_ee=t=>t.getTime()-new Date().getTime()>Eee?new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())):t,Ew=t=>{const e=Bw.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},bee=[31,28,31,30,31,30,31,31,30,31,30,31],vee=(t,e,r)=>{let n=bee[e];if(e===1&&See(t)&&(n=29),r>n)throw new TypeError(`Invalid day for ${Bw[e]} in ${t}: ${r}`)},See=t=>t%4===0&&(t%100!==0||t%400===0),pA=(t,e,r,n)=>{const s=lee(Qc(t));if(s<r||s>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return s},Tee=t=>t==null?0:cee("0."+t)*1e3,Iee=t=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),s=Number(t.substring(4,6));return r*(n*60+s)*60*1e3},Qc=t=>{let e=0;for(;e<t.length-1&&t.charAt(e)==="0";)e++;return e===0?t:t.slice(e)},Yn=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};Yn.from=t=>t&&typeof t=="object"&&(t instanceof Yn||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?Yn(String(t)):Yn(JSON.stringify(t)),Yn.fromObject=Yn.from;function xee(t){return(t.includes(",")||t.includes('"'))&&(t=`"${t.replace(/"/g,'\\"')}"`),t}const _w="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",bw="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",vw="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",VT="(\\d?\\d)",KT="(\\d{4})",Ree=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Uee=new RegExp(`^${_w}, ${VT} ${bw} ${KT} ${vw} GMT$`),kee=new RegExp(`^${_w}, ${VT}-${bw}-(\\d\\d) ${vw} GMT$`),Fee=new RegExp(`^${_w} ${bw} ( [1-9]|\\d\\d) ${vw} ${KT}$`),Pee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Oee=t=>{if(t==null)return;let e=NaN;if(typeof t=="number")e=t;else if(typeof t=="string"){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else typeof t=="object"&&t.tag===1&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Qee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC3339 timestamps must be strings");const e=Ree.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,r,n,s,A,i,o,,a,c]=e;Fs(n,1,12),Fs(s,1,31),Fs(A,0,23),Fs(i,0,59),Fs(o,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(A),Number(i),Number(o),Number(a)?Math.round(parseFloat(`0.${a}`)*1e3):0));if(l.setUTCFullYear(Number(r)),c.toUpperCase()!="Z"){const[,h,d,p]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],w=h==="-"?1:-1;l.setTime(l.getTime()+w*(Number(d)*60*60*1e3+Number(p)*60*1e3))}return l},Dee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,r,n,s,A,i,o,a;if((a=Uee.exec(t))?[,e,r,n,s,A,i,o]=a:(a=kee.exec(t))?([,e,r,n,s,A,i,o]=a,n=(Number(n)+1900).toString()):(a=Fee.exec(t))&&([,r,e,s,A,i,o,n]=a),n&&i){const c=Date.UTC(Number(n),Pee.indexOf(r),Number(e),Number(s),Number(A),Number(i),o?Math.round(parseFloat(`0.${o}`)*1e3):0);Fs(e,1,31),Fs(s,0,23),Fs(A,0,59),Fs(i,0,60);const l=new Date(c);return l.setUTCFullYear(Number(n)),l}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)};function Fs(t,e,r){const n=Number(t);if(n<e||n>r)throw new Error(`Value ${n} out of range [${e}, ${r}]`)}function Lee(t,e,r){if(!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=t.split(e),s=[];let A="";for(let i=0;i<n.length;i++)A===""?A=n[i]:A+=e+n[i],(i+1)%r===0&&(s.push(A),A="");return A!==""&&s.push(A),s}const jT=t=>{const e=t.length,r=[];let n=!1,s,A=0;for(let i=0;i<e;++i){const o=t[i];switch(o){case'"':s!=="\\"&&(n=!n);break;case",":n||(r.push(t.slice(A,i)),A=i+1);break}s=o}return r.push(t.slice(A)),r.map(i=>{i=i.trim();const o=i.length;return o<2?i:(i[0]==='"'&&i[o-1]==='"'&&(i=i.slice(1,o-1)),i.replace(/\\"/g,'"'))})},GT=/^-?\d*(\.\d+)?$/;class rn{constructor(e,r){S(this,"string");S(this,"type");if(this.string=e,this.type=r,!GT.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const r=e;return rn.prototype.isPrototypeOf(e)||r.type==="bigDecimal"&&GT.test(r.string)}}const zT={},Sw={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),zT[t]=e,Sw[e]=t}function qT(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in Sw)e[r/2]=Sw[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Mr(t){let e="";for(let r=0;r<t.byteLength;r++)e+=zT[t[r]];return e}const WT=typeof TextEncoder=="function"?new TextEncoder:null,JT=t=>{if(typeof t=="string"){if(WT)return WT.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)},Eo=t=>typeof t=="string"?Jn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),XT=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",YT=async t=>{},Mee=async t=>{const e=(t==null?void 0:t.Bucket)||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Kee(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Vee(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},Nee=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Hee=/(\d+\.){3}\d+/,$ee=/\.\./,Vee=t=>Nee.test(t)&&!Hee.test(t)&&!$ee.test(t),Kee=t=>{const[e,r,n,,,s]=t.split(":"),A=e==="arn"&&t.split(":").length>=6,i=!!(A&&r&&n&&s);if(A&&!i)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return i},jee=(t,e,r,n=!1)=>{const s=async()=>{let A;if(n){const i=r.clientContextParams;A=(i==null?void 0:i[t])??r[t]??r[e]}else A=r[t]??r[e];return typeof A=="function"?A():A};return t==="credentialScope"||e==="CredentialScope"?async()=>{const A=typeof r.credentials=="function"?await r.credentials():r.credentials;return(A==null?void 0:A.credentialScope)??(A==null?void 0:A.CredentialScope)}:t==="accountId"||e==="AccountId"?async()=>{const A=typeof r.credentials=="function"?await r.credentials():r.credentials;return(A==null?void 0:A.accountId)??(A==null?void 0:A.AccountId)}:t==="endpoint"||e==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const A=await s();if(A&&typeof A=="object"){if("url"in A)return A.url.href;if("hostname"in A){const{protocol:i,hostname:o,port:a,path:c}=A;return`${i}//${o}${a?":"+a:""}${c}`}}return A}:s};function Gee(t){return async(e,r,n,s)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await t(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(uw(o)),n.isCustomEndpoint=!0)}const A=await ZT(e,r,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const i=n.endpointProvider(A,s);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o!=null&&o.headers){i.headers??(i.headers={});for(const[a,c]of Object.entries(o.headers))i.headers[a]=Array.isArray(c)?c:[c]}}return i}}const ZT=async(t,e,r)=>{var A;const n={},s=((A=e==null?void 0:e.getEndpointParameterInstructions)==null?void 0:A.call(e))||{};for(const[i,o]of Object.entries(s))switch(o.type){case"staticContextParams":n[i]=o.value;break;case"contextParams":n[i]=t[o.name];break;case"clientContextParams":case"builtInParams":n[i]=await jee(o.name,i,r,o.type!=="builtInParams")();break;case"operationContextParams":n[i]=o.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(o))}return Object.keys(s).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await Mee(n),n};function zee(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}function qee(t){const e=Gee(t);return({config:r,instructions:n})=>(s,A)=>async i=>{var c,l,h;r.isCustomEndpoint&&zee(A,"ENDPOINT_OVERRIDE","N");const o=await e(i.input,{getEndpointParameterInstructions(){return n}},{...r},A);A.endpointV2=o,A.authSchemes=(c=o.properties)==null?void 0:c.authSchemes;const a=(l=A.authSchemes)==null?void 0:l[0];if(a){A.signing_region=a.signingRegion,A.signing_service=a.signingName;const d=xs(A),p=(h=d==null?void 0:d.selectedHttpAuthScheme)==null?void 0:h.httpAuthOption;p&&(p.signingProperties=Object.assign(p.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return s({...i})}}const Wee={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:{name:"serializerMiddleware"}.name};function Jee(t){const e=qee(t);return(r,n)=>({applyToStack:s=>{s.addRelativeTo(e({config:r,instructions:n}),Wee)}})}function Xee(t){return e=>{const r=e.tls??!0,{endpoint:n,useDualstackEndpoint:s,useFipsEndpoint:A}=e,i=n!=null?async()=>uw(await Kr(n)()):void 0,a=Object.assign(e,{endpoint:i,tls:r,isCustomEndpoint:!!n,useDualstackEndpoint:Kr(s??!1),useFipsEndpoint:Kr(A??!1)});let c;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=t(e.serviceId)),c),a}}class qh{constructor(e,r,n,s){S(this,"nodes");S(this,"root");S(this,"conditions");S(this,"results");this.nodes=e,this.root=r,this.conditions=n,this.results=s}static from(e,r,n,s){return new qh(e,r,n,s)}}class eI{constructor({size:e,params:r}){S(this,"capacity");S(this,"data",new Map);S(this,"parameters",[]);this.capacity=e??50,r&&(this.parameters=r)}get(e,r){const n=this.hash(e);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const s=this.data.keys();let A=0;for(;;){const{value:i,done:o}=s.next();if(this.data.delete(i),o||++A>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(e){let r="";const{parameters:n}=this;if(n.length===0)return!1;for(const s of n){const A=String(e[s]??"");if(A.includes("|;"))return!1;r+=A+"|;"}return r}}class Tn extends Error{constructor(e){super(e),this.name="EndpointError"}}const Yee="endpoints";function Wh(t){return typeof t!="object"||t==null?t:"ref"in t?`$${Wh(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(Wh).join(", ")})`:JSON.stringify(t,null,2)}const Jh={},Zee=(t,e)=>t===e;function ete(...t){for(const e of t)if(e!=null)return e}const tte=t=>{const e=t.split("."),r=[];for(const n of e){const s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new Tn(`Path: '${t}' does not end with ']'`);const A=n.slice(s+1,-1);if(Number.isNaN(parseInt(A)))throw new Tn(`Invalid array index: '${A}' in path: '${t}'`);s!==0&&r.push(n.slice(0,s)),r.push(A)}else r.push(n)}return r},tI=(t,e)=>tte(e).reduce((r,n)=>{if(typeof r!="object")throw new Tn(`Index '${n}' in '${e}' not found in '${JSON.stringify(t)}'`);if(Array.isArray(r)){const s=parseInt(n);return r[s<0?r.length+s:s]}return r[n]},t),rte=t=>t!=null;function nte(t,e,r){return t?e:r}const ste=t=>!t,Ate=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),rI=t=>Ate.test(t)||t.startsWith("[")&&t.endsWith("]"),Tw={[Rc.HTTP]:80,[Rc.HTTPS]:443},ite=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:d,port:p,protocol:w="",path:B="",query:C={}}=t,_=new URL(`${w}//${d}${p?`:${p}`:""}${B}`);return _.search=Object.entries(C).map(([T,v])=>`${T}=${v}`).join("&"),_}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:n,hostname:s,pathname:A,protocol:i,search:o}=e;if(o)return null;const a=i.slice(0,-1);if(!Object.values(Rc).includes(a))return null;const c=rI(s),l=r.includes(`${n}:${Tw[a]}`)||typeof t=="string"&&t.includes(`${n}:${Tw[a]}`),h=`${n}${l?`:${Tw[a]}`:""}`;return{scheme:a,authority:h,path:A,normalizedPath:A.endsWith("/")?A:`${A}/`,isIp:c}};function ote(t,e,r){if(r===1)return[t];if(t==="")return[""];const n=t.split(e);return r===0?n:n.slice(0,r-1).concat(n.slice(1).join(e))}const ate={booleanEquals:Zee,coalesce:ete,getAttr:tI,isSet:rte,isValidHostLabel:Mh,ite:nte,not:ste,parseURL:ite,split:ote,stringEquals:(t,e)=>t===e,substring:(t,e,r,n)=>t==null||e>=r||t.length<r||/[^\u0000-\u007f]/.test(t)?null:n?t.substring(t.length-r,t.length-e):t.substring(e,r),uriEncode:t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},nI=(t,e)=>{const r=[],{referenceRecord:n,endpointParams:s}=e;let A=0;for(;A<t.length;){const i=t.indexOf("{",A);if(i===-1){r.push(t.slice(A));break}r.push(t.slice(A,i));const o=t.indexOf("}",i);if(o===-1){r.push(t.slice(i));break}t[i+1]==="{"&&t[o+1]==="}"&&(r.push(t.slice(i+1,o)),A=o+2);const a=t.substring(i+1,o);if(a.includes("#")){const[c,l]=a.split("#");r.push(tI(n[c]??s[c],l))}else r.push(n[a]??s[a]);A=o+1}return r.join("")},cte=({ref:t},e)=>e.referenceRecord[t]??e.endpointParams[t],Xh=(t,e,r)=>{if(typeof t=="string")return nI(t,r);if(t.fn)return AI.callFunction(t,r);if(t.ref)return cte(t,r);throw new Tn(`'${e}': ${String(t)} is not a string, function or reference.`)},sI=({fn:t,argv:e},r)=>{const n=Array(e.length);for(let i=0;i<n.length;++i){const o=e[i];typeof o=="boolean"||typeof o=="number"?n[i]=o:n[i]=AI.evaluateExpression(o,"arg",r)}const s=t.indexOf(".");if(s!==-1){const i=Jh[t.slice(0,s)],o=i==null?void 0:i[t.slice(s+1)];if(typeof o=="function")return o(...n)}const A=ate[t];if(typeof A=="function")return A(...n);throw new Error(`function ${t} not loaded in endpointFunctions.`)},AI={evaluateExpression:Xh,callFunction:sI},ute=(t,e)=>{var A,i;const{assign:r}=t;if(r&&r in e.referenceRecord)throw new Tn(`'${r}' is already defined in Reference Record.`);const n=sI(t,e);(i=(A=e.logger)==null?void 0:A.debug)==null||i.call(A,`${Yee} evaluateCondition: ${Wh(t)} = ${Wh(n)}`);const s=n===""?!0:!!n;return r!=null?{result:s,toAssign:{name:r,value:n}}:{result:s}},lte=(t,e)=>Object.entries(t??{}).reduce((r,[n,s])=>(r[n]=s.map(A=>{const i=Xh(A,"Header value entry",e);if(typeof i!="string")throw new Tn(`Header '${n}' value '${i}' is not a string`);return i}),r),{}),iI=(t,e)=>Object.entries(t).reduce((r,[n,s])=>(r[n]=aI.getEndpointProperty(s,e),r),{}),oI=(t,e)=>{if(Array.isArray(t))return t.map(r=>oI(r,e));switch(typeof t){case"string":return nI(t,e);case"object":if(t===null)throw new Tn(`Unexpected endpoint property: ${t}`);return aI.getEndpointProperties(t,e);case"boolean":return t;default:throw new Tn(`Unexpected endpoint property type: ${typeof t}`)}},aI={getEndpointProperty:oI,getEndpointProperties:iI},hte=(t,e)=>{const r=Xh(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Tn(`Endpoint URL must be a string, got ${typeof r}`)},Iw=1e8,cI=(t,e)=>{const{nodes:r,root:n,results:s,conditions:A}=t;let i=n;const o={},a={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;i!==1&&i!==-1&&i<Iw;){const c=3*(Math.abs(i)-1),[l,h,d]=[r[c],r[c+1],r[c+2]],[p,w,B]=A[l],C=ute({fn:p,assign:B,argv:w},a);if(C.toAssign){const{name:_,value:T}=C.toAssign;o[_]=T}i=i>=0===C.result?h:d}if(i>=Iw){const c=s[i-Iw];if(c[0]===-1){const[,p]=c;throw new Tn(Xh(p,"Error",a))}const[l,h,d]=c;return{url:hte(l,a),properties:iI(h,a),headers:lte(d??{},a)}}throw new Tn("No matching endpoint.")},uI=Xee(YT),$=Jee(YT),dte=typeof ReadableStream=="function"?ReadableStream:function(){};class fte extends dte{}const xw=t=>{var e;return typeof ReadableStream=="function"&&(((e=t==null?void 0:t.constructor)==null?void 0:e.name)===ReadableStream.name||t instanceof ReadableStream)},pte=({expectedChecksum:t,checksum:e,source:r,checksumSourceLocation:n,base64Encoder:s})=>{var a;if(!xw(r))throw new Error(`@smithy/util-stream: unsupported source type ${((a=r==null?void 0:r.constructor)==null?void 0:a.name)??r} in ChecksumStream.`);const A=s??Xn;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const i=new TransformStream({start(){},async transform(c,l){e.update(c),l.enqueue(c)},async flush(c){const l=await e.digest(),h=A(l);if(t!==h){const d=new Error(`Checksum mismatch: expected "${t}" but received "${h}" in response header "${n}".`);c.error(d)}else c.terminate()}});r.pipeThrough(i);const o=i.readable;return Object.setPrototypeOf(o,fte.prototype),o};class gte{constructor(e){S(this,"allocByteArray");S(this,"byteLength",0);S(this,"byteArrays",[]);this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){const n=this.byteArrays[0];return this.reset(),n}const e=this.allocByteArray(this.byteLength);let r=0;for(let n=0;n<this.byteArrays.length;++n){const s=this.byteArrays[n];e.set(s,r),r+=s.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}function mte(t,e,r){const n=t.getReader();let s=!1,A=0;const i=["",new gte(c=>new Uint8Array(c))];let o=-1;const a=async c=>{const{value:l,done:h}=await n.read(),d=l;if(h){if(o!==-1){const p=Rw(i,o);Dc(p)>0&&c.enqueue(p)}c.close()}else{const p=Bte(d,!1);if(o!==p&&(o>=0&&c.enqueue(Rw(i,o)),o=p),o===-1){c.enqueue(d);return}const w=Dc(d);A+=w;const B=Dc(i[o]);if(w>=e&&B===0)c.enqueue(d);else{const C=yte(i,o,d);!s&&A>e*2&&(s=!0,r==null||r.warn(`@smithy/util-stream - stream chunk size ${w} is below threshold of ${e}, automatically buffering.`)),C>=e?c.enqueue(Rw(i,o)):await a(c)}}};return new ReadableStream({pull:a})}const wte=mte;function yte(t,e,r){switch(e){case 0:return t[0]+=r,Dc(t[0]);case 1:case 2:return t[e].push(r),Dc(t[e])}}function Rw(t,e){switch(e){case 0:const r=t[0];return t[0]="",r;case 1:case 2:return t[e].flush()}throw new Error(`@smithy/util-stream - invalid index ${e} given to flush()`)}function Dc(t){return(t==null?void 0:t.byteLength)??(t==null?void 0:t.length)??0}function Bte(t,e=!0){return e&&typeof Buffer<"u"&&t instanceof Buffer?2:t instanceof Uint8Array?1:typeof t=="string"?0:-1}const Cte=(t,e)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:A,streamHasher:i}=e,o=r!==void 0&&n!==void 0&&s!==void 0&&A!==void 0&&i!==void 0,a=o?i(s,t):void 0,c=t.getReader();return new ReadableStream({async pull(l){const{value:h,done:d}=await c.read();if(d){if(l.enqueue(`0\r
3026
+ `),pee={warn:console.warn},gee=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Bw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gh(t){const e=t.getUTCFullYear(),r=t.getUTCMonth(),n=t.getUTCDay(),s=t.getUTCDate(),A=t.getUTCHours(),i=t.getUTCMinutes(),o=t.getUTCSeconds(),a=s<10?`0${s}`:`${s}`,c=A<10?`0${A}`:`${A}`,l=i<10?`0${i}`:`${i}`,h=o<10?`0${o}`:`${o}`;return`${gee[n]}, ${a} ${Bw[r]} ${e} ${c}:${l}:${h} GMT`}const mee=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),wee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=mee.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,A,i,o,a,c,l]=e,h=jh(Qc(n)),d=pA(s,"month",1,12),p=pA(A,"day",1,31),w=zh(h,d,p,{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c});return l.toUpperCase()!="Z"&&w.setTime(w.getTime()-Ree(l)),w},yee=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Bee=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Cee=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Cw=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=yee.exec(t);if(e){const[r,n,s,A,i,o,a,c]=e;return zh(jh(Qc(A)),Ew(s),pA(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c})}if(e=Bee.exec(t),e){const[r,n,s,A,i,o,a,c]=e;return vee(zh(_ee(A),Ew(s),pA(n,"day",1,31),{hours:i,minutes:o,seconds:a,fractionalMilliseconds:c}))}if(e=Cee.exec(t),e){const[r,n,s,A,i,o,a,c]=e;return zh(jh(Qc(c)),Ew(n),pA(s.trimLeft(),"day",1,31),{hours:A,minutes:i,seconds:o,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},Eee=t=>{if(t==null)return;let e;if(typeof t=="number")e=t;else if(typeof t=="string")e=uee(t);else if(typeof t=="object"&&t.tag===1)e=t.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},zh=(t,e,r,n)=>{const s=e-1;return Tee(t,s,r),new Date(Date.UTC(t,s,r,pA(n.hours,"hour",0,23),pA(n.minutes,"minute",0,59),pA(n.seconds,"seconds",0,60),xee(n.fractionalMilliseconds)))},_ee=t=>{const e=new Date().getUTCFullYear(),r=Math.floor(e/100)*100+jh(Qc(t));return r<e?r+100:r},bee=50*365*24*60*60*1e3,vee=t=>t.getTime()-new Date().getTime()>bee?new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())):t,Ew=t=>{const e=Bw.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},See=[31,28,31,30,31,30,31,31,30,31,30,31],Tee=(t,e,r)=>{let n=See[e];if(e===1&&Iee(t)&&(n=29),r>n)throw new TypeError(`Invalid day for ${Bw[e]} in ${t}: ${r}`)},Iee=t=>t%4===0&&(t%100!==0||t%400===0),pA=(t,e,r,n)=>{const s=dee(Qc(t));if(s<r||s>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return s},xee=t=>t==null?0:lee("0."+t)*1e3,Ree=t=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),s=Number(t.substring(4,6));return r*(n*60+s)*60*1e3},Qc=t=>{let e=0;for(;e<t.length-1&&t.charAt(e)==="0";)e++;return e===0?t:t.slice(e)},Yn=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};Yn.from=t=>t&&typeof t=="object"&&(t instanceof Yn||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?Yn(String(t)):Yn(JSON.stringify(t)),Yn.fromObject=Yn.from;function Uee(t){return(t.includes(",")||t.includes('"'))&&(t=`"${t.replace(/"/g,'\\"')}"`),t}const _w="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",bw="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",vw="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",VT="(\\d?\\d)",KT="(\\d{4})",kee=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Fee=new RegExp(`^${_w}, ${VT} ${bw} ${KT} ${vw} GMT$`),Pee=new RegExp(`^${_w}, ${VT}-${bw}-(\\d\\d) ${vw} GMT$`),Oee=new RegExp(`^${_w} ${bw} ( [1-9]|\\d\\d) ${vw} ${KT}$`),Qee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Dee=t=>{if(t==null)return;let e=NaN;if(typeof t=="number")e=t;else if(typeof t=="string"){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else typeof t=="object"&&t.tag===1&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Lee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC3339 timestamps must be strings");const e=kee.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,r,n,s,A,i,o,,a,c]=e;Fs(n,1,12),Fs(s,1,31),Fs(A,0,23),Fs(i,0,59),Fs(o,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(A),Number(i),Number(o),Number(a)?Math.round(parseFloat(`0.${a}`)*1e3):0));if(l.setUTCFullYear(Number(r)),c.toUpperCase()!="Z"){const[,h,d,p]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],w=h==="-"?1:-1;l.setTime(l.getTime()+w*(Number(d)*60*60*1e3+Number(p)*60*1e3))}return l},Mee=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,r,n,s,A,i,o,a;if((a=Fee.exec(t))?[,e,r,n,s,A,i,o]=a:(a=Pee.exec(t))?([,e,r,n,s,A,i,o]=a,n=(Number(n)+1900).toString()):(a=Oee.exec(t))&&([,r,e,s,A,i,o,n]=a),n&&i){const c=Date.UTC(Number(n),Qee.indexOf(r),Number(e),Number(s),Number(A),Number(i),o?Math.round(parseFloat(`0.${o}`)*1e3):0);Fs(e,1,31),Fs(s,0,23),Fs(A,0,59),Fs(i,0,60);const l=new Date(c);return l.setUTCFullYear(Number(n)),l}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)};function Fs(t,e,r){const n=Number(t);if(n<e||n>r)throw new Error(`Value ${n} out of range [${e}, ${r}]`)}function Nee(t,e,r){if(!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=t.split(e),s=[];let A="";for(let i=0;i<n.length;i++)A===""?A=n[i]:A+=e+n[i],(i+1)%r===0&&(s.push(A),A="");return A!==""&&s.push(A),s}const jT=t=>{const e=t.length,r=[];let n=!1,s,A=0;for(let i=0;i<e;++i){const o=t[i];switch(o){case'"':s!=="\\"&&(n=!n);break;case",":n||(r.push(t.slice(A,i)),A=i+1);break}s=o}return r.push(t.slice(A)),r.map(i=>{i=i.trim();const o=i.length;return o<2?i:(i[0]==='"'&&i[o-1]==='"'&&(i=i.slice(1,o-1)),i.replace(/\\"/g,'"'))})},GT=/^-?\d*(\.\d+)?$/;class rn{constructor(e,r){S(this,"string");S(this,"type");if(this.string=e,this.type=r,!GT.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const r=e;return rn.prototype.isPrototypeOf(e)||r.type==="bigDecimal"&&GT.test(r.string)}}const zT={},Sw={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),zT[t]=e,Sw[e]=t}function qT(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in Sw)e[r/2]=Sw[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Mr(t){let e="";for(let r=0;r<t.byteLength;r++)e+=zT[t[r]];return e}const WT=typeof TextEncoder=="function"?new TextEncoder:null,JT=t=>{if(typeof t=="string"){if(WT)return WT.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)},Eo=t=>typeof t=="string"?Jn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),XT=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",YT=async t=>{},Hee=async t=>{const e=(t==null?void 0:t.Bucket)||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Gee(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!jee(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},$ee=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Vee=/(\d+\.){3}\d+/,Kee=/\.\./,jee=t=>$ee.test(t)&&!Vee.test(t)&&!Kee.test(t),Gee=t=>{const[e,r,n,,,s]=t.split(":"),A=e==="arn"&&t.split(":").length>=6,i=!!(A&&r&&n&&s);if(A&&!i)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return i},zee=(t,e,r,n=!1)=>{const s=async()=>{let A;if(n){const i=r.clientContextParams;A=(i==null?void 0:i[t])??r[t]??r[e]}else A=r[t]??r[e];return typeof A=="function"?A():A};return t==="credentialScope"||e==="CredentialScope"?async()=>{const A=typeof r.credentials=="function"?await r.credentials():r.credentials;return(A==null?void 0:A.credentialScope)??(A==null?void 0:A.CredentialScope)}:t==="accountId"||e==="AccountId"?async()=>{const A=typeof r.credentials=="function"?await r.credentials():r.credentials;return(A==null?void 0:A.accountId)??(A==null?void 0:A.AccountId)}:t==="endpoint"||e==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const A=await s();if(A&&typeof A=="object"){if("url"in A)return A.url.href;if("hostname"in A){const{protocol:i,hostname:o,port:a,path:c}=A;return`${i}//${o}${a?":"+a:""}${c}`}}return A}:s};function qee(t){return async(e,r,n,s)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await t(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(uw(o)),n.isCustomEndpoint=!0)}const A=await ZT(e,r,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const i=n.endpointProvider(A,s);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o!=null&&o.headers){i.headers??(i.headers={});for(const[a,c]of Object.entries(o.headers))i.headers[a]=Array.isArray(c)?c:[c]}}return i}}const ZT=async(t,e,r)=>{var A;const n={},s=((A=e==null?void 0:e.getEndpointParameterInstructions)==null?void 0:A.call(e))||{};for(const[i,o]of Object.entries(s))switch(o.type){case"staticContextParams":n[i]=o.value;break;case"contextParams":n[i]=t[o.name];break;case"clientContextParams":case"builtInParams":n[i]=await zee(o.name,i,r,o.type!=="builtInParams")();break;case"operationContextParams":n[i]=o.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(o))}return Object.keys(s).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await Hee(n),n};function Wee(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}function Jee(t){const e=qee(t);return({config:r,instructions:n})=>(s,A)=>async i=>{var c,l,h;r.isCustomEndpoint&&Wee(A,"ENDPOINT_OVERRIDE","N");const o=await e(i.input,{getEndpointParameterInstructions(){return n}},{...r},A);A.endpointV2=o,A.authSchemes=(c=o.properties)==null?void 0:c.authSchemes;const a=(l=A.authSchemes)==null?void 0:l[0];if(a){A.signing_region=a.signingRegion,A.signing_service=a.signingName;const d=xs(A),p=(h=d==null?void 0:d.selectedHttpAuthScheme)==null?void 0:h.httpAuthOption;p&&(p.signingProperties=Object.assign(p.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return s({...i})}}const Xee={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:{name:"serializerMiddleware"}.name};function Yee(t){const e=Jee(t);return(r,n)=>({applyToStack:s=>{s.addRelativeTo(e({config:r,instructions:n}),Xee)}})}function Zee(t){return e=>{const r=e.tls??!0,{endpoint:n,useDualstackEndpoint:s,useFipsEndpoint:A}=e,i=n!=null?async()=>uw(await Kr(n)()):void 0,a=Object.assign(e,{endpoint:i,tls:r,isCustomEndpoint:!!n,useDualstackEndpoint:Kr(s??!1),useFipsEndpoint:Kr(A??!1)});let c;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=t(e.serviceId)),c),a}}class qh{constructor(e,r,n,s){S(this,"nodes");S(this,"root");S(this,"conditions");S(this,"results");this.nodes=e,this.root=r,this.conditions=n,this.results=s}static from(e,r,n,s){return new qh(e,r,n,s)}}class eI{constructor({size:e,params:r}){S(this,"capacity");S(this,"data",new Map);S(this,"parameters",[]);this.capacity=e??50,r&&(this.parameters=r)}get(e,r){const n=this.hash(e);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const s=this.data.keys();let A=0;for(;;){const{value:i,done:o}=s.next();if(this.data.delete(i),o||++A>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(e){let r="";const{parameters:n}=this;if(n.length===0)return!1;for(const s of n){const A=String(e[s]??"");if(A.includes("|;"))return!1;r+=A+"|;"}return r}}class Tn extends Error{constructor(e){super(e),this.name="EndpointError"}}const ete="endpoints";function Wh(t){return typeof t!="object"||t==null?t:"ref"in t?`$${Wh(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(Wh).join(", ")})`:JSON.stringify(t,null,2)}const Jh={},tte=(t,e)=>t===e;function rte(...t){for(const e of t)if(e!=null)return e}const nte=t=>{const e=t.split("."),r=[];for(const n of e){const s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new Tn(`Path: '${t}' does not end with ']'`);const A=n.slice(s+1,-1);if(Number.isNaN(parseInt(A)))throw new Tn(`Invalid array index: '${A}' in path: '${t}'`);s!==0&&r.push(n.slice(0,s)),r.push(A)}else r.push(n)}return r},tI=(t,e)=>nte(e).reduce((r,n)=>{if(typeof r!="object")throw new Tn(`Index '${n}' in '${e}' not found in '${JSON.stringify(t)}'`);if(Array.isArray(r)){const s=parseInt(n);return r[s<0?r.length+s:s]}return r[n]},t),ste=t=>t!=null;function Ate(t,e,r){return t?e:r}const ite=t=>!t,ote=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),rI=t=>ote.test(t)||t.startsWith("[")&&t.endsWith("]"),Tw={[Rc.HTTP]:80,[Rc.HTTPS]:443},ate=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:d,port:p,protocol:w="",path:B="",query:C={}}=t,_=new URL(`${w}//${d}${p?`:${p}`:""}${B}`);return _.search=Object.entries(C).map(([T,v])=>`${T}=${v}`).join("&"),_}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:n,hostname:s,pathname:A,protocol:i,search:o}=e;if(o)return null;const a=i.slice(0,-1);if(!Object.values(Rc).includes(a))return null;const c=rI(s),l=r.includes(`${n}:${Tw[a]}`)||typeof t=="string"&&t.includes(`${n}:${Tw[a]}`),h=`${n}${l?`:${Tw[a]}`:""}`;return{scheme:a,authority:h,path:A,normalizedPath:A.endsWith("/")?A:`${A}/`,isIp:c}};function cte(t,e,r){if(r===1)return[t];if(t==="")return[""];const n=t.split(e);return r===0?n:n.slice(0,r-1).concat(n.slice(1).join(e))}const ute={booleanEquals:tte,coalesce:rte,getAttr:tI,isSet:ste,isValidHostLabel:Mh,ite:Ate,not:ite,parseURL:ate,split:cte,stringEquals:(t,e)=>t===e,substring:(t,e,r,n)=>t==null||e>=r||t.length<r||/[^\u0000-\u007f]/.test(t)?null:n?t.substring(t.length-r,t.length-e):t.substring(e,r),uriEncode:t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},nI=(t,e)=>{const r=[],{referenceRecord:n,endpointParams:s}=e;let A=0;for(;A<t.length;){const i=t.indexOf("{",A);if(i===-1){r.push(t.slice(A));break}r.push(t.slice(A,i));const o=t.indexOf("}",i);if(o===-1){r.push(t.slice(i));break}t[i+1]==="{"&&t[o+1]==="}"&&(r.push(t.slice(i+1,o)),A=o+2);const a=t.substring(i+1,o);if(a.includes("#")){const[c,l]=a.split("#");r.push(tI(n[c]??s[c],l))}else r.push(n[a]??s[a]);A=o+1}return r.join("")},lte=({ref:t},e)=>e.referenceRecord[t]??e.endpointParams[t],Xh=(t,e,r)=>{if(typeof t=="string")return nI(t,r);if(t.fn)return AI.callFunction(t,r);if(t.ref)return lte(t,r);throw new Tn(`'${e}': ${String(t)} is not a string, function or reference.`)},sI=({fn:t,argv:e},r)=>{const n=Array(e.length);for(let i=0;i<n.length;++i){const o=e[i];typeof o=="boolean"||typeof o=="number"?n[i]=o:n[i]=AI.evaluateExpression(o,"arg",r)}const s=t.indexOf(".");if(s!==-1){const i=Jh[t.slice(0,s)],o=i==null?void 0:i[t.slice(s+1)];if(typeof o=="function")return o(...n)}const A=ute[t];if(typeof A=="function")return A(...n);throw new Error(`function ${t} not loaded in endpointFunctions.`)},AI={evaluateExpression:Xh,callFunction:sI},hte=(t,e)=>{var A,i;const{assign:r}=t;if(r&&r in e.referenceRecord)throw new Tn(`'${r}' is already defined in Reference Record.`);const n=sI(t,e);(i=(A=e.logger)==null?void 0:A.debug)==null||i.call(A,`${ete} evaluateCondition: ${Wh(t)} = ${Wh(n)}`);const s=n===""?!0:!!n;return r!=null?{result:s,toAssign:{name:r,value:n}}:{result:s}},dte=(t,e)=>Object.entries(t??{}).reduce((r,[n,s])=>(r[n]=s.map(A=>{const i=Xh(A,"Header value entry",e);if(typeof i!="string")throw new Tn(`Header '${n}' value '${i}' is not a string`);return i}),r),{}),iI=(t,e)=>Object.entries(t).reduce((r,[n,s])=>(r[n]=aI.getEndpointProperty(s,e),r),{}),oI=(t,e)=>{if(Array.isArray(t))return t.map(r=>oI(r,e));switch(typeof t){case"string":return nI(t,e);case"object":if(t===null)throw new Tn(`Unexpected endpoint property: ${t}`);return aI.getEndpointProperties(t,e);case"boolean":return t;default:throw new Tn(`Unexpected endpoint property type: ${typeof t}`)}},aI={getEndpointProperty:oI,getEndpointProperties:iI},fte=(t,e)=>{const r=Xh(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Tn(`Endpoint URL must be a string, got ${typeof r}`)},Iw=1e8,cI=(t,e)=>{const{nodes:r,root:n,results:s,conditions:A}=t;let i=n;const o={},a={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;i!==1&&i!==-1&&i<Iw;){const c=3*(Math.abs(i)-1),[l,h,d]=[r[c],r[c+1],r[c+2]],[p,w,B]=A[l],C=hte({fn:p,assign:B,argv:w},a);if(C.toAssign){const{name:_,value:T}=C.toAssign;o[_]=T}i=i>=0===C.result?h:d}if(i>=Iw){const c=s[i-Iw];if(c[0]===-1){const[,p]=c;throw new Tn(Xh(p,"Error",a))}const[l,h,d]=c;return{url:fte(l,a),properties:iI(h,a),headers:dte(d??{},a)}}throw new Tn("No matching endpoint.")},uI=Zee(YT),$=Yee(YT),pte=typeof ReadableStream=="function"?ReadableStream:function(){};class gte extends pte{}const xw=t=>{var e;return typeof ReadableStream=="function"&&(((e=t==null?void 0:t.constructor)==null?void 0:e.name)===ReadableStream.name||t instanceof ReadableStream)},mte=({expectedChecksum:t,checksum:e,source:r,checksumSourceLocation:n,base64Encoder:s})=>{var a;if(!xw(r))throw new Error(`@smithy/util-stream: unsupported source type ${((a=r==null?void 0:r.constructor)==null?void 0:a.name)??r} in ChecksumStream.`);const A=s??Xn;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const i=new TransformStream({start(){},async transform(c,l){e.update(c),l.enqueue(c)},async flush(c){const l=await e.digest(),h=A(l);if(t!==h){const d=new Error(`Checksum mismatch: expected "${t}" but received "${h}" in response header "${n}".`);c.error(d)}else c.terminate()}});r.pipeThrough(i);const o=i.readable;return Object.setPrototypeOf(o,gte.prototype),o};class wte{constructor(e){S(this,"allocByteArray");S(this,"byteLength",0);S(this,"byteArrays",[]);this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){const n=this.byteArrays[0];return this.reset(),n}const e=this.allocByteArray(this.byteLength);let r=0;for(let n=0;n<this.byteArrays.length;++n){const s=this.byteArrays[n];e.set(s,r),r+=s.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}function yte(t,e,r){const n=t.getReader();let s=!1,A=0;const i=["",new wte(c=>new Uint8Array(c))];let o=-1;const a=async c=>{const{value:l,done:h}=await n.read(),d=l;if(h){if(o!==-1){const p=Rw(i,o);Dc(p)>0&&c.enqueue(p)}c.close()}else{const p=Ete(d,!1);if(o!==p&&(o>=0&&c.enqueue(Rw(i,o)),o=p),o===-1){c.enqueue(d);return}const w=Dc(d);A+=w;const B=Dc(i[o]);if(w>=e&&B===0)c.enqueue(d);else{const C=Cte(i,o,d);!s&&A>e*2&&(s=!0,r==null||r.warn(`@smithy/util-stream - stream chunk size ${w} is below threshold of ${e}, automatically buffering.`)),C>=e?c.enqueue(Rw(i,o)):await a(c)}}};return new ReadableStream({pull:a})}const Bte=yte;function Cte(t,e,r){switch(e){case 0:return t[0]+=r,Dc(t[0]);case 1:case 2:return t[e].push(r),Dc(t[e])}}function Rw(t,e){switch(e){case 0:const r=t[0];return t[0]="",r;case 1:case 2:return t[e].flush()}throw new Error(`@smithy/util-stream - invalid index ${e} given to flush()`)}function Dc(t){return(t==null?void 0:t.byteLength)??(t==null?void 0:t.length)??0}function Ete(t,e=!0){return e&&typeof Buffer<"u"&&t instanceof Buffer?2:t instanceof Uint8Array?1:typeof t=="string"?0:-1}const _te=(t,e)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:A,streamHasher:i}=e,o=r!==void 0&&n!==void 0&&s!==void 0&&A!==void 0&&i!==void 0,a=o?i(s,t):void 0,c=t.getReader();return new ReadableStream({async pull(l){const{value:h,done:d}=await c.read();if(d){if(l.enqueue(`0\r
3027
3027
  `),o){const p=r(await a);l.enqueue(`${A}:${p}\r
3028
3028
  `),l.enqueue(`\r
3029
3029
  `)}l.close()}else l.enqueue(`${(n(h)||0).toString(16)}\r
3030
3030
  ${h}\r
3031
- `)}})},Ete=async t=>{var e;return typeof Blob=="function"&&t instanceof Blob||((e=t.constructor)==null?void 0:e.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await t.arrayBuffer()):_te(t):bte(t)};async function _te(t){const e=await vte(t),r=Us(e);return new Uint8Array(r)}async function bte(t){const e=[],r=t.getReader();let n=!1,s=0;for(;!n;){const{done:o,value:a}=await r.read();a&&(e.push(a),s+=a.length),n=o}const A=new Uint8Array(s);let i=0;for(const o of e)A.set(o,i),i+=o.length;return A}function vte(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",A=s.indexOf(","),i=A>-1?A+1:s.length;e(s.substring(i))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const lI="The stream has already been transformed.",hI=t=>{var s,A;if(!dI(t)&&!xw(t)){const i=((A=(s=t==null?void 0:t.__proto__)==null?void 0:s.constructor)==null?void 0:A.name)||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let e=!1;const r=async()=>{if(e)throw new Error(lI);return e=!0,await Ete(t)},n=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
3032
- If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async i=>{const o=await r();if(i==="base64")return Xn(o);if(i==="hex")return Mr(o);if(i===void 0||i==="utf8"||i==="utf-8")return ks(o);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(o);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(lI);if(e=!0,dI(t))return n(t);if(xw(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},dI=t=>typeof Blob=="function"&&t instanceof Blob;class Uw extends nee(ks,Jn,Xn,Us){}const fI=see(t=>crypto.getRandomValues(t)),kw=fI,fi=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return Uw.mutate(t);if(!t)return Uw.mutate(new Uint8Array);const r=e.streamCollector(t);return Uw.mutate(await r)};function pI(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}class Yh{constructor(){S(this,"serdeContext")}setSerdeContext(e){this.serdeContext=e}}class gI extends Yh{constructor(r){super();S(this,"options");S(this,"compositeErrorRegistry");this.options=r,this.compositeErrorRegistry=Rs.for(r.defaultNamespace);for(const n of r.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return ot}getResponseType(){return dA}setSerdeContext(r){this.serdeContext=r,this.serializer.setSerdeContext(r),this.deserializer.setSerdeContext(r),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(r)}updateServiceEndpoint(r,n){if("url"in n){r.protocol=n.url.protocol,r.hostname=n.url.hostname,r.port=n.url.port?Number(n.url.port):void 0,r.path=n.url.pathname,r.fragment=n.url.hash||void 0,r.username=n.url.username||void 0,r.password=n.url.password||void 0,r.query||(r.query={});for(const[s,A]of n.url.searchParams.entries())r.query[s]=A;if(n.headers)for(const s in n.headers)r.headers[s]=n.headers[s].join(", ");return r}else{if(r.protocol=n.protocol,r.hostname=n.hostname,r.port=n.port?Number(n.port):void 0,r.path=n.path,r.query={...n.query},n.headers)for(const s in n.headers)r.headers[s]=n.headers[s];return r}}setHostPrefix(r,n,s){var o,a;if((o=this.serdeContext)!=null&&o.disableHostPrefix)return;const A=Oe.of(n.input),i=Bo(n.traits??{});if(i.endpoint){let c=(a=i.endpoint)==null?void 0:a[0];if(typeof c=="string"){for(const[l,h]of A.structIterator()){if(!h.getMergedTraits().hostLabel)continue;const d=s[l];if(typeof d!="string")throw new Error(`@smithy/core/schema - ${l} in input must be a string as hostLabel.`);c=c.replace(`{${l}}`,d)}r.hostname=c+r.hostname}}}deserializeMetadata(r){return{httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:r,requestSchema:n,initialRequest:s}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:r,requestSchema:n,initialRequest:s})}async deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:s}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:s})}async loadEventStreamCapability(){const{EventStreamSerde:r,eventStreamSerdeProvider:n}=await Promise.resolve().then(()=>lAe),s=this.resolveEventStreamMarshaller(n);return new r({marshaller:s,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(r){const n=this.serdeContext;return n.eventStreamMarshaller?n.eventStreamMarshaller:r(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(r,n,s,A,i){return[]}getEventStreamMarshaller(){const r=this.serdeContext;if(!r.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return r.eventStreamMarshaller}}class Ste extends gI{async serializeRequest(e,r,n){const s=r&&typeof r=="object"?r:{},A=this.serializer,i={},o={},a=await n.endpoint(),c=Oe.of(e==null?void 0:e.input),l=[],h=[];let d=!1,p;const w=new ot({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:o,body:void 0});if(a){this.updateServiceEndpoint(w,a),this.setHostPrefix(w,e,s);const B=Bo(e.traits);if(B.http){w.method=B.http[0];const[C,_]=B.http[1].split("?");w.path=="/"?w.path=C:w.path+=C;const T=new URLSearchParams(_??"");for(const[v,k]of T)i[v]=k}}for(const[B,C]of c.structIterator()){const _=C.getMergedTraits()??{},T=s[B];if(T==null&&!C.isIdempotencyToken()){if(_.httpLabel&&(w.path.includes(`{${B}+}`)||w.path.includes(`{${B}}`)))throw new Error(`No value provided for input HTTP label: ${B}.`);continue}if(_.httpPayload)C.isStreaming()?C.isStructSchema()?s[B]&&(p=await this.serializeEventStream({eventStream:s[B],requestSchema:c})):p=T:(A.write(C,T),p=A.flush());else if(_.httpLabel){A.write(C,T);const v=A.flush();w.path.includes(`{${B}+}`)?w.path=w.path.replace(`{${B}+}`,v.split("/").map(pI).join("/")):w.path.includes(`{${B}}`)&&(w.path=w.path.replace(`{${B}}`,pI(v)))}else if(_.httpHeader)A.write(C,T),o[_.httpHeader.toLowerCase()]=String(A.flush());else if(typeof _.httpPrefixHeaders=="string")for(const v in T){const k=T[v],L=_.httpPrefixHeaders+v;A.write([C.getValueSchema(),{httpHeader:L}],k),o[L.toLowerCase()]=A.flush()}else _.httpQuery||_.httpQueryParams?this.serializeQuery(C,T,i):(d=!0,l.push(B),h.push(C))}if(d&&s){const[B,C]=(c.getName(!0)??"#Unknown").split("#"),_=c.getSchema()[6],T=[3,B,C,c.getMergedTraits(),l,h,void 0];_?T[6]=_:T.pop(),A.write(T,s),p=A.flush()}return w.headers=o,w.query=i,w.body=p,w}serializeQuery(e,r,n){const s=this.serializer,A=e.getMergedTraits();if(A.httpQueryParams){for(const i in r)if(!(i in n)){const o=r[i],a=e.getValueSchema();Object.assign(a.getMergedTraits(),{...A,httpQuery:i,httpQueryParams:void 0}),this.serializeQuery(a,o,n)}return}if(e.isListSchema()){const i=!!e.getMergedTraits().sparse,o=[];for(const a of r){s.write([e.getValueSchema(),A],a);const c=s.flush();(i||c!==void 0)&&o.push(c)}n[A.httpQuery]=o}else s.write([e,A],r),n[A.httpQuery]=s.flush()}async deserializeResponse(e,r,n){const s=this.deserializer,A=Oe.of(e.output),i={};if(n.statusCode>=300){const a=await fi(n.body,r);throw a.byteLength>0&&Object.assign(i,await s.read(15,a)),await this.handleError(e,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const a in n.headers){const c=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=c}const o=await this.deserializeHttpMessage(A,r,n,i);if(o.length){const a=await fi(n.body,r);if(a.byteLength>0){const c=await s.read(A,a);for(const l of o)c[l]!=null&&(i[l]=c[l])}}else o.discardResponseBody&&await fi(n.body,r);return i.$metadata=this.deserializeMetadata(n),i}async deserializeHttpMessage(e,r,n,s,A){let i;s instanceof Set?i=A:i=s;let o=!0;const a=this.deserializer,c=Oe.of(e),l=[];for(const[h,d]of c.structIterator()){const p=d.getMemberTraits();if(p.httpPayload){if(o=!1,d.isStreaming())d.isStructSchema()?i[h]=await this.deserializeEventStream({response:n,responseSchema:c}):i[h]=hI(n.body);else if(n.body){const B=await fi(n.body,r);B.byteLength>0&&(i[h]=await a.read(d,B))}}else if(p.httpHeader){const w=String(p.httpHeader).toLowerCase(),B=n.headers[w];if(B!=null)if(d.isListSchema()){const C=d.getValueSchema();C.getMergedTraits().httpHeader=w;let _;C.isTimestampSchema()&&C.getSchema()===4?_=Lee(B,",",2):_=jT(B);const T=[];for(const v of _)T.push(await a.read(C,v.trim()));i[h]=T}else i[h]=await a.read(d,B)}else if(p.httpPrefixHeaders!==void 0){i[h]={};for(const w in n.headers)if(w.startsWith(p.httpPrefixHeaders)){const B=n.headers[w],C=d.getValueSchema();C.getMergedTraits().httpHeader=w,i[h][w.slice(p.httpPrefixHeaders.length)]=await a.read(C,B)}}else p.httpResponseCode?i[h]=n.statusCode:l.push(h)}return l.discardResponseBody=o,l}}class Tte extends gI{async serializeRequest(e,r,n){const s=this.serializer,A={},i={},o=await n.endpoint(),a=Oe.of(e==null?void 0:e.input),c=a.getSchema();let l;const h=r&&typeof r=="object"?r:{},d=new ot({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:A,headers:i,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,h)),h){const p=a.getEventStreamMember();if(p){if(h[p]){const w={};for(const[B,C]of a.structIterator())B!==p&&h[B]&&(s.write(C,h[B]),w[B]=s.flush());l=await this.serializeEventStream({eventStream:h[p],requestSchema:a,initialRequest:w})}}else s.write(c,h),l=s.flush()}return d.headers=Object.assign(d.headers,i),d.query=A,d.body=l,d.method="POST",d}async deserializeResponse(e,r,n){const s=this.deserializer,A=Oe.of(e.output),i={};if(n.statusCode>=300){const a=await fi(n.body,r);throw a.byteLength>0&&Object.assign(i,await s.read(15,a)),await this.handleError(e,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const a in n.headers){const c=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=c}const o=A.getEventStreamMember();if(o)i[o]=await this.deserializeEventStream({response:n,responseSchema:A,initialResponseContainer:i});else{const a=await fi(n.body,r);a.byteLength>0&&Object.assign(i,await s.read(A,a))}return i.$metadata=this.deserializeMetadata(n),i}}function Lc(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();const{httpLabel:r,httpPrefixHeaders:n,httpHeader:s,httpQuery:A}=t.getMergedTraits();return(e.httpBindings?typeof n=="string"||s?6:A||r?5:void 0:void 0)??e.timestampFormat.default}class mI extends Yh{constructor(r){super();S(this,"settings");this.settings=r}read(r,n){var A;const s=Oe.of(r);if(s.isListSchema())return jT(n).map(i=>this.read(s.getValueSchema(),i));if(s.isBlobSchema())return(((A=this.serdeContext)==null?void 0:A.base64Decoder)??Us)(n);if(s.isTimestampSchema())switch(Lc(s,this.settings)){case 5:return Qee(n);case 6:return Dee(n);case 7:return Oee(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(s.isStringSchema()){const i=s.getMergedTraits().mediaType;let o=n;if(i)return s.getMergedTraits().httpHeader&&(o=this.base64ToUtf8(o)),(i==="application/json"||i.endsWith("+json"))&&(o=Yn.from(o)),o}return s.isNumericSchema()?Number(n):s.isBigIntegerSchema()?BigInt(n):s.isBigDecimalSchema()?new rn(n,"bigDecimal"):s.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(r){var n,s;return(((n=this.serdeContext)==null?void 0:n.utf8Encoder)??ks)((((s=this.serdeContext)==null?void 0:s.base64Decoder)??Us)(r))}}class Ite extends Yh{constructor(r,n){super();S(this,"codecDeserializer");S(this,"stringDeserializer");this.codecDeserializer=r,this.stringDeserializer=new mI(n)}setSerdeContext(r){this.stringDeserializer.setSerdeContext(r),this.codecDeserializer.setSerdeContext(r),this.serdeContext=r}read(r,n){var o,a;const s=Oe.of(r),A=s.getMergedTraits(),i=((o=this.serdeContext)==null?void 0:o.utf8Encoder)??ks;if(A.httpHeader||A.httpResponseCode)return this.stringDeserializer.read(s,i(n));if(A.httpPayload){if(s.isBlobSchema()){const c=((a=this.serdeContext)==null?void 0:a.utf8Decoder)??Jn;return typeof n=="string"?c(n):n}else if(s.isStringSchema())return"byteLength"in n?i(n):n}return this.codecDeserializer.read(s,n)}}class xte extends Yh{constructor(r){super();S(this,"settings");S(this,"stringBuffer","");this.settings=r}write(r,n){var A,i;const s=Oe.of(r);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(s.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${s.getName(!0)}`);switch(Lc(s,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=Gh(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(s.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(((A=this.serdeContext)==null?void 0:A.base64Encoder)??Xn)(n);return}if(s.isListSchema()&&Array.isArray(n)){let c="";for(const l of n){this.write([s.getValueSchema(),s.getMergedTraits()],l);const h=this.flush(),d=s.getValueSchema().isTimestampSchema()?h:xee(h);c!==""&&(c+=", "),c+=d}this.stringBuffer=c;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":const o=s.getMergedTraits().mediaType;let a=n;if(o&&((o==="application/json"||o.endsWith("+json"))&&(a=Yn.from(a)),s.getMergedTraits().httpHeader)){this.stringBuffer=(((i=this.serdeContext)==null?void 0:i.base64Encoder)??Xn)(a.toString());return}this.stringBuffer=n;break;default:s.isIdempotencyToken()?this.stringBuffer=kw():this.stringBuffer=String(n)}}flush(){const r=this.stringBuffer;return this.stringBuffer="",r}}class Rte{constructor(e,r,n=new xte(r)){S(this,"codecSerializer");S(this,"stringSerializer");S(this,"buffer");this.codecSerializer=e,this.stringSerializer=n}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,r){const n=Oe.of(e),s=n.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(n,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,r)}flush(){if(this.buffer!==void 0){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}const wI=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){var n;(n=t.httpHandler)==null||n.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),yI=t=>({httpHandler:t.httpHandler()}),BI="content-length";function Ute(t){return e=>async r=>{const n=r.request;if(ot.isInstance(n)){const{body:s,headers:A}=n;if(s&&Object.keys(A).map(i=>i.toLowerCase()).indexOf(BI)===-1)try{const i=t(s);n.headers={...n.headers,[BI]:String(i)}}catch{}}return e({...r,request:n})}}const kte={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},CI=t=>({applyToStack:e=>{e.add(Ute(t.bodyLengthChecker),kte)}}),pi=t=>encodeURIComponent(t).replace(/[!'()*]/g,Fte),Fte=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function Pte(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=pi(r),Array.isArray(n))for(let s=0,A=n.length;s<A;s++)e.push(`${r}=${pi(n[s])}`);else{let s=r;(n||typeof n=="string")&&(s+=`=${pi(n)}`),e.push(s)}}return e.join("&")}const Ote=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Qte=["TimeoutError","RequestTimeout","RequestTimeoutException"],Dte=[500,502,503,504],Lte=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Mte=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],Nte=t=>(t==null?void 0:t.$retryable)!==void 0,Hte=t=>{var e;return(e=t.$metadata)==null?void 0:e.clockSkewCorrected},$te=t=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},EI=t=>{var e,r;return((e=t.$metadata)==null?void 0:e.httpStatusCode)===429||Ote.includes(t.name)||((r=t.$retryable)==null?void 0:r.throttling)==!0},Fw=(t,e=0)=>{var r,n;return Nte(t)||Hte(t)||t.name==="InvalidSignatureException"&&((r=t.message)==null?void 0:r.includes("Signature expired"))||Qte.includes(t.name)||Lte.includes((t==null?void 0:t.code)||"")||Mte.includes((t==null?void 0:t.code)||"")||Dte.includes(((n=t.$metadata)==null?void 0:n.httpStatusCode)||0)||$te(t)||Kte(t)||t.cause!==void 0&&e<=10&&Fw(t.cause,e+1)},Vte=t=>{var e;if(((e=t.$metadata)==null?void 0:e.httpStatusCode)!==void 0){const r=t.$metadata.httpStatusCode;return 500<=r&&r<=599&&!Fw(t)}return!1};function Kte(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}const _I=20*1e3,bI=500,jte=1,Gte="amz-sdk-invocation-id",zte="amz-sdk-request";function qte(t,e){var r,n,s,A;if(dA.isInstance(t))for(const i of Object.keys(t.headers)){const o=i.toLowerCase();if(o==="retry-after"){const a=t.headers[i];let c=NaN;if(a.endsWith("GMT"))try{c=(Cw(a).getTime()-Date.now())/1e3}catch(l){(r=e==null?void 0:e.trace)==null||r.call(e,"Failed to parse retry-after header"),(n=e==null?void 0:e.trace)==null||n.call(e,l)}else a.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?c=Number((s=a.match(/ GMT, ([\d.]+)$/))==null?void 0:s[1]):a.match(/^((\d+)|(\d+\.\d+))$/)?c=Number(a):Date.parse(a)>=Date.now()&&(c=(Date.parse(a)-Date.now())/1e3);return isNaN(c)?void 0:new Date(Date.now()+c*1e3)}else if(o==="x-amz-retry-after"){const a=t.headers[i],c=Number(a);if(isNaN(c)){(A=e==null?void 0:e.trace)==null||A.call(e,`Failed to parse x-amz-retry-after=${a}`);return}return new Date(Date.now()+c)}}}const Wte=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`);function Jte(t){return e=>(r,n)=>async s=>{var o,a;let A=await e.retryStrategy();const i=await e.maxAttempts();if(Yte(A)){A=A;let c=await A.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,h=0,d=0;const{request:p}=s,w=ot.isInstance(p);for(w&&(p.headers[Gte]=fI());;)try{w&&(p.headers[zte]=`attempt=${h+1}; max=${i}`);const{response:B,output:C}=await r(s);return A.recordSuccess(c),C.$metadata.attempts=h+1,C.$metadata.totalRetryDelay=d,{response:B,output:C}}catch(B){const C=Zte(B,e.logger);if(l=Wte(B),w&&t(p))throw(o=n.logger instanceof Vh?console:n.logger)==null||o.warn("An error was encountered in a non-retryable streaming request."),l;try{c=await A.refreshRetryTokenForRetry(c,C)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=h+1,l.$metadata.totalRetryDelay=d,l}h=c.getRetryCount();const _=c.getRetryDelay();d+=(((a=c==null?void 0:c.$retryLog)==null?void 0:a.acquisitionDelay)??0)+_,_>0&&await Xte(_)}}else return A=A,A!=null&&A.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",A.mode]]),A.retry(r,s)}}const Xte=t=>new Promise(e=>setTimeout(e,t)),Yte=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",Zte=(t,e)=>{const r={error:t,errorType:ere(t)},n=qte(t.$response,e);return n&&(r.retryAfterHint=n),r},ere=t=>EI(t)?"THROTTLING":Fw(t)?"TRANSIENT":Vte(t)?"SERVER_ERROR":"CLIENT_ERROR",tre={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function rre(t){const e=Jte(t);return r=>({applyToStack:n=>{n.add(e(r),tre)}})}const Lf=class Lf{constructor(e){S(this,"beta");S(this,"minCapacity");S(this,"minFillRate");S(this,"scaleConstant");S(this,"smooth");S(this,"enabled",!1);S(this,"availableTokens",0);S(this,"lastMaxRate",0);S(this,"measuredTxRate",0);S(this,"requestCount",0);S(this,"fillRate");S(this,"lastThrottleTime");S(this,"lastTimestamp",0);S(this,"lastTxRateBucket");S(this,"maxCapacity");S(this,"timeWindow",0);this.beta=(e==null?void 0:e.beta)??.7,this.minCapacity=(e==null?void 0:e.minCapacity)??1,this.minFillRate=(e==null?void 0:e.minFillRate)??.5,this.scaleConstant=(e==null?void 0:e.scaleConstant)??.4,this.smooth=(e==null?void 0:e.smooth)??.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 r;this.updateMeasuredRate();const n=e;if((n==null?void 0:n.errorType)==="THROTTLING"||EI((n==null?void 0:n.error)??e)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const A=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(A)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const r=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>Lf.setTimeoutFn(n,r)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}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(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}};S(Lf,"setTimeoutFn",(e,r)=>setTimeout(e,r));let Pw=Lf;const UA=class UA{static delay(){return UA.v2026?50:100}static throttlingDelay(){return UA.v2026?1e3:500}static cost(){return UA.v2026?14:5}static throttlingCost(){return UA.v2026?5:10}static modifiedCostType(){return UA.v2026?"THROTTLING":"TRANSIENT"}};S(UA,"v2026",typeof process<"u"&&((eH=process.env)==null?void 0:eH.SMITHY_NEW_RETRIES_2026)==="true");let _r=UA;class nre{constructor(){S(this,"x",_r.delay())}computeNextBackoffDelay(e){const s=Math.random()*Math.min(this.x*2**e,_I);return Math.floor(s)}setDelayBase(e){this.x=e}}class vI{constructor(e,r,n,s){S(this,"delay");S(this,"count");S(this,"cost");S(this,"longPoll");S(this,"$retryLog",{acquisitionDelay:0});this.delay=e,this.count=r,this.cost=n,this.longPoll=s}getRetryCount(){return this.count}getRetryDelay(){return Math.min(_I,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var gA;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(gA||(gA={}));const _o=3,SI=gA.STANDARD,Zh={incompatible:1,attempts:2,capacity:3};class Ow{constructor(e){S(this,"mode",gA.STANDARD);S(this,"retryBackoffStrategy");S(this,"capacity",bI);S(this,"maxAttemptsProvider");S(this,"baseDelay");typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??(this.maxAttemptsProvider=async()=>_o),this.baseDelay??(this.baseDelay=_r.delay()),this.retryBackoffStrategy??(this.retryBackoffStrategy=new nre)}async acquireInitialRetryToken(e){return new vI(_r.delay(),0,void 0,_r.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,r){var o,a;const n=await this.getMaxAttempts(),s=this.retryCode(e,r,n),A=s===0,i=(o=e.isLongPoll)==null?void 0:o.call(e);if(A||i){const c=r.errorType;this.retryBackoffStrategy.setDelayBase(c==="THROTTLING"?_r.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let h=l;if(r.retryAfterHint instanceof Date&&(h=Math.max(l,Math.min(r.retryAfterHint.getTime()-Date.now(),l+5e3))),A){const d=this.getCapacityCost(c);this.capacity-=d;const p=new vI(0,e.getRetryCount()+1,d,((a=e.isLongPoll)==null?void 0:a.call(e))??!1);return await new Promise(w=>setTimeout(w,h)),p.$retryLog.acquisitionDelay=h,p}else{const d=_r.v2026&&s===Zh.capacity&&i?h:0;d>0&&await new Promise(p=>setTimeout(p,d))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(bI,this.capacity+(e.getRetryCost()??jte))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${_o}`),_o}}retryCode(e,r,n){const s=e.getRetryCount()+1,A=this.isRetryableError(r.errorType)?0:Zh.incompatible,i=s<n?0:Zh.attempts,o=this.capacity>=this.getCapacityCost(r.errorType)?0:Zh.capacity;return A||i||o}getCapacityCost(e){return e===_r.modifiedCostType()?_r.throttlingCost():_r.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class sre{constructor(e,r){S(this,"mode",gA.ADAPTIVE);S(this,"rateLimiter");S(this,"standardRetryStrategy");const{rateLimiter:n}=r??{};this.rateLimiter=n??new Pw,this.standardRetryStrategy=r?new Ow({maxAttempts:typeof e=="number"?e:3,...r}):new Ow(e)}async acquireInitialRetryToken(e){const r=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),r}async refreshRetryTokenForRetry(e,r){this.rateLimiter.updateClientSendingRate(r);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,r);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const TI=(t,e)=>{const{retryStrategy:r,retryMode:n}=t,{defaultMaxAttempts:s=_o,defaultBaseDelay:A=_r.delay()}={},i=Kr(t.maxAttempts??s);let o=r?Promise.resolve(r):void 0;const a=async()=>{const c=await i();return await Kr(n)()===gA.ADAPTIVE?new sre(i,{maxAttempts:c,baseDelay:A}):new Ow({maxAttempts:c,baseDelay:A})};return Object.assign(t,{maxAttempts:i,retryStrategy:()=>o??(o=a())})},II=rre(kZ);_r.v2026||(_r.v2026=typeof process=="object"&&((tH=process.env)==null?void 0:tH.AWS_NEW_RETRIES_2026)==="true");function bt(t,e,r){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=r}function eBe(t){return t}const Are=t=>e=>async r=>{if(!ot.isInstance(r.request))return e(r);const{request:n}=r,{handlerProtocol:s=""}=t.requestHandler.metadata||{};if(s.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 A=n.hostname;n.port!=null&&(A+=`:${n.port}`),n.headers.host=A}return e(r)},ire={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xI=t=>({applyToStack:e=>{e.add(Are(t),ire)}}),ore=()=>(t,e)=>async r=>{var n,s;try{const A=await t(r),{clientName:i,commandName:o,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:h}=c,d=l??e.inputFilterSensitiveLog,p=h??e.outputFilterSensitiveLog,{$metadata:w,...B}=A.output;return(n=a==null?void 0:a.info)==null||n.call(a,{clientName:i,commandName:o,input:d(r.input),output:p(B),metadata:w}),A}catch(A){const{clientName:i,commandName:o,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:l}=c,h=l??e.inputFilterSensitiveLog;throw(s=a==null?void 0:a.error)==null||s.call(a,{clientName:i,commandName:o,input:h(r.input),error:A,metadata:A.$metadata}),A}},are={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},RI=t=>({applyToStack:e=>{e.add(ore(),are)}}),UI=t=>({applyToStack:e=>{}}),cre=(t,e)=>{if(!e||e.length===0)return t;const r=[];for(const n of e)for(const s of t)s.schemeId.split("#")[1]===n&&r.push(s);for(const n of t)r.find(({schemeId:s})=>s===n.schemeId)||r.push(n);return r};function ure(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const lre=(t,e)=>(r,n)=>async s=>{var h;const A=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,n,s.input)),i=t.authSchemePreference?await t.authSchemePreference():[],o=cre(A,i),a=ure(t.httpAuthSchemes),c=xs(n),l=[];for(const d of o){const p=a.get(d.schemeId);if(!p){l.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}const w=p.identityProvider(await e.identityProviderConfigProvider(t));if(!w){l.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:B={},signingProperties:C={}}=((h=d.propertiesExtractor)==null?void 0:h.call(d,t,n))||{};d.identityProperties=Object.assign(d.identityProperties||{},B),d.signingProperties=Object.assign(d.signingProperties||{},C),c.selectedHttpAuthScheme={httpAuthOption:d,identity:await w(d.identityProperties),signer:p.signer};break}if(!c.selectedHttpAuthScheme)throw new Error(l.join(`
3033
- `));return r(s)},hre={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},kI=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(lre(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),hre)}}),dre=t=>e=>{throw e},fre=(t,e)=>{},pre=t=>(e,r)=>async n=>{if(!ot.isInstance(n.request))return e(n);const A=xs(r).selectedHttpAuthScheme;if(!A)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=A,c=await e({...n,request:await a.sign(n.request,o,i)}).catch((a.errorHandler||dre)(i));return(a.successHandler||fre)(c.response,i),c},FI={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},PI=t=>({applyToStack:e=>{e.addRelativeTo(pre(),FI)}}),bo=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},gre=async(t,e,r,n=A=>A,...s)=>{let A=new t(r);return A=n(A)??A,await e.send(A,...s)};function Mc(t,e,r,n,s){return async function*(i,o,...a){const c=o;let l=i.startingToken??c[r],h=!0,d;for(;h;){if(c[r]=l,s&&(c[s]=c[s]??i.pageSize),i.client instanceof t)d=await gre(e,i.client,o,i.withCommand,...a);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield d;const p=l;l=mre(d,n),h=!!(l&&(!i.stopOnSameToken||l!==p))}return void 0}}const mre=(t,e)=>{let r=t;const n=e.split(".");for(const s of n){if(!r||typeof r!="object")return;r=r[s]}return r};class OI{constructor(e){S(this,"authSchemes",new Map);for(const r in e){const n=e[r];n!==void 0&&this.authSchemes.set(r,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class wre{async sign(e,r,n){return e}}const yre=(t=>function(r){return QI(r)&&r.expiration.getTime()-Date.now()<t})(3e5),QI=t=>t.expiration!==void 0,Bre=(t,e,r)=>{if(t===void 0)return;const n=typeof t!="function"?async()=>Promise.resolve(t):t;let s,A,i,o=!1;const a=async c=>{A||(A=n(c));try{s=await A,i=!0,o=!1}finally{A=void 0}return s};return e===void 0?async c=>((!i||c!=null&&c.forceRefresh)&&(s=await a(c)),s):async c=>((!i||c!=null&&c.forceRefresh)&&(s=await a(c)),o?s:r(s)?(e(s)&&await a(c),s):(o=!0,s))},Cre=void 0;function Ere(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function DI(t){const e=bo(t.userAgentAppId??Cre),{customUserAgent:r}=t;return Object.assign(t,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{var s,A;const n=await e();if(!Ere(n)){const i=((A=(s=t.logger)==null?void 0:s.constructor)==null?void 0:A.name)==="NoOpLogger"||!t.logger?console:t.logger;typeof n!="string"?i==null||i.warn("userAgentAppId must be a string or undefined."):n.length>50&&(i==null||i.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."))}return n}})}let _re={partitions:[{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)"}}}]};const bre=t=>{const{partitions:e}=_re;for(const n of e){const{regions:s,outputs:A}=n;for(const[i,o]of Object.entries(s))if(i===t)return{...A,...o}}for(const n of e){const{regionRegex:s,outputs:A}=n;if(new RegExp(s).test(t))return{...A}}const r=e.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},vre=/\d{12}\.ddb/;async function Sre(t,e,r){var A,i,o,a,c;const n=r.request;if(((A=n==null?void 0:n.headers)==null?void 0:A["smithy-protocol"])==="rpc-v2-cbor"&&bt(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const l=await e.retryStrategy();if(typeof l.mode=="string")switch(l.mode){case gA.ADAPTIVE:bt(t,"RETRY_MODE_ADAPTIVE","F");break;case gA.STANDARD:bt(t,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const l=t.endpointV2;switch(String((i=l==null?void 0:l.url)==null?void 0:i.hostname).match(vre)&&bt(t,"ACCOUNT_ID_ENDPOINT","O"),await((o=e.accountIdEndpointMode)==null?void 0:o.call(e))){case"disabled":bt(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":bt(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":bt(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const s=(c=(a=t.__smithy_context)==null?void 0:a.selectedHttpAuthScheme)==null?void 0:c.identity;if(s!=null&&s.$source){const l=s;l.accountId&&bt(t,"RESOLVED_ACCOUNT_ID","T");for(const[h,d]of Object.entries(l.$source??{}))bt(t,h,d)}}const LI="user-agent",Qw="x-amz-user-agent",MI=" ",Dw="/",Tre=/[^!$%&'*+\-.^_`|~\w]/g,Ire=/[^!$%&'*+\-.^_`|~\w#]/g,NI="-",xre=1024;function Rre(t){let e="";for(const r in t){const n=t[r];if(e.length+n.length+1<=xre){e.length?e+=","+n:e+=n;continue}break}return e}const Ure=t=>(e,r)=>async n=>{var p,w,B,C;const{request:s}=n;if(!ot.isInstance(s))return e(n);const{headers:A}=s,i=((p=r==null?void 0:r.userAgent)==null?void 0:p.map(ed))||[],o=(await t.defaultUserAgentProvider()).map(ed);await Sre(r,t,n);const a=r;o.push(`m/${Rre(Object.assign({},(w=r.__smithy_context)==null?void 0:w.features,(B=a.__aws_sdk_context)==null?void 0:B.features))}`);const c=((C=t==null?void 0:t.customUserAgent)==null?void 0:C.map(ed))||[],l=await t.userAgentAppId();l&&o.push(ed(["app",`${l}`]));const h=[].concat([...o,...i,...c]).join(MI),d=[...o.filter(_=>_.startsWith("aws-sdk-")),...c].join(MI);return t.runtime!=="browser"?(d&&(A[Qw]=A[Qw]?`${A[LI]} ${d}`:d),A[LI]=h):A[Qw]=h,e({...n,request:s})},ed=t=>{var i;const e=t[0].split(Dw).map(o=>o.replace(Tre,NI)).join(Dw),r=(i=t[1])==null?void 0:i.replace(Ire,NI),n=e.indexOf(Dw),s=e.substring(0,n);let A=e.substring(n+1);return s==="api"&&(A=A.toLowerCase()),[s,A,r].filter(o=>o&&o.length>0).reduce((o,a,c)=>{switch(c){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},kre={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},HI=t=>({applyToStack:e=>{e.add(Ure(t),kre)}}),$I=({serviceId:t,clientVersion:e})=>async r=>{var p,w,B;const n=typeof window<"u"?window.navigator:void 0,s=(n==null?void 0:n.userAgent)??"",A=((p=n==null?void 0:n.userAgentData)==null?void 0:p.platform)??VI.os(s)??"other",i=void 0,o=((w=n==null?void 0:n.userAgentData)==null?void 0:w.brands)??[],a=o[o.length-1],c=(a==null?void 0:a.brand)??VI.browser(s)??"unknown",l=(a==null?void 0:a.version)??"unknown",h=[["aws-sdk-js",e],["ua","2.1"],[`os/${A}`,i],["lang/js"],["md/browser",`${c}_${l}`]];t&&h.push([`api/${t}`,e]);const d=await((B=r==null?void 0:r.userAgentAppId)==null?void 0:B.call(r));return d&&h.push([`app/${d}`]),h},VI={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}},KI=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!KI(r))return!1;return!0}return!(!Mh(t)||t.length<3||t.length>63||t!==t.toLowerCase()||rI(t))},jI=":",Fre="/",Lw={isVirtualHostableS3Bucket:KI,parseArn:t=>{const e=t.split(jI);if(e.length<6)return null;const[r,n,s,A,i,...o]=e;if(r!=="arn"||n===""||s===""||o.join(jI)==="")return null;const a=o.map(c=>c.split(Fre)).flat();return{partition:n,service:s,region:A,accountId:i,resourceId:a}},partition:bre};Jh.aws=Lw;class Mw extends Error{constructor(r,n=!0){var i;let s,A=!0;typeof n=="boolean"?(s=void 0,A=n):n!=null&&typeof n=="object"&&(s=n.logger,A=n.tryNextLink??!0);super(r);S(this,"name","ProviderError");S(this,"tryNextLink");this.tryNextLink=A,Object.setPrototypeOf(this,Mw.prototype),(i=s==null?void 0:s.debug)==null||i.call(s,`@smithy/property-provider ${A?"->":"(!)"} ${r}`)}static from(r,n=!0){return Object.assign(new this(r.message,n),r)}}class vo extends Mw{constructor(r,n=!0){super(r,n);S(this,"name","CredentialsProviderError");Object.setPrototypeOf(this,vo.prototype)}}const Pre=(t,e,r)=>{let n,s,A,i=!1;const o=async()=>{s||(s=t());try{n=await s,A=!0,i=!1}finally{s=void 0}return n};return async a=>((!A||a!=null&&a.forceRefresh)&&(n=await o()),n)},GI=new Set,Ore=(t,e=Mh)=>{if(!GI.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else GI.add(t)},zI=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),Qre=t=>zI(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,qI=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{const n=typeof e=="function"?await e():e,s=Qre(n);return Ore(s),s},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return zI(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},Dre=["in-region","cross-region","mobile","standard","legacy"],WI=({defaultsMode:t}={})=>Pre(async()=>{const e=typeof t=="function"?await t():t;switch(e==null?void 0:e.toLowerCase()){case"auto":return Promise.resolve(Lre()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e==null?void 0:e.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Dre.join(", ")}, got ${e}`)}}),Lre=()=>{var e;const t=window==null?void 0:window.navigator;if(t!=null&&t.connection){const{effectiveType:r,rtt:n,downlink:s}=t==null?void 0:t.connection;if(typeof r=="string"&&r!=="4g"||Number(n)>100||Number(s)<10)return!0}return((e=t==null?void 0:t.userAgentData)==null?void 0:e.mobile)||typeof(t==null?void 0:t.maxTouchPoints)=="number"&&(t==null?void 0:t.maxTouchPoints)>1},JI=!1,XI=!1,YI=t=>({setRegion(e){t.region=e},region(){return t.region}}),ZI=t=>({region:t.region()}),Mre=()=>{const e=new Array(8);for(let r=0;r<8;r++){const n=new Array(512);for(let s=0;s<256;s++){let A=BigInt(s);for(let i=0;i<8*(r+1);i++)A&1n?A=A>>1n^0x9a6c9329ac4bc9b5n:A=A>>1n;n[s*2]=Number(A>>32n&0xffffffffn),n[s*2+1]=Number(A&0xffffffffn)}e[r]=new Uint32Array(n)}return e};let Nw,Nc,Hw,$w,Vw,Kw,jw,Gw,zw;const Nre=()=>{Nw||(Nw=Mre(),[Nc,Hw,$w,Vw,Kw,jw,Gw,zw]=Nw)};class Hre{constructor(){S(this,"c1",0);S(this,"c2",0);Nre(),this.reset()}update(e){const r=e.length;let n=0,s=this.c1,A=this.c2;for(;n+8<=r;){const i=((A^e[n++])&255)<<1,o=((A>>>8^e[n++])&255)<<1,a=((A>>>16^e[n++])&255)<<1,c=((A>>>24^e[n++])&255)<<1,l=((s^e[n++])&255)<<1,h=((s>>>8^e[n++])&255)<<1,d=((s>>>16^e[n++])&255)<<1,p=((s>>>24^e[n++])&255)<<1;s=zw[i]^Gw[o]^jw[a]^Kw[c]^Vw[l]^$w[h]^Hw[d]^Nc[p],A=zw[i+1]^Gw[o+1]^jw[a+1]^Kw[c+1]^Vw[l+1]^$w[h+1]^Hw[d+1]^Nc[p+1]}for(;n<r;){const i=((A^e[n])&255)<<1;A=(A>>>8|(s&255)<<24)>>>0,s=s>>>8^Nc[i],A^=Nc[i+1],n++}this.c1=s,this.c2=A}async digest(){const e=this.c1^4294967295,r=this.c2^4294967295;return new Uint8Array([e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255])}reset(){this.c1=4294967295,this.c2=4294967295}}const So={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},$re=So.WHEN_SUPPORTED,qw={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Vre=So.WHEN_SUPPORTED;var De;(function(t){t.MD5="MD5",t.CRC32="CRC32",t.CRC32C="CRC32C",t.CRC64NVME="CRC64NVME",t.SHA1="SHA1",t.SHA256="SHA256"})(De||(De={}));var ex;(function(t){t.HEADER="header",t.TRAILER="trailer"})(ex||(ex={}));const Ww=De.CRC32,Kre=(t,{requestChecksumRequired:e,requestAlgorithmMember:r,requestChecksumCalculation:n})=>r?t[r]?t[r]:void 0:n===So.WHEN_SUPPORTED||e?Ww:void 0,td=t=>t===De.MD5?"content-md5":`x-amz-checksum-${t.toLowerCase()}`,jre=(t,e)=>{const r=t.toLowerCase();for(const n of Object.keys(e))if(r===n.toLowerCase())return!0;return!1},Gre=(t,e)=>{const r=t.toLowerCase();for(const n of Object.keys(e))if(n.toLowerCase().startsWith(r))return!0;return!1},tx=t=>t!==void 0&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!XT(t),rx=t=>new TextEncoder().encode(t);var zre=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:rx;function mA(t){return t instanceof Uint8Array?t:typeof t=="string"?zre(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function Hc(t){return typeof t=="string"?t.length===0:t.byteLength===0}function nx(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}function sx(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),r=0;r<t.length;)e[r]=t[r],r+=1;return e}return Uint32Array.from(t)}var qre=function(){function t(){this.crc32c=new Ax}return t.prototype.update=function(e){Hc(e)||this.crc32c.update(mA(e))},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,nx(this.crc32c.digest())]})})},t.prototype.reset=function(){this.crc32c=new Ax},t}(),Ax=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,n;try{for(var s=CS(e),A=s.next();!A.done;A=s.next()){var i=A.value;this.checksum=this.checksum>>>8^Jre[(this.checksum^i)&255]}}catch(o){r={error:o}}finally{try{A&&!A.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}(),Wre=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Jre=sx(Wre),Xre=function(){function t(){this.crc32=new rd}return t.prototype.update=function(e){Hc(e)||this.crc32.update(mA(e))},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,nx(this.crc32.digest())]})})},t.prototype.reset=function(){this.crc32=new rd},t}(),rd=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,n;try{for(var s=CS(e),A=s.next();!A.done;A=s.next()){var i=A.value;this.checksum=this.checksum>>>8^Zre[(this.checksum^i)&255]}}catch(o){r={error:o}}finally{try{A&&!A.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}(),Yre=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Zre=sx(Yre);const ene=()=>Xre,tne=[De.CRC32,De.CRC32C,De.CRC64NVME,De.SHA1,De.SHA256],ix=[De.SHA256,De.SHA1,De.CRC32,De.CRC32C,De.CRC64NVME],ox=(t,e)=>{const{checksumAlgorithms:r={}}=e;switch(t){case De.MD5:return(r==null?void 0:r.MD5)??e.md5;case De.CRC32:return(r==null?void 0:r.CRC32)??ene();case De.CRC32C:return(r==null?void 0:r.CRC32C)??qre;case De.CRC64NVME:return(r==null?void 0:r.CRC64NVME)??Hre;case De.SHA1:return(r==null?void 0:r.SHA1)??e.sha1;case De.SHA256:return(r==null?void 0:r.SHA256)??e.sha256;default:if(r!=null&&r[t])return r[t];throw new Error(`The checksum algorithm "${t}" is not supported by the client. Select one of ${tne}, or provide an implementation to the client constructor checksums field.`)}},ax=(t,e)=>{const r=new t;return r.update(Eo(e||"")),r.digest()},rne={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},nne=(t,e)=>(r,n)=>async s=>{if(!ot.isInstance(s.request)||Gre("x-amz-checksum-",s.request.headers))return r(s);const{request:A,input:i}=s,{body:o,headers:a}=A,{base64Encoder:c,streamHasher:l}=t,{requestChecksumRequired:h,requestAlgorithmMember:d}=e,p=await t.requestChecksumCalculation(),w=d==null?void 0:d.name,B=d==null?void 0:d.httpHeader;w&&!i[w]&&(p===So.WHEN_SUPPORTED||h)&&(i[w]=Ww,B&&(a[B]=Ww));const C=Kre(i,{requestChecksumRequired:h,requestAlgorithmMember:d==null?void 0:d.name,requestChecksumCalculation:p});let _=o,T=a;if(C){switch(C){case De.CRC32:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case De.CRC32C:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case De.CRC64NVME:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case De.SHA1:bt(n,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case De.SHA256:bt(n,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const v=td(C),k=ox(C,t);if(tx(o)){const{getAwsChunkedEncodingStream:L,bodyLengthChecker:V}=t;_=L(typeof t.requestStreamBufferSize=="number"&&t.requestStreamBufferSize>=8*1024?wte(o,t.requestStreamBufferSize,n.logger):o,{base64Encoder:c,bodyLengthChecker:V,checksumLocationName:v,checksumAlgorithmFn:k,streamHasher:l}),T={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":v},delete T["content-length"]}else if(!jre(v,a)){const L=await ax(k,o);T={...a,[v]:c(L)}}}try{return await r({...s,request:{...A,headers:T,body:_}})}catch(v){if(v instanceof Error&&v.name==="InvalidChunkSizeError")try{v.message.endsWith(".")||(v.message+="."),v.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch{}throw v}},sne={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},Ane=(t,e)=>(r,n)=>async s=>{const A=s.input,{requestValidationModeMember:i}=e,o=await t.requestChecksumCalculation(),a=await t.responseChecksumValidation();switch(o){case So.WHEN_REQUIRED:bt(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case So.WHEN_SUPPORTED:bt(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(a){case qw.WHEN_REQUIRED:bt(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case qw.WHEN_SUPPORTED:bt(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return i&&!A[i]&&a===qw.WHEN_SUPPORTED&&(A[i]="ENABLED"),r(s)},cx=(t=[])=>{const e=[];let r=ix.length;for(const n of t){const s=ix.indexOf(n);s!==-1?e[s]=n:e[r++]=n}return e.filter(Boolean)},ine=t=>{const e=t.lastIndexOf("-");if(e!==-1){const r=t.slice(e+1);if(!r.startsWith("0")){const n=parseInt(r,10);if(!isNaN(n)&&n>=1&&n<=1e4)return!0}}return!1},one=async(t,{checksumAlgorithmFn:e,base64Encoder:r})=>r(await ax(e,t)),ane=async(t,{config:e,responseAlgorithms:r,logger:n})=>{const s=cx(r),{body:A,headers:i}=t;for(const o of s){const a=td(o),c=i[a];if(c){let l;try{l=ox(o,e)}catch(p){if(o===De.CRC64NVME){n==null||n.warn(`Skipping ${De.CRC64NVME} checksum validation: ${p.message}`);continue}throw p}const{base64Encoder:h}=e;if(tx(A)){t.body=pte({expectedChecksum:c,checksumSourceLocation:a,checksum:new l,source:A,base64Encoder:h});return}const d=await one(A,{checksumAlgorithmFn:l,base64Encoder:h});if(d===c)break;throw new Error(`Checksum mismatch: expected "${d}" but received "${c}" in response header "${a}".`)}}},cne={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},une=(t,e)=>(r,n)=>async s=>{if(!ot.isInstance(s.request))return r(s);const A=s.input,i=await r(s),o=i.response,{requestValidationModeMember:a,responseAlgorithms:c}=e;if(a&&A[a]==="ENABLED"){const{clientName:l,commandName:h}=n,d=Object.keys(t.checksumAlgorithms??{}).filter(B=>{const C=td(B);return o.headers[C]!==void 0}),p=cx([...c??[],...d]);if(l==="S3Client"&&h==="GetObjectCommand"&&p.every(B=>{const C=td(B),_=o.headers[C];return!_||ine(_)}))return i;await ane(o,{config:t,responseAlgorithms:p,logger:n.logger})}return i},ve=(t,e)=>({applyToStack:r=>{r.add(nne(t,e),rne),r.addRelativeTo(Ane(t,e),sne),r.addRelativeTo(une(t,e),cne)}}),lne=t=>{const{requestChecksumCalculation:e,responseChecksumValidation:r,requestStreamBufferSize:n}=t;return Object.assign(t,{requestChecksumCalculation:Kr(e??$re),responseChecksumValidation:Kr(r??Vre),requestStreamBufferSize:Number(n??0),checksumAlgorithms:t.checksumAlgorithms??{}})},hne="content-length",dne="x-amz-decoded-content-length";function fne(){return(t,e)=>async r=>{var s;const{request:n}=r;if(ot.isInstance(n)&&!(hne in n.headers)&&!(dne in n.headers)){const A="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof((s=e==null?void 0:e.logger)==null?void 0:s.warn)=="function"&&!(e.logger instanceof Vh)?e.logger.warn(A):console.warn(A)}return t({...r})}}const pne={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},gne=t=>({applyToStack:e=>{e.add(fne(),pne)}}),mne=t=>(e,r)=>async n=>{const s=await t.region(),A=t.region;let i=()=>{};r.__s3RegionRedirect&&(Object.defineProperty(t,"region",{writable:!1,value:async()=>r.__s3RegionRedirect}),i=()=>Object.defineProperty(t,"region",{writable:!0,value:A}));try{const o=await e(n);if(r.__s3RegionRedirect){i();const a=await t.region();if(s!==a)throw new Error("Region was not restored following S3 region redirect.")}return o}catch(o){throw i(),o}},wne={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function yne(t){return(e,r)=>async n=>{var s,A,i,o;try{return await e(n)}catch(a){if(t.followRegionRedirects){const c=(s=a==null?void 0:a.$metadata)==null?void 0:s.httpStatusCode,l=r.commandName==="HeadBucketCommand",h=(i=(A=a==null?void 0:a.$response)==null?void 0:A.headers)==null?void 0:i["x-amz-bucket-region"];if(h&&(c===301||c===400&&((a==null?void 0:a.name)==="IllegalLocationConstraintException"||l))){try{const d=h;(o=r.logger)==null||o.debug(`Redirecting from ${await t.region()} to ${d}`),r.__s3RegionRedirect=d}catch(d){throw new Error("Region redirect failed: "+d)}return e(n)}}throw a}}}const Bne={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Cne=t=>({applyToStack:e=>{e.add(yne(t),Bne),e.addRelativeTo(mne(t),wne)}}),Mf=class Mf{constructor(e={}){S(this,"data");S(this,"lastPurgeTime",Date.now());this.data=e}get(e){const r=this.data[e];if(r)return r}set(e,r){return this.data[e]=r,r}delete(e){delete this.data[e]}async purgeExpired(){const e=Date.now();if(!(this.lastPurgeTime+Mf.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>e))for(const r in this.data){const n=this.data[r];if(!n.isRefreshing){const s=await n.identity;s.expiration&&s.expiration.getTime()<e&&delete this.data[r]}}}};S(Mf,"EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS",3e4);let Jw=Mf;class Xw{constructor(e,r=!1,n=Date.now()){S(this,"_identity");S(this,"isRefreshing");S(this,"accessed");this._identity=e,this.isRefreshing=r,this.accessed=n}get identity(){return this.accessed=Date.now(),this._identity}}const Nf=class Nf{constructor(e,r=new Jw){S(this,"createSessionFn");S(this,"cache");this.createSessionFn=e,this.cache=r}async getS3ExpressIdentity(e,r){const n=r.Bucket,{cache:s}=this,A=s.get(n);return A?A.identity.then(i=>{var c,l;return(((c=i.expiration)==null?void 0:c.getTime())??0)<Date.now()?s.set(n,new Xw(this.getIdentity(n))).identity:((((l=i.expiration)==null?void 0:l.getTime())??0)<Date.now()+Nf.REFRESH_WINDOW_MS&&!A.isRefreshing&&(A.isRefreshing=!0,this.getIdentity(n).then(h=>{s.set(n,new Xw(Promise.resolve(h)))})),i)}):s.set(n,new Xw(this.getIdentity(n))).identity}async getIdentity(e){var s,A;await this.cache.purgeExpired().catch(i=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
3034
- `+i)});const r=await this.createSessionFn(e);if(!((s=r.Credentials)!=null&&s.AccessKeyId)||!((A=r.Credentials)!=null&&A.SecretAccessKey))throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretAccessKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration?new Date(r.Credentials.Expiration):void 0}}};S(Nf,"REFRESH_WINDOW_MS",6e4);let Yw=Nf;const Ene=(t,{session:e})=>{const[r,n]=e,{forcePathStyle:s,useAccelerateEndpoint:A,disableMultiregionAccessPoints:i,followRegionRedirects:o,s3ExpressIdentityProvider:a,bucketEndpoint:c,expectContinueHeader:l}=t;return Object.assign(t,{forcePathStyle:s??!1,useAccelerateEndpoint:A??!1,disableMultiregionAccessPoints:i??!1,followRegionRedirects:o??!1,s3ExpressIdentityProvider:a??new Yw(async h=>r().send(new n({Bucket:h}))),bucketEndpoint:c??!1,expectContinueHeader:l??2097152})},_ne=t=>(e,r)=>async n=>{var i;const s=await e(n),{response:A}=s;if(dA.isInstance(A)&&A.headers.expires){A.headers.expiresstring=A.headers.expires;try{Cw(A.headers.expires)}catch(o){(i=r.logger)==null||i.warn(`AWS SDK Warning for ${r.clientName}::${r.commandName} response parsing (${A.headers.expires}): ${o}`),delete A.headers.expires}}return s},bne={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},ux=t=>({applyToStack:e=>{e.addRelativeTo(_ne(),bne)}});class vne{format(e){const r=[];for(const A of Object.keys(e)){const i=Jn(A);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[A]))}const n=new Uint8Array(r.reduce((A,i)=>A+i.byteLength,0));let s=0;for(const A of r)n.set(A,s),s+=A.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const A=new DataView(new ArrayBuffer(3+e.value.byteLength));A.setUint8(0,6),A.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(A.buffer);return i.set(e.value,3),i;case"string":const o=Jn(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const l=new Uint8Array(9);return l[0]=8,l.set(Tne.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!Sne.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(qT(e.value.replace(/\-/g,"")),1),h}}}var lx;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(lx||(lx={}));const Sne=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let Tne=class i5{constructor(e){S(this,"bytes");if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(e));n>-1&&s>0;n--,s/=256)r[n]=s;return e<0&&hx(r),new i5(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&hx(e),parseInt(Mr(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function hx(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const Ine="X-Amz-Algorithm",xne="X-Amz-Credential",dx="X-Amz-Date",Rne="X-Amz-SignedHeaders",Une="X-Amz-Expires",fx="X-Amz-Signature",px="X-Amz-Security-Token",gx="authorization",mx=dx.toLowerCase(),kne=[gx,mx,"date"],Fne=fx.toLowerCase(),Zw="x-amz-content-sha256",Pne=px.toLowerCase(),One={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},Qne=/^proxy-/,Dne=/^sec-/,ey="AWS4-HMAC-SHA256",Lne="AWS4-HMAC-SHA256-PAYLOAD",Mne="UNSIGNED-PAYLOAD",Nne=50,wx="aws4_request",Hne=60*60*24*7,$ne=({query:t={}})=>{const e=[],r={};for(const n of Object.keys(t)){if(n.toLowerCase()===Fne)continue;const s=pi(n);e.push(s);const A=t[n];typeof A=="string"?r[s]=`${s}=${pi(A)}`:Array.isArray(A)&&(r[s]=A.slice(0).reduce((i,o)=>i.concat([`${s}=${pi(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>r[n]).filter(n=>n).join("&")},Vne=t=>Kne(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Kne=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class jne{constructor({applyChecksum:e,credentials:r,region:n,service:s,sha256:A,uriEscapePath:i=!0}){S(this,"service");S(this,"regionProvider");S(this,"credentialProvider");S(this,"sha256");S(this,"uriEscapePath");S(this,"applyChecksum");this.service=s,this.sha256=A,this.uriEscapePath=i,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Kr(n),this.credentialProvider=Kr(r)}createCanonicalRequest(e,r,n){const s=Object.keys(r).sort();return`${e.method}
3031
+ `)}})},bte=async t=>{var e;return typeof Blob=="function"&&t instanceof Blob||((e=t.constructor)==null?void 0:e.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await t.arrayBuffer()):vte(t):Ste(t)};async function vte(t){const e=await Tte(t),r=Us(e);return new Uint8Array(r)}async function Ste(t){const e=[],r=t.getReader();let n=!1,s=0;for(;!n;){const{done:o,value:a}=await r.read();a&&(e.push(a),s+=a.length),n=o}const A=new Uint8Array(s);let i=0;for(const o of e)A.set(o,i),i+=o.length;return A}function Tte(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",A=s.indexOf(","),i=A>-1?A+1:s.length;e(s.substring(i))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const lI="The stream has already been transformed.",hI=t=>{var s,A;if(!dI(t)&&!xw(t)){const i=((A=(s=t==null?void 0:t.__proto__)==null?void 0:s.constructor)==null?void 0:A.name)||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let e=!1;const r=async()=>{if(e)throw new Error(lI);return e=!0,await bte(t)},n=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
3032
+ If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async i=>{const o=await r();if(i==="base64")return Xn(o);if(i==="hex")return Mr(o);if(i===void 0||i==="utf8"||i==="utf-8")return ks(o);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(o);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(lI);if(e=!0,dI(t))return n(t);if(xw(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},dI=t=>typeof Blob=="function"&&t instanceof Blob;class Uw extends Aee(ks,Jn,Xn,Us){}const fI=iee(t=>crypto.getRandomValues(t)),kw=fI,fi=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return Uw.mutate(t);if(!t)return Uw.mutate(new Uint8Array);const r=e.streamCollector(t);return Uw.mutate(await r)};function pI(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}class Yh{constructor(){S(this,"serdeContext")}setSerdeContext(e){this.serdeContext=e}}class gI extends Yh{constructor(r){super();S(this,"options");S(this,"compositeErrorRegistry");this.options=r,this.compositeErrorRegistry=Rs.for(r.defaultNamespace);for(const n of r.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(n)}getRequestType(){return ot}getResponseType(){return dA}setSerdeContext(r){this.serdeContext=r,this.serializer.setSerdeContext(r),this.deserializer.setSerdeContext(r),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(r)}updateServiceEndpoint(r,n){if("url"in n){r.protocol=n.url.protocol,r.hostname=n.url.hostname,r.port=n.url.port?Number(n.url.port):void 0,r.path=n.url.pathname,r.fragment=n.url.hash||void 0,r.username=n.url.username||void 0,r.password=n.url.password||void 0,r.query||(r.query={});for(const[s,A]of n.url.searchParams.entries())r.query[s]=A;if(n.headers)for(const s in n.headers)r.headers[s]=n.headers[s].join(", ");return r}else{if(r.protocol=n.protocol,r.hostname=n.hostname,r.port=n.port?Number(n.port):void 0,r.path=n.path,r.query={...n.query},n.headers)for(const s in n.headers)r.headers[s]=n.headers[s];return r}}setHostPrefix(r,n,s){var o,a;if((o=this.serdeContext)!=null&&o.disableHostPrefix)return;const A=Oe.of(n.input),i=Bo(n.traits??{});if(i.endpoint){let c=(a=i.endpoint)==null?void 0:a[0];if(typeof c=="string"){for(const[l,h]of A.structIterator()){if(!h.getMergedTraits().hostLabel)continue;const d=s[l];if(typeof d!="string")throw new Error(`@smithy/core/schema - ${l} in input must be a string as hostLabel.`);c=c.replace(`{${l}}`,d)}r.hostname=c+r.hostname}}}deserializeMetadata(r){return{httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:r,requestSchema:n,initialRequest:s}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:r,requestSchema:n,initialRequest:s})}async deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:s}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:s})}async loadEventStreamCapability(){const{EventStreamSerde:r,eventStreamSerdeProvider:n}=await Promise.resolve().then(()=>dAe),s=this.resolveEventStreamMarshaller(n);return new r({marshaller:s,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(r){const n=this.serdeContext;return n.eventStreamMarshaller?n.eventStreamMarshaller:r(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(r,n,s,A,i){return[]}getEventStreamMarshaller(){const r=this.serdeContext;if(!r.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return r.eventStreamMarshaller}}class Ite extends gI{async serializeRequest(e,r,n){const s=r&&typeof r=="object"?r:{},A=this.serializer,i={},o={},a=await n.endpoint(),c=Oe.of(e==null?void 0:e.input),l=[],h=[];let d=!1,p;const w=new ot({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:o,body:void 0});if(a){this.updateServiceEndpoint(w,a),this.setHostPrefix(w,e,s);const B=Bo(e.traits);if(B.http){w.method=B.http[0];const[C,_]=B.http[1].split("?");w.path=="/"?w.path=C:w.path+=C;const T=new URLSearchParams(_??"");for(const[v,k]of T)i[v]=k}}for(const[B,C]of c.structIterator()){const _=C.getMergedTraits()??{},T=s[B];if(T==null&&!C.isIdempotencyToken()){if(_.httpLabel&&(w.path.includes(`{${B}+}`)||w.path.includes(`{${B}}`)))throw new Error(`No value provided for input HTTP label: ${B}.`);continue}if(_.httpPayload)C.isStreaming()?C.isStructSchema()?s[B]&&(p=await this.serializeEventStream({eventStream:s[B],requestSchema:c})):p=T:(A.write(C,T),p=A.flush());else if(_.httpLabel){A.write(C,T);const v=A.flush();w.path.includes(`{${B}+}`)?w.path=w.path.replace(`{${B}+}`,v.split("/").map(pI).join("/")):w.path.includes(`{${B}}`)&&(w.path=w.path.replace(`{${B}}`,pI(v)))}else if(_.httpHeader)A.write(C,T),o[_.httpHeader.toLowerCase()]=String(A.flush());else if(typeof _.httpPrefixHeaders=="string")for(const v in T){const k=T[v],L=_.httpPrefixHeaders+v;A.write([C.getValueSchema(),{httpHeader:L}],k),o[L.toLowerCase()]=A.flush()}else _.httpQuery||_.httpQueryParams?this.serializeQuery(C,T,i):(d=!0,l.push(B),h.push(C))}if(d&&s){const[B,C]=(c.getName(!0)??"#Unknown").split("#"),_=c.getSchema()[6],T=[3,B,C,c.getMergedTraits(),l,h,void 0];_?T[6]=_:T.pop(),A.write(T,s),p=A.flush()}return w.headers=o,w.query=i,w.body=p,w}serializeQuery(e,r,n){const s=this.serializer,A=e.getMergedTraits();if(A.httpQueryParams){for(const i in r)if(!(i in n)){const o=r[i],a=e.getValueSchema();Object.assign(a.getMergedTraits(),{...A,httpQuery:i,httpQueryParams:void 0}),this.serializeQuery(a,o,n)}return}if(e.isListSchema()){const i=!!e.getMergedTraits().sparse,o=[];for(const a of r){s.write([e.getValueSchema(),A],a);const c=s.flush();(i||c!==void 0)&&o.push(c)}n[A.httpQuery]=o}else s.write([e,A],r),n[A.httpQuery]=s.flush()}async deserializeResponse(e,r,n){const s=this.deserializer,A=Oe.of(e.output),i={};if(n.statusCode>=300){const a=await fi(n.body,r);throw a.byteLength>0&&Object.assign(i,await s.read(15,a)),await this.handleError(e,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const a in n.headers){const c=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=c}const o=await this.deserializeHttpMessage(A,r,n,i);if(o.length){const a=await fi(n.body,r);if(a.byteLength>0){const c=await s.read(A,a);for(const l of o)c[l]!=null&&(i[l]=c[l])}}else o.discardResponseBody&&await fi(n.body,r);return i.$metadata=this.deserializeMetadata(n),i}async deserializeHttpMessage(e,r,n,s,A){let i;s instanceof Set?i=A:i=s;let o=!0;const a=this.deserializer,c=Oe.of(e),l=[];for(const[h,d]of c.structIterator()){const p=d.getMemberTraits();if(p.httpPayload){if(o=!1,d.isStreaming())d.isStructSchema()?i[h]=await this.deserializeEventStream({response:n,responseSchema:c}):i[h]=hI(n.body);else if(n.body){const B=await fi(n.body,r);B.byteLength>0&&(i[h]=await a.read(d,B))}}else if(p.httpHeader){const w=String(p.httpHeader).toLowerCase(),B=n.headers[w];if(B!=null)if(d.isListSchema()){const C=d.getValueSchema();C.getMergedTraits().httpHeader=w;let _;C.isTimestampSchema()&&C.getSchema()===4?_=Nee(B,",",2):_=jT(B);const T=[];for(const v of _)T.push(await a.read(C,v.trim()));i[h]=T}else i[h]=await a.read(d,B)}else if(p.httpPrefixHeaders!==void 0){i[h]={};for(const w in n.headers)if(w.startsWith(p.httpPrefixHeaders)){const B=n.headers[w],C=d.getValueSchema();C.getMergedTraits().httpHeader=w,i[h][w.slice(p.httpPrefixHeaders.length)]=await a.read(C,B)}}else p.httpResponseCode?i[h]=n.statusCode:l.push(h)}return l.discardResponseBody=o,l}}class xte extends gI{async serializeRequest(e,r,n){const s=this.serializer,A={},i={},o=await n.endpoint(),a=Oe.of(e==null?void 0:e.input),c=a.getSchema();let l;const h=r&&typeof r=="object"?r:{},d=new ot({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:A,headers:i,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,h)),h){const p=a.getEventStreamMember();if(p){if(h[p]){const w={};for(const[B,C]of a.structIterator())B!==p&&h[B]&&(s.write(C,h[B]),w[B]=s.flush());l=await this.serializeEventStream({eventStream:h[p],requestSchema:a,initialRequest:w})}}else s.write(c,h),l=s.flush()}return d.headers=Object.assign(d.headers,i),d.query=A,d.body=l,d.method="POST",d}async deserializeResponse(e,r,n){const s=this.deserializer,A=Oe.of(e.output),i={};if(n.statusCode>=300){const a=await fi(n.body,r);throw a.byteLength>0&&Object.assign(i,await s.read(15,a)),await this.handleError(e,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const a in n.headers){const c=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=c}const o=A.getEventStreamMember();if(o)i[o]=await this.deserializeEventStream({response:n,responseSchema:A,initialResponseContainer:i});else{const a=await fi(n.body,r);a.byteLength>0&&Object.assign(i,await s.read(A,a))}return i.$metadata=this.deserializeMetadata(n),i}}function Lc(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();const{httpLabel:r,httpPrefixHeaders:n,httpHeader:s,httpQuery:A}=t.getMergedTraits();return(e.httpBindings?typeof n=="string"||s?6:A||r?5:void 0:void 0)??e.timestampFormat.default}class mI extends Yh{constructor(r){super();S(this,"settings");this.settings=r}read(r,n){var A;const s=Oe.of(r);if(s.isListSchema())return jT(n).map(i=>this.read(s.getValueSchema(),i));if(s.isBlobSchema())return(((A=this.serdeContext)==null?void 0:A.base64Decoder)??Us)(n);if(s.isTimestampSchema())switch(Lc(s,this.settings)){case 5:return Lee(n);case 6:return Mee(n);case 7:return Dee(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(s.isStringSchema()){const i=s.getMergedTraits().mediaType;let o=n;if(i)return s.getMergedTraits().httpHeader&&(o=this.base64ToUtf8(o)),(i==="application/json"||i.endsWith("+json"))&&(o=Yn.from(o)),o}return s.isNumericSchema()?Number(n):s.isBigIntegerSchema()?BigInt(n):s.isBigDecimalSchema()?new rn(n,"bigDecimal"):s.isBooleanSchema()?String(n).toLowerCase()==="true":n}base64ToUtf8(r){var n,s;return(((n=this.serdeContext)==null?void 0:n.utf8Encoder)??ks)((((s=this.serdeContext)==null?void 0:s.base64Decoder)??Us)(r))}}class Rte extends Yh{constructor(r,n){super();S(this,"codecDeserializer");S(this,"stringDeserializer");this.codecDeserializer=r,this.stringDeserializer=new mI(n)}setSerdeContext(r){this.stringDeserializer.setSerdeContext(r),this.codecDeserializer.setSerdeContext(r),this.serdeContext=r}read(r,n){var o,a;const s=Oe.of(r),A=s.getMergedTraits(),i=((o=this.serdeContext)==null?void 0:o.utf8Encoder)??ks;if(A.httpHeader||A.httpResponseCode)return this.stringDeserializer.read(s,i(n));if(A.httpPayload){if(s.isBlobSchema()){const c=((a=this.serdeContext)==null?void 0:a.utf8Decoder)??Jn;return typeof n=="string"?c(n):n}else if(s.isStringSchema())return"byteLength"in n?i(n):n}return this.codecDeserializer.read(s,n)}}class Ute extends Yh{constructor(r){super();S(this,"settings");S(this,"stringBuffer","");this.settings=r}write(r,n){var A,i;const s=Oe.of(r);switch(typeof n){case"object":if(n===null){this.stringBuffer="null";return}if(s.isTimestampSchema()){if(!(n instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${n} when schema expected Date in ${s.getName(!0)}`);switch(Lc(s,this.settings)){case 5:this.stringBuffer=n.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=Gh(n);break;case 7:this.stringBuffer=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",n),this.stringBuffer=String(n.getTime()/1e3)}return}if(s.isBlobSchema()&&"byteLength"in n){this.stringBuffer=(((A=this.serdeContext)==null?void 0:A.base64Encoder)??Xn)(n);return}if(s.isListSchema()&&Array.isArray(n)){let c="";for(const l of n){this.write([s.getValueSchema(),s.getMergedTraits()],l);const h=this.flush(),d=s.getValueSchema().isTimestampSchema()?h:Uee(h);c!==""&&(c+=", "),c+=d}this.stringBuffer=c;return}this.stringBuffer=JSON.stringify(n,null,2);break;case"string":const o=s.getMergedTraits().mediaType;let a=n;if(o&&((o==="application/json"||o.endsWith("+json"))&&(a=Yn.from(a)),s.getMergedTraits().httpHeader)){this.stringBuffer=(((i=this.serdeContext)==null?void 0:i.base64Encoder)??Xn)(a.toString());return}this.stringBuffer=n;break;default:s.isIdempotencyToken()?this.stringBuffer=kw():this.stringBuffer=String(n)}}flush(){const r=this.stringBuffer;return this.stringBuffer="",r}}class kte{constructor(e,r,n=new Ute(r)){S(this,"codecSerializer");S(this,"stringSerializer");S(this,"buffer");this.codecSerializer=e,this.stringSerializer=n}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,r){const n=Oe.of(e),s=n.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(n,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,r)}flush(){if(this.buffer!==void 0){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}const wI=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){var n;(n=t.httpHandler)==null||n.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),yI=t=>({httpHandler:t.httpHandler()}),BI="content-length";function Fte(t){return e=>async r=>{const n=r.request;if(ot.isInstance(n)){const{body:s,headers:A}=n;if(s&&Object.keys(A).map(i=>i.toLowerCase()).indexOf(BI)===-1)try{const i=t(s);n.headers={...n.headers,[BI]:String(i)}}catch{}}return e({...r,request:n})}}const Pte={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},CI=t=>({applyToStack:e=>{e.add(Fte(t.bodyLengthChecker),Pte)}}),pi=t=>encodeURIComponent(t).replace(/[!'()*]/g,Ote),Ote=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function Qte(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=pi(r),Array.isArray(n))for(let s=0,A=n.length;s<A;s++)e.push(`${r}=${pi(n[s])}`);else{let s=r;(n||typeof n=="string")&&(s+=`=${pi(n)}`),e.push(s)}}return e.join("&")}const Dte=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Lte=["TimeoutError","RequestTimeout","RequestTimeoutException"],Mte=[500,502,503,504],Nte=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Hte=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],$te=t=>(t==null?void 0:t.$retryable)!==void 0,Vte=t=>{var e;return(e=t.$metadata)==null?void 0:e.clockSkewCorrected},Kte=t=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},EI=t=>{var e,r;return((e=t.$metadata)==null?void 0:e.httpStatusCode)===429||Dte.includes(t.name)||((r=t.$retryable)==null?void 0:r.throttling)==!0},Fw=(t,e=0)=>{var r,n;return $te(t)||Vte(t)||t.name==="InvalidSignatureException"&&((r=t.message)==null?void 0:r.includes("Signature expired"))||Lte.includes(t.name)||Nte.includes((t==null?void 0:t.code)||"")||Hte.includes((t==null?void 0:t.code)||"")||Mte.includes(((n=t.$metadata)==null?void 0:n.httpStatusCode)||0)||Kte(t)||Gte(t)||t.cause!==void 0&&e<=10&&Fw(t.cause,e+1)},jte=t=>{var e;if(((e=t.$metadata)==null?void 0:e.httpStatusCode)!==void 0){const r=t.$metadata.httpStatusCode;return 500<=r&&r<=599&&!Fw(t)}return!1};function Gte(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}const _I=20*1e3,bI=500,zte=1,qte="amz-sdk-invocation-id",Wte="amz-sdk-request";function Jte(t,e){var r,n,s,A;if(dA.isInstance(t))for(const i of Object.keys(t.headers)){const o=i.toLowerCase();if(o==="retry-after"){const a=t.headers[i];let c=NaN;if(a.endsWith("GMT"))try{c=(Cw(a).getTime()-Date.now())/1e3}catch(l){(r=e==null?void 0:e.trace)==null||r.call(e,"Failed to parse retry-after header"),(n=e==null?void 0:e.trace)==null||n.call(e,l)}else a.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?c=Number((s=a.match(/ GMT, ([\d.]+)$/))==null?void 0:s[1]):a.match(/^((\d+)|(\d+\.\d+))$/)?c=Number(a):Date.parse(a)>=Date.now()&&(c=(Date.parse(a)-Date.now())/1e3);return isNaN(c)?void 0:new Date(Date.now()+c*1e3)}else if(o==="x-amz-retry-after"){const a=t.headers[i],c=Number(a);if(isNaN(c)){(A=e==null?void 0:e.trace)==null||A.call(e,`Failed to parse x-amz-retry-after=${a}`);return}return new Date(Date.now()+c)}}}const Xte=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`);function Yte(t){return e=>(r,n)=>async s=>{var o,a;let A=await e.retryStrategy();const i=await e.maxAttempts();if(ere(A)){A=A;let c=await A.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,h=0,d=0;const{request:p}=s,w=ot.isInstance(p);for(w&&(p.headers[qte]=fI());;)try{w&&(p.headers[Wte]=`attempt=${h+1}; max=${i}`);const{response:B,output:C}=await r(s);return A.recordSuccess(c),C.$metadata.attempts=h+1,C.$metadata.totalRetryDelay=d,{response:B,output:C}}catch(B){const C=tre(B,e.logger);if(l=Xte(B),w&&t(p))throw(o=n.logger instanceof Vh?console:n.logger)==null||o.warn("An error was encountered in a non-retryable streaming request."),l;try{c=await A.refreshRetryTokenForRetry(c,C)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=h+1,l.$metadata.totalRetryDelay=d,l}h=c.getRetryCount();const _=c.getRetryDelay();d+=(((a=c==null?void 0:c.$retryLog)==null?void 0:a.acquisitionDelay)??0)+_,_>0&&await Zte(_)}}else return A=A,A!=null&&A.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",A.mode]]),A.retry(r,s)}}const Zte=t=>new Promise(e=>setTimeout(e,t)),ere=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",tre=(t,e)=>{const r={error:t,errorType:rre(t)},n=Jte(t.$response,e);return n&&(r.retryAfterHint=n),r},rre=t=>EI(t)?"THROTTLING":Fw(t)?"TRANSIENT":jte(t)?"SERVER_ERROR":"CLIENT_ERROR",nre={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function sre(t){const e=Yte(t);return r=>({applyToStack:n=>{n.add(e(r),nre)}})}const Lf=class Lf{constructor(e){S(this,"beta");S(this,"minCapacity");S(this,"minFillRate");S(this,"scaleConstant");S(this,"smooth");S(this,"enabled",!1);S(this,"availableTokens",0);S(this,"lastMaxRate",0);S(this,"measuredTxRate",0);S(this,"requestCount",0);S(this,"fillRate");S(this,"lastThrottleTime");S(this,"lastTimestamp",0);S(this,"lastTxRateBucket");S(this,"maxCapacity");S(this,"timeWindow",0);this.beta=(e==null?void 0:e.beta)??.7,this.minCapacity=(e==null?void 0:e.minCapacity)??1,this.minFillRate=(e==null?void 0:e.minFillRate)??.5,this.scaleConstant=(e==null?void 0:e.scaleConstant)??.4,this.smooth=(e==null?void 0:e.smooth)??.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 r;this.updateMeasuredRate();const n=e;if((n==null?void 0:n.errorType)==="THROTTLING"||EI((n==null?void 0:n.error)??e)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const A=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(A)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const r=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>Lf.setTimeoutFn(n,r)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}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(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}};S(Lf,"setTimeoutFn",(e,r)=>setTimeout(e,r));let Pw=Lf;const UA=class UA{static delay(){return UA.v2026?50:100}static throttlingDelay(){return UA.v2026?1e3:500}static cost(){return UA.v2026?14:5}static throttlingCost(){return UA.v2026?5:10}static modifiedCostType(){return UA.v2026?"THROTTLING":"TRANSIENT"}};S(UA,"v2026",typeof process<"u"&&((eH=process.env)==null?void 0:eH.SMITHY_NEW_RETRIES_2026)==="true");let _r=UA;class Are{constructor(){S(this,"x",_r.delay())}computeNextBackoffDelay(e){const s=Math.random()*Math.min(this.x*2**e,_I);return Math.floor(s)}setDelayBase(e){this.x=e}}class vI{constructor(e,r,n,s){S(this,"delay");S(this,"count");S(this,"cost");S(this,"longPoll");S(this,"$retryLog",{acquisitionDelay:0});this.delay=e,this.count=r,this.cost=n,this.longPoll=s}getRetryCount(){return this.count}getRetryDelay(){return Math.min(_I,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var gA;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(gA||(gA={}));const _o=3,SI=gA.STANDARD,Zh={incompatible:1,attempts:2,capacity:3};class Ow{constructor(e){S(this,"mode",gA.STANDARD);S(this,"retryBackoffStrategy");S(this,"capacity",bI);S(this,"maxAttemptsProvider");S(this,"baseDelay");typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??(this.maxAttemptsProvider=async()=>_o),this.baseDelay??(this.baseDelay=_r.delay()),this.retryBackoffStrategy??(this.retryBackoffStrategy=new Are)}async acquireInitialRetryToken(e){return new vI(_r.delay(),0,void 0,_r.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,r){var o,a;const n=await this.getMaxAttempts(),s=this.retryCode(e,r,n),A=s===0,i=(o=e.isLongPoll)==null?void 0:o.call(e);if(A||i){const c=r.errorType;this.retryBackoffStrategy.setDelayBase(c==="THROTTLING"?_r.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let h=l;if(r.retryAfterHint instanceof Date&&(h=Math.max(l,Math.min(r.retryAfterHint.getTime()-Date.now(),l+5e3))),A){const d=this.getCapacityCost(c);this.capacity-=d;const p=new vI(0,e.getRetryCount()+1,d,((a=e.isLongPoll)==null?void 0:a.call(e))??!1);return await new Promise(w=>setTimeout(w,h)),p.$retryLog.acquisitionDelay=h,p}else{const d=_r.v2026&&s===Zh.capacity&&i?h:0;d>0&&await new Promise(p=>setTimeout(p,d))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(bI,this.capacity+(e.getRetryCost()??zte))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${_o}`),_o}}retryCode(e,r,n){const s=e.getRetryCount()+1,A=this.isRetryableError(r.errorType)?0:Zh.incompatible,i=s<n?0:Zh.attempts,o=this.capacity>=this.getCapacityCost(r.errorType)?0:Zh.capacity;return A||i||o}getCapacityCost(e){return e===_r.modifiedCostType()?_r.throttlingCost():_r.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class ire{constructor(e,r){S(this,"mode",gA.ADAPTIVE);S(this,"rateLimiter");S(this,"standardRetryStrategy");const{rateLimiter:n}=r??{};this.rateLimiter=n??new Pw,this.standardRetryStrategy=r?new Ow({maxAttempts:typeof e=="number"?e:3,...r}):new Ow(e)}async acquireInitialRetryToken(e){const r=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),r}async refreshRetryTokenForRetry(e,r){this.rateLimiter.updateClientSendingRate(r);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,r);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const TI=(t,e)=>{const{retryStrategy:r,retryMode:n}=t,{defaultMaxAttempts:s=_o,defaultBaseDelay:A=_r.delay()}={},i=Kr(t.maxAttempts??s);let o=r?Promise.resolve(r):void 0;const a=async()=>{const c=await i();return await Kr(n)()===gA.ADAPTIVE?new ire(i,{maxAttempts:c,baseDelay:A}):new Ow({maxAttempts:c,baseDelay:A})};return Object.assign(t,{maxAttempts:i,retryStrategy:()=>o??(o=a())})},II=sre(PZ);_r.v2026||(_r.v2026=typeof process=="object"&&((tH=process.env)==null?void 0:tH.AWS_NEW_RETRIES_2026)==="true");function bt(t,e,r){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=r}function rBe(t){return t}const ore=t=>e=>async r=>{if(!ot.isInstance(r.request))return e(r);const{request:n}=r,{handlerProtocol:s=""}=t.requestHandler.metadata||{};if(s.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 A=n.hostname;n.port!=null&&(A+=`:${n.port}`),n.headers.host=A}return e(r)},are={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xI=t=>({applyToStack:e=>{e.add(ore(t),are)}}),cre=()=>(t,e)=>async r=>{var n,s;try{const A=await t(r),{clientName:i,commandName:o,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:h}=c,d=l??e.inputFilterSensitiveLog,p=h??e.outputFilterSensitiveLog,{$metadata:w,...B}=A.output;return(n=a==null?void 0:a.info)==null||n.call(a,{clientName:i,commandName:o,input:d(r.input),output:p(B),metadata:w}),A}catch(A){const{clientName:i,commandName:o,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:l}=c,h=l??e.inputFilterSensitiveLog;throw(s=a==null?void 0:a.error)==null||s.call(a,{clientName:i,commandName:o,input:h(r.input),error:A,metadata:A.$metadata}),A}},ure={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},RI=t=>({applyToStack:e=>{e.add(cre(),ure)}}),UI=t=>({applyToStack:e=>{}}),lre=(t,e)=>{if(!e||e.length===0)return t;const r=[];for(const n of e)for(const s of t)s.schemeId.split("#")[1]===n&&r.push(s);for(const n of t)r.find(({schemeId:s})=>s===n.schemeId)||r.push(n);return r};function hre(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const dre=(t,e)=>(r,n)=>async s=>{var h;const A=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,n,s.input)),i=t.authSchemePreference?await t.authSchemePreference():[],o=lre(A,i),a=hre(t.httpAuthSchemes),c=xs(n),l=[];for(const d of o){const p=a.get(d.schemeId);if(!p){l.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}const w=p.identityProvider(await e.identityProviderConfigProvider(t));if(!w){l.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:B={},signingProperties:C={}}=((h=d.propertiesExtractor)==null?void 0:h.call(d,t,n))||{};d.identityProperties=Object.assign(d.identityProperties||{},B),d.signingProperties=Object.assign(d.signingProperties||{},C),c.selectedHttpAuthScheme={httpAuthOption:d,identity:await w(d.identityProperties),signer:p.signer};break}if(!c.selectedHttpAuthScheme)throw new Error(l.join(`
3033
+ `));return r(s)},fre={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},kI=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(dre(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),fre)}}),pre=t=>e=>{throw e},gre=(t,e)=>{},mre=t=>(e,r)=>async n=>{if(!ot.isInstance(n.request))return e(n);const A=xs(r).selectedHttpAuthScheme;if(!A)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=A,c=await e({...n,request:await a.sign(n.request,o,i)}).catch((a.errorHandler||pre)(i));return(a.successHandler||gre)(c.response,i),c},FI={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},PI=t=>({applyToStack:e=>{e.addRelativeTo(mre(),FI)}}),bo=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},wre=async(t,e,r,n=A=>A,...s)=>{let A=new t(r);return A=n(A)??A,await e.send(A,...s)};function Mc(t,e,r,n,s){return async function*(i,o,...a){const c=o;let l=i.startingToken??c[r],h=!0,d;for(;h;){if(c[r]=l,s&&(c[s]=c[s]??i.pageSize),i.client instanceof t)d=await wre(e,i.client,o,i.withCommand,...a);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield d;const p=l;l=yre(d,n),h=!!(l&&(!i.stopOnSameToken||l!==p))}return void 0}}const yre=(t,e)=>{let r=t;const n=e.split(".");for(const s of n){if(!r||typeof r!="object")return;r=r[s]}return r};class OI{constructor(e){S(this,"authSchemes",new Map);for(const r in e){const n=e[r];n!==void 0&&this.authSchemes.set(r,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class Bre{async sign(e,r,n){return e}}const Cre=(t=>function(r){return QI(r)&&r.expiration.getTime()-Date.now()<t})(3e5),QI=t=>t.expiration!==void 0,Ere=(t,e,r)=>{if(t===void 0)return;const n=typeof t!="function"?async()=>Promise.resolve(t):t;let s,A,i,o=!1;const a=async c=>{A||(A=n(c));try{s=await A,i=!0,o=!1}finally{A=void 0}return s};return e===void 0?async c=>((!i||c!=null&&c.forceRefresh)&&(s=await a(c)),s):async c=>((!i||c!=null&&c.forceRefresh)&&(s=await a(c)),o?s:r(s)?(e(s)&&await a(c),s):(o=!0,s))},_re=void 0;function bre(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function DI(t){const e=bo(t.userAgentAppId??_re),{customUserAgent:r}=t;return Object.assign(t,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{var s,A;const n=await e();if(!bre(n)){const i=((A=(s=t.logger)==null?void 0:s.constructor)==null?void 0:A.name)==="NoOpLogger"||!t.logger?console:t.logger;typeof n!="string"?i==null||i.warn("userAgentAppId must be a string or undefined."):n.length>50&&(i==null||i.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."))}return n}})}let vre={partitions:[{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)"}}}]};const Sre=t=>{const{partitions:e}=vre;for(const n of e){const{regions:s,outputs:A}=n;for(const[i,o]of Object.entries(s))if(i===t)return{...A,...o}}for(const n of e){const{regionRegex:s,outputs:A}=n;if(new RegExp(s).test(t))return{...A}}const r=e.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},Tre=/\d{12}\.ddb/;async function Ire(t,e,r){var A,i,o,a,c;const n=r.request;if(((A=n==null?void 0:n.headers)==null?void 0:A["smithy-protocol"])==="rpc-v2-cbor"&&bt(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const l=await e.retryStrategy();if(typeof l.mode=="string")switch(l.mode){case gA.ADAPTIVE:bt(t,"RETRY_MODE_ADAPTIVE","F");break;case gA.STANDARD:bt(t,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const l=t.endpointV2;switch(String((i=l==null?void 0:l.url)==null?void 0:i.hostname).match(Tre)&&bt(t,"ACCOUNT_ID_ENDPOINT","O"),await((o=e.accountIdEndpointMode)==null?void 0:o.call(e))){case"disabled":bt(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":bt(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":bt(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const s=(c=(a=t.__smithy_context)==null?void 0:a.selectedHttpAuthScheme)==null?void 0:c.identity;if(s!=null&&s.$source){const l=s;l.accountId&&bt(t,"RESOLVED_ACCOUNT_ID","T");for(const[h,d]of Object.entries(l.$source??{}))bt(t,h,d)}}const LI="user-agent",Qw="x-amz-user-agent",MI=" ",Dw="/",xre=/[^!$%&'*+\-.^_`|~\w]/g,Rre=/[^!$%&'*+\-.^_`|~\w#]/g,NI="-",Ure=1024;function kre(t){let e="";for(const r in t){const n=t[r];if(e.length+n.length+1<=Ure){e.length?e+=","+n:e+=n;continue}break}return e}const Fre=t=>(e,r)=>async n=>{var p,w,B,C;const{request:s}=n;if(!ot.isInstance(s))return e(n);const{headers:A}=s,i=((p=r==null?void 0:r.userAgent)==null?void 0:p.map(ed))||[],o=(await t.defaultUserAgentProvider()).map(ed);await Ire(r,t,n);const a=r;o.push(`m/${kre(Object.assign({},(w=r.__smithy_context)==null?void 0:w.features,(B=a.__aws_sdk_context)==null?void 0:B.features))}`);const c=((C=t==null?void 0:t.customUserAgent)==null?void 0:C.map(ed))||[],l=await t.userAgentAppId();l&&o.push(ed(["app",`${l}`]));const h=[].concat([...o,...i,...c]).join(MI),d=[...o.filter(_=>_.startsWith("aws-sdk-")),...c].join(MI);return t.runtime!=="browser"?(d&&(A[Qw]=A[Qw]?`${A[LI]} ${d}`:d),A[LI]=h):A[Qw]=h,e({...n,request:s})},ed=t=>{var i;const e=t[0].split(Dw).map(o=>o.replace(xre,NI)).join(Dw),r=(i=t[1])==null?void 0:i.replace(Rre,NI),n=e.indexOf(Dw),s=e.substring(0,n);let A=e.substring(n+1);return s==="api"&&(A=A.toLowerCase()),[s,A,r].filter(o=>o&&o.length>0).reduce((o,a,c)=>{switch(c){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},Pre={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},HI=t=>({applyToStack:e=>{e.add(Fre(t),Pre)}}),$I=({serviceId:t,clientVersion:e})=>async r=>{var p,w,B;const n=typeof window<"u"?window.navigator:void 0,s=(n==null?void 0:n.userAgent)??"",A=((p=n==null?void 0:n.userAgentData)==null?void 0:p.platform)??VI.os(s)??"other",i=void 0,o=((w=n==null?void 0:n.userAgentData)==null?void 0:w.brands)??[],a=o[o.length-1],c=(a==null?void 0:a.brand)??VI.browser(s)??"unknown",l=(a==null?void 0:a.version)??"unknown",h=[["aws-sdk-js",e],["ua","2.1"],[`os/${A}`,i],["lang/js"],["md/browser",`${c}_${l}`]];t&&h.push([`api/${t}`,e]);const d=await((B=r==null?void 0:r.userAgentAppId)==null?void 0:B.call(r));return d&&h.push([`app/${d}`]),h},VI={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}},KI=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!KI(r))return!1;return!0}return!(!Mh(t)||t.length<3||t.length>63||t!==t.toLowerCase()||rI(t))},jI=":",Ore="/",Lw={isVirtualHostableS3Bucket:KI,parseArn:t=>{const e=t.split(jI);if(e.length<6)return null;const[r,n,s,A,i,...o]=e;if(r!=="arn"||n===""||s===""||o.join(jI)==="")return null;const a=o.map(c=>c.split(Ore)).flat();return{partition:n,service:s,region:A,accountId:i,resourceId:a}},partition:Sre};Jh.aws=Lw;class Mw extends Error{constructor(r,n=!0){var i;let s,A=!0;typeof n=="boolean"?(s=void 0,A=n):n!=null&&typeof n=="object"&&(s=n.logger,A=n.tryNextLink??!0);super(r);S(this,"name","ProviderError");S(this,"tryNextLink");this.tryNextLink=A,Object.setPrototypeOf(this,Mw.prototype),(i=s==null?void 0:s.debug)==null||i.call(s,`@smithy/property-provider ${A?"->":"(!)"} ${r}`)}static from(r,n=!0){return Object.assign(new this(r.message,n),r)}}class vo extends Mw{constructor(r,n=!0){super(r,n);S(this,"name","CredentialsProviderError");Object.setPrototypeOf(this,vo.prototype)}}const Qre=(t,e,r)=>{let n,s,A,i=!1;const o=async()=>{s||(s=t());try{n=await s,A=!0,i=!1}finally{s=void 0}return n};return async a=>((!A||a!=null&&a.forceRefresh)&&(n=await o()),n)},GI=new Set,Dre=(t,e=Mh)=>{if(!GI.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else GI.add(t)},zI=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),Lre=t=>zI(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,qI=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{const n=typeof e=="function"?await e():e,s=Lre(n);return Dre(s),s},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return zI(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},Mre=["in-region","cross-region","mobile","standard","legacy"],WI=({defaultsMode:t}={})=>Qre(async()=>{const e=typeof t=="function"?await t():t;switch(e==null?void 0:e.toLowerCase()){case"auto":return Promise.resolve(Nre()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e==null?void 0:e.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Mre.join(", ")}, got ${e}`)}}),Nre=()=>{var e;const t=window==null?void 0:window.navigator;if(t!=null&&t.connection){const{effectiveType:r,rtt:n,downlink:s}=t==null?void 0:t.connection;if(typeof r=="string"&&r!=="4g"||Number(n)>100||Number(s)<10)return!0}return((e=t==null?void 0:t.userAgentData)==null?void 0:e.mobile)||typeof(t==null?void 0:t.maxTouchPoints)=="number"&&(t==null?void 0:t.maxTouchPoints)>1},JI=!1,XI=!1,YI=t=>({setRegion(e){t.region=e},region(){return t.region}}),ZI=t=>({region:t.region()}),Hre=()=>{const e=new Array(8);for(let r=0;r<8;r++){const n=new Array(512);for(let s=0;s<256;s++){let A=BigInt(s);for(let i=0;i<8*(r+1);i++)A&1n?A=A>>1n^0x9a6c9329ac4bc9b5n:A=A>>1n;n[s*2]=Number(A>>32n&0xffffffffn),n[s*2+1]=Number(A&0xffffffffn)}e[r]=new Uint32Array(n)}return e};let Nw,Nc,Hw,$w,Vw,Kw,jw,Gw,zw;const $re=()=>{Nw||(Nw=Hre(),[Nc,Hw,$w,Vw,Kw,jw,Gw,zw]=Nw)};class Vre{constructor(){S(this,"c1",0);S(this,"c2",0);$re(),this.reset()}update(e){const r=e.length;let n=0,s=this.c1,A=this.c2;for(;n+8<=r;){const i=((A^e[n++])&255)<<1,o=((A>>>8^e[n++])&255)<<1,a=((A>>>16^e[n++])&255)<<1,c=((A>>>24^e[n++])&255)<<1,l=((s^e[n++])&255)<<1,h=((s>>>8^e[n++])&255)<<1,d=((s>>>16^e[n++])&255)<<1,p=((s>>>24^e[n++])&255)<<1;s=zw[i]^Gw[o]^jw[a]^Kw[c]^Vw[l]^$w[h]^Hw[d]^Nc[p],A=zw[i+1]^Gw[o+1]^jw[a+1]^Kw[c+1]^Vw[l+1]^$w[h+1]^Hw[d+1]^Nc[p+1]}for(;n<r;){const i=((A^e[n])&255)<<1;A=(A>>>8|(s&255)<<24)>>>0,s=s>>>8^Nc[i],A^=Nc[i+1],n++}this.c1=s,this.c2=A}async digest(){const e=this.c1^4294967295,r=this.c2^4294967295;return new Uint8Array([e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255])}reset(){this.c1=4294967295,this.c2=4294967295}}const So={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Kre=So.WHEN_SUPPORTED,qw={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},jre=So.WHEN_SUPPORTED;var De;(function(t){t.MD5="MD5",t.CRC32="CRC32",t.CRC32C="CRC32C",t.CRC64NVME="CRC64NVME",t.SHA1="SHA1",t.SHA256="SHA256"})(De||(De={}));var ex;(function(t){t.HEADER="header",t.TRAILER="trailer"})(ex||(ex={}));const Ww=De.CRC32,Gre=(t,{requestChecksumRequired:e,requestAlgorithmMember:r,requestChecksumCalculation:n})=>r?t[r]?t[r]:void 0:n===So.WHEN_SUPPORTED||e?Ww:void 0,td=t=>t===De.MD5?"content-md5":`x-amz-checksum-${t.toLowerCase()}`,zre=(t,e)=>{const r=t.toLowerCase();for(const n of Object.keys(e))if(r===n.toLowerCase())return!0;return!1},qre=(t,e)=>{const r=t.toLowerCase();for(const n of Object.keys(e))if(n.toLowerCase().startsWith(r))return!0;return!1},tx=t=>t!==void 0&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!XT(t),rx=t=>new TextEncoder().encode(t);var Wre=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:rx;function mA(t){return t instanceof Uint8Array?t:typeof t=="string"?Wre(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function Hc(t){return typeof t=="string"?t.length===0:t.byteLength===0}function nx(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}function sx(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),r=0;r<t.length;)e[r]=t[r],r+=1;return e}return Uint32Array.from(t)}var Jre=function(){function t(){this.crc32c=new Ax}return t.prototype.update=function(e){Hc(e)||this.crc32c.update(mA(e))},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,nx(this.crc32c.digest())]})})},t.prototype.reset=function(){this.crc32c=new Ax},t}(),Ax=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,n;try{for(var s=CS(e),A=s.next();!A.done;A=s.next()){var i=A.value;this.checksum=this.checksum>>>8^Yre[(this.checksum^i)&255]}}catch(o){r={error:o}}finally{try{A&&!A.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}(),Xre=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Yre=sx(Xre),Zre=function(){function t(){this.crc32=new rd}return t.prototype.update=function(e){Hc(e)||this.crc32.update(mA(e))},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,nx(this.crc32.digest())]})})},t.prototype.reset=function(){this.crc32=new rd},t}(),rd=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,n;try{for(var s=CS(e),A=s.next();!A.done;A=s.next()){var i=A.value;this.checksum=this.checksum>>>8^tne[(this.checksum^i)&255]}}catch(o){r={error:o}}finally{try{A&&!A.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}(),ene=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],tne=sx(ene);const rne=()=>Zre,nne=[De.CRC32,De.CRC32C,De.CRC64NVME,De.SHA1,De.SHA256],ix=[De.SHA256,De.SHA1,De.CRC32,De.CRC32C,De.CRC64NVME],ox=(t,e)=>{const{checksumAlgorithms:r={}}=e;switch(t){case De.MD5:return(r==null?void 0:r.MD5)??e.md5;case De.CRC32:return(r==null?void 0:r.CRC32)??rne();case De.CRC32C:return(r==null?void 0:r.CRC32C)??Jre;case De.CRC64NVME:return(r==null?void 0:r.CRC64NVME)??Vre;case De.SHA1:return(r==null?void 0:r.SHA1)??e.sha1;case De.SHA256:return(r==null?void 0:r.SHA256)??e.sha256;default:if(r!=null&&r[t])return r[t];throw new Error(`The checksum algorithm "${t}" is not supported by the client. Select one of ${nne}, or provide an implementation to the client constructor checksums field.`)}},ax=(t,e)=>{const r=new t;return r.update(Eo(e||"")),r.digest()},sne={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Ane=(t,e)=>(r,n)=>async s=>{if(!ot.isInstance(s.request)||qre("x-amz-checksum-",s.request.headers))return r(s);const{request:A,input:i}=s,{body:o,headers:a}=A,{base64Encoder:c,streamHasher:l}=t,{requestChecksumRequired:h,requestAlgorithmMember:d}=e,p=await t.requestChecksumCalculation(),w=d==null?void 0:d.name,B=d==null?void 0:d.httpHeader;w&&!i[w]&&(p===So.WHEN_SUPPORTED||h)&&(i[w]=Ww,B&&(a[B]=Ww));const C=Gre(i,{requestChecksumRequired:h,requestAlgorithmMember:d==null?void 0:d.name,requestChecksumCalculation:p});let _=o,T=a;if(C){switch(C){case De.CRC32:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case De.CRC32C:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case De.CRC64NVME:bt(n,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case De.SHA1:bt(n,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case De.SHA256:bt(n,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const v=td(C),k=ox(C,t);if(tx(o)){const{getAwsChunkedEncodingStream:L,bodyLengthChecker:V}=t;_=L(typeof t.requestStreamBufferSize=="number"&&t.requestStreamBufferSize>=8*1024?Bte(o,t.requestStreamBufferSize,n.logger):o,{base64Encoder:c,bodyLengthChecker:V,checksumLocationName:v,checksumAlgorithmFn:k,streamHasher:l}),T={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":v},delete T["content-length"]}else if(!zre(v,a)){const L=await ax(k,o);T={...a,[v]:c(L)}}}try{return await r({...s,request:{...A,headers:T,body:_}})}catch(v){if(v instanceof Error&&v.name==="InvalidChunkSizeError")try{v.message.endsWith(".")||(v.message+="."),v.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch{}throw v}},ine={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},one=(t,e)=>(r,n)=>async s=>{const A=s.input,{requestValidationModeMember:i}=e,o=await t.requestChecksumCalculation(),a=await t.responseChecksumValidation();switch(o){case So.WHEN_REQUIRED:bt(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case So.WHEN_SUPPORTED:bt(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(a){case qw.WHEN_REQUIRED:bt(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case qw.WHEN_SUPPORTED:bt(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return i&&!A[i]&&a===qw.WHEN_SUPPORTED&&(A[i]="ENABLED"),r(s)},cx=(t=[])=>{const e=[];let r=ix.length;for(const n of t){const s=ix.indexOf(n);s!==-1?e[s]=n:e[r++]=n}return e.filter(Boolean)},ane=t=>{const e=t.lastIndexOf("-");if(e!==-1){const r=t.slice(e+1);if(!r.startsWith("0")){const n=parseInt(r,10);if(!isNaN(n)&&n>=1&&n<=1e4)return!0}}return!1},cne=async(t,{checksumAlgorithmFn:e,base64Encoder:r})=>r(await ax(e,t)),une=async(t,{config:e,responseAlgorithms:r,logger:n})=>{const s=cx(r),{body:A,headers:i}=t;for(const o of s){const a=td(o),c=i[a];if(c){let l;try{l=ox(o,e)}catch(p){if(o===De.CRC64NVME){n==null||n.warn(`Skipping ${De.CRC64NVME} checksum validation: ${p.message}`);continue}throw p}const{base64Encoder:h}=e;if(tx(A)){t.body=mte({expectedChecksum:c,checksumSourceLocation:a,checksum:new l,source:A,base64Encoder:h});return}const d=await cne(A,{checksumAlgorithmFn:l,base64Encoder:h});if(d===c)break;throw new Error(`Checksum mismatch: expected "${d}" but received "${c}" in response header "${a}".`)}}},lne={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},hne=(t,e)=>(r,n)=>async s=>{if(!ot.isInstance(s.request))return r(s);const A=s.input,i=await r(s),o=i.response,{requestValidationModeMember:a,responseAlgorithms:c}=e;if(a&&A[a]==="ENABLED"){const{clientName:l,commandName:h}=n,d=Object.keys(t.checksumAlgorithms??{}).filter(B=>{const C=td(B);return o.headers[C]!==void 0}),p=cx([...c??[],...d]);if(l==="S3Client"&&h==="GetObjectCommand"&&p.every(B=>{const C=td(B),_=o.headers[C];return!_||ane(_)}))return i;await une(o,{config:t,responseAlgorithms:p,logger:n.logger})}return i},ve=(t,e)=>({applyToStack:r=>{r.add(Ane(t,e),sne),r.addRelativeTo(one(t,e),ine),r.addRelativeTo(hne(t,e),lne)}}),dne=t=>{const{requestChecksumCalculation:e,responseChecksumValidation:r,requestStreamBufferSize:n}=t;return Object.assign(t,{requestChecksumCalculation:Kr(e??Kre),responseChecksumValidation:Kr(r??jre),requestStreamBufferSize:Number(n??0),checksumAlgorithms:t.checksumAlgorithms??{}})},fne="content-length",pne="x-amz-decoded-content-length";function gne(){return(t,e)=>async r=>{var s;const{request:n}=r;if(ot.isInstance(n)&&!(fne in n.headers)&&!(pne in n.headers)){const A="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof((s=e==null?void 0:e.logger)==null?void 0:s.warn)=="function"&&!(e.logger instanceof Vh)?e.logger.warn(A):console.warn(A)}return t({...r})}}const mne={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},wne=t=>({applyToStack:e=>{e.add(gne(),mne)}}),yne=t=>(e,r)=>async n=>{const s=await t.region(),A=t.region;let i=()=>{};r.__s3RegionRedirect&&(Object.defineProperty(t,"region",{writable:!1,value:async()=>r.__s3RegionRedirect}),i=()=>Object.defineProperty(t,"region",{writable:!0,value:A}));try{const o=await e(n);if(r.__s3RegionRedirect){i();const a=await t.region();if(s!==a)throw new Error("Region was not restored following S3 region redirect.")}return o}catch(o){throw i(),o}},Bne={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Cne(t){return(e,r)=>async n=>{var s,A,i,o;try{return await e(n)}catch(a){if(t.followRegionRedirects){const c=(s=a==null?void 0:a.$metadata)==null?void 0:s.httpStatusCode,l=r.commandName==="HeadBucketCommand",h=(i=(A=a==null?void 0:a.$response)==null?void 0:A.headers)==null?void 0:i["x-amz-bucket-region"];if(h&&(c===301||c===400&&((a==null?void 0:a.name)==="IllegalLocationConstraintException"||l))){try{const d=h;(o=r.logger)==null||o.debug(`Redirecting from ${await t.region()} to ${d}`),r.__s3RegionRedirect=d}catch(d){throw new Error("Region redirect failed: "+d)}return e(n)}}throw a}}}const Ene={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},_ne=t=>({applyToStack:e=>{e.add(Cne(t),Ene),e.addRelativeTo(yne(t),Bne)}}),Mf=class Mf{constructor(e={}){S(this,"data");S(this,"lastPurgeTime",Date.now());this.data=e}get(e){const r=this.data[e];if(r)return r}set(e,r){return this.data[e]=r,r}delete(e){delete this.data[e]}async purgeExpired(){const e=Date.now();if(!(this.lastPurgeTime+Mf.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>e))for(const r in this.data){const n=this.data[r];if(!n.isRefreshing){const s=await n.identity;s.expiration&&s.expiration.getTime()<e&&delete this.data[r]}}}};S(Mf,"EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS",3e4);let Jw=Mf;class Xw{constructor(e,r=!1,n=Date.now()){S(this,"_identity");S(this,"isRefreshing");S(this,"accessed");this._identity=e,this.isRefreshing=r,this.accessed=n}get identity(){return this.accessed=Date.now(),this._identity}}const Nf=class Nf{constructor(e,r=new Jw){S(this,"createSessionFn");S(this,"cache");this.createSessionFn=e,this.cache=r}async getS3ExpressIdentity(e,r){const n=r.Bucket,{cache:s}=this,A=s.get(n);return A?A.identity.then(i=>{var c,l;return(((c=i.expiration)==null?void 0:c.getTime())??0)<Date.now()?s.set(n,new Xw(this.getIdentity(n))).identity:((((l=i.expiration)==null?void 0:l.getTime())??0)<Date.now()+Nf.REFRESH_WINDOW_MS&&!A.isRefreshing&&(A.isRefreshing=!0,this.getIdentity(n).then(h=>{s.set(n,new Xw(Promise.resolve(h)))})),i)}):s.set(n,new Xw(this.getIdentity(n))).identity}async getIdentity(e){var s,A;await this.cache.purgeExpired().catch(i=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
3034
+ `+i)});const r=await this.createSessionFn(e);if(!((s=r.Credentials)!=null&&s.AccessKeyId)||!((A=r.Credentials)!=null&&A.SecretAccessKey))throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretAccessKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration?new Date(r.Credentials.Expiration):void 0}}};S(Nf,"REFRESH_WINDOW_MS",6e4);let Yw=Nf;const bne=(t,{session:e})=>{const[r,n]=e,{forcePathStyle:s,useAccelerateEndpoint:A,disableMultiregionAccessPoints:i,followRegionRedirects:o,s3ExpressIdentityProvider:a,bucketEndpoint:c,expectContinueHeader:l}=t;return Object.assign(t,{forcePathStyle:s??!1,useAccelerateEndpoint:A??!1,disableMultiregionAccessPoints:i??!1,followRegionRedirects:o??!1,s3ExpressIdentityProvider:a??new Yw(async h=>r().send(new n({Bucket:h}))),bucketEndpoint:c??!1,expectContinueHeader:l??2097152})},vne=t=>(e,r)=>async n=>{var i;const s=await e(n),{response:A}=s;if(dA.isInstance(A)&&A.headers.expires){A.headers.expiresstring=A.headers.expires;try{Cw(A.headers.expires)}catch(o){(i=r.logger)==null||i.warn(`AWS SDK Warning for ${r.clientName}::${r.commandName} response parsing (${A.headers.expires}): ${o}`),delete A.headers.expires}}return s},Sne={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},ux=t=>({applyToStack:e=>{e.addRelativeTo(vne(),Sne)}});class Tne{format(e){const r=[];for(const A of Object.keys(e)){const i=Jn(A);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[A]))}const n=new Uint8Array(r.reduce((A,i)=>A+i.byteLength,0));let s=0;for(const A of r)n.set(A,s),s+=A.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const A=new DataView(new ArrayBuffer(3+e.value.byteLength));A.setUint8(0,6),A.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(A.buffer);return i.set(e.value,3),i;case"string":const o=Jn(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const l=new Uint8Array(9);return l[0]=8,l.set(xne.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!Ine.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(qT(e.value.replace(/\-/g,"")),1),h}}}var lx;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(lx||(lx={}));const Ine=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let xne=class i5{constructor(e){S(this,"bytes");if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(e));n>-1&&s>0;n--,s/=256)r[n]=s;return e<0&&hx(r),new i5(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&hx(e),parseInt(Mr(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function hx(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const Rne="X-Amz-Algorithm",Une="X-Amz-Credential",dx="X-Amz-Date",kne="X-Amz-SignedHeaders",Fne="X-Amz-Expires",fx="X-Amz-Signature",px="X-Amz-Security-Token",gx="authorization",mx=dx.toLowerCase(),Pne=[gx,mx,"date"],One=fx.toLowerCase(),Zw="x-amz-content-sha256",Qne=px.toLowerCase(),Dne={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},Lne=/^proxy-/,Mne=/^sec-/,ey="AWS4-HMAC-SHA256",Nne="AWS4-HMAC-SHA256-PAYLOAD",Hne="UNSIGNED-PAYLOAD",$ne=50,wx="aws4_request",Vne=60*60*24*7,Kne=({query:t={}})=>{const e=[],r={};for(const n of Object.keys(t)){if(n.toLowerCase()===One)continue;const s=pi(n);e.push(s);const A=t[n];typeof A=="string"?r[s]=`${s}=${pi(A)}`:Array.isArray(A)&&(r[s]=A.slice(0).reduce((i,o)=>i.concat([`${s}=${pi(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>r[n]).filter(n=>n).join("&")},jne=t=>Gne(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Gne=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class zne{constructor({applyChecksum:e,credentials:r,region:n,service:s,sha256:A,uriEscapePath:i=!0}){S(this,"service");S(this,"regionProvider");S(this,"credentialProvider");S(this,"sha256");S(this,"uriEscapePath");S(this,"applyChecksum");this.service=s,this.sha256=A,this.uriEscapePath=i,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Kr(n),this.credentialProvider=Kr(r)}createCanonicalRequest(e,r,n){const s=Object.keys(r).sort();return`${e.method}
3035
3035
  ${this.getCanonicalPath(e)}
3036
- ${$ne(e)}
3036
+ ${Kne(e)}
3037
3037
  ${s.map(A=>`${A}:${r[A]}`).join(`
3038
3038
  `)}
3039
3039
 
@@ -3041,6 +3041,6 @@ ${s.join(";")}
3041
3041
  ${n}`}async createStringToSign(e,r,n,s){const A=new this.sha256;A.update(Eo(n));const i=await A.digest();return`${s}
3042
3042
  ${e}
3043
3043
  ${r}
3044
- ${Mr(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const A of e.split("/"))(A==null?void 0:A.length)!==0&&A!=="."&&(A===".."?r.pop():r.push(A));const n=`${e!=null&&e.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&(e!=null&&e.endsWith("/"))?"/":""}`;return pi(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const r=Vne(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}const nd={},ty=[],ry=(t,e,r)=>`${t}/${e}/${r}/${wx}`,Gne=async(t,e,r,n,s)=>{const A=await yx(t,e.secretAccessKey,e.accessKeyId),i=`${r}:${n}:${s}:${Mr(A)}:${e.sessionToken}`;if(i in nd)return nd[i];for(ty.push(i);ty.length>Nne;)delete nd[ty.shift()];let o=`AWS4${e.secretAccessKey}`;for(const a of[r,n,s,wx])o=await yx(t,o,a);return nd[i]=o},yx=(t,e,r)=>{const n=new t(e);return n.update(Eo(r)),n.digest()},Bx=({headers:t},e,r)=>{const n={};for(const s of Object.keys(t).sort()){if(t[s]==null)continue;const A=s.toLowerCase();(A in One||e!=null&&e.has(A)||Qne.test(A)||Dne.test(A))&&(!r||r&&!r.has(A))||(n[A]=t[s].trim().replace(/\s+/g," "))}return n},ny=async({headers:t,body:e},r)=>{for(const n of Object.keys(t))if(n.toLowerCase()===Zw)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||XT(e)){const n=new r;return n.update(Eo(e)),Mr(await n.digest())}return Mne},zne=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},qne=(t,e={})=>{var s,A;const{headers:r,query:n={}}=ot.clone(t);for(const i of Object.keys(r)){const o=i.toLowerCase();(o.slice(0,6)==="x-amz-"&&!((s=e.unhoistableHeaders)!=null&&s.has(o))||(A=e.hoistableHeaders)!=null&&A.has(o))&&(n[i]=r[i],delete r[i])}return{...t,headers:r,query:n}},Cx=t=>{t=ot.clone(t);for(const e of Object.keys(t.headers))kne.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t};class sy extends jne{constructor({applyChecksum:r,credentials:n,region:s,service:A,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:r,credentials:n,region:s,service:A,sha256:i,uriEscapePath:o});S(this,"headerFormatter",new vne)}async presign(r,n={}){const{signingDate:s=new Date,expiresIn:A=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:c,signingRegion:l,signingService:h}=n,d=await this.credentialProvider();this.validateResolvedCredentials(d);const p=l??await this.regionProvider(),{longDate:w,shortDate:B}=this.formatDate(s);if(A>Hne)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const C=ry(B,p,h??this.service),_=qne(Cx(r),{unhoistableHeaders:o,hoistableHeaders:c});d.sessionToken&&(_.query[px]=d.sessionToken),_.query[Ine]=ey,_.query[xne]=`${d.accessKeyId}/${C}`,_.query[dx]=w,_.query[Une]=A.toString(10);const T=Bx(_,i,a);return _.query[Rne]=this.getCanonicalHeaderList(T),_.query[fx]=await this.getSignature(w,C,this.getSigningKey(d,p,B,h),this.createCanonicalRequest(_,T,await ny(r,this.sha256))),_}async sign(r,n){return typeof r=="string"?this.signString(r,n):r.headers&&r.payload?this.signEvent(r,n):r.message?this.signMessage(r,n):this.signRequest(r,n)}async signEvent({headers:r,payload:n},{signingDate:s=new Date,priorSignature:A,signingRegion:i,signingService:o,eventStreamCredentials:a}){const c=i??await this.regionProvider(),{shortDate:l,longDate:h}=this.formatDate(s),d=ry(l,c,o??this.service),p=await ny({headers:{},body:n},this.sha256),w=new this.sha256;w.update(r);const B=Mr(await w.digest()),C=[Lne,h,d,A,B,p].join(`
3045
- `);return this.signString(C,{signingDate:s,signingRegion:c,signingService:o,eventStreamCredentials:a})}async signMessage(r,{signingDate:n=new Date,signingRegion:s,signingService:A,eventStreamCredentials:i}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:n,signingRegion:s,signingService:A,priorSignature:r.priorSignature,eventStreamCredentials:i}).then(a=>({message:r.message,signature:a}))}async signString(r,{signingDate:n=new Date,signingRegion:s,signingService:A,eventStreamCredentials:i}={}){const o=i??await this.credentialProvider();this.validateResolvedCredentials(o);const a=s??await this.regionProvider(),{shortDate:c}=this.formatDate(n),l=new this.sha256(await this.getSigningKey(o,a,c,A));return l.update(Eo(r)),Mr(await l.digest())}async signRequest(r,{signingDate:n=new Date,signableHeaders:s,unsignableHeaders:A,signingRegion:i,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const c=i??await this.regionProvider(),l=Cx(r),{longDate:h,shortDate:d}=this.formatDate(n),p=ry(d,c,o??this.service);l.headers[mx]=h,a.sessionToken&&(l.headers[Pne]=a.sessionToken);const w=await ny(l,this.sha256);!zne(Zw,l.headers)&&this.applyChecksum&&(l.headers[Zw]=w);const B=Bx(l,A,s),C=await this.getSignature(h,p,this.getSigningKey(a,c,d,o),this.createCanonicalRequest(l,B,w));return l.headers[gx]=`${ey} Credential=${a.accessKeyId}/${p}, SignedHeaders=${this.getCanonicalHeaderList(B)}, Signature=${C}`,l}async getSignature(r,n,s,A){const i=await this.createStringToSign(r,n,A,ey),o=new this.sha256(await s);return o.update(Eo(i)),Mr(await o.digest())}getSigningKey(r,n,s,A){return Gne(this.sha256,r,s,n,A||this.service)}}const Ay="X-Amz-S3session-Token",Ex=Ay.toLowerCase();class Wne extends sy{async signWithCredentials(e,r,n){const s=_x(r);e.headers[Ex]=r.sessionToken;const A=this;return bx(A,s),A.signRequest(e,n??{})}async presignWithCredentials(e,r,n){const s=_x(r);return delete e.headers[Ex],e.headers[Ay]=r.sessionToken,e.query=e.query??{},e.query[Ay]=r.sessionToken,bx(this,s),this.presign(e,n)}}function _x(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function bx(t,e){const r=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=r,Promise.resolve(e))}class vx{constructor(e){S(this,"sigv4aSigner");S(this,"sigv4Signer");S(this,"signerOptions");this.sigv4Signer=new Wne(e),this.signerOptions=e}static sigv4aDependency(){return"none"}async sign(e,r={}){return r.signingRegion==="*"?this.getSigv4aSigner().sign(e,r):this.sigv4Signer.sign(e,r)}async signWithCredentials(e,r,n={}){if(n.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(e,r,n)}async presign(e,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(e,r)}async presignWithCredentials(e,r,n={}){if(n.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const Jne="Directory",Xne="S3Express",Yne="sigv4-s3express",Zne="X-Amz-S3session-Token".toLowerCase(),ese=t=>(e,r)=>async n=>{var s,A,i,o,a;if(r.endpointV2){const c=r.endpointV2,l=((i=(A=(s=c.properties)==null?void 0:s.authSchemes)==null?void 0:A[0])==null?void 0:i.name)===Yne;if((((o=c.properties)==null?void 0:o.backend)===Xne||((a=c.properties)==null?void 0:a.bucketType)===Jne)&&(bt(r,"S3_EXPRESS_BUCKET","J"),r.isS3ExpressBucket=!0),l){const d=n.input.Bucket;if(d){const p=await t.s3ExpressIdentityProvider.getS3ExpressIdentity(await t.credentials(),{Bucket:d});r.s3ExpressIdentity=p,ot.isInstance(n.request)&&p.sessionToken&&(n.request.headers[Zne]=p.sessionToken)}}}return e(n)},tse={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},rse=t=>({applyToStack:e=>{e.add(ese(t),tse)}}),nse=async(t,e,r,n)=>{const s=await n.signWithCredentials(r,t,{});if(s.headers["X-Amz-Security-Token"]||s.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return s},sse=t=>e=>{throw e},Ase=(t,e)=>{},ise=t=>(e,r)=>async n=>{if(!ot.isInstance(n.request))return e(n);const A=xs(r).selectedHttpAuthScheme;if(!A)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=A;let c;r.s3ExpressIdentity?c=await nse(r.s3ExpressIdentity,i,n.request,await t.signer()):c=await a.sign(n.request,o,i);const l=await e({...n,request:c}).catch((a.errorHandler||sse)(i));return(a.successHandler||Ase)(l.response,i),l},ose=t=>({applyToStack:e=>{e.addRelativeTo(ise(t),FI)}});function ase(t){return new ReadableStream({start(e){e.enqueue(t),e.close()}})}const cse={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},use=t=>(e,r)=>async n=>{const s=await e(n),{response:A}=s;if(!dA.isInstance(A))return s;const{statusCode:i,body:o}=A;if(i<200||i>=300)return s;const a=await lse(o,t);if(A.body=ase(a),a.length===0&&cse[r.commandName]){const l=new Error("S3 aborted request");throw l.$metadata={httpStatusCode:503},l.name="InternalError",l}const c=t.utf8Encoder(a.subarray(a.length-16));return c&&c.endsWith("</Error>")&&(A.statusCode=503),s},lse=(t=new Uint8Array,e)=>t instanceof Uint8Array?Promise.resolve(t):e.streamCollector(t)||Promise.resolve(new Uint8Array),hse={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ee=t=>({applyToStack:e=>{e.addRelativeTo(use(t),hse)}}),dse=t=>typeof t=="string"&&t.indexOf("arn:")===0&&t.split(":").length>=6;function fse(t){return(e,r)=>async n=>{var s,A,i,o;if(t.bucketEndpoint){const a=r.endpointV2;if(a){const c=n.input.Bucket;if(typeof c=="string")try{const l=new URL(c);r.endpointV2={...a,url:l}}catch(l){const h=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${c} could not be parsed as URL.`;throw((A=(s=r.logger)==null?void 0:s.constructor)==null?void 0:A.name)==="NoOpLogger"?console.warn(h):(o=(i=r.logger)==null?void 0:i.warn)==null||o.call(i,h),l}}}return e(n)}}const pse={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function gse({bucketEndpoint:t}){return e=>async r=>{const{input:{Bucket:n}}=r;if(!t&&typeof n=="string"&&!dse(n)&&n.indexOf("/")>=0){const s=new Error(`Bucket name shouldn't contain '/', received '${n}'`);throw s.name="InvalidBucketName",s}return e({...r})}}const mse={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},wse=t=>({applyToStack:e=>{e.add(gse(t),mse),e.addRelativeTo(fse(t),pse)}});class Sx{constructor(e=!1){S(this,"queryCompat");S(this,"errorRegistry");this.queryCompat=e}resolveRestContentType(e,r){const n=r.getMemberSchemas(),s=Object.values(n).find(A=>!!A.getMergedTraits().httpPayload);if(s){const A=s.getMergedTraits().mediaType;return A||(s.isStringSchema()?"text/plain":s.isBlobSchema()?"application/octet-stream":e)}else if(!r.isUnitSchema()&&Object.values(n).find(i=>{const{httpQuery:o,httpQueryParams:a,httpHeader:c,httpLabel:l,httpPrefixHeaders:h}=i.getMergedTraits();return!o&&!a&&!c&&!l&&h===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,r,n,s,A,i){var c,l;let o=e;e.includes("#")&&([,o]=e.split("#"));const a={$metadata:A,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:(i==null?void 0:i(this.errorRegistry,o))??this.errorRegistry.getSchema(e),errorMetadata:a}}catch{s.message=s.message??s.Message??"UnknownError";const d=this.errorRegistry,p=d.getBaseException();if(p){const C=d.getErrorCtor(p)??Error;throw this.decorateServiceException(Object.assign(new C({name:o}),a),s)}const w=s,B=(w==null?void 0:w.message)??(w==null?void 0:w.Message)??((c=w==null?void 0:w.Error)==null?void 0:c.Message)??((l=w==null?void 0:w.Error)==null?void 0:l.message);throw this.decorateServiceException(Object.assign(new Error(B),{name:o},a),s)}}compose(e,r,n){let s=n;r.includes("#")&&([s]=r.split("#"));const A=Rs.for(s),i=Rs.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(A),e.copyFrom(i),this.errorRegistry=e}decorateServiceException(e,r={}){var n,s,A,i;if(this.queryCompat){const o=e.Message??r.Message,a=UT(e,r);o&&(a.message=o);const c=a.Error??{};c.Type=(n=a.Error)==null?void 0:n.Type,c.Code=(s=a.Error)==null?void 0:s.Code,c.Message=((A=a.Error)==null?void 0:A.message)??((i=a.Error)==null?void 0:i.Message)??o,a.Error=c;const l=a.$metadata.requestId;return l&&(a.RequestId=l),a}return UT(e,r)}setQueryCompatError(e,r){var s;const n=(s=r.headers)==null?void 0:s["x-amzn-query-error"];if(e!==void 0&&n!=null){const[A,i]=n.split(";"),o=Object.keys(e),a={Code:A,Type:i};e.Code=A,e.Type=i;for(let c=0;c<o.length;c++){const l=o[c];a[l==="message"?"Message":l]=e[l]}delete a.__type,e.Error=a}}queryCompatOutput(e,r){e.Error&&(r.Error=e.Error),e.Type&&(r.Type=e.Type),e.Code&&(r.Code=e.Code)}findQueryCompatibleError(e,r){try{return e.getSchema(r)}catch{return e.find(s=>{var A;return((A=Oe.of(s).getMergedTraits().awsQueryError)==null?void 0:A[0])===r})}}}class To{constructor(){S(this,"serdeContext")}setSerdeContext(e){this.serdeContext=e}}class Tx{constructor(e,r){S(this,"from");S(this,"to");S(this,"keys");this.from=e,this.to=r;const n=Object.keys(this.from),s=new Set(n);s.delete("__type"),this.keys=s}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,r=this.from[e];this.to.$unknown=[e,r]}}}function yse(t,e,r){if(r!=null&&r.source){const n=r.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new rn(n,"bigDecimal"):BigInt(n)}return e}const Bse=(t,e)=>fi(t,e).then(r=>((e==null?void 0:e.utf8Encoder)??ks)(r)),Cse=(t,e)=>Bse(t,e).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw(n==null?void 0:n.name)==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),Ix=(t,e)=>Object.keys(t).find(r=>r.toLowerCase()===e.toLowerCase()),iy=t=>{let e=t;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},Ese=(t,e,r=!1)=>_se(t,e,r?["code","header","type"]:["type","code","header"]),_se=({headers:t},e,r)=>{for(;r.length>0;)switch(r.shift()){case"header":const s=Ix(t??{},"x-amzn-errortype");if(s!==void 0)return iy(t[s]);break;case"code":const A=Ix(e??{},"code");if(A&&e[A]!==void 0)return iy(e[A]);break;case"type":if((e==null?void 0:e.__type)!==void 0)return iy(e.__type);break}};class bse extends To{constructor(r){super();S(this,"settings");this.settings=r}async read(r,n){return this._read(r,typeof n=="string"?JSON.parse(n,yse):await Cse(n,this.serdeContext))}readObject(r,n){return this._read(r,n)}_read(r,n){const s=n!==null&&typeof n=="object",A=Oe.of(r);if(s){if(A.isStructSchema()){const o=n,a=A.isUnionSchema(),c={};let l;const{jsonName:h}=this.settings;h&&(l={});let d;a&&(d=new Tx(o,c));for(const[p,w]of A.structIterator()){let B=p;h&&(B=w.getMergedTraits().jsonName??B,l[B]=p),a&&d.mark(B),o[B]!=null&&(c[p]=this._read(w,o[B]))}if(a)d.writeUnknown();else if(typeof o.__type=="string")for(const p in o){const w=o[p],B=h?l[p]??p:p;B in c||(c[B]=w)}return c}if(Array.isArray(n)&&A.isListSchema()){const o=A.getValueSchema(),a=[];for(const c of n)a.push(this._read(o,c));return a}if(A.isMapSchema()){const o=A.getValueSchema(),a={};for(const c in n)a[c]=this._read(o,n[c]);return a}}if(A.isBlobSchema()&&typeof n=="string")return Us(n);const i=A.getMergedTraits().mediaType;if(A.isStringSchema()&&typeof n=="string"&&i)return i==="application/json"||i.endsWith("+json")?Yn.from(n):n;if(A.isTimestampSchema()&&n!=null)switch(Lc(A,this.settings)){case 5:return gee(n);case 6:return Cw(n);case 7:return Bee(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(A.isBigIntegerSchema()&&(typeof n=="number"||typeof n=="string"))return BigInt(n);if(A.isBigDecimalSchema()&&n!=null){if(n instanceof rn)return n;const o=n;return o.type==="bigDecimal"&&"string"in o?new rn(o.string,o.type):new rn(String(n),"bigDecimal")}if(A.isNumericSchema()&&typeof n=="string"){switch(n){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return n}if(A.isDocumentSchema())if(s){const o=Array.isArray(n)?[]:{};for(const a in n){const c=n[a];c instanceof rn?o[a]=c:o[a]=this._read(A,c)}return o}else return structuredClone(n);return n}}const xx="Ν";class vse{constructor(){S(this,"values",new Map);S(this,"counter",0);S(this,"stage",0)}createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,r)=>{if(r instanceof rn){const n=`${xx+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r=="bigint"){const n=r.toString(),s=`${xx+"b"+this.counter++}_`+n;return this.values.set(`"${s}"`,n),s}return r}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[r,n]of this.values)e=e.replace(r,n);return e}}class Sse extends To{constructor(r){super();S(this,"settings");S(this,"buffer");S(this,"useReplacer",!1);S(this,"rootSchema");this.settings=r}write(r,n){this.rootSchema=Oe.of(r),this.buffer=this._write(this.rootSchema,n)}flush(){const{rootSchema:r,useReplacer:n}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r!=null&&r.isStructSchema()||r!=null&&r.isDocumentSchema()){if(!n)return JSON.stringify(this.buffer);const s=new vse;return s.replaceInJson(JSON.stringify(this.buffer,s.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(r,n){this.write(r,n),typeof this.buffer=="object"&&(this.buffer.__type=Oe.of(r).getName(!0))}_write(r,n,s){var o,a;const A=n!==null&&typeof n=="object",i=Oe.of(r);if(A){if(i.isStructSchema()){const c=n,l={},{jsonName:h}=this.settings;let d;h&&(d={});let p=0;for(const[w,B]of i.structIterator()){const C=this._write(B,c[w],i);if(C!==void 0){let _=w;h&&(_=B.getMergedTraits().jsonName??w,d[w]=_),l[_]=C,p++}}if(i.isUnionSchema()&&p===0){const{$unknown:w}=c;if(Array.isArray(w)){const[B,C]=w;l[B]=this._write(15,C)}}else if(typeof c.__type=="string")for(const w in c){const B=c[w],C=h?d[w]??w:w;C in l||(l[C]=this._write(15,B))}return l}if(Array.isArray(n)&&i.isListSchema()){const c=i.getValueSchema(),l=[],h=!!i.getMergedTraits().sparse;for(const d of n)(h||d!=null)&&l.push(this._write(c,d));return l}if(i.isMapSchema()){const c=i.getValueSchema(),l={},h=!!i.getMergedTraits().sparse;for(const d in n){const p=n[d];(h||p!=null)&&(l[d]=this._write(c,p))}return l}if(n instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?n:(((o=this.serdeContext)==null?void 0:o.base64Encoder)??Xn)(n);if(n instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(Lc(i,this.settings)){case 5:return n.toISOString().replace(".000Z","Z");case 6:return Gh(n);case 7:return n.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",n),n.getTime()/1e3}n instanceof rn&&(this.useReplacer=!0)}if(!(n===null&&(s!=null&&s.isStructSchema()))){if(i.isStringSchema()){if(typeof n>"u"&&i.isIdempotencyToken())return kw();const c=i.getMergedTraits().mediaType;return n!=null&&c&&(c==="application/json"||c.endsWith("+json"))?Yn.from(n):n}if(typeof n=="number"&&i.isNumericSchema())return Math.abs(n)===1/0||isNaN(n)?String(n):n;if(typeof n=="string"&&i.isBlobSchema())return i===this.rootSchema?n:(((a=this.serdeContext)==null?void 0:a.base64Encoder)??Xn)(n);if(typeof n=="bigint"&&(this.useReplacer=!0),i.isDocumentSchema())if(A){const c=Array.isArray(n)?[]:{};for(const l in n){const h=n[l];h instanceof rn?(this.useReplacer=!0,c[l]=h):c[l]=this._write(i,h)}return c}else return structuredClone(n);return n}}}class Tse extends To{constructor(r){super();S(this,"settings");this.settings=r}createSerializer(){const r=new Sse(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){const r=new bse(this.settings);return r.setSerdeContext(this.serdeContext),r}}class Ise extends Tte{constructor({defaultNamespace:r,errorTypeRegistries:n,serviceTarget:s,awsQueryCompatible:A,jsonCodec:i}){super({defaultNamespace:r,errorTypeRegistries:n});S(this,"serializer");S(this,"deserializer");S(this,"serviceTarget");S(this,"codec");S(this,"mixin");S(this,"awsQueryCompatible");this.serviceTarget=s,this.codec=i??new Tse({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!A,this.mixin=new Sx(this.awsQueryCompatible)}async serializeRequest(r,n,s){const A=await super.serializeRequest(r,n,s);return A.path.endsWith("/")||(A.path+="/"),A.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,A.headers["x-amz-target"]=`${this.serviceTarget}.${r.name}`,this.awsQueryCompatible&&(A.headers["x-amzn-query-mode"]="true"),($h(r.input)==="unit"||!A.body)&&(A.body="{}"),A}getPayloadCodec(){return this.codec}async handleError(r,n,s,A,i){const{awsQueryCompatible:o}=this;o&&this.mixin.setQueryCompatError(A,s);const a=Ese(s,A,o)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);const{errorSchema:c,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,s,A,i,o?this.mixin.findQueryCompatibleError:void 0),h=Oe.of(c),d=A.message??A.Message??"UnknownError",p=this.compositeErrorRegistry.getErrorCtor(c)??Error,w=new p({}),B={},C=this.codec.createDeserializer();for(const[_,T]of h.structIterator())A[_]!=null&&(B[_]=C.readObject(T,A[_]));throw o&&this.mixin.queryCompatOutput(A,B),this.mixin.decorateServiceException(Object.assign(w,l,{$fault:h.getMergedTraits().error,message:d},B),A)}}class xse extends Ise{constructor({defaultNamespace:e,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:A}){super({defaultNamespace:e,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:A})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const Rse=/[&<>"]/g,Use={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function kse(t){return t.replace(Rse,e=>Use[e])}const Fse=/[&"'<>\r\n\u0085\u2028]/g,Pse={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","…":"&#x85;","\u2028":"&#x2028;"};function Ose(t){return t.replace(Fse,e=>Pse[e])}class oy{constructor(e){S(this,"value");this.value=e}toString(){return Ose(""+this.value)}}class br{constructor(e,r=[]){S(this,"name");S(this,"children");S(this,"attributes",{});this.name=e,this.children=r}static of(e,r,n){const s=new br(e);return r!==void 0&&s.addChildNode(new oy(r)),n!==void 0&&s.withName(n),s}withName(e){return this.name=e,this}addAttribute(e,r){return this.attributes[e]=r,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,r){return r!=null&&(this.attributes[e]=r),this}cc(e,r,n=r){if(e[r]!=null){const s=br.of(r,e[r]).withName(n);this.c(s)}}l(e,r,n,s){e[r]!=null&&s().map(i=>{i.withName(n),this.c(i)})}lc(e,r,n,s){if(e[r]!=null){const A=s(),i=new br(n);A.map(o=>{i.c(o)}),this.c(i)}}toString(){const e=!!this.children.length;let r=`<${this.name}`;const n=this.attributes;for(const s of Object.keys(n)){const A=n[s];A!=null&&(r+=` ${s}="${kse(""+A)}"`)}return r+=e?`>${this.children.map(s=>s.toString()).join("")}</${this.name}>`:"/>"}}let ay;function Qse(t){ay||(ay=new DOMParser);const e=ay.parseFromString(t,"application/xml");if(e.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const r=n=>{var s;if(n.nodeType===Node.TEXT_NODE&&(s=n.textContent)!=null&&s.trim())return n.textContent;if(n.nodeType===Node.ELEMENT_NODE){const A=n;if(A.attributes.length===0&&A.childNodes.length===0)return"";const i={},o=Array.from(A.attributes);for(const c of o)i[`${c.name}`]=c.value;const a=Array.from(A.childNodes);for(const c of a){const l=r(c);if(l!=null){const h=c.nodeName;if(a.length===1&&o.length===0&&h==="#text")return l;h in i?Array.isArray(i[h])?i[h].push(l):i[h]=[i[h],l]:i[h]=l}else if(a.length===1&&o.length===0)return A.textContent}return i}return null};return{[e.documentElement.nodeName]:r(e.documentElement)}}class Dse extends To{constructor(r){super();S(this,"settings");S(this,"stringDeserializer");this.settings=r,this.stringDeserializer=new mI(r)}setSerdeContext(r){this.serdeContext=r,this.stringDeserializer.setSerdeContext(r)}read(r,n,s){var l;const A=Oe.of(r),i=A.getMemberSchemas();if(A.isStructSchema()&&A.isMemberSchema()&&!!Object.values(i).find(h=>!!h.getMemberTraits().eventPayload)){const h={},d=Object.keys(i)[0];return i[d].isBlobSchema()?h[d]=n:h[d]=this.read(i[d],n),h}const a=(((l=this.serdeContext)==null?void 0:l.utf8Encoder)??ks)(n),c=this.parseXml(a);return this.readSchema(r,s?c[s]:c)}readSchema(r,n){const s=Oe.of(r);if(s.isUnitSchema())return;const A=s.getMergedTraits();if(s.isListSchema()&&!Array.isArray(n))return this.readSchema(s,[n]);if(n==null)return n;if(typeof n=="object"){const i=!!A.xmlFlattened;if(s.isListSchema()){const a=s.getValueSchema(),c=[],l=a.getMergedTraits().xmlName??"member",h=i?n:(n[0]??n)[l];if(h==null)return c;const d=Array.isArray(h)?h:[h];for(const p of d)c.push(this.readSchema(a,p));return c}const o={};if(s.isMapSchema()){const a=s.getKeySchema(),c=s.getValueSchema();let l;i?l=Array.isArray(n)?n:[n]:l=Array.isArray(n.entry)?n.entry:[n.entry];const h=a.getMergedTraits().xmlName??"key",d=c.getMergedTraits().xmlName??"value";for(const p of l){const w=p[h],B=p[d];o[w]=this.readSchema(c,B)}return o}if(s.isStructSchema()){const a=s.isUnionSchema();let c;a&&(c=new Tx(n,o));for(const[l,h]of s.structIterator()){const d=h.getMergedTraits(),p=d.httpPayload?d.xmlName??h.getName():h.getMemberTraits().xmlName??l;a&&c.mark(p),n[p]!=null&&(o[l]=this.readSchema(h,n[p]))}return a&&c.writeUnknown(),o}if(s.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${s.getName(!0)}`)}return s.isListSchema()?[]:s.isMapSchema()||s.isStructSchema()?{}:this.stringDeserializer.read(s,n)}parseXml(r){if(r.length){let n;try{n=Qse(r)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:r}),o}const s="#text",A=Object.keys(n)[0],i=n[A];return i[s]&&(i[A]=i[s],delete i[s]),QT(i)}return{}}}const Lse=(t,e)=>{var r;if(((r=e==null?void 0:e.Error)==null?void 0:r.Code)!==void 0)return e.Error.Code;if((e==null?void 0:e.Code)!==void 0)return e.Code;if(t.statusCode==404)return"NotFound"};class Mse extends To{constructor(r){super();S(this,"settings");S(this,"stringBuffer");S(this,"byteBuffer");S(this,"buffer");this.settings=r}write(r,n){var A;const s=Oe.of(r);if(s.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(s.isBlobSchema())this.byteBuffer="byteLength"in n?n:(((A=this.serdeContext)==null?void 0:A.base64Decoder)??Us)(n);else{this.buffer=this.writeStruct(s,n,void 0);const i=s.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(s.getName())}}flush(){var n;if(this.byteBuffer!==void 0){const s=this.byteBuffer;return delete this.byteBuffer,s}if(this.stringBuffer!==void 0){const s=this.stringBuffer;return delete this.stringBuffer,s}const r=this.buffer;return this.settings.xmlNamespace&&((n=r==null?void 0:r.attributes)!=null&&n.xmlns||r.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,r.toString()}writeStruct(r,n,s){const A=r.getMergedTraits(),i=r.isMemberSchema()&&!A.httpPayload?r.getMemberTraits().xmlName??r.getMemberName():A.xmlName??r.getName();if(!i||!r.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${r.getName(!0)}.`);const o=br.of(i),[a,c]=this.getXmlnsAttribute(r,s);for(const[h,d]of r.structIterator()){const p=n[h];if(p!=null||d.isIdempotencyToken()){if(d.getMergedTraits().xmlAttribute){o.addAttribute(d.getMergedTraits().xmlName??h,this.writeSimple(d,p));continue}if(d.isListSchema())this.writeList(d,p,o,c);else if(d.isMapSchema())this.writeMap(d,p,o,c);else if(d.isStructSchema())o.addChildNode(this.writeStruct(d,p,c));else{const w=br.of(d.getMergedTraits().xmlName??d.getMemberName());this.writeSimpleInto(d,p,w,c),o.addChildNode(w)}}}const{$unknown:l}=n;if(l&&r.isUnionSchema()&&Array.isArray(l)&&Object.keys(n).length===1){const[h,d]=l,p=br.of(h);if(typeof d!="string")if(n instanceof br||n instanceof oy)o.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,d,p,c),o.addChildNode(p)}return c&&o.addAttribute(a,c),o}writeList(r,n,s,A){if(!r.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${r.getName(!0)}`);const i=r.getMergedTraits(),o=r.getValueSchema(),a=o.getMergedTraits(),c=!!a.sparse,l=!!i.xmlFlattened,[h,d]=this.getXmlnsAttribute(r,A),p=(w,B)=>{if(o.isListSchema())this.writeList(o,Array.isArray(B)?B:[B],w,d);else if(o.isMapSchema())this.writeMap(o,B,w,d);else if(o.isStructSchema()){const C=this.writeStruct(o,B,d);w.addChildNode(C.withName(l?i.xmlName??r.getMemberName():a.xmlName??"member"))}else{const C=br.of(l?i.xmlName??r.getMemberName():a.xmlName??"member");this.writeSimpleInto(o,B,C,d),w.addChildNode(C)}};if(l)for(const w of n)(c||w!=null)&&p(s,w);else{const w=br.of(i.xmlName??r.getMemberName());d&&w.addAttribute(h,d);for(const B of n)(c||B!=null)&&p(w,B);s.addChildNode(w)}}writeMap(r,n,s,A,i=!1){if(!r.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${r.getName(!0)}`);const o=r.getMergedTraits(),a=r.getKeySchema(),l=a.getMergedTraits().xmlName??"key",h=r.getValueSchema(),d=h.getMergedTraits(),p=d.xmlName??"value",w=!!d.sparse,B=!!o.xmlFlattened,[C,_]=this.getXmlnsAttribute(r,A),T=(v,k,L)=>{const V=br.of(l,k),[x,I]=this.getXmlnsAttribute(a,_);I&&V.addAttribute(x,I),v.addChildNode(V);let R=br.of(p);h.isListSchema()?this.writeList(h,L,R,_):h.isMapSchema()?this.writeMap(h,L,R,_,!0):h.isStructSchema()?R=this.writeStruct(h,L,_):this.writeSimpleInto(h,L,R,_),v.addChildNode(R)};if(B)for(const v in n){const k=n[v];if(w||k!=null){const L=br.of(o.xmlName??r.getMemberName());T(L,v,k),s.addChildNode(L)}}else{let v;i||(v=br.of(o.xmlName??r.getMemberName()),_&&v.addAttribute(C,_),s.addChildNode(v));for(const k in n){const L=n[k];if(w||L!=null){const V=br.of("entry");T(V,k,L),(i?s:v).addChildNode(V)}}}}writeSimple(r,n){var i;if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const s=Oe.of(r);let A=null;if(n&&typeof n=="object")if(s.isBlobSchema())A=(((i=this.serdeContext)==null?void 0:i.base64Encoder)??Xn)(n);else if(s.isTimestampSchema()&&n instanceof Date)switch(Lc(s,this.settings)){case 5:A=n.toISOString().replace(".000Z","Z");break;case 6:A=Gh(n);break;case 7:A=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),A=Gh(n);break}else{if(s.isBigDecimalSchema()&&n)return n instanceof rn?n.string:String(n);throw s.isMapSchema()||s.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${s.getName(!0)}`)}if((s.isBooleanSchema()||s.isNumericSchema()||s.isBigIntegerSchema()||s.isBigDecimalSchema())&&(A=String(n)),s.isStringSchema()&&(n===void 0&&s.isIdempotencyToken()?A=kw():A=String(n)),A===null)throw new Error(`Unhandled schema-value pair ${s.getName(!0)}=${n}`);return A}writeSimpleInto(r,n,s,A){const i=this.writeSimple(r,n),o=Oe.of(r),a=new oy(i),[c,l]=this.getXmlnsAttribute(o,A);l&&s.addAttribute(c,l),s.addChildNode(a)}getXmlnsAttribute(r,n){const s=r.getMergedTraits(),[A,i]=s.xmlNamespace??[];return i&&i!==n?[A?`xmlns:${A}`:"xmlns",i]:[void 0,void 0]}}class Nse extends To{constructor(r){super();S(this,"settings");this.settings=r}createSerializer(){const r=new Mse(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){const r=new Dse(this.settings);return r.setSerdeContext(this.serdeContext),r}}class Hse extends Ste{constructor(r){super(r);S(this,"codec");S(this,"serializer");S(this,"deserializer");S(this,"mixin",new Sx);const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:r.xmlNamespace,serviceNamespace:r.defaultNamespace};this.codec=new Nse(n),this.serializer=new Rte(this.codec.createSerializer(),n),this.deserializer=new Ite(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(r,n,s){const A=await super.serializeRequest(r,n,s),i=Oe.of(r.input);if(!A.headers["content-type"]){const o=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);o&&(A.headers["content-type"]=o)}return typeof A.body=="string"&&A.headers["content-type"]===this.getDefaultContentType()&&!A.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(i)&&(A.body='<?xml version="1.0" encoding="UTF-8"?>'+A.body),A}async deserializeResponse(r,n,s){return super.deserializeResponse(r,n,s)}async handleError(r,n,s,A,i){var C,_,T;const o=Lse(s,A)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace),A.Error&&typeof A.Error=="object")for(const v of Object.keys(A.Error))A[v]=A.Error[v],v.toLowerCase()==="message"&&(A.message=A.Error[v]);A.RequestId&&!i.requestId&&(i.requestId=A.RequestId);const{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,s,A,i),l=Oe.of(a),h=((C=A.Error)==null?void 0:C.message)??((_=A.Error)==null?void 0:_.Message)??A.message??A.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,p=new d({});await this.deserializeHttpMessage(a,n,s,A);const w={},B=this.codec.createDeserializer();for(const[v,k]of l.structIterator()){const L=k.getMergedTraits().xmlName??v,V=((T=A.Error)==null?void 0:T[L])??A[L];w[v]=B.readSchema(k,V)}throw this.mixin.decorateServiceException(Object.assign(p,c,{$fault:l.getMergedTraits().error,message:h},w),A)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(r){for(const[,n]of r.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}class $se extends Hse{async serializeRequest(e,r,n){const s=await super.serializeRequest(e,r,n),A=Oe.of(e.input),i=A.getSchema();let o=0;const a=i[6]??0;if(r&&typeof r=="object")for(const[c,l]of A.structIterator()){if(++o>a)break;if(c==="Bucket"){if(!r.Bucket&&l.getMergedTraits().httpLabel)throw new Error("No value provided for input HTTP label: Bucket.");break}}return s}}function Vse(t){return e=>async r=>{var s,A,i,o;const{request:n}=r;if(t.expectContinueHeader!==!1&&ot.isInstance(n)&&n.body&&t.runtime==="node"&&((A=(s=t.requestHandler)==null?void 0:s.constructor)==null?void 0:A.name)!=="FetchHttpHandler"){let a=!0;if(typeof t.expectContinueHeader=="number")try{a=(Number((i=n.headers)==null?void 0:i["content-length"])??((o=t.bodyLengthChecker)==null?void 0:o.call(t,n.body))??1/0)>=t.expectContinueHeader}catch{}else a=!!t.expectContinueHeader;a&&(n.headers.Expect="100-continue")}return e({...r,request:n})}}const Kse={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},jse=t=>({applyToStack:e=>{e.add(Vse(t),Kse)}});function Gse(t){return e=>async r=>{const{CreateBucketConfiguration:n}=r.input,s=await t.region();return!(n!=null&&n.LocationConstraint)&&!(n!=null&&n.Location)&&s!=="us-east-1"&&(r.input.CreateBucketConfiguration=r.input.CreateBucketConfiguration??{},r.input.CreateBucketConfiguration.LocationConstraint=s),e(r)}}const zse={step:"initialize",tags:["LOCATION_CONSTRAINT","CREATE_BUCKET_CONFIGURATION"],name:"locationConstraintMiddleware",override:!0},qse=t=>({applyToStack:e=>{e.add(Gse(t),zse)}});function Wse(t){return e=>async r=>{const n={...r.input},s=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const A of s){const i=n[A.target];if(i){let o;typeof i=="string"?Xse(i,t)?o=t.base64Decoder(i):(o=t.utf8Decoder(i),n[A.target]=t.base64Encoder(o)):(o=ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i),n[A.target]=t.base64Encoder(o));const a=new t.md5;a.update(o),n[A.hash]=t.base64Encoder(await a.digest())}}return e({...r,input:n})}}const Jse={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},In=t=>({applyToStack:e=>{e.add(Wse(t),Jse)}});function Xse(t,e){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return!1;try{return e.base64Decoder(t).length===32}catch{return!1}}class Io{constructor(e){S(this,"bytes");if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(e));n>-1&&s>0;n--,s/=256)r[n]=s;return e<0&&Rx(r),new Io(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&Rx(e),parseInt(Mr(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Rx(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}class Ux{constructor(e,r){S(this,"toUtf8");S(this,"fromUtf8");this.toUtf8=e,this.fromUtf8=r}format(e){const r=[];for(const A of Object.keys(e)){const i=this.fromUtf8(A);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[A]))}const n=new Uint8Array(r.reduce((A,i)=>A+i.byteLength,0));let s=0;for(const A of r)n.set(A,s),s+=A.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const A=new DataView(new ArrayBuffer(3+e.value.byteLength));A.setUint8(0,6),A.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(A.buffer);return i.set(e.value,3),i;case"string":const o=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const l=new Uint8Array(9);return l[0]=8,l.set(Io.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!iAe.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(qT(e.value.replace(/\-/g,"")),1),h}}parse(e){const r={};let n=0;for(;n<e.byteLength;){const s=e.getUint8(n++),A=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s));switch(n+=s,e.getUint8(n++)){case 0:r[A]={type:Fx,value:!0};break;case 1:r[A]={type:Fx,value:!1};break;case 2:r[A]={type:Yse,value:e.getInt8(n++)};break;case 3:r[A]={type:Zse,value:e.getInt16(n,!1)},n+=2;break;case 4:r[A]={type:eAe,value:e.getInt32(n,!1)},n+=4;break;case 5:r[A]={type:tAe,value:new Io(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:const i=e.getUint16(n,!1);n+=2,r[A]={type:rAe,value:new Uint8Array(e.buffer,e.byteOffset+n,i)},n+=i;break;case 7:const o=e.getUint16(n,!1);n+=2,r[A]={type:nAe,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,o))},n+=o;break;case 8:r[A]={type:sAe,value:new Date(new Io(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const a=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,r[A]={type:AAe,value:`${Mr(a.subarray(0,4))}-${Mr(a.subarray(4,6))}-${Mr(a.subarray(6,8))}-${Mr(a.subarray(8,10))}-${Mr(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var kx;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(kx||(kx={}));const Fx="boolean",Yse="byte",Zse="short",eAe="integer",tAe="long",rAe="binary",nAe="string",sAe="timestamp",AAe="uuid",iAe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,Px=4,wA=Px*2,gi=4,oAe=wA+gi*2;function aAe({byteLength:t,byteOffset:e,buffer:r}){if(t<oAe)throw new Error("Provided message too short to accommodate event stream message overhead");const n=new DataView(r,e,t),s=n.getUint32(0,!1);if(t!==s)throw new Error("Reported message length does not match received message length");const A=n.getUint32(Px,!1),i=n.getUint32(wA,!1),o=n.getUint32(t-gi,!1),a=new rd().update(new Uint8Array(r,e,wA));if(i!==a.digest())throw new Error(`The prelude checksum specified in the message (${i}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(r,e+wA,t-(wA+gi))),o!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${o}`);return{headers:new DataView(r,e+wA+gi,A),body:new Uint8Array(r,e+wA+gi+A,s-A-(wA+gi+gi))}}class Ox{constructor(e,r){S(this,"headerMarshaller");S(this,"messageBuffer");S(this,"isEndOfStream");this.headerMarshaller=new Ux(e,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return r}}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return r}}}encode({headers:e,body:r}){const n=this.headerMarshaller.format(e),s=n.byteLength+r.byteLength+16,A=new Uint8Array(s),i=new DataView(A.buffer,A.byteOffset,A.byteLength),o=new rd;return i.setUint32(0,s,!1),i.setUint32(4,n.byteLength,!1),i.setUint32(8,o.update(A.subarray(0,8)).digest(),!1),A.set(n,12),A.set(r,n.byteLength+12),i.setUint32(s-4,o.update(A.subarray(8,s-4)).digest(),!1),A}decode(e){const{headers:r,body:n}=aAe(e);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}}class Qx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.decoder.decode(e)}}class Dx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class Lx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const r=await this.options.deserializer(e);r!==void 0&&(yield r)}}}class Mx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.serializer(e)}}function Nx(t){let e=0,r=0,n=null,s=null;const A=o=>{if(typeof o!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+o);e=o,r=4,n=new Uint8Array(o),new DataView(n.buffer).setUint32(0,o,!1)},i=async function*(){const o=t[Symbol.asyncIterator]();for(;;){const{value:a,done:c}=await o.next();if(c){if(e)if(e===r)yield n;else throw new Error("Truncated event message received.");else return;return}const l=a.length;let h=0;for(;h<l;){if(!n){const p=l-h;s||(s=new Uint8Array(4));const w=Math.min(4-r,p);if(s.set(a.slice(h,h+w),r),r+=w,h+=w,r<4)break;A(new DataView(s.buffer).getUint32(0,!1)),s=null}const d=Math.min(e-r,l-h);n.set(a.slice(h,h+d),r),r+=d,h+=d,e&&e===r&&(yield n,n=null,e=0,r=0)}}};return{[Symbol.asyncIterator]:i}}function Hx(t,e){return async function(r){const{value:n}=r.headers[":message-type"];if(n==="error"){const s=new Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){const s=r.headers[":exception-type"].value,A={[s]:r},i=await t(A);if(i.$unknown){const o=new Error(e(r.body));throw o.name=s,o}throw i[s]}else if(n==="event"){const s={[r.headers[":event-type"].value]:r},A=await t(s);return A.$unknown?void 0:A}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let $x=class{constructor({utf8Encoder:e,utf8Decoder:r}){S(this,"eventStreamCodec");S(this,"utfEncoder");this.eventStreamCodec=new Ox(e,r),this.utfEncoder=e}deserialize(e,r){const n=Nx(e);return new Lx({messageStream:new Qx({inputStream:n,decoder:this.eventStreamCodec}),deserializer:Hx(r,this.utfEncoder)})}serialize(e,r){return new Dx({messageStream:new Mx({inputStream:e,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const Vx=t=>({[Symbol.asyncIterator]:async function*(){const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}}),Kx=t=>{const e=t[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:n,value:s}=await e.next();if(n)return r.close();r.enqueue(s)}})};class jx{constructor({utf8Encoder:e,utf8Decoder:r}){S(this,"universalMarshaller");this.universalMarshaller=new $x({utf8Decoder:r,utf8Encoder:e})}deserialize(e,r){const n=cAe(e)?Vx(e):e;return this.universalMarshaller.deserialize(n,r)}serialize(e,r){const n=this.universalMarshaller.serialize(e,r);return typeof ReadableStream=="function"?Kx(n):n}}const cAe=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream,Gx=t=>new jx(t),zx=t=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)});class uAe{constructor({marshaller:e,serializer:r,deserializer:n,serdeContext:s,defaultContentType:A}){S(this,"marshaller");S(this,"serializer");S(this,"deserializer");S(this,"serdeContext");S(this,"defaultContentType");this.marshaller=e,this.serializer=r,this.deserializer=n,this.serdeContext=s,this.defaultContentType=A}async serializeEventStream({eventStream:e,requestSchema:r,initialRequest:n}){const s=this.marshaller,A=r.getEventStreamMember(),i=r.getMemberSchema(A),o=this.serializer,a=this.defaultContentType,c=Symbol("initialRequestMarker"),l={async*[Symbol.asyncIterator](){if(n){const h={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a}};o.write(r,n);const d=o.flush();yield{[c]:!0,headers:h,body:d}}for await(const h of e)yield h}};return s.serialize(l,h=>{if(h[c])return{headers:h.headers,body:h.body};let d="";for(const T in h)if(T!=="__type"){d=T;break}const{additionalHeaders:p,body:w,eventType:B,explicitPayloadContentType:C}=this.writeEventBody(d,i,h);return{headers:{":event-type":{type:"string",value:B},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:C??a},...p},body:w}})}async deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:n}){var d;const s=this.marshaller,A=r.getEventStreamMember(),o=r.getMemberSchema(A).getMemberSchemas(),a=Symbol("initialResponseMarker"),c=s.deserialize(e.body,async p=>{var C,_;let w="";for(const T in p)if(T!=="__type"){w=T;break}const B=p[w].body;if(w==="initial-response"){const T=await this.deserializer.read(r,B);return delete T[A],{[a]:!0,...T}}else if(w in o){const T=o[w];if(T.isStructSchema()){const v={};let k=!1;for(const[L,V]of T.structIterator()){const{eventHeader:x,eventPayload:I}=V.getMergedTraits();if(k=k||!!(x||I),I)V.isBlobSchema()?v[L]=B:V.isStringSchema()?v[L]=(((C=this.serdeContext)==null?void 0:C.utf8Encoder)??ks)(B):V.isStructSchema()&&(v[L]=await this.deserializer.read(V,B));else if(x){const R=(_=p[w].headers[L])==null?void 0:_.value;R!=null&&(V.isNumericSchema()?R&&typeof R=="object"&&"bytes"in R?v[L]=BigInt(R.toString()):v[L]=Number(R):v[L]=R)}}if(k)return{[w]:v};if(B.byteLength===0)return{[w]:{}}}return{[w]:await this.deserializer.read(T,B)}}else return{$unknown:p}}),l=c[Symbol.asyncIterator](),h=await l.next();if(h.done)return c;if((d=h.value)!=null&&d[a]){if(!r)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const p in h.value)n[p]=h.value[p]}return{async*[Symbol.asyncIterator](){var p;for((p=h==null?void 0:h.value)!=null&&p[a]||(yield h.value);;){const{done:w,value:B}=await l.next();if(w)break;yield B}}}}writeEventBody(e,r,n){var d;const s=this.serializer;let A=e,i=null,o;const a=r.getSchema()[4].includes(e),c={};if(a){const p=r.getMemberSchema(e);if(p.isStructSchema()){for(const[w,B]of p.structIterator()){const{eventHeader:C,eventPayload:_}=B.getMergedTraits();if(_)i=w;else if(C){const T=n[e][w];let v="binary";B.isNumericSchema()?(-2)**31<=T&&T<=2**31-1?v="integer":v="long":B.isTimestampSchema()?v="timestamp":B.isStringSchema()?v="string":B.isBooleanSchema()&&(v="boolean"),T!=null&&(c[w]={type:v,value:T},delete n[e][w])}}if(i!==null){const w=p.getMemberSchema(i);w.isBlobSchema()?o="application/octet-stream":w.isStringSchema()&&(o="text/plain"),s.write(w,n[e][i])}else s.write(p,n[e])}else if(p.isUnitSchema())s.write(p,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[p,w]=n[e];A=p,s.write(15,w)}const l=s.flush()??new Uint8Array;return{body:typeof l=="string"?(((d=this.serdeContext)==null?void 0:d.utf8Decoder)??Jn)(l):l,eventType:A,explicitPayloadContentType:o,additionalHeaders:c}}}const lAe=Object.freeze(Object.defineProperty({__proto__:null,EventStreamCodec:Ox,EventStreamMarshaller:jx,EventStreamSerde:uAe,HeaderMarshaller:Ux,Int64:Io,MessageDecoderStream:Qx,MessageEncoderStream:Dx,SmithyMessageDecoderStream:Lx,SmithyMessageEncoderStream:Mx,UniversalEventStreamMarshaller:$x,eventStreamSerdeProvider:Gx,getChunkedStream:Nx,getMessageUnmarshaller:Hx,iterableToReadableStream:Kx,readableStreamToIterable:Vx,resolveEventStreamSerdeConfig:zx},Symbol.toStringTag,{value:"Module"})),qx=t=>{var e,r;return dA.isInstance(t)?((e=t.headers)==null?void 0:e.date)??((r=t.headers)==null?void 0:r.Date):void 0},cy=t=>new Date(Date.now()+t),hAe=(t,e)=>Math.abs(cy(e).getTime()-t)>=3e5,Wx=(t,e)=>{const r=Date.parse(t);return hAe(r,e)?r-Date.now():e},$c=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},Jx=async t=>{var c,l,h;const e=$c("context",t.context),r=$c("config",t.config),n=(h=(l=(c=e.endpointV2)==null?void 0:c.properties)==null?void 0:l.authSchemes)==null?void 0:h[0],A=await $c("signer",r.signer)(n),i=t==null?void 0:t.signingRegion,o=t==null?void 0:t.signingRegionSet,a=t==null?void 0:t.signingName;return{config:r,signer:A,signingRegion:i,signingRegionSet:o,signingName:a}};class uy{async sign(e,r,n){var h;if(!ot.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const s=await Jx(n),{config:A,signer:i}=s;let{signingRegion:o,signingName:a}=s;const c=n.context;if(((h=c==null?void 0:c.authSchemes)==null?void 0:h.length)??!1){const[d,p]=c.authSchemes;(d==null?void 0:d.name)==="sigv4a"&&(p==null?void 0:p.name)==="sigv4"&&(o=(p==null?void 0:p.signingRegion)??o,a=(p==null?void 0:p.signingName)??a)}return n._preRequestSystemClockOffset=A.systemClockOffset,await i.sign(e,{signingDate:cy(A.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return r=>{const n=r,s=n.ServerTime??qx(n.$response);if(s){const A=$c("config",e.config),i=e._preRequestSystemClockOffset,o=Wx(s,A.systemClockOffset);(o!==A.systemClockOffset||i!==void 0&&i!==o)&&n.$metadata&&(A.systemClockOffset=o,n.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const n=qx(e);if(n){const s=$c("config",r.config);s.systemClockOffset=Wx(n,s.systemClockOffset)}}}class dAe extends uy{async sign(e,r,n){var d;if(!ot.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:s,signer:A,signingRegion:i,signingRegionSet:o,signingName:a}=await Jx(n),l=(await((d=s.sigv4aSigningRegionSet)==null?void 0:d.call(s))??o??[i]).join(",");return n._preRequestSystemClockOffset=s.systemClockOffset,await A.sign(e,{signingDate:cy(s.systemClockOffset),signingRegion:l,signingService:a})}}const fAe=t=>(t.sigv4aSigningRegionSet=bo(t.sigv4aSigningRegionSet),t),Xx=t=>{let e=t.credentials,r=!!t.credentials,n;Object.defineProperty(t,"credentials",{set(c){c&&c!==e&&c!==n&&(r=!0),e=c;const l=pAe(t,{credentials:e,credentialDefaultProvider:t.credentialDefaultProvider}),h=gAe(t,l);if(r&&!h.attributed){const d=typeof e=="object"&&e!==null;n=async p=>{const B=await h(p);return d&&(!B.$source||Object.keys(B.$source).length===0)?UZ(B,"CREDENTIALS_CODE","e"):B},n.memoized=h.memoized,n.configBound=h.configBound,n.attributed=!0}else n=h},get(){return n},enumerable:!0,configurable:!0}),t.credentials=e;const{signingEscapePath:s=!0,systemClockOffset:A=t.systemClockOffset||0,sha256:i}=t;let o;return t.signer?o=bo(t.signer):t.regionInfoProvider?o=()=>bo(t.region)().then(async c=>[await t.regionInfoProvider(c,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},c]).then(([c,l])=>{const{signingRegion:h,signingService:d}=c;t.signingRegion=t.signingRegion||h||l,t.signingName=t.signingName||d||t.serviceId;const p={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:s},w=t.signerConstructor||sy;return new w(p)}):o=async c=>{c=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await bo(t.region)(),properties:{}},c);const l=c.signingRegion,h=c.signingName;t.signingRegion=t.signingRegion||l,t.signingName=t.signingName||h||t.serviceId;const d={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:s},p=t.signerConstructor||sy;return new p(d)},Object.assign(t,{systemClockOffset:A,signingEscapePath:s,signer:o})};function pAe(t,{credentials:e,credentialDefaultProvider:r}){let n;return e?e!=null&&e.memoized?n=e:n=Bre(e,yre,QI):r?n=bo(r(Object.assign({},t,{parentClientConfig:t}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function gAe(t,e){if(e.configBound)return e;const r=async n=>e({...n,callerClientConfig:t});return r.memoized=e.memoized,r.configBound=!0,r}const Le="ref",we="argv",Yx="backend",Zn="authSchemes",nn="disableDoubleEncoding",sn="signingName",Ps="signingRegion",ly="signingRegionSet",Ae=-1,Qe=!0,An=!1,hy="isSet",xn="booleanEquals",xe="stringEquals",or="coalesce",vr="substring",vt="",Zx="aws.partition",e1="partitionResult",t1="accessPointSuffix",r1="regionPrefix",sd=t=>"outpostId_ssa_"+t+vt,n1="hardwareType",dy="ite",Os="isValidHostLabel",Qs="sigv4",s1="aws.isVirtualHostableS3Bucket",A1="url",Sr="getAttr",i1="bucketArn",Ds="--",o1="arnType",a1="accesspoint",fy=t=>"accessPointName_ssa_"+t+vt,py="s3-object-lambda",Vc="s3-outposts",c1="bucketPartition",u1="us-east-1",l1="outpostType",jr="name",Kc="s3",gy="{url#scheme}://{Bucket}.{url#authority}{url#path}",Ad="{url#scheme}://{url#authority}{url#path}",h1="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",d1="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",f1="https://{Bucket}.s3.{partitionResult#dnsSuffix}",p1=t=>"{url#scheme}://{accessPointName_ssa_"+t+"}-{bucketArn#accountId}.{url#authority}{url#path}",g1=t=>"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName_ssa_"+t+"}`",my="sigv4a",m1="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",w1="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",y1="https://s3.{partitionResult#dnsSuffix}",B1={[Le]:"UseFIPS"},C1={[Le]:"UseDualStack"},kt={[Le]:"Bucket"},wy={fn:Sr,[we]:[{[Le]:e1},jr]},E1={[Le]:A1},xo={[Le]:"Region"},Ls={[Le]:i1},_1={[Le]:o1},yy={[Le]:"accessPointName_ssa_1"},id={fn:Sr,[we]:[Ls,"region"]},b1={[Le]:n1},By={fn:Sr,[we]:[Ls,"service"]},v1={fn:Sr,[we]:[Ls,"accountId"]},od={[Yx]:"S3Express",[Zn]:[{[nn]:!0,[jr]:"{_s3e_auth}",[sn]:"s3express",[Ps]:"{Region}"}]},S1={[Yx]:"S3Express",[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:"s3express",[Ps]:"{Region}"}]},ad={[Zn]:[{[nn]:!0,[jr]:my,[sn]:Vc,[ly]:["*"]},{[nn]:!0,[jr]:Qs,[sn]:Vc,[Ps]:"{Region}"}]},Ft={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:u1}]},at={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:"{Region}"}]},Cy={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:py,[Ps]:"{bucketArn#region}"}]},jc={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:"{bucketArn#region}"}]},T1={[Zn]:[{[nn]:!0,[jr]:my,[sn]:Vc,[ly]:["*"]},{[nn]:!0,[jr]:Qs,[sn]:Vc,[Ps]:"{bucketArn#region}"}]},Ey={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:py,[Ps]:"{Region}"}]},I1=[xo],x1=[{[Le]:"Endpoint"}],_y=[kt],R1=[kt,0,7,!0],U1=[Ls,"resourceId[1]"],mAe=["*"],k1={conditions:[[hy,I1],[xn,[{[Le]:"Accelerate"},Qe]],[xn,[B1,Qe]],[xn,[C1,Qe]],[hy,x1],[hy,_y],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,0,6,Qe]},vt]},"--x-s3"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:R1},vt]},"--xa-s3"]],[Zx,I1,e1],[vr,R1,t1],[xe,[{[Le]:t1},"--op-s3"]],[vr,[kt,8,12,Qe],r1],[vr,[kt,32,49,Qe],sd(2)],[vr,[kt,49,50,Qe],n1],[xn,[{[Le]:"ForcePathStyle"},Qe]],[xe,[wy,"aws-cn"]],[dy,[C1,".dualstack",vt],"_s3e_ds"],[Os,[{[Le]:sd(2)},An]],[dy,[B1,"-fips",vt],"_s3e_fips"],[dy,[{fn:or,[we]:[{[Le]:"DisableS3ExpressSessionAuth"},An]},Qs,"sigv4-s3express"],"_s3e_auth"],[s1,[kt,An]],["parseURL",x1,A1],[xn,[{fn:or,[we]:[{[Le]:"UseS3ExpressControlEndpoint"},An]},Qe]],[s1,[kt,Qe]],[xe,[{fn:Sr,[we]:[E1,"scheme"]},"http"]],[Os,[xo,An]],["aws.parseArn",_y,i1],[Sr,[{fn:"split",[we]:[kt,Ds,0]},"[-2]"],"s3expressAvailabilityZoneId"],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,0,4,An]},vt]},"arn:"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,16,18,Qe]},vt]},Ds]],[xn,[{fn:Sr,[we]:[E1,"isIp"]},Qe]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,21,23,Qe]},vt]},Ds]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,27,29,Qe]},vt]},Ds]],[xe,[{[Le]:r1},"beta"]],["uriEncode",_y,"uri_encoded_bucket"],[Os,[xo,Qe]],[xn,[{fn:or,[we]:[{[Le]:"UseObjectLambdaEndpoint"},An]},Qe]],[Sr,[Ls,"resourceId[0]"],o1],[xe,[_1,vt]],[xe,[_1,a1]],[Sr,U1,fy(1)],[xe,[yy,vt]],[xe,[id,vt]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,14,16,Qe]},vt]},Ds]],[xe,[b1,"e"]],[xe,[b1,"o"]],[xe,[xo,"aws-global"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,19,21,Qe]},vt]},Ds]],[xe,[By,py]],[xn,[{fn:or,[we]:[{[Le]:"DisableAccessPoints"},An]},Qe]],[xe,[By,Vc]],[Zx,[id],c1],[Os,[yy,Qe]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,26,28,Qe]},vt]},Ds]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,15,17,Qe]},vt]},Ds]],[Sr,[Ls,"resourceId[4]"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,20,22,Qe]},vt]},Ds]],[xn,[{[Le]:"UseGlobalEndpoint"},Qe]],[xe,[xo,u1]],[Sr,U1,sd(1)],[xn,[{fn:or,[we]:[{[Le]:"UseArnRegion"},Qe]},Qe]],[Os,[{[Le]:sd(1)},An]],[Sr,[Ls,"resourceId[2]"],l1],[xe,[xo,id]],[xe,[{fn:Sr,[we]:[{[Le]:c1},jr]},wy]],[xn,[{[Le]:"DisableMultiRegionAccessPoints"},Qe]],[Os,[id,Qe]],[xe,[{fn:Sr,[we]:[Ls,"partition"]},wy]],[xe,[v1,vt]],[xe,[By,Kc]],[Os,[v1,An]],[Sr,[Ls,"resourceId[3]"],fy(2)],[Os,[yy,An]],[xe,[{[Le]:l1},a1]],[Os,[{[Le]:fy(2)},An]]],results:[[Ae],[Ae,"Accelerate cannot be used with FIPS"],[Ae,"Cannot set dual-stack in combination with a custom endpoint."],[Ae,"A custom endpoint cannot be combined with FIPS"],[Ae,"A custom endpoint cannot be combined with S3 Accelerate"],[Ae,"Partition does not support FIPS"],[Ae,"S3Express does not support S3 Accelerate."],["{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",od],[gy,od],[Ae,"S3Express bucket name is not a valid virtual hostable name."],["https://s3express-control{_s3e_fips}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",S1],["https://{Bucket}.s3express{_s3e_fips}-{s3expressAvailabilityZoneId}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}",od],[Ae,"Unrecognized S3Express bucket name format."],[Ad,od],["https://s3express-control{_s3e_fips}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}",S1],[Ae,"Expected a endpoint to be specified but no endpoint was found"],["https://{Bucket}.ec2.{url#authority}",ad],["https://{Bucket}.ec2.s3-outposts.{Region}.{partitionResult#dnsSuffix}",ad],["https://{Bucket}.op-{outpostId_ssa_2}.{url#authority}",ad],["https://{Bucket}.op-{outpostId_ssa_2}.s3-outposts.{Region}.{partitionResult#dnsSuffix}",ad],[Ae,'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"'],[Ae,"Invalid Outposts Bucket alias - it must be a valid bucket name."],[Ae,"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`."],[Ae,"Custom endpoint `{Endpoint}` was not a valid URI"],[Ae,"S3 Accelerate cannot be used in this region"],["https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",at],[h1,Ft],[gy,Ft],[h1,at],[gy,at],[d1,Ft],[d1,at],[f1,Ft],[f1,at],["https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",at],[Ae,"Invalid region: region was not a valid DNS name."],[Ae,"S3 Object Lambda does not support Dual-stack"],[Ae,"S3 Object Lambda does not support S3 Accelerate"],[Ae,"Access points are not supported for this operation"],[Ae,"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`"],[Ae,"Invalid ARN: Missing account id"],[p1(1),Cy],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",Cy],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",Cy],[Ae,g1(1)],[Ae,"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`"],[Ae,"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)"],[Ae,"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`"],[Ae,"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`."],[Ae,"Invalid ARN: bucket ARN is missing a region"],[Ae,"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided"],[Ae,"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`"],[Ae,"Access Points do not support S3 Accelerate"],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],[p1(1),jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],[Ae,"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}"],[Ae,"S3 MRAP does not support dual-stack"],[Ae,"S3 MRAP does not support FIPS"],[Ae,"S3 MRAP does not support S3 Accelerate"],[Ae,"Invalid configuration: Multi-Region Access Point ARNs are disabled."],["https://{accessPointName_ssa_1}.accesspoint.s3-global.{partitionResult#dnsSuffix}",{[Zn]:[{[nn]:Qe,name:my,[sn]:Kc,[ly]:mAe}]}],[Ae,"Client was configured for partition `{partitionResult#name}` but bucket referred to partition `{bucketArn#partition}`"],[Ae,"Invalid Access Point Name"],[Ae,"S3 Outposts does not support Dual-stack"],[Ae,"S3 Outposts does not support FIPS"],[Ae,"S3 Outposts does not support S3 Accelerate"],[Ae,"Invalid Arn: Outpost Access Point ARN contains sub resources"],["https://{accessPointName_ssa_2}-{bucketArn#accountId}.{outpostId_ssa_1}.{url#authority}",T1],["https://{accessPointName_ssa_2}-{bucketArn#accountId}.{outpostId_ssa_1}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",T1],[Ae,g1(2)],[Ae,"Expected an outpost type `accesspoint`, found {outpostType}"],[Ae,"Invalid ARN: expected an access point name"],[Ae,"Invalid ARN: Expected a 4-component resource"],[Ae,"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId_ssa_1}`"],[Ae,"Invalid ARN: The Outpost Id was not set"],[Ae,"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})"],[Ae,"Invalid ARN: No ARN type specified"],[Ae,"Invalid ARN: `{Bucket}` was not a valid ARN"],[Ae,"Path-style addressing cannot be used with ARN buckets"],["https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],["https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],["https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],[m1,Ft],[m1,at],[w1,Ft],[w1,at],["https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],[Ae,"Path-style addressing cannot be used with S3 Accelerate"],[Ad,Ey],["https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",Ey],["https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",Ey],["https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",at],["https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3-fips.{Region}.{partitionResult#dnsSuffix}",at],["https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",at],[Ad,Ft],[Ad,at],[y1,Ft],[y1,at],["https://s3.{Region}.{partitionResult#dnsSuffix}",at],[Ae,"A region must be set when sending requests to S3."]]},wAe=2,E=1e8,yAe=new Int32Array([-1,1,-1,0,3,E+115,1,424,4,2,272,5,3,233,6,4,85,7,5,15,8,8,9,E+115,16,10,13,18,11,13,19,12,13,22,E+14,13,35,14,E+42,36,E+103,435,6,271,16,7,270,17,8,19,18,14,501,106,9,20,24,10,21,24,11,22,24,12,23,24,13,547,24,14,77,25,20,73,26,26,27,78,37,28,E+86,38,E+86,29,39,47,30,48,E+58,31,50,32,E+85,51,33,136,55,E+76,34,59,35,E+84,60,39,36,61,37,E+83,62,38,146,63,41,E+46,61,40,E+83,62,41,150,64,42,E+54,66,43,E+53,70,44,E+52,71,45,E+81,73,46,E+80,74,E+78,E+79,40,48,E+57,41,E+57,49,42,185,50,48,62,51,49,E+45,52,51,53,526,60,56,54,62,E+55,55,63,57,E+46,62,E+55,57,64,58,E+54,66,59,E+53,69,60,E+65,70,61,E+52,72,E+64,E+51,49,E+45,63,51,64,526,60,67,65,62,E+55,66,63,68,E+46,62,E+55,68,64,69,E+54,66,70,E+53,68,E+47,71,70,72,E+52,72,E+50,E+51,25,74,E+42,46,E+39,75,57,76,E+41,58,E+40,E+41,26,E+88,78,28,E+87,79,34,82,80,35,81,545,36,E+103,E+115,46,E+97,83,57,84,E+99,58,E+98,E+99,5,101,86,8,87,E+115,16,88,89,18,91,89,19,90,92,21,97,95,19,93,92,21,98,95,21,97,94,22,E+14,95,35,96,E+42,36,E+103,E+42,22,E+13,98,35,99,E+42,36,E+101,100,46,E+110,E+111,6,214,102,7,208,103,8,119,104,14,118,105,21,106,E+23,26,107,502,37,108,E+86,38,E+86,109,39,112,110,48,E+58,111,50,136,E+85,40,113,E+57,41,E+57,114,42,115,500,48,E+56,116,52,117,E+72,65,E+69,E+72,21,501,E+23,9,120,124,10,121,124,11,122,124,12,123,124,13,202,124,14,195,125,20,190,126,21,127,E+23,23,128,129,24,189,129,26,130,197,37,131,E+86,38,E+86,132,39,159,133,48,E+58,134,50,135,E+85,51,141,136,55,E+76,137,59,138,E+84,60,E+83,139,61,140,E+83,63,E+83,E+46,55,E+76,142,59,143,E+84,60,148,144,61,145,E+83,62,147,146,63,150,E+46,63,153,E+46,61,149,E+83,62,153,150,64,151,E+54,66,152,E+53,70,E+82,E+52,64,154,E+54,66,155,E+53,70,156,E+52,71,157,E+81,73,158,E+80,74,E+77,E+79,40,160,E+57,41,E+57,161,42,185,162,48,174,163,49,E+45,164,51,165,526,60,168,166,62,E+55,167,63,169,E+46,62,E+55,169,64,170,E+54,66,171,E+53,69,172,E+65,70,173,E+52,72,E+63,E+51,49,E+45,175,51,176,526,60,179,177,62,E+55,178,63,180,E+46,62,E+55,180,64,181,E+54,66,182,E+53,68,E+47,183,70,184,E+52,72,E+48,E+51,48,E+56,186,52,187,E+72,65,E+69,188,67,E+70,E+71,25,E+36,E+42,21,191,E+23,25,192,E+42,30,194,193,46,E+34,E+36,46,E+33,E+35,21,196,E+23,26,E+88,197,28,E+87,198,34,201,199,35,200,545,36,E+101,E+115,46,E+95,E+96,17,203,E+22,20,204,E+21,21,205,550,33,206,550,44,E+16,207,45,E+18,E+20,8,209,215,16,210,220,18,211,220,19,212,224,20,213,227,21,231,401,8,218,215,19,216,E+9,20,217,227,21,231,E+9,16,219,220,18,223,220,19,221,224,20,222,227,21,231,E+12,19,226,224,20,225,E+9,21,E+9,E+12,20,230,227,21,228,E+9,30,229,E+9,34,E+7,E+9,21,231,415,30,232,E+8,34,E+7,E+8,4,E+2,234,5,235,480,6,271,236,7,270,237,8,238,491,9,239,243,10,240,243,11,241,243,12,242,243,13,547,243,14,266,244,20,264,245,26,246,267,37,247,E+86,38,E+86,248,39,249,518,40,250,E+57,41,E+57,251,42,538,252,48,E+43,253,49,E+45,254,51,255,526,60,258,256,62,E+55,257,63,259,E+46,62,E+55,259,64,260,E+54,66,261,E+53,69,262,E+65,70,263,E+52,72,E+62,E+51,25,265,E+42,46,E+31,E+32,26,E+88,267,28,E+87,268,34,269,544,46,E+93,E+94,8,397,E+9,8,407,E+9,3,346,273,4,E+3,274,5,284,275,8,276,E+115,15,E+5,277,16,278,281,18,279,281,19,280,281,22,E+14,281,35,282,E+42,36,E+102,283,46,E+106,E+107,6,405,285,7,395,286,8,295,287,14,501,288,26,289,502,37,290,E+86,38,E+86,291,39,292,307,40,293,E+57,41,E+57,294,42,335,500,9,296,300,10,297,300,11,298,300,12,299,300,13,394,300,14,339,301,15,E+5,302,20,337,303,26,304,341,37,305,E+86,38,E+86,306,39,309,307,48,E+58,308,50,E+74,E+85,40,310,E+57,41,E+57,311,42,335,312,48,324,313,49,E+45,314,51,315,526,60,318,316,62,E+55,317,63,319,E+46,62,E+55,319,64,320,E+54,66,321,E+53,69,322,E+65,70,323,E+52,72,E+61,E+51,49,E+45,325,51,326,526,60,329,327,62,E+55,328,63,330,E+46,62,E+55,330,64,331,E+54,66,332,E+53,68,E+47,333,70,334,E+52,72,E+49,E+51,48,E+56,336,52,E+67,E+72,25,338,E+42,46,E+27,E+28,15,E+5,340,26,E+88,341,28,E+87,342,34,345,343,35,344,545,36,E+102,E+115,46,E+91,E+92,4,E+2,347,5,357,348,8,349,E+115,15,E+5,350,16,351,354,18,352,354,19,353,354,22,E+14,354,35,355,E+42,36,E+43,356,46,E+104,E+105,6,405,358,7,395,359,8,360,491,9,361,365,10,362,365,11,363,365,12,364,365,13,394,365,14,389,366,15,E+5,367,20,387,368,26,369,391,37,370,E+86,38,E+86,371,39,372,518,40,373,E+57,41,E+57,374,42,538,375,48,E+43,376,49,E+45,377,51,378,526,60,381,379,62,E+55,380,63,382,E+46,62,E+55,382,64,383,E+54,66,384,E+53,69,385,E+65,70,386,E+52,72,E+60,E+51,25,388,E+42,46,E+25,E+26,15,E+5,390,26,E+88,391,28,E+87,392,34,393,544,46,E+89,E+90,15,E+5,547,8,396,E+9,15,E+5,397,16,398,410,18,399,410,19,400,410,20,401,E+9,27,402,E+12,29,E+11,403,31,E+11,404,32,E+11,422,8,406,E+9,15,E+5,407,16,408,410,18,409,410,19,411,410,20,E+12,E+9,20,414,412,22,413,E+9,34,E+10,E+9,22,416,415,27,419,E+12,27,418,417,34,E+10,E+12,34,E+10,419,43,E+11,420,47,E+11,421,53,E+11,422,54,E+11,423,56,E+11,E+12,2,E+1,425,3,478,426,4,E+4,427,5,438,428,8,429,E+115,16,430,433,18,431,433,19,432,433,22,E+14,433,35,434,E+42,36,E+44,435,46,E+112,436,57,437,E+114,58,E+113,E+114,6,E+6,439,7,E+6,440,8,450,441,14,501,442,26,443,502,37,444,E+86,38,E+86,445,39,446,465,40,447,E+57,41,E+57,448,42,471,449,48,E+44,500,9,451,455,10,452,455,11,453,455,12,454,455,13,547,455,14,473,456,15,460,457,20,458,461,25,459,E+42,46,E+37,E+38,20,540,461,26,462,474,37,463,E+86,38,E+86,464,39,467,465,48,E+58,466,50,E+75,E+85,40,468,E+57,41,E+57,469,42,471,470,48,E+44,524,48,E+44,472,52,E+68,E+72,26,E+88,474,28,E+87,475,34,E+100,476,35,477,545,36,E+44,E+115,4,E+2,479,5,488,480,8,481,E+115,16,482,485,18,483,485,19,484,485,22,E+14,485,35,486,E+42,36,E+43,487,46,E+108,E+109,6,E+6,489,7,E+6,490,8,503,491,14,501,492,26,493,502,37,494,E+86,38,E+86,495,39,496,518,40,497,E+57,41,E+57,498,42,538,499,48,E+43,500,49,E+45,526,26,E+88,502,28,E+87,E+115,9,504,508,10,505,508,11,506,508,12,507,508,13,547,508,14,541,509,15,513,510,20,511,514,25,512,E+42,46,E+29,E+30,20,540,514,26,515,542,37,516,E+86,38,E+86,517,39,520,518,48,E+58,519,50,E+73,E+85,40,521,E+57,41,E+57,522,42,538,523,48,E+43,524,49,E+45,525,51,529,526,60,E+55,527,62,E+55,528,63,E+55,E+46,60,532,530,62,E+55,531,63,533,E+46,62,E+55,533,64,534,E+54,66,535,E+53,69,536,E+65,70,537,E+52,72,E+59,E+51,48,E+43,539,52,E+66,E+72,25,E+24,E+42,26,E+88,542,28,E+87,543,34,E+100,544,35,546,545,36,E+42,E+115,36,E+43,E+115,17,548,E+22,20,549,E+21,33,552,550,44,E+17,551,45,E+19,E+20,44,E+15,553,45,E+15,E+20]),BAe=qh.from(yAe,wAe,k1.conditions,k1.results),CAe=new eI({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),F1=(t,e={})=>CAe.get(t,()=>cI(BAe,{endpointParams:t,logger:e.logger}));Jh.aws=Lw;const EAe=(t=>async(e,r,n)=>{var o,a,c;if(!n)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const s=await t(e,r,n),A=(c=(a=(o=xs(r))==null?void 0:o.commandInstance)==null?void 0:a.constructor)==null?void 0:c.getEndpointParameterInstructions;if(!A)throw new Error(`getEndpointParameterInstructions() is not defined on '${r.commandName}'`);const i=await ZT(n,{getEndpointParameterInstructions:A},e);return Object.assign(s,i)})(async(t,e,r)=>({operation:xs(e).operation,region:await Kr(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}));function P1(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function O1(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}const _Ae=((t,e,r)=>s=>{var a;const i=(a=t(s).properties)==null?void 0:a.authSchemes;if(!i)return e(s);const o=[];for(const c of i){const{name:l,properties:h={},...d}=c,p=l.toLowerCase();l!==p&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${l}' to '${p}'`);let w;if(p==="sigv4a"){w="aws.auth#sigv4a";const _=i.find(T=>{const v=T.name.toLowerCase();return v!=="sigv4a"&&v.startsWith("sigv4")});if(vx.sigv4aDependency()==="none"&&_)continue}else if(p.startsWith("sigv4"))w="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);const B=r[w];if(!B)throw new Error(`Could not find HttpAuthOption create function for '${w}'`);const C=B(s);C.schemeId=w,C.signingProperties={...C.signingProperties||{},...d,...h},o.push(C)}return o})(F1,t=>{const e=[];switch(t.operation){default:e.push(P1(t)),e.push(O1(t))}return e},{"aws.auth#sigv4":P1,"aws.auth#sigv4a":O1}),bAe=t=>{const e=Xx(t),r=fAe(e);return Object.assign(r,{authSchemePreference:Kr(t.authSchemePreference??[])})},vAe=t=>Object.assign(t,{useFipsEndpoint:t.useFipsEndpoint??!1,useDualstackEndpoint:t.useDualstackEndpoint??!1,forcePathStyle:t.forcePathStyle??!1,useAccelerateEndpoint:t.useAccelerateEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,disableMultiregionAccessPoints:t.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:t.clientContextParams??{}}),K={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class je extends di{constructor(e){super(e),Object.setPrototypeOf(this,je.prototype)}}class cd extends je{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});S(this,"name","NoSuchUpload");S(this,"$fault","client");Object.setPrototypeOf(this,cd.prototype)}}class ud extends je{constructor(r){super({name:"AccessDenied",$fault:"client",...r});S(this,"name","AccessDenied");S(this,"$fault","client");Object.setPrototypeOf(this,ud.prototype)}}class ld extends je{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});S(this,"name","ObjectNotInActiveTierError");S(this,"$fault","client");Object.setPrototypeOf(this,ld.prototype)}}class hd extends je{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});S(this,"name","BucketAlreadyExists");S(this,"$fault","client");Object.setPrototypeOf(this,hd.prototype)}}class dd extends je{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});S(this,"name","BucketAlreadyOwnedByYou");S(this,"$fault","client");Object.setPrototypeOf(this,dd.prototype)}}class fd extends je{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});S(this,"name","NoSuchBucket");S(this,"$fault","client");Object.setPrototypeOf(this,fd.prototype)}}class pd extends je{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});S(this,"name","NoSuchKey");S(this,"$fault","client");Object.setPrototypeOf(this,pd.prototype)}}class gd extends je{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});S(this,"name","InvalidObjectState");S(this,"$fault","client");S(this,"StorageClass");S(this,"AccessTier");Object.setPrototypeOf(this,gd.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class md extends je{constructor(r){super({name:"NoSuchAnnotation",$fault:"client",...r});S(this,"name","NoSuchAnnotation");S(this,"$fault","client");Object.setPrototypeOf(this,md.prototype)}}class wd extends je{constructor(r){super({name:"NotFound",$fault:"client",...r});S(this,"name","NotFound");S(this,"$fault","client");Object.setPrototypeOf(this,wd.prototype)}}class yd extends je{constructor(r){super({name:"InvalidPrefix",$fault:"client",...r});S(this,"name","InvalidPrefix");S(this,"$fault","client");Object.setPrototypeOf(this,yd.prototype)}}class Bd extends je{constructor(r){super({name:"EncryptionTypeMismatch",$fault:"client",...r});S(this,"name","EncryptionTypeMismatch");S(this,"$fault","client");Object.setPrototypeOf(this,Bd.prototype)}}class Cd extends je{constructor(r){super({name:"InvalidRequest",$fault:"client",...r});S(this,"name","InvalidRequest");S(this,"$fault","client");Object.setPrototypeOf(this,Cd.prototype)}}class Ed extends je{constructor(r){super({name:"InvalidWriteOffset",$fault:"client",...r});S(this,"name","InvalidWriteOffset");S(this,"$fault","client");Object.setPrototypeOf(this,Ed.prototype)}}class _d extends je{constructor(r){super({name:"TooManyParts",$fault:"client",...r});S(this,"name","TooManyParts");S(this,"$fault","client");Object.setPrototypeOf(this,_d.prototype)}}class bd extends je{constructor(r){super({name:"AnnotationLimitExceeded",$fault:"client",...r});S(this,"name","AnnotationLimitExceeded");S(this,"$fault","client");Object.setPrototypeOf(this,bd.prototype)}}class vd extends je{constructor(r){super({name:"AnnotationNameTooLong",$fault:"client",...r});S(this,"name","AnnotationNameTooLong");S(this,"$fault","client");Object.setPrototypeOf(this,vd.prototype)}}class Sd extends je{constructor(r){super({name:"InvalidAnnotationName",$fault:"client",...r});S(this,"name","InvalidAnnotationName");S(this,"$fault","client");Object.setPrototypeOf(this,Sd.prototype)}}class Td extends je{constructor(r){super({name:"UnsupportedMediaType",$fault:"client",...r});S(this,"name","UnsupportedMediaType");S(this,"$fault","client");Object.setPrototypeOf(this,Td.prototype)}}class Id extends je{constructor(r){super({name:"IdempotencyParameterMismatch",$fault:"client",...r});S(this,"name","IdempotencyParameterMismatch");S(this,"$fault","client");Object.setPrototypeOf(this,Id.prototype)}}class xd extends je{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});S(this,"name","ObjectAlreadyInActiveTierError");S(this,"$fault","client");Object.setPrototypeOf(this,xd.prototype)}}const SAe="Account",TAe="AnalyticsAndOperator",Rd="AccelerateConfiguration",Ud="AccessControlList",Ro="ACL",Q1="AnalyticsConfigurationList",mi="AccessControlPolicy",D1="AccessControlTranslation",Gc="AnalyticsConfiguration",IAe="AnnotationCount",xAe="AccessDenied",L1="AbortDate",RAe="AnnotationDirective",M1="AnnotationEntry",UAe="AnalyticsExportDestination",kAe="AnalyticsFilter",FAe="AllowedHeaders",PAe="AllowedHeader",OAe="AccountId",N1="AbortIncompleteMultipartUpload",H1="AccessKeyId",QAe="AnnotationList",DAe="AnnotationLimitExceeded",LAe="AllowedMethods",MAe="AbortMultipartUpload",NAe="AbortMultipartUploadOutput",HAe="AbortMultipartUploadRequest",$Ae="AllowedMethod",zc="AnnotationName",VAe="AnnotationNameTooLong",KAe="AllowedOrigins",jAe="AllowedOrigin",$1="AnnotationPayload",GAe="AccessPointAlias",V1="AccessPointArn",K1="AnnotationPrefix",zAe="AllowQuotedRecordDelimiter",by="AcceptRanges",j1="AbortRuleId",kd="AbacStatus",qAe="AnalyticsS3BucketDestination",WAe="ApplyServerSideEncryptionByDefault",JAe="ArchiveStatus",G1="AccessTier",Fd="AnnotationTableConfiguration",z1="AnnotationTableConfigurationResult",XAe="AnnotationTableConfigurationUpdates",qc="And",YAe="Annotations",N="Bucket",vy="BucketArn",ZAe="BucketAlreadyExists",eie="BucketAccountId",tie="BucketAlreadyOwnedByYou",q1="BlockedEncryptionTypes",Sy="BypassGovernanceRetention",rie="BucketInfo",ar="BucketKeyEnabled",nie="BucketLifecycleConfiguration",sie="BucketLocationName",Pd="BucketLoggingStatus",Aie="BucketLocationType",iie="BucketNamespace",oie="BucketName",W1="BytesProcessed",J1="BlockPublicAcls",X1="BlockPublicPolicy",Ty="BucketRegion",Y1="BytesReturned",Z1="BytesScanned",Wc="Body",Iy="Buckets",eR="Checksum",pe="ChecksumAlgorithm",aie="CannedACL",cie="CreateBucket",xy="CreateBucketConfiguration",uie="CreateBucketMetadataConfiguration",lie="CreateBucketMetadataConfigurationRequest",hie="CreateBucketMetadataTableConfiguration",die="CreateBucketMetadataTableConfigurationRequest",fie="CreateBucketOutput",pie="CreateBucketRequest",Uo="CacheControl",Pt="ChecksumCRC32",Ot="ChecksumCRC32C",Qt="ChecksumCRC64NVME",Jc="Cache-Control",gie="CreationDate",Xc="Content-Disposition",ko="ContentDisposition",mie="ContinuationEvent",Yc="Content-Encoding",Fo="ContentEncoding",wie="CloudFunction",yie="CloudFunctionConfiguration",Po="ContentLanguage",Zc="Content-Language",Oo="Content-Length",Qo="ContentLength",Me="Content-MD5",Dt="ChecksumMD5",Ne="ContentMD5",Bie="CompletedMultipartUpload",Cie="CompleteMultipartUploadOutput",Eie="CreateMultipartUploadOutput",_ie="CompleteMultipartUploadResult",bie="CompleteMultipartUploadRequest",vie="CreateMultipartUploadRequest",tR="CompleteMultipartUpload",Sie="CreateMultipartUpload",Ry="ChecksumMode",Tie="CopyObject",Iie="CopyObjectOutput",rR="CopyObjectResult",Od="CORSConfiguration",Uy="CORSRules",ky="CORSRule",xie="CopyObjectRequest",Rie="CommonPrefix",Uie="CommonPrefixList",kie="CompletedPartList",nR="CopyPartResult",Fie="CompletedPart",Qd="CommonPrefixes",Fy="ContentRange",Pie="ConfirmRemoveSelfBucketAccess",sR="Content-Range",Do="ConfigurationState",Lt="ChecksumSHA1",Mt="ChecksumSHA256",Nt="ChecksumSHA512",AR="CopySourceIfMatch",iR="CopySourceIfModifiedSince",oR="CopySourceIfNoneMatch",aR="CopySourceIfUnmodifiedSince",Oie="CreateSessionOutput",Qie="CreateSessionResult",Die="CopySourceRange",Lie="CreateSessionRequest",cR="CopySourceSSECustomerAlgorithm",Py="CopySourceSSECustomerKey",uR="CopySourceSSECustomerKeyMD5",lR="CSV",hR="CopySourceVersionId",Mie="CSVInput",Nie="CSVOutput",dR="CopySource",Hie="CreateSession",Tr="ChecksumType",eu="Content-Type",$ie="ClientToken",Lo="ContentType",Vie="CompressionType",cr="ContinuationToken",Ht="ChecksumXXHASH64",$t="ChecksumXXHASH3",Vt="ChecksumXXHASH128",fR="Condition",Kie="Code",jie="Comments",pR="Contents",Gie="Cont",gR="Credentials",Mo="Days",zie="DaysAfterInitiation",qie="DeleteBucket",Wie="DeleteBucketAnalyticsConfiguration",Jie="DeleteBucketAnalyticsConfigurationRequest",Xie="DeleteBucketCors",Yie="DeleteBucketCorsRequest",Zie="DeleteBucketEncryption",eoe="DeleteBucketEncryptionRequest",toe="DeleteBucketInventoryConfiguration",roe="DeleteBucketInventoryConfigurationRequest",noe="DeleteBucketIntelligentTieringConfiguration",soe="DeleteBucketIntelligentTieringConfigurationRequest",Aoe="DeleteBucketLifecycle",ioe="DeleteBucketLifecycleRequest",ooe="DeleteBucketMetadataConfiguration",aoe="DeleteBucketMetadataConfigurationRequest",coe="DeleteBucketMetricsConfigurationRequest",uoe="DeleteBucketMetricsConfiguration",loe="DeleteBucketMetadataTableConfiguration",hoe="DeleteBucketMetadataTableConfigurationRequest",doe="DeleteBucketOwnershipControls",foe="DeleteBucketOwnershipControlsRequest",poe="DeleteBucketPolicy",goe="DeleteBucketPolicyRequest",moe="DeleteBucketRequest",woe="DeleteBucketReplicationRequest",yoe="DeleteBucketReplication",Boe="DeleteBucketTagging",Coe="DeleteBucketTaggingRequest",Eoe="DeleteBucketWebsite",_oe="DeleteBucketWebsiteRequest",boe="DataExport",voe="DestinationIfMatch",Soe="DestinationIfModifiedSince",Toe="DestinationIfNoneMatch",Ioe="DestinationIfUnmodifiedSince",wi="DeleteMarker",xoe="DeleteMarkerEntry",mR="DeleteMarkerReplication",Roe="DeleteMarkerVersionId",wR="DeleteMarkers",Oy="DisplayName",Uoe="DeletedObject",koe="DeleteObjectAnnotation",Foe="DeleteObjectAnnotationOutput",Poe="DeleteObjectAnnotationRequest",Ooe="DeleteObjectOutput",Qoe="DeleteObjectsOutput",Doe="DeleteObjectRequest",Loe="DeleteObjectsRequest",Moe="DeleteObjectTagging",Noe="DeleteObjectTaggingOutput",Hoe="DeleteObjectTaggingRequest",$oe="DeletedObjects",Voe="DeleteObject",Koe="DeleteObjects",joe="DeletePublicAccessBlock",Goe="DeletePublicAccessBlockRequest",zoe="DataRedundancy",yR="DefaultRetention",qoe="DeleteResult",BR="DestinationResult",CR="Date",Qy="Delete",Woe="Deleted",yA="Delimiter",Dd="Destination",Joe="Description",ER="Details",No="Error",Xoe="EmailAddress",_R="EventBridgeConfiguration",z="ExpectedBucketOwner",yi="EncryptionConfiguration",bR="ErrorCode",Yoe="ErrorDetails",Dy="ErrorDocument",Zoe="EndEvent",eae="ExposeHeaders",tae="ExposeHeader",vR="ErrorMessage",rae="ExpiredObjectDeleteMarker",SR="ExistingObjectReplication",Ld="ExpiresString",TR="ExpectedSourceBucketOwner",We="ETag",nae="EncryptionTypeList",sae="EncryptionTypeMismatch",Ly="EncryptionType",BA="EncodingType",Aae="EventThreshold",IR="ExpressionType",My="Encryption",iae="Enabled",xR="End",RR="Errors",Ny="Events",Hy="Event",es="Expiration",Rn="Expires",UR="Expression",Ms="Filter",kR="FieldDelimiter",oae="FileHeaderInfo",aae="FetchOwner",FR="FilterRule",cae="FilterRuleList",uae="FilterRules",lae="Field",PR="Format",hae="Frequency",Md="Grants",dae="GetBucketAbac",fae="GetBucketAccelerateConfiguration",pae="GetBucketAccelerateConfigurationOutput",gae="GetBucketAnalyticsConfigurationOutput",mae="GetBucketAccelerateConfigurationRequest",wae="GetBucketAnalyticsConfigurationRequest",yae="GetBucketAnalyticsConfiguration",Bae="GetBucketAbacOutput",Cae="GetBucketAclOutput",Eae="GetBucketAbacRequest",_ae="GetBucketAclRequest",bae="GetBucketAcl",vae="GetBucketCors",Sae="GetBucketCorsOutput",Tae="GetBucketCorsRequest",Iae="GetBucketEncryption",xae="GetBucketEncryptionOutput",Rae="GetBucketEncryptionRequest",Uae="GetBucketInventoryConfiguration",kae="GetBucketInventoryConfigurationOutput",Fae="GetBucketInventoryConfigurationRequest",Pae="GetBucketIntelligentTieringConfiguration",Oae="GetBucketIntelligentTieringConfigurationOutput",Qae="GetBucketIntelligentTieringConfigurationRequest",Dae="GetBucketLocation",Lae="GetBucketLifecycleConfiguration",Mae="GetBucketLifecycleConfigurationOutput",Nae="GetBucketLifecycleConfigurationRequest",Hae="GetBucketLocationOutput",$ae="GetBucketLoggingOutput",Vae="GetBucketLocationRequest",Kae="GetBucketLoggingRequest",jae="GetBucketLogging",Gae="GetBucketMetadataConfiguration",zae="GetBucketMetadataConfigurationOutput",qae="GetBucketMetricsConfigurationOutput",OR="GetBucketMetadataConfigurationResult",Wae="GetBucketMetadataConfigurationRequest",Jae="GetBucketMetricsConfigurationRequest",Xae="GetBucketMetricsConfiguration",Yae="GetBucketMetadataTableConfiguration",Zae="GetBucketMetadataTableConfigurationOutput",QR="GetBucketMetadataTableConfigurationResult",ece="GetBucketMetadataTableConfigurationRequest",tce="GetBucketNotificationConfiguration",rce="GetBucketNotificationConfigurationRequest",nce="GetBucketOwnershipControls",sce="GetBucketOwnershipControlsOutput",Ace="GetBucketOwnershipControlsRequest",ice="GetBucketPolicy",oce="GetBucketPolicyOutput",ace="GetBucketPolicyRequest",cce="GetBucketPolicyStatus",uce="GetBucketPolicyStatusOutput",lce="GetBucketPolicyStatusRequest",hce="GetBucketReplication",dce="GetBucketReplicationOutput",fce="GetBucketRequestPayment",pce="GetBucketRequestPaymentOutput",gce="GetBucketRequestPaymentRequest",mce="GetBucketReplicationRequest",wce="GetBucketTagging",yce="GetBucketTaggingOutput",Bce="GetBucketTaggingRequest",Cce="GetBucketVersioning",Ece="GetBucketVersioningOutput",_ce="GetBucketVersioningRequest",bce="GetBucketWebsite",vce="GetBucketWebsiteOutput",Sce="GetBucketWebsiteRequest",Ho="GrantFullControl",DR="GlacierJobParameters",Tce="GetObject",Ice="GetObjectAcl",xce="GetObjectAclOutput",Rce="GetObjectAnnotationOutput",Uce="GetObjectAttributesOutput",kce="GetObjectAttributesParts",Fce="GetObjectAclRequest",Pce="GetObjectAnnotationRequest",Oce="GetObjectAttributesResponse",Qce="GetObjectAttributesRequest",Dce="GetObjectAnnotation",Lce="GetObjectAttributes",Mce="GetObjectLockConfiguration",Nce="GetObjectLockConfigurationOutput",Hce="GetObjectLockConfigurationRequest",$ce="GetObjectLegalHold",Vce="GetObjectLegalHoldOutput",Kce="GetObjectLegalHoldRequest",jce="GetObjectOutput",Gce="GetObjectRequest",zce="GetObjectRetentionOutput",qce="GetObjectRetentionRequest",Wce="GetObjectRetention",Jce="GetObjectTagging",Xce="GetObjectTaggingOutput",Yce="GetObjectTorrentOutput",Zce="GetObjectTaggingRequest",eue="GetObjectTorrentRequest",tue="GetObjectTorrent",rue="GetPublicAccessBlock",nue="GetPublicAccessBlockOutput",sue="GetPublicAccessBlockRequest",$o="GrantRead",Vo="GrantReadACP",$y="GrantWrite",Ko="GrantWriteACP",Vy="Grant",Ky="Grantee",Aue="HeadBucket",iue="HeadBucketOutput",oue="HeadBucketRequest",aue="HttpErrorCodeReturnedEquals",LR="HostName",cue="HeadObject",uue="HeadObjectOutput",lue="HeadObjectRequest",hue="HttpRedirectCode",St="Id",due="InvalidAnnotationName",tu="InventoryConfiguration",MR="InventoryConfigurationList",jo="ID",jy="IndexDocument",fue="InventoryDestination",pue="IsEnabled",gue="InventoryEncryption",mue="InventoryFilter",NR="IsLatest",Go="IfMatch",wue="IfMatchInitiatedTime",yue="IfMatchLastModifiedTime",Bue="IfMatchSize",Gy="If-Modified-Since",HR="IfModifiedSince",Cue="InitiateMultipartUploadResult",Bi="If-Match",ru="IfNoneMatch",zo="If-None-Match",Eue="InventoryOptionalFields",_ue="InvalidObjectState",bue="IncludedObjectVersions",vue="InvalidPrefix",$R="IgnorePublicAcls",Sue="IdempotencyParameterMismatch",VR="IsPublic",Tue="InvalidRequest",Iue="IsRestoreInProgress",zy="InputSerialization",xue="InventoryS3BucketDestination",Rue="InventorySchedule",ts="IsTruncated",Uue="IntelligentTieringAndOperator",nu="IntelligentTieringConfiguration",KR="IntelligentTieringConfigurationList",jR="InventoryTableConfigurationResult",kue="InventoryTableConfigurationUpdates",Nd="InventoryTableConfiguration",Fue="IntelligentTieringFilter",GR="IfUnmodifiedSince",qy="If-Unmodified-Since",Pue="InvalidWriteOffset",Wy="Initiator",Oue="Initiated",zR="JSON",Que="JSONInput",Due="JSONOutput",Hd="JournalTableConfiguration",qR="JournalTableConfigurationResult",Lue="JournalTableConfigurationUpdates",le="Key",Mue="KeyCount",Nue="KeyId",Hue="KmsKeyArn",$d="KeyMarker",$ue="KMSContext",Vue="KMSKeyArn",Kue="KMSKeyId",jue="KMSMasterKeyID",Gue="KeyPrefixEquals",Vd="Location",zue="ListAllMyBucketsResult",que="ListAllMyDirectoryBucketsResult",Wue="ListBuckets",Jue="ListBucketAnalyticsConfigurations",Xue="ListBucketAnalyticsConfigurationsOutput",Yue="ListBucketAnalyticsConfigurationResult",Zue="ListBucketAnalyticsConfigurationsRequest",ele="ListBucketInventoryConfigurations",tle="ListBucketInventoryConfigurationsOutput",rle="ListBucketInventoryConfigurationsRequest",nle="ListBucketIntelligentTieringConfigurations",sle="ListBucketIntelligentTieringConfigurationsOutput",Ale="ListBucketIntelligentTieringConfigurationsRequest",ile="ListBucketMetricsConfigurations",ole="ListBucketMetricsConfigurationsOutput",ale="ListBucketMetricsConfigurationsRequest",cle="ListBucketsOutput",ule="ListBucketsRequest",WR="ListBucketResult",Jy="LocationConstraint",Xy="LifecycleConfiguration",lle="ListDirectoryBuckets",hle="ListDirectoryBucketsOutput",dle="ListDirectoryBucketsRequest",Yy="LoggingEnabled",fle="LifecycleExpiration",ple="LambdaFunctionArn",gle="LambdaFunctionConfiguration",mle="LambdaFunctionConfigurationList",wle="LambdaFunctionConfigurations",Kd="LegalHold",yle="LocationInfo",Ble="ListInventoryConfigurationsResult",on="LastModified",Cle="ListMetricsConfigurationsResult",Ele="LastModifiedTime",_le="ListMultipartUploads",ble="ListMultipartUploadsOutput",vle="ListMultipartUploadsResult",Sle="ListMultipartUploadsRequest",jd="Last-Modified",Tle="ListObjects",Ile="ListObjectAnnotations",xle="ListObjectAnnotationsOutput",Rle="ListObjectAnnotationsRequest",Ule="ListObjectsOutput",kle="ListObjectsRequest",Fle="ListObjectsV2",Ple="ListObjectsV2Output",Ole="ListObjectVersionsOutput",Qle="ListObjectsV2Request",Dle="ListObjectVersionsRequest",Lle="ListObjectVersions",Mle="ListParts",Nle="ListPartsOutput",Hle="ListPartsResult",$le="ListPartsRequest",Vle="LifecycleRule",Kle="LifecycleRuleAndOperator",jle="LifecycleRuleFilter",Gle="LifecycleRules",zle="ListVersionsResult",qo="Metadata",qle="MetricsAndOperator",JR="MaxAnnotationResults",Wle="MaxAgeSeconds",Jle="MaxBuckets",Zy="MetadataConfiguration",XR="MetricsConfigurationList",YR="MetadataConfigurationResult",su="MetricsConfiguration",Xle="MetadataDirective",Yle="MaxDirectoryBuckets",ZR="MfaDelete",eU="MetadataEntry",Zle="MetricsFilter",e0="MFA",tU="MFADelete",Wo="MaxKeys",t0="MissingMeta",ehe="MpuObjectSize",Gd="MaxParts",r0="MetadataTableConfiguration",rU="MetadataTableConfigurationResult",the="MetadataTableEncryptionConfiguration",nU="MultipartUpload",rhe="MultipartUploadList",sU="MaxUploads",AU="Marker",iU="Metrics",nhe="Message",she="Minutes",oU="Mode",Ci="Name",n0="NotificationConfiguration",Ahe="NotificationConfigurationFilter",Jo="NextContinuationToken",aU="NoncurrentDays",ihe="NonEmptyKmsKeyArnString",ohe="NotFound",cU="NextKeyMarker",ahe="NextMarker",uU="NewerNoncurrentVersions",lU="NextPartNumberMarker",che="NoSuchAnnotation",uhe="NoSuchBucket",lhe="NoSuchKey",hhe="NoSuchUpload",dhe="NextUploadIdMarker",hU="NoncurrentVersionExpiration",fhe="NextVersionIdMarker",phe="NoncurrentVersionTransitions",ghe="NoncurrentVersionTransitionList",dU="NoncurrentVersionTransition",Un="Owner",mhe="ObjectAttributes",whe="ObjectAlreadyInActiveTierError",zd="OwnershipControls",yhe="OwnershipControlsRule",Bhe="OwnershipControlsRules",fU="ObjectEncryption",Che="OptionalFields",Ehe="ObjectIdentifier",_he="ObjectIdentifierList",pU="ObjectIfMatch",gU="OutputLocation",qd="ObjectLockConfiguration",bhe="ObjectLockEnabled",vhe="ObjectLockEnabledForBucket",She="ObjectLockLegalHold",Xo="ObjectLockLegalHoldStatus",Yo="ObjectLockMode",The="ObjectLockRetention",Zo="ObjectLockRetainUntilDate",Ihe="ObjectLockRule",xhe="ObjectList",Rhe="ObjectNotInActiveTierError",mU="ObjectOwnership",s0="OptionalObjectAttributes",Uhe="ObjectParts",khe="ObjectPart",Fhe="ObjectSize",wU="ObjectSizeGreaterThan",yU="ObjectSizeLessThan",Phe="OutputSchemaVersion",A0="OutputSerialization",Ohe="ObjectVersion",Wd="ObjectVersionId",Qhe="ObjectVersionList",Dhe="Objects",BU="Object",He="Prefix",Jd="PublicAccessBlockConfiguration",Lhe="PutBucketAbac",Mhe="PutBucketAccelerateConfiguration",Nhe="PutBucketAccelerateConfigurationRequest",Hhe="PutBucketAnalyticsConfigurationRequest",$he="PutBucketAnalyticsConfiguration",Vhe="PutBucketAbacRequest",Khe="PutBucketAclRequest",jhe="PutBucketAcl",Ghe="PutBucketCors",zhe="PutBucketCorsRequest",qhe="PutBucketEncryption",Whe="PutBucketEncryptionRequest",Jhe="PutBucketInventoryConfiguration",Xhe="PutBucketInventoryConfigurationRequest",Yhe="PutBucketIntelligentTieringConfiguration",Zhe="PutBucketIntelligentTieringConfigurationRequest",ede="PutBucketLogging",tde="PutBucketLifecycleConfiguration",rde="PutBucketLifecycleConfigurationOutput",nde="PutBucketLifecycleConfigurationRequest",sde="PutBucketLoggingRequest",Ade="PutBucketMetricsConfiguration",ide="PutBucketMetricsConfigurationRequest",ode="PutBucketNotificationConfiguration",ade="PutBucketNotificationConfigurationRequest",cde="PutBucketOwnershipControls",ude="PutBucketOwnershipControlsRequest",lde="PutBucketPolicy",hde="PutBucketPolicyRequest",dde="PutBucketReplication",fde="PutBucketRequestPayment",pde="PutBucketRequestPaymentRequest",gde="PutBucketReplicationRequest",mde="PutBucketTagging",wde="PutBucketTaggingRequest",yde="PutBucketVersioning",Bde="PutBucketVersioningRequest",Cde="PutBucketWebsite",Ede="PutBucketWebsiteRequest",Xd="PartsCount",_de="PartitionDateSource",bde="ProgressEvent",vde="ParquetInput",Sde="PartsList",Ei="PartNumber",Yd="PartNumberMarker",Tde="PutObject",Ide="PutObjectAcl",xde="PutObjectAclOutput",Rde="PutObjectAnnotationOutput",Ude="PutObjectAclRequest",kde="PutObjectAnnotationRequest",Fde="PutObjectAnnotation",Pde="PutObjectLockConfiguration",Ode="PutObjectLockConfigurationOutput",Qde="PutObjectLockConfigurationRequest",Dde="PutObjectLegalHold",Lde="PutObjectLegalHoldOutput",Mde="PutObjectLegalHoldRequest",Nde="PutObjectOutput",Hde="PutObjectRequest",$de="PutObjectRetentionOutput",Vde="PutObjectRetentionRequest",Kde="PutObjectRetention",jde="PutObjectTagging",Gde="PutObjectTaggingOutput",zde="PutObjectTaggingRequest",Zd="PartitionedPrefix",qde="PutPublicAccessBlock",Wde="PutPublicAccessBlockRequest",CU="PolicyStatus",ef="Parts",tf="Part",Jde="Parquet",EU="Payer",_U="Payload",bU="Permission",vU="Policy",SU="Progress",Xde="Priority",TU="Protocol",Yde="Quiet",Zde="QueueArn",IU="QuoteCharacter",efe="QueueConfigurationList",tfe="QueueConfigurations",xU="QueueConfiguration",RU="QuoteEscapeCharacter",rfe="QuoteFields",nfe="Queue",rf="Role",i0="RedirectAllRequestsTo",Re="RequestCharged",UU="ResponseCacheControl",kU="ResponseContentDisposition",FU="ResponseContentEncoding",PU="ResponseContentLanguage",OU="ResponseContentType",nf="ReplicationConfiguration",o0="RecordDelimiter",QU="ResponseExpires",sfe="RestoreExpiryDate",sf="RecordExpiration",Afe="RecordsEvent",ife="ReplicaKmsKeyID",ofe="ReplaceKeyPrefixWith",afe="ReplaceKeyWith",DU="ReplicaModifications",cfe="RenameObject",ufe="RenameObjectOutput",lfe="RestoreObjectOutput",hfe="RestoreOutputPath",dfe="RenameObjectRequest",ffe="RestoreObjectRequest",pfe="RestoreObject",Ee="RequestPayer",LU="RestrictPublicBuckets",Af="RequestPaymentConfiguration",MU="RequestProgress",a0="RoutingRules",gfe="ReplicationRuleAndOperator",mfe="ReplicationRuleFilter",wfe="ReplicationRule",yfe="ReplicationRules",Bfe="RequestRoute",c0="RestoreRequest",NU="RoutingRule",Au="ReplicationStatus",u0="RestoreStatus",Cfe="RenameSource",HU="ReplicationTime",Efe="ReplicationTimeValue",_fe="RequestToken",bfe="RetainUntilDate",of="Range",l0="Restore",vfe="Records",$U="Redirect",af="Retention",iu="Rules",ea="Rule",ur="Status",VU="StartAfter",KU="SecretAccessKey",Sfe="SseAlgorithm",Tfe="StreamingBlob",jU="S3BucketDestination",lr="StorageClass",GU="StorageClassAnalysis",Ife="StorageClassAnalysisDataExport",xfe="SessionCredentialValue",Rfe="SessionCredentials",Ufe="StatusCode",kfe="SkipDestinationValidation",Ffe="StatsEvent",Pfe="SourceIfMatch",Ofe="SourceIfModifiedSince",Qfe="SourceIfNoneMatch",Dfe="SourceIfUnmodifiedSince",cf="SSE-KMS",zU="SseKmsEncryptedObjects",Lfe="S3KeyFilter",Mfe="S3Key",Nfe="S3Location",Hfe="SessionMode",$fe="SelectObjectContent",Vfe="SelectObjectContentEventStream",Kfe="SelectObjectContentOutput",jfe="SelectObjectContentRequest",qU="SelectParameters",uf="SimplePrefix",WU="ScanRange",JU="SSE-S3",XU="SourceSelectionCriteria",hr="ServerSideEncryption",Gfe="SSEAlgorithm",zfe="ServerSideEncryptionByDefault",lf="ServerSideEncryptionConfiguration",Tt="SSECustomerAlgorithm",an="SSECustomerKey",It="SSECustomerKeyMD5",h0="SSEKMS",qfe="SSEKMSEncryption",Ns="SSEKMSEncryptionContext",Ir="SSEKMSKeyId",Wfe="ServerSideEncryptionRule",Jfe="ServerSideEncryptionRules",YU="SSES3",ZU="SessionToken",ek="S3TablesDestination",tk="S3TablesDestinationResult",Xfe="S3",Yfe="Schedule",_i="Size",Zfe="Start",rk="Stats",epe="Suffix",ta="Tags",hf="TableArn",tpe="TopicArn",rpe="TargetBucket",d0="TableBucketArn",npe="TableBucketType",f0="TagCount",spe="TopicConfigurationList",Ape="TopicConfigurations",nk="TopicConfiguration",ipe="TaggingDirective",p0="TransitionDefaultMinimumObjectSize",sk="TargetGrants",ope="TargetGrant",ape="TieringList",cpe="TransitionList",upe="TooManyParts",ou="TableName",Ak="TableNamespace",ik="TargetObjectKeyFormat",lpe="TargetPrefix",hpe="TotalPartsCount",g0="TableStatus",df="TagSet",cn="Tag",kn="Tagging",ok="Tier",dpe="Tierings",ak="Tiering",fpe="Time",ck="Token",ppe="Topic",gpe="Transitions",uk="Transition",au="Type",mpe="Uploads",wpe="UpdateBucketMetadataAnnotationTableConfiguration",ype="UpdateBucketMetadataAnnotationTableConfigurationRequest",Bpe="UpdateBucketMetadataInventoryTableConfiguration",Cpe="UpdateBucketMetadataInventoryTableConfigurationRequest",Epe="UpdateBucketMetadataJournalTableConfiguration",_pe="UpdateBucketMetadataJournalTableConfigurationRequest",CA="UploadId",lk="UploadIdMarker",hk="UserMetadata",bpe="UnsupportedMediaType",vpe="UpdateObjectEncryption",Spe="UpdateObjectEncryptionRequest",Tpe="UpdateObjectEncryptionResponse",Ipe="UploadPart",xpe="UploadPartCopy",Rpe="UploadPartCopyOutput",Upe="UploadPartCopyRequest",kpe="UploadPartOutput",Fpe="UploadPartRequest",Ppe="URI",Ope="Upload",m0="Value",ff="VersioningConfiguration",ye="VersionId",dk="VersionIdMarker",Qpe="Versions",Dpe="Version",pf="WebsiteConfiguration",Lpe="WriteGetObjectResponse",Mpe="WriteGetObjectResponseRequest",Npe="WriteOffsetBytes",cu="WebsiteRedirectLocation",Hpe="Years",w0="annotationName",$pe="annotation-prefix",fk="accept-ranges",Vpe="bucket-region",ct="client",EA="continuation-token",gf="delimiter",ut="error",y0="eventPayload",Kpe="endpoint",mf="encoding-type",jpe="fetch-owner",j="http",Se="httpChecksum",gt="httpError",f="httpHeader",Gpe="hostLabel",Be="httpPayload",ra="httpPrefixHeaders",J="httpQuery",pk="http://www.w3.org/2001/XMLSchema-instance",un="id",zpe="idempotencyToken",gk="key-marker",qpe="marker",Wpe="max-annotation-results",Jpe="max-buckets",Xpe="max-directory-buckets",B0="max-keys",Ype="max-parts",Zpe="max-uploads",uu="prefix",wf="partNumber",ege="part-number-marker",mk="response-cache-control",wk="response-content-disposition",yk="response-content-encoding",Bk="response-content-language",Ck="response-content-type",Ek="response-expires",_k="smithy.ts.sdk.synthetic.com.amazonaws.s3",tge="start-after",bk="streaming",lu="uploadId",rge="upload-id-marker",xt="versionId",nge="version-id-marker",vk="xsi",sge="xmlAttribute",ae="xmlFlattened",D="xmlName",Sk="xmlNamespace",na="x-amz-acl",Tk="x-amz-abort-date",Age="x-amz-access-point-alias",Ik="x-amz-abort-rule-id",ige="x-amz-archive-status",xk="x-amz-bucket-arn",C0="x-amz-bypass-governance-retention",oge="x-amz-bucket-location-name",age="x-amz-bucket-location-type",cge="x-amz-bucket-namespace",uge="x-amz-bucket-object-lock-enabled",Rk="x-amz-bucket-object-lock-token",lge="x-amz-bucket-region",E0="x-amz-checksum-algorithm",rs="x-amz-checksum-crc32",ns="x-amz-checksum-crc32c",ss="x-amz-checksum-crc64nvme",As="x-amz-checksum-md5",_0="x-amz-checksum-mode",hge="x-amz-confirm-remove-self-bucket-access",is="x-amz-checksum-sha1",os="x-amz-checksum-sha256",as="x-amz-checksum-sha512",Uk="x-amz-copy-source",kk="x-amz-copy-source-if-match",Fk="x-amz-copy-source-if-modified-since",Pk="x-amz-copy-source-if-none-match",Ok="x-amz-copy-source-if-unmodified-since",dge="x-amz-create-session-mode",fge="x-amz-copy-source-range",Qk="x-amz-copy-source-server-side-encryption-customer-algorithm",Dk="x-amz-copy-source-server-side-encryption-customer-key",Lk="x-amz-copy-source-server-side-encryption-customer-key-MD5",Mk="x-amz-copy-source-version-id",_A="x-amz-checksum-type",pge="x-amz-client-token",cs="x-amz-checksum-xxhash64",us="x-amz-checksum-xxhash3",ls="x-amz-checksum-xxhash128",yf="x-amz-delete-marker",hu="x-amz-expiration",q="x-amz-expected-bucket-owner",gge="x-amz-fwd-error-code",mge="x-amz-fwd-error-message",wge="x-amz-fwd-header-Cache-Control",yge="x-amz-fwd-header-Content-Disposition",Bge="x-amz-fwd-header-Content-Encoding",Cge="x-amz-fwd-header-Content-Language",Ege="x-amz-fwd-header-Content-Range",_ge="x-amz-fwd-header-Content-Type",bge="x-amz-fwd-header-ETag",vge="x-amz-fwd-header-Expires",Sge="x-amz-fwd-header-Last-Modified",Tge="x-amz-fwd-header-accept-ranges",Ige="x-amz-fwd-header-x-amz-checksum-crc32",xge="x-amz-fwd-header-x-amz-checksum-crc32c",Rge="x-amz-fwd-header-x-amz-checksum-crc64nvme",Uge="x-amz-fwd-header-x-amz-checksum-md5",kge="x-amz-fwd-header-x-amz-checksum-sha1",Fge="x-amz-fwd-header-x-amz-checksum-sha256",Pge="x-amz-fwd-header-x-amz-checksum-sha512",Oge="x-amz-fwd-header-x-amz-checksum-xxhash64",Qge="x-amz-fwd-header-x-amz-checksum-xxhash3",Dge="x-amz-fwd-header-x-amz-checksum-xxhash128",Lge="x-amz-fwd-header-x-amz-delete-marker",Mge="x-amz-fwd-header-x-amz-expiration",Nge="x-amz-fwd-header-x-amz-missing-meta",Hge="x-amz-fwd-header-x-amz-mp-parts-count",$ge="x-amz-fwd-header-x-amz-object-lock-legal-hold",Vge="x-amz-fwd-header-x-amz-object-lock-mode",Kge="x-amz-fwd-header-x-amz-object-lock-retain-until-date",jge="x-amz-fwd-header-x-amz-restore",Gge="x-amz-fwd-header-x-amz-request-charged",zge="x-amz-fwd-header-x-amz-replication-status",qge="x-amz-fwd-header-x-amz-storage-class",Wge="x-amz-fwd-header-x-amz-server-side-encryption",Jge="x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id",Xge="x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled",Yge="x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm",Zge="x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5",eme="x-amz-fwd-header-x-amz-tagging-count",tme="x-amz-fwd-header-x-amz-version-id",rme="x-amz-fwd-status",sa="x-amz-grant-full-control",Aa="x-amz-grant-read",ia="x-amz-grant-read-acp",b0="x-amz-grant-write",oa="x-amz-grant-write-acp",nme="x-amz-if-match-initiated-time",sme="x-amz-if-match-last-modified-time",Ame="x-amz-if-match-size",aa="x-amz-meta-",v0="x-amz-mfa",ime="x-amz-metadata-directive",Nk="x-amz-missing-meta",ome="x-amz-mp-object-size",ame="x-amz-max-parts",Hk="x-amz-mp-parts-count",cme="x-amz-object-attributes",ume="x-amz-object-annotation-directive",$k="x-amz-object-if-match",du="x-amz-object-lock-legal-hold",fu="x-amz-object-lock-mode",pu="x-amz-object-lock-retain-until-date",lme="x-amz-object-ownership",S0="x-amz-optional-object-attributes",hme="x-amz-object-size",Bf="x-amz-object-version-id",dme="x-amz-part-number-marker",Vk="x-amz-restore",Fe="x-amz-request-charged",fme="x-amz-restore-output-path",_e="x-amz-request-payer",pme="x-amz-request-route",T0="x-amz-replication-status",gme="x-amz-rename-source",mme="x-amz-rename-source-if-match",wme="x-amz-rename-source-if-modified-since",yme="x-amz-rename-source-if-none-match",Bme="x-amz-rename-source-if-unmodified-since",Cme="x-amz-request-token",gu="x-amz-storage-class",Ue="x-amz-sdk-checksum-algorithm",Eme="x-amz-skip-destination-validation",Kk="x-amz-source-expected-bucket-owner",xr="x-amz-server-side-encryption",Gr="x-amz-server-side-encryption-aws-kms-key-id",zr="x-amz-server-side-encryption-bucket-key-enabled",bA="x-amz-server-side-encryption-context",Kt="x-amz-server-side-encryption-customer-algorithm",Fn="x-amz-server-side-encryption-customer-key",jt="x-amz-server-side-encryption-customer-key-MD5",I0="x-amz-tagging",jk="x-amz-tagging-count",_me="x-amz-tagging-directive",x0="x-amz-transition-default-minimum-object-size",hs="x-amz-version-id",bme="x-amz-write-offset-bytes",mu="x-amz-website-redirect-location",vme="xsi:type",m="com.amazonaws.s3",Gk=Rs.for(_k);var zk=[-3,_k,"S3ServiceException",0,[],[]];Gk.registerError(zk,je);const et=Rs.for(m);var qk=[-3,m,xAe,{[ut]:ct,[gt]:403},[],[]];et.registerError(qk,ud);var Wk=[-3,m,DAe,{[ut]:ct,[gt]:400},[],[]];et.registerError(Wk,bd);var Jk=[-3,m,VAe,{[ut]:ct,[gt]:400},[],[]];et.registerError(Jk,vd);var Xk=[-3,m,ZAe,{[ut]:ct,[gt]:409},[],[]];et.registerError(Xk,hd);var Yk=[-3,m,tie,{[ut]:ct,[gt]:409},[],[]];et.registerError(Yk,dd);var Zk=[-3,m,sae,{[ut]:ct,[gt]:400},[],[]];et.registerError(Zk,Bd);var eF=[-3,m,Sue,{[ut]:ct,[gt]:400},[],[]];et.registerError(eF,Id);var tF=[-3,m,due,{[ut]:ct,[gt]:400},[],[]];et.registerError(tF,Sd);var rF=[-3,m,_ue,{[ut]:ct,[gt]:403},[lr,G1],[0,0]];et.registerError(rF,gd);var nF=[-3,m,vue,{[ut]:ct,[gt]:400},[],[]];et.registerError(nF,yd);var sF=[-3,m,Tue,{[ut]:ct,[gt]:400},[],[]];et.registerError(sF,Cd);var AF=[-3,m,Pue,{[ut]:ct,[gt]:400},[],[]];et.registerError(AF,Ed);var iF=[-3,m,che,{[ut]:ct,[gt]:404},[],[]];et.registerError(iF,md);var oF=[-3,m,uhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(oF,fd);var aF=[-3,m,lhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(aF,pd);var cF=[-3,m,hhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(cF,cd);var uF=[-3,m,ohe,{[ut]:ct},[],[]];et.registerError(uF,wd);var lF=[-3,m,whe,{[ut]:ct,[gt]:403},[],[]];et.registerError(lF,xd);var hF=[-3,m,Rhe,{[ut]:ct,[gt]:403},[],[]];et.registerError(hF,ld);var dF=[-3,m,upe,{[ut]:ct,[gt]:400},[],[]];et.registerError(dF,_d);var fF=[-3,m,bpe,{[ut]:ct,[gt]:415},[],[]];et.registerError(fF,Td);const pF=[Gk,et];var gF=[0,m,Py,8,0],Sme=[0,m,ihe,8,0],mF=[0,m,xfe,8,0],Pn=[0,m,an,8,0],vA=[0,m,Ns,8,0],Zt=[0,m,Ir,8,0],bi=[0,m,Tfe,{[bk]:1},42],R0=[3,m,kd,0,[ur],[0]],wF=[3,m,N1,0,[zie],[1]],yF=[3,m,NAe,0,[Re],[[0,{[f]:Fe}]]],BF=[3,m,HAe,0,[N,le,CA,Ee,z,wue],[[0,1],[0,1],[0,{[J]:lu}],[0,{[f]:_e}],[0,{[f]:q}],[6,{[f]:nme}]],3],CF=[3,m,Rd,0,[ur],[0]],U0=[3,m,mi,0,[Md,Un],[[()=>xf,{[D]:Ud}],()=>ds]],EF=[3,m,D1,0,[Un],[0],1],_F=[3,m,TAe,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],Cf=[3,m,Gc,0,[St,GU,Ms],[0,()=>N4,[()=>uD,0]],2],bF=[3,m,UAe,0,[jU],[()=>vF],1],vF=[3,m,qAe,0,[PR,N,eie,He],[0,0,0,0],2],SF=[3,m,M1,0,[zc,on,_i,We,pe,Au],[0,4,1,0,[64,{[ae]:1}],0],3],TF=[3,m,Fd,0,[Do,yi,rf],[0,()=>ca,0],1],IF=[3,m,z1,0,[Do,g0,No,ou,hf,rf],[0,0,()=>wu,0,0,0],1],xF=[3,m,XAe,0,[Do,yi,rf],[0,()=>ca,0],1],RF=[3,m,q1,0,[Ly],[[()=>kme,{[ae]:1}]]],UF=[3,m,N,0,[Ci,gie,Ty,vy],[0,4,0,0]],kF=[3,m,rie,0,[zoe,au],[0,0]],FF=[3,m,nie,0,[iu],[[()=>oD,{[ae]:1,[D]:ea}]],1],PF=[3,m,Pd,0,[Yy],[[()=>D0,0]]],OF=[3,m,eR,0,[Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr],[0,0,0,0,0,0,0,0,0,0,0]],QF=[3,m,Rie,0,[He],[0]],DF=[3,m,Bie,0,[ef],[[()=>xme,{[ae]:1,[D]:tf}]]],LF=[3,m,Fie,0,[We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Ei],[0,0,0,0,0,0,0,0,0,0,0,1]],MF=[3,m,Cie,{[D]:_ie},[Vd,N,le,es,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,ye,Ir,ar,Re],[0,0,0,[0,{[f]:hu}],0,0,0,0,0,0,0,0,0,0,0,0,[0,{[f]:xr}],[0,{[f]:hs}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],NF=[3,m,bie,0,[N,le,CA,nU,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,ehe,Ee,z,Go,ru,Tt,an,It],[[0,1],[0,1],[0,{[J]:lu}],[()=>DF,{[Be]:1,[D]:tR}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[1,{[f]:ome}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Bi}],[0,{[f]:zo}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}]],3],HF=[3,m,fR,0,[aue,Gue],[0,0]],$F=[3,m,mie,0,[],[]],VF=[3,m,Iie,0,[rR,es,hR,ye,hr,Tt,It,Ir,Ns,ar,Re],[[()=>jF,16],[0,{[f]:hu}],[0,{[f]:Mk}],[0,{[f]:hs}],[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Fe}]]],KF=[3,m,xie,0,[N,dR,le,Ro,Uo,pe,ko,Fo,Po,Lo,AR,iR,oR,aR,Rn,Ho,$o,Vo,Ko,Go,ru,qo,Xle,ipe,RAe,hr,lr,cu,Tt,an,It,Ir,Ns,ar,cR,Py,uR,Ee,kn,Yo,Zo,Xo,z,TR],[[0,1],[0,{[f]:Uk}],[0,1],[0,{[f]:na}],[0,{[f]:Jc}],[0,{[f]:E0}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[0,{[f]:kk}],[4,{[f]:Fk}],[0,{[f]:Pk}],[4,{[f]:Ok}],[4,{[f]:Rn}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[0,{[f]:Bi}],[0,{[f]:zo}],[128,{[ra]:aa}],[0,{[f]:ime}],[0,{[f]:_me}],[0,{[f]:ume}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Qk}],[()=>gF,{[f]:Dk}],[0,{[f]:Lk}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}],[0,{[f]:Kk}]],3],jF=[3,m,rR,0,[We,on,Tr,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[0,4,0,0,0,0,0,0,0,0,0,0,0]],GF=[3,m,nR,0,[We,on,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[0,4,0,0,0,0,0,0,0,0,0,0]],zF=[3,m,Od,0,[Uy],[[()=>iD,{[ae]:1,[D]:ky}]],1],qF=[3,m,ky,0,[LAe,KAe,jo,FAe,eae,Wle],[[64,{[ae]:1,[D]:$Ae}],[64,{[ae]:1,[D]:jAe}],0,[64,{[ae]:1,[D]:PAe}],[64,{[ae]:1,[D]:tae}],1],2],WF=[3,m,xy,0,[Jy,Vd,N,ta],[0,()=>eQ,()=>kF,[()=>Hs,0]]],JF=[3,m,lie,0,[N,Zy,Ne,pe,z],[[0,1],[()=>tQ,{[Be]:1,[D]:Zy}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],XF=[3,m,die,0,[N,r0,Ne,pe,z],[[0,1],[()=>sQ,{[Be]:1,[D]:r0}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],YF=[3,m,fie,0,[Vd,vy],[[0,{[f]:Vd}],[0,{[f]:xk}]]],ZF=[3,m,pie,0,[N,Ro,xy,Ho,$o,Vo,$y,Ko,vhe,mU,iie],[[0,1],[0,{[f]:na}],[()=>WF,{[Be]:1,[D]:xy}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[2,{[f]:uge}],[0,{[f]:lme}],[0,{[f]:cge}]],1],e2=[3,m,Eie,{[D]:Cue},[L1,j1,N,le,CA,hr,Tt,It,Ir,Ns,ar,Re,pe,Tr],[[4,{[f]:Tk}],[0,{[f]:Ik}],[0,{[D]:N}],0,0,[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Fe}],[0,{[f]:E0}],[0,{[f]:_A}]]],t2=[3,m,vie,0,[N,le,Ro,Uo,ko,Fo,Po,Lo,Rn,Ho,$o,Vo,Ko,qo,hr,lr,cu,Tt,an,It,Ir,Ns,ar,Ee,kn,Yo,Zo,Xo,z,pe,Tr],[[0,1],[0,1],[0,{[f]:na}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[4,{[f]:Rn}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[128,{[ra]:aa}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}],[0,{[f]:E0}],[0,{[f]:_A}]],2],r2=[3,m,Oie,{[D]:Qie},[gR,hr,Ir,Ns,ar],[[()=>U4,{[D]:gR}],[0,{[f]:xr}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}]],1],n2=[3,m,Lie,0,[N,Hfe,hr,Ir,Ns,ar],[[0,1],[0,{[f]:dge}],[0,{[f]:xr}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}]],1],s2=[3,m,Mie,0,[oae,jie,RU,o0,kR,IU,zAe],[0,0,0,0,0,0,2]],A2=[3,m,Nie,0,[rfe,RU,o0,kR,IU],[0,0,0,0,0]],i2=[3,m,yR,0,[oU,Mo,Hpe],[0,1,1]],o2=[3,m,Qy,0,[Dhe,Yde],[[()=>$me,{[ae]:1,[D]:BU}],2],1],a2=[3,m,Jie,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],c2=[3,m,Yie,0,[N,z],[[0,1],[0,{[f]:q}]],1],u2=[3,m,eoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],l2=[3,m,soe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],h2=[3,m,roe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],d2=[3,m,ioe,0,[N,z],[[0,1],[0,{[f]:q}]],1],f2=[3,m,aoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],p2=[3,m,hoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],g2=[3,m,coe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],m2=[3,m,foe,0,[N,z],[[0,1],[0,{[f]:q}]],1],w2=[3,m,goe,0,[N,z],[[0,1],[0,{[f]:q}]],1],y2=[3,m,woe,0,[N,z],[[0,1],[0,{[f]:q}]],1],B2=[3,m,moe,0,[N,z],[[0,1],[0,{[f]:q}]],1],C2=[3,m,Coe,0,[N,z],[[0,1],[0,{[f]:q}]],1],E2=[3,m,_oe,0,[N,z],[[0,1],[0,{[f]:q}]],1],_2=[3,m,Uoe,0,[le,ye,wi,Roe],[0,0,2,0]],b2=[3,m,xoe,0,[Un,le,ye,NR,on],[()=>ds,0,0,2,4]],v2=[3,m,mR,0,[ur],[0]],S2=[3,m,Foe,0,[Wd,Re],[[0,{[f]:Bf}],[0,{[f]:Fe}]]],T2=[3,m,Poe,0,[N,le,zc,ye,Ee,z,pU],[[0,1],[0,1],[0,{[J]:w0}],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:$k}]],3],I2=[3,m,Ooe,0,[wi,ye,Re],[[2,{[f]:yf}],[0,{[f]:hs}],[0,{[f]:Fe}]]],x2=[3,m,Doe,0,[N,le,e0,ye,Ee,Sy,z,Go,yue,Bue],[[0,1],[0,1],[0,{[f]:v0}],[0,{[J]:xt}],[0,{[f]:_e}],[2,{[f]:C0}],[0,{[f]:q}],[0,{[f]:Bi}],[6,{[f]:sme}],[1,{[f]:Ame}]],2],R2=[3,m,Qoe,{[D]:qoe},[Woe,Re,RR],[[()=>Rme,{[ae]:1}],[0,{[f]:Fe}],[()=>Fme,{[ae]:1,[D]:No}]]],U2=[3,m,Loe,0,[N,Qy,e0,Ee,Sy,z,pe],[[0,1],[()=>o2,{[Be]:1,[D]:Qy}],[0,{[f]:v0}],[0,{[f]:_e}],[2,{[f]:C0}],[0,{[f]:q}],[0,{[f]:Ue}]],2],k2=[3,m,Noe,0,[ye],[[0,{[f]:hs}]]],F2=[3,m,Hoe,0,[N,le,ye,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:q}]],2],P2=[3,m,Goe,0,[N,z],[[0,1],[0,{[f]:q}]],1],O2=[3,m,Dd,0,[N,SAe,lr,D1,yi,HU,iU],[0,0,0,()=>EF,()=>L2,()=>f4,()=>iQ],1],Q2=[3,m,BR,0,[npe,d0,Ak],[0,0,0]],D2=[3,m,My,0,[Ly,Kue,$ue],[0,[()=>Zt,0],0],1],L2=[3,m,yi,0,[ife],[0]],M2=[3,m,Zoe,0,[],[]],N2=[3,m,No,0,[le,ye,Kie,nhe],[0,0,0,0]],wu=[3,m,Yoe,0,[bR,vR],[0,0]],k0=[3,m,Dy,0,[le],[0],1],H2=[3,m,_R,0,[],[]],$2=[3,m,SR,0,[ur],[0],1],V2=[3,m,FR,0,[Ci,m0],[0,0]],K2=[3,m,Bae,0,[kd],[[()=>R0,16]]],j2=[3,m,Eae,0,[N,z],[[0,1],[0,{[f]:q}]],1],G2=[3,m,pae,{[D]:Rd},[ur,Re],[0,[0,{[f]:Fe}]]],z2=[3,m,mae,0,[N,z,Ee],[[0,1],[0,{[f]:q}],[0,{[f]:_e}]],1],q2=[3,m,Cae,{[D]:mi},[Un,Md],[()=>ds,[()=>xf,{[D]:Ud}]]],W2=[3,m,_ae,0,[N,z],[[0,1],[0,{[f]:q}]],1],J2=[3,m,gae,0,[Gc],[[()=>Cf,16]]],X2=[3,m,wae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],Y2=[3,m,Sae,{[D]:Od},[Uy],[[()=>iD,{[ae]:1,[D]:ky}]]],Z2=[3,m,Tae,0,[N,z],[[0,1],[0,{[f]:q}]],1],eP=[3,m,xae,0,[lf],[[()=>W0,16]]],tP=[3,m,Rae,0,[N,z],[[0,1],[0,{[f]:q}]],1],rP=[3,m,Oae,0,[nu],[[()=>Ef,16]]],nP=[3,m,Qae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],sP=[3,m,kae,0,[tu],[[()=>_f,16]]],AP=[3,m,Fae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],iP=[3,m,Mae,{[D]:Xy},[iu,p0],[[()=>oD,{[ae]:1,[D]:ea}],[0,{[f]:x0}]]],oP=[3,m,Nae,0,[N,z],[[0,1],[0,{[f]:q}]],1],aP=[3,m,Hae,{[D]:Jy},[Jy],[0]],cP=[3,m,Vae,0,[N,z],[[0,1],[0,{[f]:q}]],1],uP=[3,m,$ae,{[D]:Pd},[Yy],[[()=>D0,0]]],lP=[3,m,Kae,0,[N,z],[[0,1],[0,{[f]:q}]],1],hP=[3,m,zae,0,[OR],[[()=>fP,16]]],dP=[3,m,Wae,0,[N,z],[[0,1],[0,{[f]:q}]],1],fP=[3,m,OR,0,[YR],[()=>rQ],1],pP=[3,m,Zae,0,[QR],[[()=>mP,16]]],gP=[3,m,ece,0,[N,z],[[0,1],[0,{[f]:q}]],1],mP=[3,m,QR,0,[rU,ur,No],[()=>AQ,0,()=>wu],2],wP=[3,m,qae,0,[su],[[()=>bf,16]]],yP=[3,m,Jae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],BP=[3,m,rce,0,[N,z],[[0,1],[0,{[f]:q}]],1],CP=[3,m,sce,0,[zd],[[()=>V0,16]]],EP=[3,m,Ace,0,[N,z],[[0,1],[0,{[f]:q}]],1],_P=[3,m,oce,0,[vU],[[0,16]]],bP=[3,m,ace,0,[N,z],[[0,1],[0,{[f]:q}]],1],vP=[3,m,uce,0,[CU],[[()=>CQ,16]]],SP=[3,m,lce,0,[N,z],[[0,1],[0,{[f]:q}]],1],TP=[3,m,dce,0,[nf],[[()=>G0,16]]],IP=[3,m,mce,0,[N,z],[[0,1],[0,{[f]:q}]],1],xP=[3,m,pce,{[D]:Af},[EU],[0]],RP=[3,m,gce,0,[N,z],[[0,1],[0,{[f]:q}]],1],UP=[3,m,yce,{[D]:kn},[df],[[()=>Hs,0]],1],kP=[3,m,Bce,0,[N,z],[[0,1],[0,{[f]:q}]],1],FP=[3,m,Ece,{[D]:ff},[ur,tU],[0,[0,{[D]:ZR}]]],PP=[3,m,_ce,0,[N,z],[[0,1],[0,{[f]:q}]],1],OP=[3,m,vce,{[D]:pf},[i0,jy,Dy,a0],[()=>j0,()=>P0,()=>k0,[()=>cD,0]]],QP=[3,m,Sce,0,[N,z],[[0,1],[0,{[f]:q}]],1],DP=[3,m,xce,{[D]:mi},[Un,Md,Re],[()=>ds,[()=>xf,{[D]:Ud}],[0,{[f]:Fe}]]],LP=[3,m,Fce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],MP=[3,m,Rce,0,[$1,Wd,on,Qo,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,Re,Au],[[()=>bi,16],[0,{[f]:Bf}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:Fe}],[0,{[f]:T0}]]],NP=[3,m,Pce,0,[N,le,zc,ye,Ee,z,Ry],[[0,1],[0,1],[0,{[J]:w0}],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:_0}]],3],HP=[3,m,Uce,{[D]:Oce},[wi,on,ye,Re,We,eR,Uhe,lr,Fhe],[[2,{[f]:yf}],[4,{[f]:jd}],[0,{[f]:hs}],[0,{[f]:Fe}],0,()=>OF,[()=>$P,0],0,1]],$P=[3,m,kce,0,[hpe,Yd,lU,Gd,ts,ef],[[1,{[D]:Xd}],0,0,1,2,[()=>Gme,{[ae]:1,[D]:tf}]]],VP=[3,m,Qce,0,[N,le,mhe,ye,Gd,Yd,Tt,an,It,Ee,z],[[0,1],[0,1],[64,{[f]:cme}],[0,{[J]:xt}],[1,{[f]:ame}],[0,{[f]:dme}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[0,{[f]:q}]],3],KP=[3,m,Vce,0,[Kd],[[()=>N0,{[Be]:1,[D]:Kd}]]],jP=[3,m,Kce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],GP=[3,m,Nce,0,[qd],[[()=>M0,16]]],zP=[3,m,Hce,0,[N,z],[[0,1],[0,{[f]:q}]],1],qP=[3,m,jce,0,[Wc,wi,by,es,l0,on,Qo,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,t0,ye,Uo,ko,Fo,Po,Fy,Lo,Rn,Ld,cu,hr,qo,Tt,It,Ir,ar,lr,Re,Au,Xd,f0,Yo,Zo,Xo],[[()=>bi,16],[2,{[f]:yf}],[0,{[f]:fk}],[0,{[f]:hu}],[0,{[f]:Vk}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[1,{[f]:Nk}],[0,{[f]:hs}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:sR}],[0,{[f]:eu}],[4,{[f]:Rn}],[0,{[f]:Ld}],[0,{[f]:mu}],[0,{[f]:xr}],[128,{[ra]:aa}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:gu}],[0,{[f]:Fe}],[0,{[f]:T0}],[1,{[f]:Hk}],[1,{[f]:jk}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}]]],WP=[3,m,Gce,0,[N,le,Go,HR,ru,GR,of,UU,kU,FU,PU,OU,QU,ye,Tt,an,It,Ee,Ei,z,Ry],[[0,1],[0,1],[0,{[f]:Bi}],[4,{[f]:Gy}],[0,{[f]:zo}],[4,{[f]:qy}],[0,{[f]:of}],[0,{[J]:mk}],[0,{[J]:wk}],[0,{[J]:yk}],[0,{[J]:Bk}],[0,{[J]:Ck}],[6,{[J]:Ek}],[0,{[J]:xt}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[1,{[J]:wf}],[0,{[f]:q}],[0,{[f]:_0}]],2],JP=[3,m,zce,0,[af],[[()=>H0,{[Be]:1,[D]:af}]]],XP=[3,m,qce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],YP=[3,m,Xce,{[D]:kn},[df,ye],[[()=>Hs,0],[0,{[f]:hs}]],1],ZP=[3,m,Zce,0,[N,le,ye,z,Ee],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:q}],[0,{[f]:_e}]],2],eO=[3,m,Yce,0,[Wc,Re],[[()=>bi,16],[0,{[f]:Fe}]]],tO=[3,m,eue,0,[N,le,Ee,z],[[0,1],[0,1],[0,{[f]:_e}],[0,{[f]:q}]],2],rO=[3,m,nue,0,[Jd],[[()=>K0,16]]],nO=[3,m,sue,0,[N,z],[[0,1],[0,{[f]:q}]],1],sO=[3,m,DR,0,[ok],[0],1],AO=[3,m,Vy,0,[Ky,bU],[[()=>F0,{[Sk]:[vk,pk]}],0]],F0=[3,m,Ky,0,[au,Oy,Xoe,jo,Ppe],[[0,{[sge]:1,[D]:vme}],0,0,0,0],1],iO=[3,m,iue,0,[vy,Aie,sie,Ty,GAe],[[0,{[f]:xk}],[0,{[f]:age}],[0,{[f]:oge}],[0,{[f]:lge}],[2,{[f]:Age}]]],oO=[3,m,oue,0,[N,z],[[0,1],[0,{[f]:q}]],1],aO=[3,m,uue,0,[wi,by,es,l0,JAe,on,Qo,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,We,t0,ye,Uo,ko,Fo,Po,Lo,Fy,Rn,Ld,cu,hr,qo,Tt,It,Ir,ar,lr,Re,Au,Xd,f0,Yo,Zo,Xo],[[2,{[f]:yf}],[0,{[f]:fk}],[0,{[f]:hu}],[0,{[f]:Vk}],[0,{[f]:ige}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:We}],[1,{[f]:Nk}],[0,{[f]:hs}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[0,{[f]:sR}],[4,{[f]:Rn}],[0,{[f]:Ld}],[0,{[f]:mu}],[0,{[f]:xr}],[128,{[ra]:aa}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:gu}],[0,{[f]:Fe}],[0,{[f]:T0}],[1,{[f]:Hk}],[1,{[f]:jk}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}]]],cO=[3,m,lue,0,[N,le,Go,HR,ru,GR,of,UU,kU,FU,PU,OU,QU,ye,Tt,an,It,Ee,Ei,z,Ry],[[0,1],[0,1],[0,{[f]:Bi}],[4,{[f]:Gy}],[0,{[f]:zo}],[4,{[f]:qy}],[0,{[f]:of}],[0,{[J]:mk}],[0,{[J]:wk}],[0,{[J]:yk}],[0,{[J]:Bk}],[0,{[J]:Ck}],[6,{[J]:Ek}],[0,{[J]:xt}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[1,{[J]:wf}],[0,{[f]:q}],[0,{[f]:_0}]],2],P0=[3,m,jy,0,[epe],[0],1],O0=[3,m,Wy,0,[jo,Oy],[0,0]],Q0=[3,m,zy,0,[lR,Vie,zR,Jde],[()=>s2,0,()=>_O,()=>wQ]],uO=[3,m,Uue,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],Ef=[3,m,nu,0,[St,ur,dpe,Ms],[0,0,[()=>Xme,{[ae]:1,[D]:ak}],[()=>lO,0]],3],lO=[3,m,Fue,0,[He,cn,qc],[0,()=>vi,[()=>uO,0]]],_f=[3,m,tu,0,[Dd,pue,St,bue,Yfe,Ms,Che],[[()=>hO,0],2,0,0,()=>gO,()=>fO,[()=>Dme,0]],5],hO=[3,m,fue,0,[jU],[[()=>pO,0]],1],dO=[3,m,gue,0,[YU,h0],[[()=>D4,{[D]:JU}],[()=>P4,{[D]:cf}]]],fO=[3,m,mue,0,[He],[0],1],pO=[3,m,xue,0,[N,PR,OAe,He,My],[0,0,0,0,[()=>dO,0]],2],gO=[3,m,Rue,0,[hae],[0],1],mO=[3,m,Nd,0,[Do,yi],[0,()=>ca],1],wO=[3,m,jR,0,[Do,g0,No,ou,hf],[0,0,()=>wu,0,0],1],yO=[3,m,kue,0,[Do,yi],[0,()=>ca],1],BO=[3,m,Hd,0,[sf,yi],[()=>Sf,()=>ca],1],CO=[3,m,qR,0,[g0,ou,sf,No,hf],[0,0,()=>Sf,()=>wu,0],3],EO=[3,m,Lue,0,[sf],[()=>Sf],1],_O=[3,m,Que,0,[au],[0]],bO=[3,m,Due,0,[o0],[0]],vO=[3,m,gle,0,[ple,Ny,St,Ms],[[0,{[D]:wie}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],SO=[3,m,fle,0,[CR,Mo,rae],[5,1,2]],TO=[3,m,Vle,0,[ur,es,jo,He,Ms,gpe,phe,hU,N1],[0,()=>SO,0,0,[()=>xO,0],[()=>Zme,{[ae]:1,[D]:uk}],[()=>Hme,{[ae]:1,[D]:dU}],()=>cQ,()=>wF],1],IO=[3,m,Kle,0,[He,ta,wU,yU],[0,[()=>Hs,{[ae]:1,[D]:cn}],1,1]],xO=[3,m,jle,0,[He,cn,wU,yU,qc],[0,()=>vi,1,1,[()=>IO,0]]],RO=[3,m,Xue,{[D]:Yue},[ts,cr,Jo,Q1],[2,0,0,[()=>Tme,{[ae]:1,[D]:Gc}]]],UO=[3,m,Zue,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],kO=[3,m,sle,0,[ts,cr,Jo,KR],[2,0,0,[()=>Ome,{[ae]:1,[D]:nu}]]],FO=[3,m,Ale,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],PO=[3,m,tle,{[D]:Ble},[cr,MR,ts,Jo],[0,[()=>Qme,{[ae]:1,[D]:tu}],2,0]],OO=[3,m,rle,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],QO=[3,m,ole,{[D]:Cle},[ts,cr,Jo,XR],[2,0,0,[()=>Mme,{[ae]:1,[D]:su}]]],DO=[3,m,ale,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],LO=[3,m,cle,{[D]:zue},[Iy,Un,cr,He],[[()=>AD,0],()=>ds,0,0]],MO=[3,m,ule,0,[Jle,cr,He,Ty],[[1,{[J]:Jpe}],[0,{[J]:EA}],[0,{[J]:uu}],[0,{[J]:Vpe}]]],NO=[3,m,hle,{[D]:que},[Iy,cr],[[()=>AD,0],0]],HO=[3,m,dle,0,[cr,Yle],[[0,{[J]:EA}],[1,{[J]:Xpe}]]],$O=[3,m,ble,{[D]:vle},[N,$d,lk,cU,He,yA,dhe,sU,ts,mpe,Qd,BA,Re],[0,0,0,0,0,0,0,1,2,[()=>Nme,{[ae]:1,[D]:Ope}],[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],VO=[3,m,Sle,0,[N,yA,BA,$d,sU,He,lk,z,Ee],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:gk}],[1,{[J]:Zpe}],[0,{[J]:uu}],[0,{[J]:rge}],[0,{[f]:q}],[0,{[f]:_e}]],1],KO=[3,m,xle,0,[YAe,N,le,Wd,K1,JR,IAe,cr,Jo,Re],[[()=>Ime,0],0,0,[0,{[f]:Bf}],0,1,1,0,0,[0,{[f]:Fe}]]],jO=[3,m,Rle,0,[N,le,ye,JR,K1,cr,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[1,{[J]:Wpe}],[0,{[J]:$pe}],[0,{[J]:EA}],[0,{[f]:_e}],[0,{[f]:q}]],2],GO=[3,m,Ule,{[D]:WR},[ts,AU,ahe,pR,Ci,He,yA,Wo,Qd,BA,Re],[2,0,0,[()=>aD,{[ae]:1}],0,0,0,1,[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],zO=[3,m,kle,0,[N,yA,BA,AU,Wo,He,Ee,z,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:qpe}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[f]:_e}],[0,{[f]:q}],[64,{[f]:S0}]],1],qO=[3,m,Ple,{[D]:WR},[ts,pR,Ci,He,yA,Wo,Qd,BA,Mue,cr,Jo,VU,Re],[2,[()=>aD,{[ae]:1}],0,0,0,1,[()=>If,{[ae]:1}],0,1,0,0,0,[0,{[f]:Fe}]]],WO=[3,m,Qle,0,[N,yA,BA,Wo,He,cr,aae,VU,Ee,z,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[J]:EA}],[2,{[J]:jpe}],[0,{[J]:tge}],[0,{[f]:_e}],[0,{[f]:q}],[64,{[f]:S0}]],1],JO=[3,m,Ole,{[D]:zle},[ts,$d,dk,cU,fhe,Qpe,wR,Ci,He,yA,Wo,Qd,BA,Re],[2,0,0,0,0,[()=>Vme,{[ae]:1,[D]:Dpe}],[()=>Ume,{[ae]:1,[D]:wi}],0,0,0,1,[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],XO=[3,m,Dle,0,[N,yA,BA,$d,Wo,He,dk,z,Ee,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:gk}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[J]:nge}],[0,{[f]:q}],[0,{[f]:_e}],[64,{[f]:S0}]],1],YO=[3,m,Nle,{[D]:Hle},[L1,j1,N,le,CA,Yd,lU,Gd,ts,ef,Wy,Un,lr,Re,pe,Tr],[[4,{[f]:Tk}],[0,{[f]:Ik}],0,0,0,0,0,1,2,[()=>jme,{[ae]:1,[D]:tf}],()=>O0,()=>ds,0,[0,{[f]:Fe}],0,0]],ZO=[3,m,$le,0,[N,le,CA,Gd,Yd,Ee,z,Tt,an,It],[[0,1],[0,1],[0,{[J]:lu}],[1,{[J]:Ype}],[0,{[J]:ege}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}]],3],eQ=[3,m,yle,0,[au,Ci],[0,0]],D0=[3,m,Yy,0,[rpe,lpe,sk,ik],[0,0,[()=>Jme,0],[()=>V4,0]],2],tQ=[3,m,Zy,0,[Hd,Nd,Fd],[()=>BO,()=>mO,()=>TF],1],rQ=[3,m,YR,0,[BR,qR,jR,z1],[()=>Q2,()=>CO,()=>wO,()=>IF],1],nQ=[3,m,eU,0,[Ci,m0],[0,0]],sQ=[3,m,r0,0,[ek],[()=>_4],1],AQ=[3,m,rU,0,[tk],[()=>b4],1],ca=[3,m,the,0,[Sfe,Hue],[0,0],1],iQ=[3,m,iU,0,[ur,Aae],[0,()=>z0],1],oQ=[3,m,qle,0,[He,ta,V1],[0,[()=>Hs,{[ae]:1,[D]:cn}],0]],bf=[3,m,su,0,[St,Ms],[0,[()=>lD,0]],1],aQ=[3,m,nU,0,[CA,le,Oue,lr,Un,Wy,pe,Tr],[0,0,4,0,()=>ds,()=>O0,0,0]],cQ=[3,m,hU,0,[aU,uU],[1,1]],uQ=[3,m,dU,0,[aU,lr,uU],[1,0,1]],L0=[3,m,n0,0,[Ape,tfe,wle,_R],[[()=>Yme,{[ae]:1,[D]:nk}],[()=>zme,{[ae]:1,[D]:xU}],[()=>Lme,{[ae]:1,[D]:yie}],()=>H2]],vf=[3,m,Ahe,0,[le],[[()=>C4,{[D]:Mfe}]]],lQ=[3,m,BU,0,[le,on,We,pe,Tr,_i,lr,Un,u0],[0,4,0,[64,{[ae]:1}],0,1,0,()=>ds,()=>q0]],hQ=[3,m,Ehe,0,[le,ye,We,Ele,_i],[0,0,0,6,1],1],M0=[3,m,qd,0,[bhe,ea],[0,()=>dQ]],N0=[3,m,She,0,[ur],[0]],H0=[3,m,The,0,[oU,bfe],[0,5]],dQ=[3,m,Ihe,0,[yR],[()=>i2]],fQ=[3,m,khe,0,[Ei,_i,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[1,1,0,0,0,0,0,0,0,0,0,0]],pQ=[3,m,Ohe,0,[We,pe,Tr,_i,lr,le,ye,NR,on,Un,u0],[0,[64,{[ae]:1}],0,1,0,0,0,2,4,()=>ds,()=>q0]],gQ=[3,m,gU,0,[Xfe],[[()=>E4,0]]],$0=[3,m,A0,0,[lR,zR],[()=>A2,()=>bO]],ds=[3,m,Un,0,[Oy,jo],[0,0]],V0=[3,m,zd,0,[iu],[[()=>Kme,{[ae]:1,[D]:ea}]],1],mQ=[3,m,yhe,0,[mU],[0],1],wQ=[3,m,vde,0,[],[]],yQ=[3,m,tf,0,[Ei,on,We,_i,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[1,4,0,1,0,0,0,0,0,0,0,0,0,0]],BQ=[3,m,Zd,{[D]:Zd},[_de],[0]],CQ=[3,m,CU,0,[VR],[[2,{[D]:VR}]]],EQ=[3,m,SU,0,[Z1,W1,Y1],[1,1,1]],_Q=[3,m,bde,0,[ER],[[()=>EQ,{[y0]:1}]]],K0=[3,m,Jd,0,[J1,$R,X1,LU],[[2,{[D]:J1}],[2,{[D]:$R}],[2,{[D]:X1}],[2,{[D]:LU}]]],bQ=[3,m,Vhe,0,[N,kd,Ne,pe,z],[[0,1],[()=>R0,{[Be]:1,[D]:kd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],vQ=[3,m,Nhe,0,[N,Rd,z,pe],[[0,1],[()=>CF,{[Be]:1,[D]:Rd}],[0,{[f]:q}],[0,{[f]:Ue}]],2],SQ=[3,m,Khe,0,[N,Ro,mi,Ne,pe,Ho,$o,Vo,$y,Ko,z],[[0,1],[0,{[f]:na}],[()=>U0,{[Be]:1,[D]:mi}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[0,{[f]:q}]],1],TQ=[3,m,Hhe,0,[N,St,Gc,z],[[0,1],[0,{[J]:un}],[()=>Cf,{[Be]:1,[D]:Gc}],[0,{[f]:q}]],3],IQ=[3,m,zhe,0,[N,Od,Ne,pe,z],[[0,1],[()=>zF,{[Be]:1,[D]:Od}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],xQ=[3,m,Whe,0,[N,lf,Ne,pe,z],[[0,1],[()=>W0,{[Be]:1,[D]:lf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],RQ=[3,m,Zhe,0,[N,St,nu,z],[[0,1],[0,{[J]:un}],[()=>Ef,{[Be]:1,[D]:nu}],[0,{[f]:q}]],3],UQ=[3,m,Xhe,0,[N,St,tu,z],[[0,1],[0,{[J]:un}],[()=>_f,{[Be]:1,[D]:tu}],[0,{[f]:q}]],3],kQ=[3,m,rde,0,[p0],[[0,{[f]:x0}]]],FQ=[3,m,nde,0,[N,pe,Xy,z,p0],[[0,1],[0,{[f]:Ue}],[()=>FF,{[Be]:1,[D]:Xy}],[0,{[f]:q}],[0,{[f]:x0}]],1],PQ=[3,m,sde,0,[N,Pd,Ne,pe,z],[[0,1],[()=>PF,{[Be]:1,[D]:Pd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],OQ=[3,m,ide,0,[N,St,su,z],[[0,1],[0,{[J]:un}],[()=>bf,{[Be]:1,[D]:su}],[0,{[f]:q}]],3],QQ=[3,m,ade,0,[N,n0,z,kfe],[[0,1],[()=>L0,{[Be]:1,[D]:n0}],[0,{[f]:q}],[2,{[f]:Eme}]],2],DQ=[3,m,ude,0,[N,zd,Ne,z,pe],[[0,1],[()=>V0,{[Be]:1,[D]:zd}],[0,{[f]:Me}],[0,{[f]:q}],[0,{[f]:Ue}]],2],LQ=[3,m,hde,0,[N,vU,Ne,pe,Pie,z],[[0,1],[0,16],[0,{[f]:Me}],[0,{[f]:Ue}],[2,{[f]:hge}],[0,{[f]:q}]],2],MQ=[3,m,gde,0,[N,nf,Ne,pe,ck,z],[[0,1],[()=>G0,{[Be]:1,[D]:nf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:Rk}],[0,{[f]:q}]],2],NQ=[3,m,pde,0,[N,Af,Ne,pe,z],[[0,1],[()=>p4,{[Be]:1,[D]:Af}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],HQ=[3,m,wde,0,[N,kn,Ne,pe,z],[[0,1],[()=>Tf,{[Be]:1,[D]:kn}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],$Q=[3,m,Bde,0,[N,ff,Ne,pe,e0,z],[[0,1],[()=>rD,{[Be]:1,[D]:ff}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:v0}],[0,{[f]:q}]],2],VQ=[3,m,Ede,0,[N,pf,Ne,pe,z],[[0,1],[()=>nD,{[Be]:1,[D]:pf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],KQ=[3,m,xde,0,[Re],[[0,{[f]:Fe}]]],jQ=[3,m,Ude,0,[N,le,Ro,mi,Ne,pe,Ho,$o,Vo,$y,Ko,Ee,ye,z],[[0,1],[0,1],[0,{[f]:na}],[()=>U0,{[Be]:1,[D]:mi}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[0,{[f]:_e}],[0,{[J]:xt}],[0,{[f]:q}]],2],GQ=[3,m,Rde,0,[le,zc,Wd,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,Re],[0,0,[0,{[f]:Bf}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:Fe}]]],zQ=[3,m,kde,0,[N,le,zc,$1,ye,pU,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Ne,Ee,z],[[0,1],[0,1],[0,{[J]:w0}],[()=>bi,16],[0,{[J]:xt}],[0,{[f]:$k}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Me}],[0,{[f]:_e}],[0,{[f]:q}]],4],qQ=[3,m,Lde,0,[Re],[[0,{[f]:Fe}]]],WQ=[3,m,Mde,0,[N,le,Kd,Ee,ye,Ne,pe,z],[[0,1],[0,1],[()=>N0,{[Be]:1,[D]:Kd}],[0,{[f]:_e}],[0,{[J]:xt}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],JQ=[3,m,Ode,0,[Re],[[0,{[f]:Fe}]]],XQ=[3,m,Qde,0,[N,qd,Ee,ck,Ne,pe,z],[[0,1],[()=>M0,{[Be]:1,[D]:qd}],[0,{[f]:_e}],[0,{[f]:Rk}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],1],YQ=[3,m,Nde,0,[es,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,ye,Tt,It,Ir,Ns,ar,_i,Re],[[0,{[f]:hu}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:hs}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[1,{[f]:hme}],[0,{[f]:Fe}]]],ZQ=[3,m,Hde,0,[N,le,Ro,Wc,Uo,ko,Fo,Po,Qo,Ne,Lo,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Rn,Go,ru,Ho,$o,Vo,Ko,Npe,qo,hr,lr,cu,Tt,an,It,Ir,Ns,ar,Ee,kn,Yo,Zo,Xo,z],[[0,1],[0,1],[0,{[f]:na}],[()=>bi,16],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[1,{[f]:Oo}],[0,{[f]:Me}],[0,{[f]:eu}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[4,{[f]:Rn}],[0,{[f]:Bi}],[0,{[f]:zo}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[1,{[f]:bme}],[128,{[ra]:aa}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}]],2],e4=[3,m,$de,0,[Re],[[0,{[f]:Fe}]]],t4=[3,m,Vde,0,[N,le,af,Ee,ye,Sy,Ne,pe,z],[[0,1],[0,1],[()=>H0,{[Be]:1,[D]:af}],[0,{[f]:_e}],[0,{[J]:xt}],[2,{[f]:C0}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],r4=[3,m,Gde,0,[ye],[[0,{[f]:hs}]]],n4=[3,m,zde,0,[N,le,kn,ye,Ne,pe,z,Ee],[[0,1],[0,1],[()=>Tf,{[Be]:1,[D]:kn}],[0,{[J]:xt}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}],[0,{[f]:_e}]],3],s4=[3,m,Wde,0,[N,Jd,Ne,pe,z],[[0,1],[()=>K0,{[Be]:1,[D]:Jd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],A4=[3,m,xU,0,[Zde,Ny,St,Ms],[[0,{[D]:nfe}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],Sf=[3,m,sf,0,[es,Mo],[0,1],1],i4=[3,m,Afe,0,[_U],[[21,{[y0]:1}]]],o4=[3,m,$U,0,[LR,hue,TU,ofe,afe],[0,0,0,0,0]],j0=[3,m,i0,0,[LR,TU],[0,0],1],a4=[3,m,ufe,0,[],[]],c4=[3,m,dfe,0,[N,le,Cfe,voe,Toe,Soe,Ioe,Pfe,Qfe,Ofe,Dfe,$ie],[[0,1],[0,1],[0,{[f]:gme}],[0,{[f]:Bi}],[0,{[f]:zo}],[4,{[f]:Gy}],[4,{[f]:qy}],[0,{[f]:mme}],[0,{[f]:yme}],[6,{[f]:wme}],[6,{[f]:Bme}],[0,{[f]:pge,[zpe]:1}]],3],u4=[3,m,DU,0,[ur],[0],1],G0=[3,m,nf,0,[rf,iu],[0,[()=>qme,{[ae]:1,[D]:ea}]],2],l4=[3,m,wfe,0,[ur,Dd,jo,Xde,He,Ms,XU,SR,mR],[0,()=>O2,0,1,0,[()=>d4,0],()=>F4,()=>$2,()=>v2],2],h4=[3,m,gfe,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],d4=[3,m,mfe,0,[He,cn,qc],[0,()=>vi,[()=>h4,0]]],f4=[3,m,HU,0,[ur,fpe],[0,()=>z0],2],z0=[3,m,Efe,0,[she],[1]],p4=[3,m,Af,0,[EU],[0],1],g4=[3,m,MU,0,[iae],[2]],m4=[3,m,lfe,0,[Re,hfe],[[0,{[f]:Fe}],[0,{[f]:fme}]]],w4=[3,m,ffe,0,[N,le,ye,c0,Ee,pe,z],[[0,1],[0,1],[0,{[J]:xt}],[()=>y4,{[Be]:1,[D]:c0}],[0,{[f]:_e}],[0,{[f]:Ue}],[0,{[f]:q}]],2],y4=[3,m,c0,0,[Mo,DR,au,ok,Joe,qU,gU],[1,()=>sO,0,0,0,()=>I4,[()=>gQ,0]]],q0=[3,m,u0,0,[Iue,sfe],[2,4]],B4=[3,m,NU,0,[$U,fR],[()=>o4,()=>HF],1],C4=[3,m,Lfe,0,[uae],[[()=>Pme,{[ae]:1,[D]:FR}]]],E4=[3,m,Nfe,0,[oie,He,My,aie,Ud,kn,hk,lr],[0,0,[()=>D2,0],0,[()=>xf,0],[()=>Tf,0],[()=>ewe,0],0],2],_4=[3,m,ek,0,[d0,ou],[0,0],2],b4=[3,m,tk,0,[d0,ou,hf,Ak],[0,0,0,0],4],v4=[3,m,WU,0,[Zfe,xR],[1,1]],S4=[3,m,Kfe,0,[_U],[[()=>dD,16]]],T4=[3,m,jfe,0,[N,le,UR,IR,zy,A0,Tt,an,It,MU,WU,z],[[0,1],[0,1],0,0,()=>Q0,()=>$0,[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],()=>g4,()=>v4,[0,{[f]:q}]],6],I4=[3,m,qU,0,[zy,IR,UR,A0],[()=>Q0,0,0,()=>$0],4],x4=[3,m,zfe,0,[Gfe,jue],[0,[()=>Zt,0]],1],W0=[3,m,lf,0,[iu],[[()=>Wme,{[ae]:1,[D]:ea}]],1],R4=[3,m,Wfe,0,[WAe,ar,q1],[[()=>x4,0],2,[()=>RF,0]]],U4=[3,m,Rfe,0,[H1,KU,ZU,es],[[0,{[D]:H1}],[()=>mF,{[D]:KU}],[()=>mF,{[D]:ZU}],[4,{[D]:es}]],4],k4=[3,m,uf,{[D]:uf},[],[]],F4=[3,m,XU,0,[zU,DU],[()=>O4,()=>u4]],P4=[3,m,h0,{[D]:cf},[Nue],[[()=>Zt,0]],1],O4=[3,m,zU,0,[ur],[0],1],Q4=[3,m,qfe,{[D]:cf},[Vue,ar],[[()=>Sme,0],2],1],D4=[3,m,YU,{[D]:JU},[],[]],L4=[3,m,rk,0,[Z1,W1,Y1],[1,1,1]],M4=[3,m,Ffe,0,[ER],[[()=>L4,{[y0]:1}]]],N4=[3,m,GU,0,[boe],[()=>H4]],H4=[3,m,Ife,0,[Phe,Dd],[0,()=>bF],2],vi=[3,m,cn,0,[le,m0],[0,0],2],Tf=[3,m,kn,0,[df],[[()=>Hs,0]],1],$4=[3,m,ope,0,[Ky,bU],[[()=>F0,{[Sk]:[vk,pk]}],0]],V4=[3,m,ik,0,[uf,Zd],[[()=>k4,{[D]:uf}],[()=>BQ,{[D]:Zd}]]],K4=[3,m,ak,0,[Mo,G1],[1,0],2],j4=[3,m,nk,0,[tpe,Ny,St,Ms],[[0,{[D]:ppe}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],G4=[3,m,uk,0,[CR,Mo,lr],[5,1,0]],z4=[3,m,ype,0,[N,Fd,Ne,pe,z],[[0,1],[()=>xF,{[Be]:1,[D]:Fd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],q4=[3,m,Cpe,0,[N,Nd,Ne,pe,z],[[0,1],[()=>yO,{[Be]:1,[D]:Nd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],W4=[3,m,_pe,0,[N,Hd,Ne,pe,z],[[0,1],[()=>EO,{[Be]:1,[D]:Hd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],J4=[3,m,Spe,0,[N,le,fU,ye,Ee,z,Ne,pe],[[0,1],[0,1],[()=>hD,16],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Me}],[0,{[f]:Ue}]],3],X4=[3,m,Tpe,0,[Re],[[0,{[f]:Fe}]]],Y4=[3,m,Rpe,0,[hR,nR,hr,Tt,It,Ir,ar,Re],[[0,{[f]:Mk}],[()=>GF,16],[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],Z4=[3,m,Upe,0,[N,dR,le,Ei,CA,AR,iR,oR,aR,Die,Tt,an,It,cR,Py,uR,Ee,z,TR],[[0,1],[0,{[f]:Uk}],[0,1],[1,{[J]:wf}],[0,{[J]:lu}],[0,{[f]:kk}],[4,{[f]:Fk}],[0,{[f]:Pk}],[4,{[f]:Ok}],[0,{[f]:fge}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:Qk}],[()=>gF,{[f]:Dk}],[0,{[f]:Lk}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Kk}]],5],eD=[3,m,kpe,0,[hr,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tt,It,Ir,ar,Re],[[0,{[f]:xr}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],tD=[3,m,Fpe,0,[N,le,Ei,CA,Wc,Qo,Ne,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tt,an,It,Ee,z],[[0,1],[0,1],[1,{[J]:wf}],[0,{[J]:lu}],[()=>bi,16],[1,{[f]:Oo}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[0,{[f]:q}]],4],rD=[3,m,ff,0,[tU,ur],[[0,{[D]:ZR}],0]],nD=[3,m,pf,0,[Dy,jy,i0,a0],[()=>k0,()=>P0,()=>j0,[()=>cD,0]]],sD=[3,m,Mpe,0,[Bfe,_fe,Wc,Ufe,bR,vR,by,Uo,ko,Fo,Po,Qo,Fy,Lo,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,wi,We,Rn,es,on,t0,qo,Yo,Xo,Zo,Xd,Au,Re,l0,hr,Tt,Ir,It,lr,f0,ye,ar],[[0,{[Gpe]:1,[f]:pme}],[0,{[f]:Cme}],[()=>bi,16],[1,{[f]:rme}],[0,{[f]:gge}],[0,{[f]:mge}],[0,{[f]:Tge}],[0,{[f]:wge}],[0,{[f]:yge}],[0,{[f]:Bge}],[0,{[f]:Cge}],[1,{[f]:Oo}],[0,{[f]:Ege}],[0,{[f]:_ge}],[0,{[f]:Ige}],[0,{[f]:xge}],[0,{[f]:Rge}],[0,{[f]:kge}],[0,{[f]:Fge}],[0,{[f]:Pge}],[0,{[f]:Uge}],[0,{[f]:Oge}],[0,{[f]:Qge}],[0,{[f]:Dge}],[2,{[f]:Lge}],[0,{[f]:bge}],[4,{[f]:vge}],[0,{[f]:Mge}],[4,{[f]:Sge}],[1,{[f]:Nge}],[128,{[ra]:aa}],[0,{[f]:Vge}],[0,{[f]:$ge}],[5,{[f]:Kge}],[1,{[f]:Hge}],[0,{[f]:zge}],[0,{[f]:Gge}],[0,{[f]:jge}],[0,{[f]:Wge}],[0,{[f]:Yge}],[()=>Zt,{[f]:Jge}],[0,{[f]:Zge}],[0,{[f]:qge}],[1,{[f]:eme}],[0,{[f]:tme}],[2,{[f]:Xge}]],2],fe="unit",Tme=[1,m,Q1,0,[()=>Cf,0]],Ime=[1,m,QAe,0,[()=>SF,{[D]:M1}]],AD=[1,m,Iy,0,[()=>UF,{[D]:N}]],If=[1,m,Uie,0,()=>QF],xme=[1,m,kie,0,()=>LF],iD=[1,m,Uy,0,[()=>qF,0]],Rme=[1,m,$oe,0,()=>_2],Ume=[1,m,wR,0,()=>b2],kme=[1,m,nae,0,[0,{[D]:Ly}]],Fme=[1,m,RR,0,()=>N2],Pme=[1,m,cae,0,()=>V2],xf=[1,m,Md,0,[()=>AO,{[D]:Vy}]],Ome=[1,m,KR,0,[()=>Ef,0]],Qme=[1,m,MR,0,[()=>_f,0]],Dme=[1,m,Eue,0,[0,{[D]:lae}]],Lme=[1,m,mle,0,[()=>vO,0]],oD=[1,m,Gle,0,[()=>TO,0]],Mme=[1,m,XR,0,[()=>bf,0]],Nme=[1,m,rhe,0,()=>aQ],Hme=[1,m,ghe,0,()=>uQ],$me=[1,m,_he,0,()=>hQ],aD=[1,m,xhe,0,[()=>lQ,0]],Vme=[1,m,Qhe,0,[()=>pQ,0]],Kme=[1,m,Bhe,0,()=>mQ],jme=[1,m,ef,0,()=>yQ],Gme=[1,m,Sde,0,()=>fQ],zme=[1,m,efe,0,[()=>A4,0]],qme=[1,m,yfe,0,[()=>l4,0]],cD=[1,m,a0,0,[()=>B4,{[D]:NU}]],Wme=[1,m,Jfe,0,[()=>R4,0]],Hs=[1,m,df,0,[()=>vi,{[D]:cn}]],Jme=[1,m,sk,0,[()=>$4,{[D]:Vy}]],Xme=[1,m,ape,0,()=>K4],Yme=[1,m,spe,0,[()=>j4,0]],Zme=[1,m,cpe,0,()=>G4],ewe=[1,m,hk,0,[()=>nQ,{[D]:eU}]],uD=[4,m,kAe,0,[He,cn,qc],[0,()=>vi,[()=>_F,0]]],lD=[4,m,Zle,0,[He,cn,V1,qc],[0,()=>vi,0,[()=>oQ,0]]],hD=[4,m,fU,0,[h0],[[()=>Q4,{[D]:cf}]]],dD=[4,m,Vfe,{[bk]:1},[vfe,rk,SU,Gie,xR],[[()=>i4,0],[()=>M4,0],[()=>_Q,0],()=>$F,()=>M2]],fD=[9,m,MAe,{[j]:["DELETE","/{Key+}?x-id=AbortMultipartUpload",204]},()=>BF,()=>yF],pD=[9,m,tR,{[j]:["POST","/{Key+}",200]},()=>NF,()=>MF],gD=[9,m,Tie,{[j]:["PUT","/{Key+}?x-id=CopyObject",200]},()=>KF,()=>VF],mD=[9,m,cie,{[j]:["PUT","/",200]},()=>ZF,()=>YF],wD=[9,m,uie,{[Se]:"-",[j]:["POST","/?metadataConfiguration",200]},()=>JF,()=>fe],yD=[9,m,hie,{[Se]:"-",[j]:["POST","/?metadataTable",200]},()=>XF,()=>fe],BD=[9,m,Sie,{[j]:["POST","/{Key+}?uploads",200]},()=>t2,()=>e2],CD=[9,m,Hie,{[j]:["GET","/?session",200]},()=>n2,()=>r2],ED=[9,m,qie,{[j]:["DELETE","/",204]},()=>B2,()=>fe],_D=[9,m,Wie,{[j]:["DELETE","/?analytics",204]},()=>a2,()=>fe],bD=[9,m,Xie,{[j]:["DELETE","/?cors",204]},()=>c2,()=>fe],vD=[9,m,Zie,{[j]:["DELETE","/?encryption",204]},()=>u2,()=>fe],SD=[9,m,noe,{[j]:["DELETE","/?intelligent-tiering",204]},()=>l2,()=>fe],TD=[9,m,toe,{[j]:["DELETE","/?inventory",204]},()=>h2,()=>fe],ID=[9,m,Aoe,{[j]:["DELETE","/?lifecycle",204]},()=>d2,()=>fe],xD=[9,m,ooe,{[j]:["DELETE","/?metadataConfiguration",204]},()=>f2,()=>fe],RD=[9,m,loe,{[j]:["DELETE","/?metadataTable",204]},()=>p2,()=>fe],UD=[9,m,uoe,{[j]:["DELETE","/?metrics",204]},()=>g2,()=>fe],kD=[9,m,doe,{[j]:["DELETE","/?ownershipControls",204]},()=>m2,()=>fe],FD=[9,m,poe,{[j]:["DELETE","/?policy",204]},()=>w2,()=>fe],PD=[9,m,yoe,{[j]:["DELETE","/?replication",204]},()=>y2,()=>fe],OD=[9,m,Boe,{[j]:["DELETE","/?tagging",204]},()=>C2,()=>fe],QD=[9,m,Eoe,{[j]:["DELETE","/?website",204]},()=>E2,()=>fe],DD=[9,m,Voe,{[j]:["DELETE","/{Key+}?x-id=DeleteObject",204]},()=>x2,()=>I2],LD=[9,m,koe,{[j]:["DELETE","/{Key+}?annotation",204]},()=>T2,()=>S2],MD=[9,m,Koe,{[Se]:"-",[j]:["POST","/?delete",200]},()=>U2,()=>R2],ND=[9,m,Moe,{[j]:["DELETE","/{Key+}?tagging",204]},()=>F2,()=>k2],HD=[9,m,joe,{[j]:["DELETE","/?publicAccessBlock",204]},()=>P2,()=>fe],$D=[9,m,dae,{[j]:["GET","/?abac",200]},()=>j2,()=>K2],VD=[9,m,fae,{[j]:["GET","/?accelerate",200]},()=>z2,()=>G2],KD=[9,m,bae,{[j]:["GET","/?acl",200]},()=>W2,()=>q2],jD=[9,m,yae,{[j]:["GET","/?analytics&x-id=GetBucketAnalyticsConfiguration",200]},()=>X2,()=>J2],GD=[9,m,vae,{[j]:["GET","/?cors",200]},()=>Z2,()=>Y2],zD=[9,m,Iae,{[j]:["GET","/?encryption",200]},()=>tP,()=>eP],qD=[9,m,Pae,{[j]:["GET","/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration",200]},()=>nP,()=>rP],WD=[9,m,Uae,{[j]:["GET","/?inventory&x-id=GetBucketInventoryConfiguration",200]},()=>AP,()=>sP],JD=[9,m,Lae,{[j]:["GET","/?lifecycle",200]},()=>oP,()=>iP],XD=[9,m,Dae,{[j]:["GET","/?location",200]},()=>cP,()=>aP],YD=[9,m,jae,{[j]:["GET","/?logging",200]},()=>lP,()=>uP],ZD=[9,m,Gae,{[j]:["GET","/?metadataConfiguration",200]},()=>dP,()=>hP],eL=[9,m,Yae,{[j]:["GET","/?metadataTable",200]},()=>gP,()=>pP],tL=[9,m,Xae,{[j]:["GET","/?metrics&x-id=GetBucketMetricsConfiguration",200]},()=>yP,()=>wP],rL=[9,m,tce,{[j]:["GET","/?notification",200]},()=>BP,()=>L0],nL=[9,m,nce,{[j]:["GET","/?ownershipControls",200]},()=>EP,()=>CP],sL=[9,m,ice,{[j]:["GET","/?policy",200]},()=>bP,()=>_P],AL=[9,m,cce,{[j]:["GET","/?policyStatus",200]},()=>SP,()=>vP],iL=[9,m,hce,{[j]:["GET","/?replication",200]},()=>IP,()=>TP],oL=[9,m,fce,{[j]:["GET","/?requestPayment",200]},()=>RP,()=>xP],aL=[9,m,wce,{[j]:["GET","/?tagging",200]},()=>kP,()=>UP],cL=[9,m,Cce,{[j]:["GET","/?versioning",200]},()=>PP,()=>FP],uL=[9,m,bce,{[j]:["GET","/?website",200]},()=>QP,()=>OP],lL=[9,m,Tce,{[Se]:"-",[j]:["GET","/{Key+}?x-id=GetObject",200]},()=>WP,()=>qP],hL=[9,m,Ice,{[j]:["GET","/{Key+}?acl",200]},()=>LP,()=>DP],dL=[9,m,Dce,{[Se]:"-",[j]:["GET","/{Key+}?annotation&x-id=GetObjectAnnotation",200]},()=>NP,()=>MP],fL=[9,m,Lce,{[j]:["GET","/{Key+}?attributes",200]},()=>VP,()=>HP],pL=[9,m,$ce,{[j]:["GET","/{Key+}?legal-hold",200]},()=>jP,()=>KP],gL=[9,m,Mce,{[j]:["GET","/?object-lock",200]},()=>zP,()=>GP],mL=[9,m,Wce,{[j]:["GET","/{Key+}?retention",200]},()=>XP,()=>JP],wL=[9,m,Jce,{[j]:["GET","/{Key+}?tagging",200]},()=>ZP,()=>YP],yL=[9,m,tue,{[j]:["GET","/{Key+}?torrent",200]},()=>tO,()=>eO],BL=[9,m,rue,{[j]:["GET","/?publicAccessBlock",200]},()=>nO,()=>rO],CL=[9,m,Aue,{[j]:["HEAD","/",200]},()=>oO,()=>iO],EL=[9,m,cue,{[j]:["HEAD","/{Key+}",200]},()=>cO,()=>aO],_L=[9,m,Jue,{[j]:["GET","/?analytics&x-id=ListBucketAnalyticsConfigurations",200]},()=>UO,()=>RO],bL=[9,m,nle,{[j]:["GET","/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations",200]},()=>FO,()=>kO],vL=[9,m,ele,{[j]:["GET","/?inventory&x-id=ListBucketInventoryConfigurations",200]},()=>OO,()=>PO],SL=[9,m,ile,{[j]:["GET","/?metrics&x-id=ListBucketMetricsConfigurations",200]},()=>DO,()=>QO],TL=[9,m,Wue,{[j]:["GET","/?x-id=ListBuckets",200]},()=>MO,()=>LO],IL=[9,m,lle,{[j]:["GET","/?x-id=ListDirectoryBuckets",200]},()=>HO,()=>NO],xL=[9,m,_le,{[j]:["GET","/?uploads",200]},()=>VO,()=>$O],RL=[9,m,Ile,{[j]:["GET","/{Key+}?annotation&x-id=ListObjectAnnotations",200]},()=>jO,()=>KO],UL=[9,m,Tle,{[j]:["GET","/",200]},()=>zO,()=>GO],kL=[9,m,Fle,{[j]:["GET","/?list-type=2",200]},()=>WO,()=>qO],FL=[9,m,Lle,{[j]:["GET","/?versions",200]},()=>XO,()=>JO],PL=[9,m,Mle,{[j]:["GET","/{Key+}?x-id=ListParts",200]},()=>ZO,()=>YO],OL=[9,m,Lhe,{[Se]:"-",[j]:["PUT","/?abac",200]},()=>bQ,()=>fe],QL=[9,m,Mhe,{[Se]:"-",[j]:["PUT","/?accelerate",200]},()=>vQ,()=>fe],DL=[9,m,jhe,{[Se]:"-",[j]:["PUT","/?acl",200]},()=>SQ,()=>fe],LL=[9,m,$he,{[j]:["PUT","/?analytics",200]},()=>TQ,()=>fe],ML=[9,m,Ghe,{[Se]:"-",[j]:["PUT","/?cors",200]},()=>IQ,()=>fe],NL=[9,m,qhe,{[Se]:"-",[j]:["PUT","/?encryption",200]},()=>xQ,()=>fe],HL=[9,m,Yhe,{[j]:["PUT","/?intelligent-tiering",200]},()=>RQ,()=>fe],$L=[9,m,Jhe,{[j]:["PUT","/?inventory",200]},()=>UQ,()=>fe],VL=[9,m,tde,{[Se]:"-",[j]:["PUT","/?lifecycle",200]},()=>FQ,()=>kQ],KL=[9,m,ede,{[Se]:"-",[j]:["PUT","/?logging",200]},()=>PQ,()=>fe],jL=[9,m,Ade,{[j]:["PUT","/?metrics",200]},()=>OQ,()=>fe],GL=[9,m,ode,{[j]:["PUT","/?notification",200]},()=>QQ,()=>fe],zL=[9,m,cde,{[Se]:"-",[j]:["PUT","/?ownershipControls",200]},()=>DQ,()=>fe],qL=[9,m,lde,{[Se]:"-",[j]:["PUT","/?policy",200]},()=>LQ,()=>fe],WL=[9,m,dde,{[Se]:"-",[j]:["PUT","/?replication",200]},()=>MQ,()=>fe],JL=[9,m,fde,{[Se]:"-",[j]:["PUT","/?requestPayment",200]},()=>NQ,()=>fe],XL=[9,m,mde,{[Se]:"-",[j]:["PUT","/?tagging",200]},()=>HQ,()=>fe],YL=[9,m,yde,{[Se]:"-",[j]:["PUT","/?versioning",200]},()=>$Q,()=>fe],ZL=[9,m,Cde,{[Se]:"-",[j]:["PUT","/?website",200]},()=>VQ,()=>fe],e3=[9,m,Tde,{[Se]:"-",[j]:["PUT","/{Key+}?x-id=PutObject",200]},()=>ZQ,()=>YQ],t3=[9,m,Ide,{[Se]:"-",[j]:["PUT","/{Key+}?acl",200]},()=>jQ,()=>KQ],r3=[9,m,Fde,{[Se]:"-",[j]:["PUT","/{Key+}?annotation",200]},()=>zQ,()=>GQ],n3=[9,m,Dde,{[Se]:"-",[j]:["PUT","/{Key+}?legal-hold",200]},()=>WQ,()=>qQ],s3=[9,m,Pde,{[Se]:"-",[j]:["PUT","/?object-lock",200]},()=>XQ,()=>JQ],A3=[9,m,Kde,{[Se]:"-",[j]:["PUT","/{Key+}?retention",200]},()=>t4,()=>e4],i3=[9,m,jde,{[Se]:"-",[j]:["PUT","/{Key+}?tagging",200]},()=>n4,()=>r4],o3=[9,m,qde,{[Se]:"-",[j]:["PUT","/?publicAccessBlock",200]},()=>s4,()=>fe],a3=[9,m,cfe,{[j]:["PUT","/{Key+}?renameObject",200]},()=>c4,()=>a4],c3=[9,m,pfe,{[Se]:"-",[j]:["POST","/{Key+}?restore",200]},()=>w4,()=>m4],u3=[9,m,$fe,{[j]:["POST","/{Key+}?select&select-type=2",200]},()=>T4,()=>S4],l3=[9,m,wpe,{[Se]:"-",[j]:["PUT","/?metadataAnnotationTable",200]},()=>z4,()=>fe],h3=[9,m,Bpe,{[Se]:"-",[j]:["PUT","/?metadataInventoryTable",200]},()=>q4,()=>fe],d3=[9,m,Epe,{[Se]:"-",[j]:["PUT","/?metadataJournalTable",200]},()=>W4,()=>fe],f3=[9,m,vpe,{[Se]:"-",[j]:["PUT","/{Key+}?encryption",200]},()=>J4,()=>X4],p3=[9,m,Ipe,{[Se]:"-",[j]:["PUT","/{Key+}?x-id=UploadPart",200]},()=>tD,()=>eD],g3=[9,m,xpe,{[j]:["PUT","/{Key+}?x-id=UploadPartCopy",200]},()=>Z4,()=>Y4],m3=[9,m,Lpe,{[Kpe]:["{RequestRoute}."],[j]:["POST","/WriteGetObjectResponse",200]},()=>sD,()=>fe];class J0 extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(CD).build(){}const twe={version:"3.1075.0"};function w3(t){return typeof t=="string"?t.length===0:t.byteLength===0}var y3={name:"SHA-1"},B3={name:"HMAC",hash:y3},rwe=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);const nwe={};function SA(){return typeof window<"u"?window:typeof self<"u"?self:nwe}var swe=function(){function t(e){this.toHash=new Uint8Array(0),e!==void 0&&(this.key=new Promise(function(r,n){SA().crypto.subtle.importKey("raw",C3(e),B3,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))}return t.prototype.update=function(e){if(!w3(e)){var r=C3(e),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return SA().crypto.subtle.sign(B3,r,e.toHash).then(function(n){return new Uint8Array(n)})}):w3(this.toHash)?Promise.resolve(rwe):Promise.resolve().then(function(){return SA().crypto.subtle.digest(y3,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){this.toHash=new Uint8Array(0)},t}();function C3(t){return typeof t=="string"?rx(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}var Awe=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function E3(t){if(iwe(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return owe(e)}return!1}function iwe(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}function owe(t){return t&&Awe.every(function(e){return typeof t[e]=="function"})}var awe=function(){function t(e){if(E3(SA()))this.hash=new swe(e);else throw new Error("SHA1 not supported")}return t.prototype.update=function(e,r){this.hash.update(mA(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}(),_3={name:"SHA-256"},b3={name:"HMAC",hash:_3},cwe=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]),uwe=function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!Hc(e)){var r=mA(e),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return SA().crypto.subtle.sign(b3,r,e.toHash).then(function(n){return new Uint8Array(n)})}):Hc(this.toHash)?Promise.resolve(cwe):Promise.resolve().then(function(){return SA().crypto.subtle.digest(_3,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,n){SA().crypto.subtle.importKey("raw",mA(e.secret),b3,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))},t}(),ln=64,lwe=32,hwe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dwe=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],fwe=Math.pow(2,53)-1,Rf=function(){function t(){this.state=Int32Array.from(dwe),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>fwe)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[r++],n--,this.bufferLength===ln&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(r.setUint8(this.bufferLength++,128),n%ln>=ln-8){for(var s=this.bufferLength;s<ln;s++)r.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(var s=this.bufferLength;s<ln-8;s++)r.setUint8(s,0);r.setUint32(ln-8,Math.floor(e/4294967296),!0),r.setUint32(ln-4,e),this.hashBuffer(),this.finished=!0}for(var A=new Uint8Array(lwe),s=0;s<8;s++)A[s*4]=this.state[s]>>>24&255,A[s*4+1]=this.state[s]>>>16&255,A[s*4+2]=this.state[s]>>>8&255,A[s*4+3]=this.state[s]>>>0&255;return A},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,n=e.state,s=n[0],A=n[1],i=n[2],o=n[3],a=n[4],c=n[5],l=n[6],h=n[7],d=0;d<ln;d++){if(d<16)this.temp[d]=(r[d*4]&255)<<24|(r[d*4+1]&255)<<16|(r[d*4+2]&255)<<8|r[d*4+3]&255;else{var p=this.temp[d-2],w=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[d-15];var B=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[d]=(w+this.temp[d-7]|0)+(B+this.temp[d-16]|0)}var C=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&l)|0)+(h+(hwe[d]+this.temp[d]|0)|0)|0,_=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&A^s&i^A&i)|0;h=l,l=c,c=a,a=o+C|0,o=i,i=A,A=s,s=C+_|0}n[0]+=s,n[1]+=A,n[2]+=i,n[3]+=o,n[4]+=a,n[5]+=c,n[6]+=l,n[7]+=h},t}(),pwe=function(){function t(e){this.secret=e,this.hash=new Rf,this.reset()}return t.prototype.update=function(e){if(!(Hc(e)||this.error))try{this.hash.update(mA(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Rf,this.secret){this.outer=new Rf;var e=gwe(this.secret),r=new Uint8Array(ln);r.set(e);for(var n=0;n<ln;n++)e[n]^=54,r[n]^=92;this.hash.update(e),this.outer.update(r);for(var n=0;n<e.byteLength;n++)e[n]=0}},t}();function gwe(t){var e=mA(t);if(e.byteLength>ln){var r=new Rf;r.update(e),e=r.digest()}var n=new Uint8Array(ln);return n.set(e),n}var v3=function(){function t(e){E3(SA())?this.hash=new uwe(e):this.hash=new pwe(e)}return t.prototype.update=function(e,r){this.hash.update(mA(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}();async function mwe(t,e,r=1024*1024){const n=t.size;let s=0;for(;s<n;){const A=t.slice(s,Math.min(n,s+r));e(new Uint8Array(await A.arrayBuffer())),s+=A.size}}const wwe=async function(e,r){const n=new e;return await mwe(r,s=>{n.update(s)}),n.digest()},TA=64,ywe=16,Bwe=[1732584193,4023233417,2562383102,271733878];class Cwe{constructor(){S(this,"state");S(this,"buffer");S(this,"bufferLength");S(this,"bytesHashed");S(this,"finished");this.reset()}update(e){if(Ewe(e))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=_we(e);let n=0,{byteLength:s}=r;for(this.bytesHashed+=s;s>0;)this.buffer.setUint8(this.bufferLength++,r[n++]),s--,this.bufferLength===TA&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:n,bytesHashed:s}=this,A=s*8;if(r.setUint8(this.bufferLength++,128),n%TA>=TA-8){for(let i=this.bufferLength;i<TA;i++)r.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(let i=this.bufferLength;i<TA-8;i++)r.setUint8(i,0);r.setUint32(TA-8,A>>>0,!0),r.setUint32(TA-4,Math.floor(A/4294967296),!0),this.hashBuffer(),this.finished=!0}const e=new DataView(new ArrayBuffer(ywe));for(let r=0;r<4;r++)e.setUint32(r*4,this.state[r],!0);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}hashBuffer(){const{buffer:e,state:r}=this;let n=r[0],s=r[1],A=r[2],i=r[3];n=dr(n,s,A,i,e.getUint32(0,!0),7,3614090360),i=dr(i,n,s,A,e.getUint32(4,!0),12,3905402710),A=dr(A,i,n,s,e.getUint32(8,!0),17,606105819),s=dr(s,A,i,n,e.getUint32(12,!0),22,3250441966),n=dr(n,s,A,i,e.getUint32(16,!0),7,4118548399),i=dr(i,n,s,A,e.getUint32(20,!0),12,1200080426),A=dr(A,i,n,s,e.getUint32(24,!0),17,2821735955),s=dr(s,A,i,n,e.getUint32(28,!0),22,4249261313),n=dr(n,s,A,i,e.getUint32(32,!0),7,1770035416),i=dr(i,n,s,A,e.getUint32(36,!0),12,2336552879),A=dr(A,i,n,s,e.getUint32(40,!0),17,4294925233),s=dr(s,A,i,n,e.getUint32(44,!0),22,2304563134),n=dr(n,s,A,i,e.getUint32(48,!0),7,1804603682),i=dr(i,n,s,A,e.getUint32(52,!0),12,4254626195),A=dr(A,i,n,s,e.getUint32(56,!0),17,2792965006),s=dr(s,A,i,n,e.getUint32(60,!0),22,1236535329),n=fr(n,s,A,i,e.getUint32(4,!0),5,4129170786),i=fr(i,n,s,A,e.getUint32(24,!0),9,3225465664),A=fr(A,i,n,s,e.getUint32(44,!0),14,643717713),s=fr(s,A,i,n,e.getUint32(0,!0),20,3921069994),n=fr(n,s,A,i,e.getUint32(20,!0),5,3593408605),i=fr(i,n,s,A,e.getUint32(40,!0),9,38016083),A=fr(A,i,n,s,e.getUint32(60,!0),14,3634488961),s=fr(s,A,i,n,e.getUint32(16,!0),20,3889429448),n=fr(n,s,A,i,e.getUint32(36,!0),5,568446438),i=fr(i,n,s,A,e.getUint32(56,!0),9,3275163606),A=fr(A,i,n,s,e.getUint32(12,!0),14,4107603335),s=fr(s,A,i,n,e.getUint32(32,!0),20,1163531501),n=fr(n,s,A,i,e.getUint32(52,!0),5,2850285829),i=fr(i,n,s,A,e.getUint32(8,!0),9,4243563512),A=fr(A,i,n,s,e.getUint32(28,!0),14,1735328473),s=fr(s,A,i,n,e.getUint32(48,!0),20,2368359562),n=pr(n,s,A,i,e.getUint32(20,!0),4,4294588738),i=pr(i,n,s,A,e.getUint32(32,!0),11,2272392833),A=pr(A,i,n,s,e.getUint32(44,!0),16,1839030562),s=pr(s,A,i,n,e.getUint32(56,!0),23,4259657740),n=pr(n,s,A,i,e.getUint32(4,!0),4,2763975236),i=pr(i,n,s,A,e.getUint32(16,!0),11,1272893353),A=pr(A,i,n,s,e.getUint32(28,!0),16,4139469664),s=pr(s,A,i,n,e.getUint32(40,!0),23,3200236656),n=pr(n,s,A,i,e.getUint32(52,!0),4,681279174),i=pr(i,n,s,A,e.getUint32(0,!0),11,3936430074),A=pr(A,i,n,s,e.getUint32(12,!0),16,3572445317),s=pr(s,A,i,n,e.getUint32(24,!0),23,76029189),n=pr(n,s,A,i,e.getUint32(36,!0),4,3654602809),i=pr(i,n,s,A,e.getUint32(48,!0),11,3873151461),A=pr(A,i,n,s,e.getUint32(60,!0),16,530742520),s=pr(s,A,i,n,e.getUint32(8,!0),23,3299628645),n=gr(n,s,A,i,e.getUint32(0,!0),6,4096336452),i=gr(i,n,s,A,e.getUint32(28,!0),10,1126891415),A=gr(A,i,n,s,e.getUint32(56,!0),15,2878612391),s=gr(s,A,i,n,e.getUint32(20,!0),21,4237533241),n=gr(n,s,A,i,e.getUint32(48,!0),6,1700485571),i=gr(i,n,s,A,e.getUint32(12,!0),10,2399980690),A=gr(A,i,n,s,e.getUint32(40,!0),15,4293915773),s=gr(s,A,i,n,e.getUint32(4,!0),21,2240044497),n=gr(n,s,A,i,e.getUint32(32,!0),6,1873313359),i=gr(i,n,s,A,e.getUint32(60,!0),10,4264355552),A=gr(A,i,n,s,e.getUint32(24,!0),15,2734768916),s=gr(s,A,i,n,e.getUint32(52,!0),21,1309151649),n=gr(n,s,A,i,e.getUint32(16,!0),6,4149444226),i=gr(i,n,s,A,e.getUint32(44,!0),10,3174756917),A=gr(A,i,n,s,e.getUint32(8,!0),15,718787259),s=gr(s,A,i,n,e.getUint32(36,!0),21,3951481745),r[0]=n+r[0]&4294967295,r[1]=s+r[1]&4294967295,r[2]=A+r[2]&4294967295,r[3]=i+r[3]&4294967295}reset(){this.state=Uint32Array.from(Bwe),this.buffer=new DataView(new ArrayBuffer(TA)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function Uf(t,e,r,n,s,A){return e=(e+t&4294967295)+(n+A&4294967295)&4294967295,(e<<s|e>>>32-s)+r&4294967295}function dr(t,e,r,n,s,A,i){return Uf(e&r|~e&n,t,e,s,A,i)}function fr(t,e,r,n,s,A,i){return Uf(e&n|r&~n,t,e,s,A,i)}function pr(t,e,r,n,s,A,i){return Uf(e^r^n,t,e,s,A,i)}function gr(t,e,r,n,s,A,i){return Uf(r^(e|~n),t,e,s,A,i)}function Ewe(t){return typeof t=="string"?t.length===0:t.byteLength===0}function _we(t){return typeof t=="string"?Jn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function S3(t,e){return new Request(t,e)}function bwe(t=0){return new Promise((e,r)=>{t&&setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}const X0={supported:void 0};class kf{constructor(e){S(this,"config");S(this,"configProvider");typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),X0.supported===void 0&&(X0.supported=typeof Request<"u"&&"keepalive"in S3("https://[::1]"))}static create(e){return typeof(e==null?void 0:e.handle)=="function"?e:new kf(e)}destroy(){}async handle(e,{abortSignal:r,requestTimeout:n}={}){var T;this.config||(this.config=await this.configProvider);const s=n??this.config.requestTimeout,A=this.config.keepAlive===!0,i=this.config.credentials;if(r!=null&&r.aborted){const v=T3(r);return Promise.reject(v)}let o=e.path;const a=Pte(e.query||{});a&&(o+=`?${a}`),e.fragment&&(o+=`#${e.fragment}`);let c="";if(e.username!=null||e.password!=null){const v=e.username??"",k=e.password??"";c=`${v}:${k}@`}const{port:l,method:h}=e,d=`${e.protocol}//${c}${e.hostname}${l?`:${l}`:""}${o}`,p=h==="GET"||h==="HEAD"?void 0:e.body,w={body:p,headers:new Headers(e.headers),method:h,credentials:i};(T=this.config)!=null&&T.cache&&(w.cache=this.config.cache),p&&(w.duplex="half"),typeof AbortController<"u"&&(w.signal=r),X0.supported&&(w.keepalive=A),typeof this.config.requestInit=="function"&&Object.assign(w,this.config.requestInit(e));let B=()=>{};const C=S3(d,w),_=[fetch(C).then(v=>{const k=v.headers,L={};for(const x of k.entries())L[x[0]]=x[1];return v.body!=null?{response:new dA({headers:L,reason:v.statusText,statusCode:v.status,body:v.body})}:v.blob().then(x=>({response:new dA({headers:L,reason:v.statusText,statusCode:v.status,body:x})}))}),bwe(s)];return r&&_.push(new Promise((v,k)=>{const L=()=>{const V=T3(r);k(V)};if(typeof r.addEventListener=="function"){const V=r;V.addEventListener("abort",L,{once:!0}),B=()=>V.removeEventListener("abort",L)}else r.onabort=L})),Promise.race(_).finally(B)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=r,n))}httpHandlerConfigs(){return this.config??{}}}function T3(t){const e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){const s=new Error("Request aborted");return s.name="AbortError",s.cause=e,s}const n=new Error(String(e));return n.name="AbortError",n}const r=new Error("Request aborted");return r.name="AbortError",r}const I3=async t=>{var e;return typeof Blob=="function"&&t instanceof Blob||((e=t.constructor)==null?void 0:e.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await t.arrayBuffer()):vwe(t):Swe(t)};async function vwe(t){const e=await Twe(t),r=Us(e);return new Uint8Array(r)}async function Swe(t){const e=[],r=t.getReader();let n=!1,s=0;for(;!n;){const{done:o,value:a}=await r.read();a&&(e.push(a),s+=a.length),n=o}const A=new Uint8Array(s);let i=0;for(const o of e)A.set(o,i),i+=o.length;return A}function Twe(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",A=s.indexOf(","),i=A>-1?A+1:s.length;e(s.substring(i))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const Iwe=t=>({apiVersion:"2006-03-01",base64Decoder:(t==null?void 0:t.base64Decoder)??Us,base64Encoder:(t==null?void 0:t.base64Encoder)??Xn,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??F1,extensions:(t==null?void 0:t.extensions)??[],getAwsChunkedEncodingStream:(t==null?void 0:t.getAwsChunkedEncodingStream)??Cte,httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??_Ae,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new uy},{schemeId:"aws.auth#sigv4a",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4a"),signer:new dAe}],logger:(t==null?void 0:t.logger)??new Vh,protocol:(t==null?void 0:t.protocol)??$se,protocolSettings:(t==null?void 0:t.protocolSettings)??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:pF,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:(t==null?void 0:t.sdkStreamMixin)??hI,serviceId:(t==null?void 0:t.serviceId)??"S3",signerConstructor:(t==null?void 0:t.signerConstructor)??vx,signingEscapePath:(t==null?void 0:t.signingEscapePath)??!1,urlParser:(t==null?void 0:t.urlParser)??kc,useArnRegion:(t==null?void 0:t.useArnRegion)??void 0,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Jn,utf8Encoder:(t==null?void 0:t.utf8Encoder)??ks}),xwe=t=>{const e=WI(t),r=()=>e().then(kT),n=Iwe(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JT,credentialDefaultProvider:(t==null?void 0:t.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??$I({serviceId:n.serviceId,clientVersion:twe.version}),eventStreamSerdeProvider:(t==null?void 0:t.eventStreamSerdeProvider)??Gx,maxAttempts:(t==null?void 0:t.maxAttempts)??_o,md5:(t==null?void 0:t.md5)??Cwe,region:(t==null?void 0:t.region)??TT("Region is missing"),requestHandler:kf.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||SI),sha1:(t==null?void 0:t.sha1)??awe,sha256:(t==null?void 0:t.sha256)??v3,streamCollector:(t==null?void 0:t.streamCollector)??I3,streamHasher:(t==null?void 0:t.streamHasher)??wwe,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(JI)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(XI))}},Rwe=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(s){const A=e.findIndex(i=>i.schemeId===s.schemeId);A===-1?e.push(s):e.splice(A,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},Uwe=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),kwe=(t,e)=>{const r=Object.assign(YI(t),PT(t),wI(t),Rwe(t));return e.forEach(n=>n.configure(r)),Object.assign(t,ZI(r),OT(r),yI(r),Uwe(r))};class Si extends lw{constructor(...[r]){const n=xwe(r||{});super(n);S(this,"config");this.initConfig=n;const s=vAe(n),A=DI(s),i=lne(A),o=TI(i),a=qI(o),c=a,l=uI(c),h=zx(l),d=bAe(h),p=Ene(d,{session:[()=>this,J0]}),w=kwe(p,(r==null?void 0:r.extensions)||[]);this.config=w,this.middlewareStack.use(RT(this.config)),this.middlewareStack.use(HI(this.config)),this.middlewareStack.use(II(this.config)),this.middlewareStack.use(CI(this.config)),this.middlewareStack.use(xI(this.config)),this.middlewareStack.use(RI(this.config)),this.middlewareStack.use(UI(this.config)),this.middlewareStack.use(kI(this.config,{httpAuthSchemeParametersProvider:EAe,identityProviderConfigProvider:async B=>new OI({"aws.auth#sigv4":B.credentials,"aws.auth#sigv4a":B.credentials})})),this.middlewareStack.use(PI(this.config)),this.middlewareStack.use(wse(this.config)),this.middlewareStack.use(jse(this.config)),this.middlewareStack.use(Cne(this.config)),this.middlewareStack.use(rse(this.config)),this.middlewareStack.use(ose(this.config))}destroy(){super.destroy()}}class x3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","AbortMultipartUpload",{}).n("S3Client","AbortMultipartUploadCommand").sc(fD).build(){}class R3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CompleteMultipartUpload",{}).n("S3Client","CompleteMultipartUploadCommand").sc(pD).build(){}class U3 extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"},CopySource:{type:"contextParams",name:"CopySource"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CopyObject",{}).n("S3Client","CopyObjectCommand").sc(gD).build(){}class k3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},DisableAccessPoints:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),qse(n)]}).s("AmazonS3","CreateBucket",{}).n("S3Client","CreateBucketCommand").sc(mD).build(){}class F3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataConfiguration",{}).n("S3Client","CreateBucketMetadataConfigurationCommand").sc(wD).build(){}class P3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataTableConfiguration",{}).n("S3Client","CreateBucketMetadataTableConfigurationCommand").sc(yD).build(){}class O3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CreateMultipartUpload",{}).n("S3Client","CreateMultipartUploadCommand").sc(BD).build(){}class Q3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketAnalyticsConfiguration",{}).n("S3Client","DeleteBucketAnalyticsConfigurationCommand").sc(_D).build(){}class D3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucket",{}).n("S3Client","DeleteBucketCommand").sc(ED).build(){}class L3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketCors",{}).n("S3Client","DeleteBucketCorsCommand").sc(bD).build(){}class M3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketEncryption",{}).n("S3Client","DeleteBucketEncryptionCommand").sc(vD).build(){}class N3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketIntelligentTieringConfiguration",{}).n("S3Client","DeleteBucketIntelligentTieringConfigurationCommand").sc(SD).build(){}class H3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketInventoryConfiguration",{}).n("S3Client","DeleteBucketInventoryConfigurationCommand").sc(TD).build(){}class $3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketLifecycle",{}).n("S3Client","DeleteBucketLifecycleCommand").sc(ID).build(){}class V3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataConfiguration",{}).n("S3Client","DeleteBucketMetadataConfigurationCommand").sc(xD).build(){}class K3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataTableConfiguration",{}).n("S3Client","DeleteBucketMetadataTableConfigurationCommand").sc(RD).build(){}class j3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetricsConfiguration",{}).n("S3Client","DeleteBucketMetricsConfigurationCommand").sc(UD).build(){}class G3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketOwnershipControls",{}).n("S3Client","DeleteBucketOwnershipControlsCommand").sc(kD).build(){}class z3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketPolicy",{}).n("S3Client","DeleteBucketPolicyCommand").sc(FD).build(){}class q3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketReplication",{}).n("S3Client","DeleteBucketReplicationCommand").sc(PD).build(){}class W3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketTagging",{}).n("S3Client","DeleteBucketTaggingCommand").sc(OD).build(){}class J3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketWebsite",{}).n("S3Client","DeleteBucketWebsiteCommand").sc(QD).build(){}class X3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObjectAnnotation",{}).n("S3Client","DeleteObjectAnnotationCommand").sc(LD).build(){}class Y3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObject",{}).n("S3Client","DeleteObjectCommand").sc(DD).build(){}class Z3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","DeleteObjects",{}).n("S3Client","DeleteObjectsCommand").sc(MD).build(){}class eM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObjectTagging",{}).n("S3Client","DeleteObjectTaggingCommand").sc(ND).build(){}class tM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeletePublicAccessBlock",{}).n("S3Client","DeletePublicAccessBlockCommand").sc(HD).build(){}class rM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAbac",{}).n("S3Client","GetBucketAbacCommand").sc($D).build(){}class nM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAccelerateConfiguration",{}).n("S3Client","GetBucketAccelerateConfigurationCommand").sc(VD).build(){}class sM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAcl",{}).n("S3Client","GetBucketAclCommand").sc(KD).build(){}class AM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAnalyticsConfiguration",{}).n("S3Client","GetBucketAnalyticsConfigurationCommand").sc(jD).build(){}class iM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketCors",{}).n("S3Client","GetBucketCorsCommand").sc(GD).build(){}class oM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketEncryption",{}).n("S3Client","GetBucketEncryptionCommand").sc(zD).build(){}class aM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketIntelligentTieringConfiguration",{}).n("S3Client","GetBucketIntelligentTieringConfigurationCommand").sc(qD).build(){}class cM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketInventoryConfiguration",{}).n("S3Client","GetBucketInventoryConfigurationCommand").sc(WD).build(){}class uM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLifecycleConfiguration",{}).n("S3Client","GetBucketLifecycleConfigurationCommand").sc(JD).build(){}class lM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLocation",{}).n("S3Client","GetBucketLocationCommand").sc(XD).build(){}class hM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLogging",{}).n("S3Client","GetBucketLoggingCommand").sc(YD).build(){}class dM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetadataConfiguration",{}).n("S3Client","GetBucketMetadataConfigurationCommand").sc(ZD).build(){}class fM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetadataTableConfiguration",{}).n("S3Client","GetBucketMetadataTableConfigurationCommand").sc(eL).build(){}class pM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetricsConfiguration",{}).n("S3Client","GetBucketMetricsConfigurationCommand").sc(tL).build(){}class gM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketNotificationConfiguration",{}).n("S3Client","GetBucketNotificationConfigurationCommand").sc(rL).build(){}class mM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketOwnershipControls",{}).n("S3Client","GetBucketOwnershipControlsCommand").sc(nL).build(){}class wM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","GetBucketPolicy",{}).n("S3Client","GetBucketPolicyCommand").sc(sL).build(){}class yM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketPolicyStatus",{}).n("S3Client","GetBucketPolicyStatusCommand").sc(AL).build(){}class BM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketReplication",{}).n("S3Client","GetBucketReplicationCommand").sc(iL).build(){}class CM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketRequestPayment",{}).n("S3Client","GetBucketRequestPaymentCommand").sc(oL).build(){}class EM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketTagging",{}).n("S3Client","GetBucketTaggingCommand").sc(aL).build(){}class _M extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketVersioning",{}).n("S3Client","GetBucketVersioningCommand").sc(cL).build(){}class bM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketWebsite",{}).n("S3Client","GetBucketWebsiteCommand").sc(uL).build(){}class vM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectAcl",{}).n("S3Client","GetObjectAclCommand").sc(hL).build(){}class SM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1","SHA512","MD5","XXHASH64","XXHASH3","XXHASH128"]})]}).s("AmazonS3","GetObjectAnnotation",{}).n("S3Client","GetObjectAnnotationCommand").sc(dL).build(){}class TM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","GetObjectAttributes",{}).n("S3Client","GetObjectAttributesCommand").sc(fL).build(){}class IM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1","SHA512","MD5","XXHASH64","XXHASH3","XXHASH128"]}),In(n),ux()]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(lL).build(){}class xM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectLegalHold",{}).n("S3Client","GetObjectLegalHoldCommand").sc(pL).build(){}class RM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectLockConfiguration",{}).n("S3Client","GetObjectLockConfigurationCommand").sc(gL).build(){}class UM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectRetention",{}).n("S3Client","GetObjectRetentionCommand").sc(mL).build(){}class kM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectTagging",{}).n("S3Client","GetObjectTaggingCommand").sc(wL).build(){}class FM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","GetObjectTorrent",{}).n("S3Client","GetObjectTorrentCommand").sc(yL).build(){}class PM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetPublicAccessBlock",{}).n("S3Client","GetPublicAccessBlockCommand").sc(BL).build(){}class Ff extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","HeadBucket",{}).n("S3Client","HeadBucketCommand").sc(CL).build(){}class Pf extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n),ux()]}).s("AmazonS3","HeadObject",{}).n("S3Client","HeadObjectCommand").sc(EL).build(){}class OM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketAnalyticsConfigurations",{}).n("S3Client","ListBucketAnalyticsConfigurationsCommand").sc(_L).build(){}class QM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketIntelligentTieringConfigurations",{}).n("S3Client","ListBucketIntelligentTieringConfigurationsCommand").sc(bL).build(){}class DM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketInventoryConfigurations",{}).n("S3Client","ListBucketInventoryConfigurationsCommand").sc(vL).build(){}class LM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketMetricsConfigurations",{}).n("S3Client","ListBucketMetricsConfigurationsCommand").sc(SL).build(){}class Y0 extends H.classBuilder().ep(K).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBuckets",{}).n("S3Client","ListBucketsCommand").sc(TL).build(){}class Z0 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListDirectoryBuckets",{}).n("S3Client","ListDirectoryBucketsCommand").sc(IL).build(){}class MM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListMultipartUploads",{}).n("S3Client","ListMultipartUploadsCommand").sc(xL).build(){}class eB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectAnnotations",{}).n("S3Client","ListObjectAnnotationsCommand").sc(RL).build(){}class NM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjects",{}).n("S3Client","ListObjectsCommand").sc(UL).build(){}class tB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(kL).build(){}class HM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectVersions",{}).n("S3Client","ListObjectVersionsCommand").sc(FL).build(){}class rB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","ListParts",{}).n("S3Client","ListPartsCommand").sc(PL).build(){}class $M extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAbac",{}).n("S3Client","PutBucketAbacCommand").sc(OL).build(){}class VM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAccelerateConfiguration",{}).n("S3Client","PutBucketAccelerateConfigurationCommand").sc(QL).build(){}class KM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketAcl",{}).n("S3Client","PutBucketAclCommand").sc(DL).build(){}class jM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketAnalyticsConfiguration",{}).n("S3Client","PutBucketAnalyticsConfigurationCommand").sc(LL).build(){}class GM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketCors",{}).n("S3Client","PutBucketCorsCommand").sc(ML).build(){}class zM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketEncryption",{}).n("S3Client","PutBucketEncryptionCommand").sc(NL).build(){}class qM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketIntelligentTieringConfiguration",{}).n("S3Client","PutBucketIntelligentTieringConfigurationCommand").sc(HL).build(){}class WM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketInventoryConfiguration",{}).n("S3Client","PutBucketInventoryConfigurationCommand").sc($L).build(){}class JM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutBucketLifecycleConfiguration",{}).n("S3Client","PutBucketLifecycleConfigurationCommand").sc(VL).build(){}class XM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketLogging",{}).n("S3Client","PutBucketLoggingCommand").sc(KL).build(){}class YM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketMetricsConfiguration",{}).n("S3Client","PutBucketMetricsConfigurationCommand").sc(jL).build(){}class ZM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketNotificationConfiguration",{}).n("S3Client","PutBucketNotificationConfigurationCommand").sc(GL).build(){}class eN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketOwnershipControls",{}).n("S3Client","PutBucketOwnershipControlsCommand").sc(zL).build(){}class tN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketPolicy",{}).n("S3Client","PutBucketPolicyCommand").sc(qL).build(){}class rN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketReplication",{}).n("S3Client","PutBucketReplicationCommand").sc(WL).build(){}class nN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketRequestPayment",{}).n("S3Client","PutBucketRequestPaymentCommand").sc(JL).build(){}class sN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketTagging",{}).n("S3Client","PutBucketTaggingCommand").sc(XL).build(){}class AN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketVersioning",{}).n("S3Client","PutBucketVersioningCommand").sc(YL).build(){}class iN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketWebsite",{}).n("S3Client","PutBucketWebsiteCommand").sc(ZL).build(){}class oN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectAcl",{}).n("S3Client","PutObjectAclCommand").sc(t3).build(){}class aN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n)]}).s("AmazonS3","PutObjectAnnotation",{}).n("S3Client","PutObjectAnnotationCommand").sc(r3).build(){}class cN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),gne(),ee(n),In(n)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(e3).build(){}class uN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectLegalHold",{}).n("S3Client","PutObjectLegalHoldCommand").sc(n3).build(){}class lN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectLockConfiguration",{}).n("S3Client","PutObjectLockConfigurationCommand").sc(s3).build(){}class hN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectRetention",{}).n("S3Client","PutObjectRetentionCommand").sc(A3).build(){}class dN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectTagging",{}).n("S3Client","PutObjectTaggingCommand").sc(i3).build(){}class fN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutPublicAccessBlock",{}).n("S3Client","PutPublicAccessBlockCommand").sc(o3).build(){}class pN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","RenameObject",{}).n("S3Client","RenameObjectCommand").sc(a3).build(){}class gN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n)]}).s("AmazonS3","RestoreObject",{}).n("S3Client","RestoreObjectCommand").sc(c3).build(){}class mN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),In(n)]}).s("AmazonS3","SelectObjectContent",{eventStream:{output:!0}}).n("S3Client","SelectObjectContentCommand").sc(u3).build(){}class wN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataAnnotationTableConfiguration",{}).n("S3Client","UpdateBucketMetadataAnnotationTableConfigurationCommand").sc(l3).build(){}class yN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataInventoryTableConfiguration",{}).n("S3Client","UpdateBucketMetadataInventoryTableConfigurationCommand").sc(h3).build(){}class BN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataJournalTableConfiguration",{}).n("S3Client","UpdateBucketMetadataJournalTableConfigurationCommand").sc(d3).build(){}class CN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","UpdateObjectEncryption",{}).n("S3Client","UpdateObjectEncryptionCommand").sc(f3).build(){}class EN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n),In(n)]}).s("AmazonS3","UploadPart",{}).n("S3Client","UploadPartCommand").sc(p3).build(){}class _N extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","UploadPartCopy",{}).n("S3Client","UploadPartCopyCommand").sc(g3).build(){}class bN extends H.classBuilder().ep({...K,UseObjectLambdaEndpoint:{type:"staticContextParams",value:!0}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","WriteGetObjectResponse",{}).n("S3Client","WriteGetObjectResponseCommand").sc(m3).build(){}const vN=Mc(Si,Y0,"ContinuationToken","ContinuationToken","MaxBuckets"),SN=Mc(Si,Z0,"ContinuationToken","ContinuationToken","MaxDirectoryBuckets"),TN=Mc(Si,eB,"ContinuationToken","NextContinuationToken","MaxAnnotationResults"),IN=Mc(Si,tB,"ContinuationToken","NextContinuationToken","MaxKeys"),xN=Mc(Si,rB,"PartNumberMarker","NextPartNumberMarker","MaxParts"),RN=async(t,e)=>{let r;try{return r=await t.send(new Ff(e)),{state:_t.SUCCESS,reason:r}}catch(n){if(r=n,n.name==="NotFound")return{state:_t.RETRY,reason:r}}return{state:_t.RETRY,reason:r}},Fwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,RN),UN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,RN);return Hh(n)},kN=async(t,e)=>{let r;try{r=await t.send(new Ff(e))}catch(n){if(r=n,n.name==="NotFound")return{state:_t.SUCCESS,reason:r}}return{state:_t.RETRY,reason:r}},Pwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,kN),FN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,kN);return Hh(n)},PN=async(t,e)=>{let r;try{return r=await t.send(new Pf(e)),{state:_t.SUCCESS,reason:r}}catch(n){if(r=n,n.name==="NotFound")return{state:_t.RETRY,reason:r}}return{state:_t.RETRY,reason:r}},Owe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,PN),ON=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,PN);return Hh(n)},QN=async(t,e)=>{let r;try{r=await t.send(new Pf(e))}catch(n){if(r=n,n.name==="NotFound")return{state:_t.SUCCESS,reason:r}}return{state:_t.RETRY,reason:r}},Qwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,QN),DN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,QN);return Hh(n)},Dwe={AbortMultipartUploadCommand:x3,CompleteMultipartUploadCommand:R3,CopyObjectCommand:U3,CreateBucketCommand:k3,CreateBucketMetadataConfigurationCommand:F3,CreateBucketMetadataTableConfigurationCommand:P3,CreateMultipartUploadCommand:O3,CreateSessionCommand:J0,DeleteBucketCommand:D3,DeleteBucketAnalyticsConfigurationCommand:Q3,DeleteBucketCorsCommand:L3,DeleteBucketEncryptionCommand:M3,DeleteBucketIntelligentTieringConfigurationCommand:N3,DeleteBucketInventoryConfigurationCommand:H3,DeleteBucketLifecycleCommand:$3,DeleteBucketMetadataConfigurationCommand:V3,DeleteBucketMetadataTableConfigurationCommand:K3,DeleteBucketMetricsConfigurationCommand:j3,DeleteBucketOwnershipControlsCommand:G3,DeleteBucketPolicyCommand:z3,DeleteBucketReplicationCommand:q3,DeleteBucketTaggingCommand:W3,DeleteBucketWebsiteCommand:J3,DeleteObjectCommand:Y3,DeleteObjectAnnotationCommand:X3,DeleteObjectsCommand:Z3,DeleteObjectTaggingCommand:eM,DeletePublicAccessBlockCommand:tM,GetBucketAbacCommand:rM,GetBucketAccelerateConfigurationCommand:nM,GetBucketAclCommand:sM,GetBucketAnalyticsConfigurationCommand:AM,GetBucketCorsCommand:iM,GetBucketEncryptionCommand:oM,GetBucketIntelligentTieringConfigurationCommand:aM,GetBucketInventoryConfigurationCommand:cM,GetBucketLifecycleConfigurationCommand:uM,GetBucketLocationCommand:lM,GetBucketLoggingCommand:hM,GetBucketMetadataConfigurationCommand:dM,GetBucketMetadataTableConfigurationCommand:fM,GetBucketMetricsConfigurationCommand:pM,GetBucketNotificationConfigurationCommand:gM,GetBucketOwnershipControlsCommand:mM,GetBucketPolicyCommand:wM,GetBucketPolicyStatusCommand:yM,GetBucketReplicationCommand:BM,GetBucketRequestPaymentCommand:CM,GetBucketTaggingCommand:EM,GetBucketVersioningCommand:_M,GetBucketWebsiteCommand:bM,GetObjectCommand:IM,GetObjectAclCommand:vM,GetObjectAnnotationCommand:SM,GetObjectAttributesCommand:TM,GetObjectLegalHoldCommand:xM,GetObjectLockConfigurationCommand:RM,GetObjectRetentionCommand:UM,GetObjectTaggingCommand:kM,GetObjectTorrentCommand:FM,GetPublicAccessBlockCommand:PM,HeadBucketCommand:Ff,HeadObjectCommand:Pf,ListBucketAnalyticsConfigurationsCommand:OM,ListBucketIntelligentTieringConfigurationsCommand:QM,ListBucketInventoryConfigurationsCommand:DM,ListBucketMetricsConfigurationsCommand:LM,ListBucketsCommand:Y0,ListDirectoryBucketsCommand:Z0,ListMultipartUploadsCommand:MM,ListObjectAnnotationsCommand:eB,ListObjectsCommand:NM,ListObjectsV2Command:tB,ListObjectVersionsCommand:HM,ListPartsCommand:rB,PutBucketAbacCommand:$M,PutBucketAccelerateConfigurationCommand:VM,PutBucketAclCommand:KM,PutBucketAnalyticsConfigurationCommand:jM,PutBucketCorsCommand:GM,PutBucketEncryptionCommand:zM,PutBucketIntelligentTieringConfigurationCommand:qM,PutBucketInventoryConfigurationCommand:WM,PutBucketLifecycleConfigurationCommand:JM,PutBucketLoggingCommand:XM,PutBucketMetricsConfigurationCommand:YM,PutBucketNotificationConfigurationCommand:ZM,PutBucketOwnershipControlsCommand:eN,PutBucketPolicyCommand:tN,PutBucketReplicationCommand:rN,PutBucketRequestPaymentCommand:nN,PutBucketTaggingCommand:sN,PutBucketVersioningCommand:AN,PutBucketWebsiteCommand:iN,PutObjectCommand:cN,PutObjectAclCommand:oN,PutObjectAnnotationCommand:aN,PutObjectLegalHoldCommand:uN,PutObjectLockConfigurationCommand:lN,PutObjectRetentionCommand:hN,PutObjectTaggingCommand:dN,PutPublicAccessBlockCommand:fN,RenameObjectCommand:pN,RestoreObjectCommand:gN,SelectObjectContentCommand:mN,UpdateBucketMetadataAnnotationTableConfigurationCommand:wN,UpdateBucketMetadataInventoryTableConfigurationCommand:yN,UpdateBucketMetadataJournalTableConfigurationCommand:BN,UpdateObjectEncryptionCommand:CN,UploadPartCommand:EN,UploadPartCopyCommand:_N,WriteGetObjectResponseCommand:bN},Lwe={paginateListBuckets:vN,paginateListDirectoryBuckets:SN,paginateListObjectAnnotations:TN,paginateListObjectsV2:IN,paginateListParts:xN},Mwe={waitUntilBucketExists:UN,waitUntilBucketNotExists:FN,waitUntilObjectExists:ON,waitUntilObjectNotExists:DN};class LN extends Si{}JZ(Dwe,LN,{paginators:Lwe,waiters:Mwe});const Of=Object.freeze(Object.defineProperty({__proto__:null,$Command:H,AbacStatus$:R0,AbortIncompleteMultipartUpload$:wF,AbortMultipartUpload$:fD,AbortMultipartUploadCommand:x3,AbortMultipartUploadOutput$:yF,AbortMultipartUploadRequest$:BF,AccelerateConfiguration$:CF,AccessControlPolicy$:U0,AccessControlTranslation$:EF,AccessDenied:ud,AccessDenied$:qk,AnalyticsAndOperator$:_F,AnalyticsConfiguration$:Cf,AnalyticsExportDestination$:bF,AnalyticsFilter$:uD,AnalyticsS3BucketDestination$:vF,AnalyticsS3ExportFileFormat:{CSV:"CSV"},AnnotationConfigurationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},AnnotationDirective:{COPY:"COPY",EXCLUDE:"EXCLUDE"},AnnotationEntry$:SF,AnnotationLimitExceeded:bd,AnnotationLimitExceeded$:Wk,AnnotationNameTooLong:vd,AnnotationNameTooLong$:Jk,AnnotationTableConfiguration$:TF,AnnotationTableConfigurationResult$:IF,AnnotationTableConfigurationUpdates$:xF,ArchiveStatus:{ARCHIVE_ACCESS:"ARCHIVE_ACCESS",DEEP_ARCHIVE_ACCESS:"DEEP_ARCHIVE_ACCESS"},BlockedEncryptionTypes$:RF,Bucket$:UF,BucketAbacStatus:{Disabled:"Disabled",Enabled:"Enabled"},BucketAccelerateStatus:{Enabled:"Enabled",Suspended:"Suspended"},BucketAlreadyExists:hd,BucketAlreadyExists$:Xk,BucketAlreadyOwnedByYou:dd,BucketAlreadyOwnedByYou$:Yk,BucketCannedACL:{authenticated_read:"authenticated-read",private:"private",public_read:"public-read",public_read_write:"public-read-write"},BucketInfo$:kF,BucketLifecycleConfiguration$:FF,BucketLocationConstraint:{EU:"EU",af_south_1:"af-south-1",ap_east_1:"ap-east-1",ap_east_2:"ap-east-2",ap_northeast_1:"ap-northeast-1",ap_northeast_2:"ap-northeast-2",ap_northeast_3:"ap-northeast-3",ap_south_1:"ap-south-1",ap_south_2:"ap-south-2",ap_southeast_1:"ap-southeast-1",ap_southeast_2:"ap-southeast-2",ap_southeast_3:"ap-southeast-3",ap_southeast_4:"ap-southeast-4",ap_southeast_5:"ap-southeast-5",ap_southeast_6:"ap-southeast-6",ap_southeast_7:"ap-southeast-7",ca_central_1:"ca-central-1",ca_west_1:"ca-west-1",cn_north_1:"cn-north-1",cn_northwest_1:"cn-northwest-1",eu_central_1:"eu-central-1",eu_central_2:"eu-central-2",eu_north_1:"eu-north-1",eu_south_1:"eu-south-1",eu_south_2:"eu-south-2",eu_west_1:"eu-west-1",eu_west_2:"eu-west-2",eu_west_3:"eu-west-3",il_central_1:"il-central-1",me_central_1:"me-central-1",me_south_1:"me-south-1",mx_central_1:"mx-central-1",sa_east_1:"sa-east-1",us_east_2:"us-east-2",us_gov_east_1:"us-gov-east-1",us_gov_west_1:"us-gov-west-1",us_west_1:"us-west-1",us_west_2:"us-west-2"},BucketLoggingStatus$:PF,BucketLogsPermission:{FULL_CONTROL:"FULL_CONTROL",READ:"READ",WRITE:"WRITE"},BucketNamespace:{ACCOUNT_REGIONAL:"account-regional",GLOBAL:"global"},BucketType:{Directory:"Directory"},BucketVersioningStatus:{Enabled:"Enabled",Suspended:"Suspended"},CORSConfiguration$:zF,CORSRule$:qF,CSVInput$:s2,CSVOutput$:A2,Checksum$:OF,ChecksumAlgorithm:{CRC32:"CRC32",CRC32C:"CRC32C",CRC64NVME:"CRC64NVME",MD5:"MD5",SHA1:"SHA1",SHA256:"SHA256",SHA512:"SHA512",XXHASH128:"XXHASH128",XXHASH3:"XXHASH3",XXHASH64:"XXHASH64"},ChecksumMode:{ENABLED:"ENABLED"},ChecksumType:{COMPOSITE:"COMPOSITE",FULL_OBJECT:"FULL_OBJECT"},CommonPrefix$:QF,CompleteMultipartUpload$:pD,CompleteMultipartUploadCommand:R3,CompleteMultipartUploadOutput$:MF,CompleteMultipartUploadRequest$:NF,CompletedMultipartUpload$:DF,CompletedPart$:LF,CompressionType:{BZIP2:"BZIP2",GZIP:"GZIP",NONE:"NONE"},Condition$:HF,ContinuationEvent$:$F,CopyObject$:gD,CopyObjectCommand:U3,CopyObjectOutput$:VF,CopyObjectRequest$:KF,CopyObjectResult$:jF,CopyPartResult$:GF,CreateBucket$:mD,CreateBucketCommand:k3,CreateBucketConfiguration$:WF,CreateBucketMetadataConfiguration$:wD,CreateBucketMetadataConfigurationCommand:F3,CreateBucketMetadataConfigurationRequest$:JF,CreateBucketMetadataTableConfiguration$:yD,CreateBucketMetadataTableConfigurationCommand:P3,CreateBucketMetadataTableConfigurationRequest$:XF,CreateBucketOutput$:YF,CreateBucketRequest$:ZF,CreateMultipartUpload$:BD,CreateMultipartUploadCommand:O3,CreateMultipartUploadOutput$:e2,CreateMultipartUploadRequest$:t2,CreateSession$:CD,CreateSessionCommand:J0,CreateSessionOutput$:r2,CreateSessionRequest$:n2,DataRedundancy:{SingleAvailabilityZone:"SingleAvailabilityZone",SingleLocalZone:"SingleLocalZone"},DefaultRetention$:i2,Delete$:o2,DeleteBucket$:ED,DeleteBucketAnalyticsConfiguration$:_D,DeleteBucketAnalyticsConfigurationCommand:Q3,DeleteBucketAnalyticsConfigurationRequest$:a2,DeleteBucketCommand:D3,DeleteBucketCors$:bD,DeleteBucketCorsCommand:L3,DeleteBucketCorsRequest$:c2,DeleteBucketEncryption$:vD,DeleteBucketEncryptionCommand:M3,DeleteBucketEncryptionRequest$:u2,DeleteBucketIntelligentTieringConfiguration$:SD,DeleteBucketIntelligentTieringConfigurationCommand:N3,DeleteBucketIntelligentTieringConfigurationRequest$:l2,DeleteBucketInventoryConfiguration$:TD,DeleteBucketInventoryConfigurationCommand:H3,DeleteBucketInventoryConfigurationRequest$:h2,DeleteBucketLifecycle$:ID,DeleteBucketLifecycleCommand:$3,DeleteBucketLifecycleRequest$:d2,DeleteBucketMetadataConfiguration$:xD,DeleteBucketMetadataConfigurationCommand:V3,DeleteBucketMetadataConfigurationRequest$:f2,DeleteBucketMetadataTableConfiguration$:RD,DeleteBucketMetadataTableConfigurationCommand:K3,DeleteBucketMetadataTableConfigurationRequest$:p2,DeleteBucketMetricsConfiguration$:UD,DeleteBucketMetricsConfigurationCommand:j3,DeleteBucketMetricsConfigurationRequest$:g2,DeleteBucketOwnershipControls$:kD,DeleteBucketOwnershipControlsCommand:G3,DeleteBucketOwnershipControlsRequest$:m2,DeleteBucketPolicy$:FD,DeleteBucketPolicyCommand:z3,DeleteBucketPolicyRequest$:w2,DeleteBucketReplication$:PD,DeleteBucketReplicationCommand:q3,DeleteBucketReplicationRequest$:y2,DeleteBucketRequest$:B2,DeleteBucketTagging$:OD,DeleteBucketTaggingCommand:W3,DeleteBucketTaggingRequest$:C2,DeleteBucketWebsite$:QD,DeleteBucketWebsiteCommand:J3,DeleteBucketWebsiteRequest$:E2,DeleteMarkerEntry$:b2,DeleteMarkerReplication$:v2,DeleteMarkerReplicationStatus:{Disabled:"Disabled",Enabled:"Enabled"},DeleteObject$:DD,DeleteObjectAnnotation$:LD,DeleteObjectAnnotationCommand:X3,DeleteObjectAnnotationOutput$:S2,DeleteObjectAnnotationRequest$:T2,DeleteObjectCommand:Y3,DeleteObjectOutput$:I2,DeleteObjectRequest$:x2,DeleteObjectTagging$:ND,DeleteObjectTaggingCommand:eM,DeleteObjectTaggingOutput$:k2,DeleteObjectTaggingRequest$:F2,DeleteObjects$:MD,DeleteObjectsCommand:Z3,DeleteObjectsOutput$:R2,DeleteObjectsRequest$:U2,DeletePublicAccessBlock$:HD,DeletePublicAccessBlockCommand:tM,DeletePublicAccessBlockRequest$:P2,DeletedObject$:_2,Destination$:O2,DestinationResult$:Q2,EncodingType:{url:"url"},Encryption$:D2,EncryptionConfiguration$:L2,EncryptionType:{NONE:"NONE",SSE_C:"SSE-C"},EncryptionTypeMismatch:Bd,EncryptionTypeMismatch$:Zk,EndEvent$:M2,ErrorDetails$:wu,ErrorDocument$:k0,Event:{s3_IntelligentTiering:"s3:IntelligentTiering",s3_LifecycleExpiration_:"s3:LifecycleExpiration:*",s3_LifecycleExpiration_Delete:"s3:LifecycleExpiration:Delete",s3_LifecycleExpiration_DeleteMarkerCreated:"s3:LifecycleExpiration:DeleteMarkerCreated",s3_LifecycleTransition:"s3:LifecycleTransition",s3_ObjectAcl_Put:"s3:ObjectAcl:Put",s3_ObjectAnnotation_:"s3:ObjectAnnotation:*",s3_ObjectAnnotation_Delete:"s3:ObjectAnnotation:Delete",s3_ObjectAnnotation_Put:"s3:ObjectAnnotation:Put",s3_ObjectCreated_:"s3:ObjectCreated:*",s3_ObjectCreated_CompleteMultipartUpload:"s3:ObjectCreated:CompleteMultipartUpload",s3_ObjectCreated_Copy:"s3:ObjectCreated:Copy",s3_ObjectCreated_Post:"s3:ObjectCreated:Post",s3_ObjectCreated_Put:"s3:ObjectCreated:Put",s3_ObjectRemoved_:"s3:ObjectRemoved:*",s3_ObjectRemoved_Delete:"s3:ObjectRemoved:Delete",s3_ObjectRemoved_DeleteMarkerCreated:"s3:ObjectRemoved:DeleteMarkerCreated",s3_ObjectRestore_:"s3:ObjectRestore:*",s3_ObjectRestore_Completed:"s3:ObjectRestore:Completed",s3_ObjectRestore_Delete:"s3:ObjectRestore:Delete",s3_ObjectRestore_Post:"s3:ObjectRestore:Post",s3_ObjectTagging_:"s3:ObjectTagging:*",s3_ObjectTagging_Delete:"s3:ObjectTagging:Delete",s3_ObjectTagging_Put:"s3:ObjectTagging:Put",s3_ReducedRedundancyLostObject:"s3:ReducedRedundancyLostObject",s3_Replication_:"s3:Replication:*",s3_Replication_OperationFailedReplication:"s3:Replication:OperationFailedReplication",s3_Replication_OperationMissedThreshold:"s3:Replication:OperationMissedThreshold",s3_Replication_OperationNotTracked:"s3:Replication:OperationNotTracked",s3_Replication_OperationReplicatedAfterThreshold:"s3:Replication:OperationReplicatedAfterThreshold"},EventBridgeConfiguration$:H2,ExistingObjectReplication$:$2,ExistingObjectReplicationStatus:{Disabled:"Disabled",Enabled:"Enabled"},ExpirationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},ExpirationStatus:{Disabled:"Disabled",Enabled:"Enabled"},ExpressionType:{SQL:"SQL"},FileHeaderInfo:{IGNORE:"IGNORE",NONE:"NONE",USE:"USE"},FilterRule$:V2,FilterRuleName:{prefix:"prefix",suffix:"suffix"},GetBucketAbac$:$D,GetBucketAbacCommand:rM,GetBucketAbacOutput$:K2,GetBucketAbacRequest$:j2,GetBucketAccelerateConfiguration$:VD,GetBucketAccelerateConfigurationCommand:nM,GetBucketAccelerateConfigurationOutput$:G2,GetBucketAccelerateConfigurationRequest$:z2,GetBucketAcl$:KD,GetBucketAclCommand:sM,GetBucketAclOutput$:q2,GetBucketAclRequest$:W2,GetBucketAnalyticsConfiguration$:jD,GetBucketAnalyticsConfigurationCommand:AM,GetBucketAnalyticsConfigurationOutput$:J2,GetBucketAnalyticsConfigurationRequest$:X2,GetBucketCors$:GD,GetBucketCorsCommand:iM,GetBucketCorsOutput$:Y2,GetBucketCorsRequest$:Z2,GetBucketEncryption$:zD,GetBucketEncryptionCommand:oM,GetBucketEncryptionOutput$:eP,GetBucketEncryptionRequest$:tP,GetBucketIntelligentTieringConfiguration$:qD,GetBucketIntelligentTieringConfigurationCommand:aM,GetBucketIntelligentTieringConfigurationOutput$:rP,GetBucketIntelligentTieringConfigurationRequest$:nP,GetBucketInventoryConfiguration$:WD,GetBucketInventoryConfigurationCommand:cM,GetBucketInventoryConfigurationOutput$:sP,GetBucketInventoryConfigurationRequest$:AP,GetBucketLifecycleConfiguration$:JD,GetBucketLifecycleConfigurationCommand:uM,GetBucketLifecycleConfigurationOutput$:iP,GetBucketLifecycleConfigurationRequest$:oP,GetBucketLocation$:XD,GetBucketLocationCommand:lM,GetBucketLocationOutput$:aP,GetBucketLocationRequest$:cP,GetBucketLogging$:YD,GetBucketLoggingCommand:hM,GetBucketLoggingOutput$:uP,GetBucketLoggingRequest$:lP,GetBucketMetadataConfiguration$:ZD,GetBucketMetadataConfigurationCommand:dM,GetBucketMetadataConfigurationOutput$:hP,GetBucketMetadataConfigurationRequest$:dP,GetBucketMetadataConfigurationResult$:fP,GetBucketMetadataTableConfiguration$:eL,GetBucketMetadataTableConfigurationCommand:fM,GetBucketMetadataTableConfigurationOutput$:pP,GetBucketMetadataTableConfigurationRequest$:gP,GetBucketMetadataTableConfigurationResult$:mP,GetBucketMetricsConfiguration$:tL,GetBucketMetricsConfigurationCommand:pM,GetBucketMetricsConfigurationOutput$:wP,GetBucketMetricsConfigurationRequest$:yP,GetBucketNotificationConfiguration$:rL,GetBucketNotificationConfigurationCommand:gM,GetBucketNotificationConfigurationRequest$:BP,GetBucketOwnershipControls$:nL,GetBucketOwnershipControlsCommand:mM,GetBucketOwnershipControlsOutput$:CP,GetBucketOwnershipControlsRequest$:EP,GetBucketPolicy$:sL,GetBucketPolicyCommand:wM,GetBucketPolicyOutput$:_P,GetBucketPolicyRequest$:bP,GetBucketPolicyStatus$:AL,GetBucketPolicyStatusCommand:yM,GetBucketPolicyStatusOutput$:vP,GetBucketPolicyStatusRequest$:SP,GetBucketReplication$:iL,GetBucketReplicationCommand:BM,GetBucketReplicationOutput$:TP,GetBucketReplicationRequest$:IP,GetBucketRequestPayment$:oL,GetBucketRequestPaymentCommand:CM,GetBucketRequestPaymentOutput$:xP,GetBucketRequestPaymentRequest$:RP,GetBucketTagging$:aL,GetBucketTaggingCommand:EM,GetBucketTaggingOutput$:UP,GetBucketTaggingRequest$:kP,GetBucketVersioning$:cL,GetBucketVersioningCommand:_M,GetBucketVersioningOutput$:FP,GetBucketVersioningRequest$:PP,GetBucketWebsite$:uL,GetBucketWebsiteCommand:bM,GetBucketWebsiteOutput$:OP,GetBucketWebsiteRequest$:QP,GetObject$:lL,GetObjectAcl$:hL,GetObjectAclCommand:vM,GetObjectAclOutput$:DP,GetObjectAclRequest$:LP,GetObjectAnnotation$:dL,GetObjectAnnotationCommand:SM,GetObjectAnnotationOutput$:MP,GetObjectAnnotationRequest$:NP,GetObjectAttributes$:fL,GetObjectAttributesCommand:TM,GetObjectAttributesOutput$:HP,GetObjectAttributesParts$:$P,GetObjectAttributesRequest$:VP,GetObjectCommand:IM,GetObjectLegalHold$:pL,GetObjectLegalHoldCommand:xM,GetObjectLegalHoldOutput$:KP,GetObjectLegalHoldRequest$:jP,GetObjectLockConfiguration$:gL,GetObjectLockConfigurationCommand:RM,GetObjectLockConfigurationOutput$:GP,GetObjectLockConfigurationRequest$:zP,GetObjectOutput$:qP,GetObjectRequest$:WP,GetObjectRetention$:mL,GetObjectRetentionCommand:UM,GetObjectRetentionOutput$:JP,GetObjectRetentionRequest$:XP,GetObjectTagging$:wL,GetObjectTaggingCommand:kM,GetObjectTaggingOutput$:YP,GetObjectTaggingRequest$:ZP,GetObjectTorrent$:yL,GetObjectTorrentCommand:FM,GetObjectTorrentOutput$:eO,GetObjectTorrentRequest$:tO,GetPublicAccessBlock$:BL,GetPublicAccessBlockCommand:PM,GetPublicAccessBlockOutput$:rO,GetPublicAccessBlockRequest$:nO,GlacierJobParameters$:sO,Grant$:AO,Grantee$:F0,HeadBucket$:CL,HeadBucketCommand:Ff,HeadBucketOutput$:iO,HeadBucketRequest$:oO,HeadObject$:EL,HeadObjectCommand:Pf,HeadObjectOutput$:aO,HeadObjectRequest$:cO,IdempotencyParameterMismatch:Id,IdempotencyParameterMismatch$:eF,IndexDocument$:P0,Initiator$:O0,InputSerialization$:Q0,IntelligentTieringAccessTier:{ARCHIVE_ACCESS:"ARCHIVE_ACCESS",DEEP_ARCHIVE_ACCESS:"DEEP_ARCHIVE_ACCESS"},IntelligentTieringAndOperator$:uO,IntelligentTieringConfiguration$:Ef,IntelligentTieringFilter$:lO,IntelligentTieringStatus:{Disabled:"Disabled",Enabled:"Enabled"},InvalidAnnotationName:Sd,InvalidAnnotationName$:tF,InvalidObjectState:gd,InvalidObjectState$:rF,InvalidPrefix:yd,InvalidPrefix$:nF,InvalidRequest:Cd,InvalidRequest$:sF,InvalidWriteOffset:Ed,InvalidWriteOffset$:AF,InventoryConfiguration$:_f,InventoryConfigurationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},InventoryDestination$:hO,InventoryEncryption$:dO,InventoryFilter$:fO,InventoryFormat:{CSV:"CSV",ORC:"ORC",Parquet:"Parquet"},InventoryFrequency:{Daily:"Daily",Weekly:"Weekly"},InventoryIncludedObjectVersions:{All:"All",Current:"Current"},InventoryOptionalField:{BucketKeyStatus:"BucketKeyStatus",ChecksumAlgorithm:"ChecksumAlgorithm",ETag:"ETag",EncryptionStatus:"EncryptionStatus",IntelligentTieringAccessTier:"IntelligentTieringAccessTier",IsMultipartUploaded:"IsMultipartUploaded",LastModifiedDate:"LastModifiedDate",LifecycleExpirationDate:"LifecycleExpirationDate",ObjectAccessControlList:"ObjectAccessControlList",ObjectLockLegalHoldStatus:"ObjectLockLegalHoldStatus",ObjectLockMode:"ObjectLockMode",ObjectLockRetainUntilDate:"ObjectLockRetainUntilDate",ObjectOwner:"ObjectOwner",ReplicationStatus:"ReplicationStatus",Size:"Size",StorageClass:"StorageClass"},InventoryS3BucketDestination$:pO,InventorySchedule$:gO,InventoryTableConfiguration$:mO,InventoryTableConfigurationResult$:wO,InventoryTableConfigurationUpdates$:yO,JSONInput$:_O,JSONOutput$:bO,JSONType:{DOCUMENT:"DOCUMENT",LINES:"LINES"},JournalTableConfiguration$:BO,JournalTableConfigurationResult$:CO,JournalTableConfigurationUpdates$:EO,LambdaFunctionConfiguration$:vO,LifecycleExpiration$:SO,LifecycleRule$:TO,LifecycleRuleAndOperator$:IO,LifecycleRuleFilter$:xO,ListBucketAnalyticsConfigurations$:_L,ListBucketAnalyticsConfigurationsCommand:OM,ListBucketAnalyticsConfigurationsOutput$:RO,ListBucketAnalyticsConfigurationsRequest$:UO,ListBucketIntelligentTieringConfigurations$:bL,ListBucketIntelligentTieringConfigurationsCommand:QM,ListBucketIntelligentTieringConfigurationsOutput$:kO,ListBucketIntelligentTieringConfigurationsRequest$:FO,ListBucketInventoryConfigurations$:vL,ListBucketInventoryConfigurationsCommand:DM,ListBucketInventoryConfigurationsOutput$:PO,ListBucketInventoryConfigurationsRequest$:OO,ListBucketMetricsConfigurations$:SL,ListBucketMetricsConfigurationsCommand:LM,ListBucketMetricsConfigurationsOutput$:QO,ListBucketMetricsConfigurationsRequest$:DO,ListBuckets$:TL,ListBucketsCommand:Y0,ListBucketsOutput$:LO,ListBucketsRequest$:MO,ListDirectoryBuckets$:IL,ListDirectoryBucketsCommand:Z0,ListDirectoryBucketsOutput$:NO,ListDirectoryBucketsRequest$:HO,ListMultipartUploads$:xL,ListMultipartUploadsCommand:MM,ListMultipartUploadsOutput$:$O,ListMultipartUploadsRequest$:VO,ListObjectAnnotations$:RL,ListObjectAnnotationsCommand:eB,ListObjectAnnotationsOutput$:KO,ListObjectAnnotationsRequest$:jO,ListObjectVersions$:FL,ListObjectVersionsCommand:HM,ListObjectVersionsOutput$:JO,ListObjectVersionsRequest$:XO,ListObjects$:UL,ListObjectsCommand:NM,ListObjectsOutput$:GO,ListObjectsRequest$:zO,ListObjectsV2$:kL,ListObjectsV2Command:tB,ListObjectsV2Output$:qO,ListObjectsV2Request$:WO,ListParts$:PL,ListPartsCommand:rB,ListPartsOutput$:YO,ListPartsRequest$:ZO,LocationInfo$:eQ,LocationType:{AvailabilityZone:"AvailabilityZone",LocalZone:"LocalZone"},LoggingEnabled$:D0,MFADelete:{Disabled:"Disabled",Enabled:"Enabled"},MFADeleteStatus:{Disabled:"Disabled",Enabled:"Enabled"},MetadataConfiguration$:tQ,MetadataConfigurationResult$:rQ,MetadataDirective:{COPY:"COPY",REPLACE:"REPLACE"},MetadataEntry$:nQ,MetadataTableConfiguration$:sQ,MetadataTableConfigurationResult$:AQ,MetadataTableEncryptionConfiguration$:ca,Metrics$:iQ,MetricsAndOperator$:oQ,MetricsConfiguration$:bf,MetricsFilter$:lD,MetricsStatus:{Disabled:"Disabled",Enabled:"Enabled"},MultipartUpload$:aQ,NoSuchAnnotation:md,NoSuchAnnotation$:iF,NoSuchBucket:fd,NoSuchBucket$:oF,NoSuchKey:pd,NoSuchKey$:aF,NoSuchUpload:cd,NoSuchUpload$:cF,NoncurrentVersionExpiration$:cQ,NoncurrentVersionTransition$:uQ,NotFound:wd,NotFound$:uF,NotificationConfiguration$:L0,NotificationConfigurationFilter$:vf,ObjectAlreadyInActiveTierError:xd,ObjectAlreadyInActiveTierError$:lF,ObjectAttributes:{CHECKSUM:"Checksum",ETAG:"ETag",OBJECT_PARTS:"ObjectParts",OBJECT_SIZE:"ObjectSize",STORAGE_CLASS:"StorageClass"},ObjectCannedACL:{authenticated_read:"authenticated-read",aws_exec_read:"aws-exec-read",bucket_owner_full_control:"bucket-owner-full-control",bucket_owner_read:"bucket-owner-read",private:"private",public_read:"public-read",public_read_write:"public-read-write"},ObjectEncryption$:hD,ObjectIdentifier$:hQ,ObjectLockConfiguration$:M0,ObjectLockEnabled:{Enabled:"Enabled"},ObjectLockLegalHold$:N0,ObjectLockLegalHoldStatus:{OFF:"OFF",ON:"ON"},ObjectLockMode:{COMPLIANCE:"COMPLIANCE",GOVERNANCE:"GOVERNANCE"},ObjectLockRetention$:H0,ObjectLockRetentionMode:{COMPLIANCE:"COMPLIANCE",GOVERNANCE:"GOVERNANCE"},ObjectLockRule$:dQ,ObjectNotInActiveTierError:ld,ObjectNotInActiveTierError$:hF,ObjectOwnership:{BucketOwnerEnforced:"BucketOwnerEnforced",BucketOwnerPreferred:"BucketOwnerPreferred",ObjectWriter:"ObjectWriter"},ObjectPart$:fQ,ObjectStorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",EXPRESS_ONEZONE:"EXPRESS_ONEZONE",FSX_ONTAP:"FSX_ONTAP",FSX_OPENZFS:"FSX_OPENZFS",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",OUTPOSTS:"OUTPOSTS",REDUCED_REDUNDANCY:"REDUCED_REDUNDANCY",SNOW:"SNOW",STANDARD:"STANDARD",STANDARD_IA:"STANDARD_IA"},ObjectVersion$:pQ,ObjectVersionStorageClass:{STANDARD:"STANDARD"},OptionalObjectAttributes:{RESTORE_STATUS:"RestoreStatus"},OutputLocation$:gQ,OutputSerialization$:$0,Owner$:ds,OwnerOverride:{Destination:"Destination"},OwnershipControls$:V0,OwnershipControlsRule$:mQ,ParquetInput$:wQ,Part$:yQ,PartitionDateSource:{DeliveryTime:"DeliveryTime",EventTime:"EventTime"},PartitionedPrefix$:BQ,Payer:{BucketOwner:"BucketOwner",Requester:"Requester"},Permission:{FULL_CONTROL:"FULL_CONTROL",READ:"READ",READ_ACP:"READ_ACP",WRITE:"WRITE",WRITE_ACP:"WRITE_ACP"},PolicyStatus$:CQ,Progress$:EQ,ProgressEvent$:_Q,Protocol:{http:"http",https:"https"},PublicAccessBlockConfiguration$:K0,PutBucketAbac$:OL,PutBucketAbacCommand:$M,PutBucketAbacRequest$:bQ,PutBucketAccelerateConfiguration$:QL,PutBucketAccelerateConfigurationCommand:VM,PutBucketAccelerateConfigurationRequest$:vQ,PutBucketAcl$:DL,PutBucketAclCommand:KM,PutBucketAclRequest$:SQ,PutBucketAnalyticsConfiguration$:LL,PutBucketAnalyticsConfigurationCommand:jM,PutBucketAnalyticsConfigurationRequest$:TQ,PutBucketCors$:ML,PutBucketCorsCommand:GM,PutBucketCorsRequest$:IQ,PutBucketEncryption$:NL,PutBucketEncryptionCommand:zM,PutBucketEncryptionRequest$:xQ,PutBucketIntelligentTieringConfiguration$:HL,PutBucketIntelligentTieringConfigurationCommand:qM,PutBucketIntelligentTieringConfigurationRequest$:RQ,PutBucketInventoryConfiguration$:$L,PutBucketInventoryConfigurationCommand:WM,PutBucketInventoryConfigurationRequest$:UQ,PutBucketLifecycleConfiguration$:VL,PutBucketLifecycleConfigurationCommand:JM,PutBucketLifecycleConfigurationOutput$:kQ,PutBucketLifecycleConfigurationRequest$:FQ,PutBucketLogging$:KL,PutBucketLoggingCommand:XM,PutBucketLoggingRequest$:PQ,PutBucketMetricsConfiguration$:jL,PutBucketMetricsConfigurationCommand:YM,PutBucketMetricsConfigurationRequest$:OQ,PutBucketNotificationConfiguration$:GL,PutBucketNotificationConfigurationCommand:ZM,PutBucketNotificationConfigurationRequest$:QQ,PutBucketOwnershipControls$:zL,PutBucketOwnershipControlsCommand:eN,PutBucketOwnershipControlsRequest$:DQ,PutBucketPolicy$:qL,PutBucketPolicyCommand:tN,PutBucketPolicyRequest$:LQ,PutBucketReplication$:WL,PutBucketReplicationCommand:rN,PutBucketReplicationRequest$:MQ,PutBucketRequestPayment$:JL,PutBucketRequestPaymentCommand:nN,PutBucketRequestPaymentRequest$:NQ,PutBucketTagging$:XL,PutBucketTaggingCommand:sN,PutBucketTaggingRequest$:HQ,PutBucketVersioning$:YL,PutBucketVersioningCommand:AN,PutBucketVersioningRequest$:$Q,PutBucketWebsite$:ZL,PutBucketWebsiteCommand:iN,PutBucketWebsiteRequest$:VQ,PutObject$:e3,PutObjectAcl$:t3,PutObjectAclCommand:oN,PutObjectAclOutput$:KQ,PutObjectAclRequest$:jQ,PutObjectAnnotation$:r3,PutObjectAnnotationCommand:aN,PutObjectAnnotationOutput$:GQ,PutObjectAnnotationRequest$:zQ,PutObjectCommand:cN,PutObjectLegalHold$:n3,PutObjectLegalHoldCommand:uN,PutObjectLegalHoldOutput$:qQ,PutObjectLegalHoldRequest$:WQ,PutObjectLockConfiguration$:s3,PutObjectLockConfigurationCommand:lN,PutObjectLockConfigurationOutput$:JQ,PutObjectLockConfigurationRequest$:XQ,PutObjectOutput$:YQ,PutObjectRequest$:ZQ,PutObjectRetention$:A3,PutObjectRetentionCommand:hN,PutObjectRetentionOutput$:e4,PutObjectRetentionRequest$:t4,PutObjectTagging$:i3,PutObjectTaggingCommand:dN,PutObjectTaggingOutput$:r4,PutObjectTaggingRequest$:n4,PutPublicAccessBlock$:o3,PutPublicAccessBlockCommand:fN,PutPublicAccessBlockRequest$:s4,QueueConfiguration$:A4,QuoteFields:{ALWAYS:"ALWAYS",ASNEEDED:"ASNEEDED"},RecordExpiration$:Sf,RecordsEvent$:i4,Redirect$:o4,RedirectAllRequestsTo$:j0,RenameObject$:a3,RenameObjectCommand:pN,RenameObjectOutput$:a4,RenameObjectRequest$:c4,ReplicaModifications$:u4,ReplicaModificationsStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationConfiguration$:G0,ReplicationRule$:l4,ReplicationRuleAndOperator$:h4,ReplicationRuleFilter$:d4,ReplicationRuleStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationStatus:{COMPLETE:"COMPLETE",COMPLETED:"COMPLETED",FAILED:"FAILED",PENDING:"PENDING",REPLICA:"REPLICA"},ReplicationTime$:f4,ReplicationTimeStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationTimeValue$:z0,RequestCharged:{requester:"requester"},RequestPayer:{requester:"requester"},RequestPaymentConfiguration$:p4,RequestProgress$:g4,RestoreObject$:c3,RestoreObjectCommand:gN,RestoreObjectOutput$:m4,RestoreObjectRequest$:w4,RestoreRequest$:y4,RestoreRequestType:{SELECT:"SELECT"},RestoreStatus$:q0,RoutingRule$:B4,S3:LN,S3Client:Si,S3KeyFilter$:C4,S3Location$:E4,S3ServiceException:je,S3ServiceException$:zk,S3TablesBucketType:{aws:"aws",customer:"customer"},S3TablesDestination$:_4,S3TablesDestinationResult$:b4,SSEKMS$:P4,SSEKMSEncryption$:Q4,SSES3$:D4,ScanRange$:v4,SelectObjectContent$:u3,SelectObjectContentCommand:mN,SelectObjectContentEventStream$:dD,SelectObjectContentOutput$:S4,SelectObjectContentRequest$:T4,SelectParameters$:I4,ServerSideEncryption:{AES256:"AES256",aws_fsx:"aws:fsx",aws_kms:"aws:kms",aws_kms_dsse:"aws:kms:dsse"},ServerSideEncryptionByDefault$:x4,ServerSideEncryptionConfiguration$:W0,ServerSideEncryptionRule$:R4,SessionCredentials$:U4,SessionMode:{ReadOnly:"ReadOnly",ReadWrite:"ReadWrite"},SimplePrefix$:k4,SourceSelectionCriteria$:F4,SseKmsEncryptedObjects$:O4,SseKmsEncryptedObjectsStatus:{Disabled:"Disabled",Enabled:"Enabled"},Stats$:L4,StatsEvent$:M4,StorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",EXPRESS_ONEZONE:"EXPRESS_ONEZONE",FSX_ONTAP:"FSX_ONTAP",FSX_OPENZFS:"FSX_OPENZFS",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",OUTPOSTS:"OUTPOSTS",REDUCED_REDUNDANCY:"REDUCED_REDUNDANCY",SNOW:"SNOW",STANDARD:"STANDARD",STANDARD_IA:"STANDARD_IA"},StorageClassAnalysis$:N4,StorageClassAnalysisDataExport$:H4,StorageClassAnalysisSchemaVersion:{V_1:"V_1"},TableSseAlgorithm:{AES256:"AES256",aws_kms:"aws:kms"},Tag$:vi,Tagging$:Tf,TaggingDirective:{COPY:"COPY",REPLACE:"REPLACE"},TargetGrant$:$4,TargetObjectKeyFormat$:V4,Tier:{Bulk:"Bulk",Expedited:"Expedited",Standard:"Standard"},Tiering$:K4,TooManyParts:_d,TooManyParts$:dF,TopicConfiguration$:j4,Transition$:G4,TransitionDefaultMinimumObjectSize:{all_storage_classes_128K:"all_storage_classes_128K",varies_by_storage_class:"varies_by_storage_class"},TransitionStorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",STANDARD_IA:"STANDARD_IA"},Type:{AmazonCustomerByEmail:"AmazonCustomerByEmail",CanonicalUser:"CanonicalUser",Group:"Group"},UnsupportedMediaType:Td,UnsupportedMediaType$:fF,UpdateBucketMetadataAnnotationTableConfiguration$:l3,UpdateBucketMetadataAnnotationTableConfigurationCommand:wN,UpdateBucketMetadataAnnotationTableConfigurationRequest$:z4,UpdateBucketMetadataInventoryTableConfiguration$:h3,UpdateBucketMetadataInventoryTableConfigurationCommand:yN,UpdateBucketMetadataInventoryTableConfigurationRequest$:q4,UpdateBucketMetadataJournalTableConfiguration$:d3,UpdateBucketMetadataJournalTableConfigurationCommand:BN,UpdateBucketMetadataJournalTableConfigurationRequest$:W4,UpdateObjectEncryption$:f3,UpdateObjectEncryptionCommand:CN,UpdateObjectEncryptionRequest$:J4,UpdateObjectEncryptionResponse$:X4,UploadPart$:p3,UploadPartCommand:EN,UploadPartCopy$:g3,UploadPartCopyCommand:_N,UploadPartCopyOutput$:Y4,UploadPartCopyRequest$:Z4,UploadPartOutput$:eD,UploadPartRequest$:tD,VersioningConfiguration$:rD,WebsiteConfiguration$:nD,WriteGetObjectResponse$:m3,WriteGetObjectResponseCommand:bN,WriteGetObjectResponseRequest$:sD,_Error$:N2,_Object$:lQ,__Client:lw,errorTypeRegistries:pF,paginateListBuckets:vN,paginateListDirectoryBuckets:SN,paginateListObjectAnnotations:TN,paginateListObjectsV2:IN,paginateListParts:xN,waitForBucketExists:Fwe,waitForBucketNotExists:Pwe,waitForObjectExists:Owe,waitForObjectNotExists:Qwe,waitUntilBucketExists:UN,waitUntilBucketNotExists:FN,waitUntilObjectExists:ON,waitUntilObjectNotExists:DN},Symbol.toStringTag,{value:"Module"}));function MN(t){return Promise.all(Object.keys(t).reduce((e,r)=>{const n=t[r];return typeof n=="string"?e.push([r,n]):e.push(n().then(s=>[r,s])),e},[])).then(e=>e.reduce((r,[n,s])=>(r[n]=s,r),{}))}function NN(t){return async e=>{var c;(c=t.logger)==null||c.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:r,CognitoIdentityClient:n}=await Promise.resolve().then(()=>ZN),s=l=>{var h,d,p;return((h=t.clientConfig)==null?void 0:h[l])??((d=t.parentClientConfig)==null?void 0:d[l])??((p=e==null?void 0:e.callerClientConfig)==null?void 0:p[l])},{Credentials:{AccessKeyId:A=Nwe(t.logger),Expiration:i,SecretKey:o=$we(t.logger),SessionToken:a}=Hwe(t.logger)}=await(t.client??new n(Object.assign({},t.clientConfig??{},{region:s("region"),profile:s("profile"),userAgentAppId:s("userAgentAppId")}))).send(new r({CustomRoleArn:t.customRoleArn,IdentityId:t.identityId,Logins:t.logins?await MN(t.logins):void 0}));return{identityId:t.identityId,accessKeyId:A,secretAccessKey:o,sessionToken:a,expiration:i}}}function Nwe(t){throw new vo("Response from Amazon Cognito contained no access key ID",{logger:t})}function Hwe(t){throw new vo("Response from Amazon Cognito contained no credentials",{logger:t})}function $we(t){throw new vo("Response from Amazon Cognito contained no secret key",{logger:t})}const nB="IdentityIds";class Vwe{constructor(e="aws:cognito-identity-ids"){S(this,"dbName");this.dbName=e}getItem(e){return this.withObjectStore("readonly",r=>{const n=r.get(e);return new Promise(s=>{n.onerror=()=>s(null),n.onsuccess=()=>s(n.result?n.result.value:null)})}).catch(()=>null)}removeItem(e){return this.withObjectStore("readwrite",r=>{const n=r.delete(e);return new Promise((s,A)=>{n.onerror=()=>A(n.error),n.onsuccess=()=>s()})})}setItem(e,r){return this.withObjectStore("readwrite",n=>{const s=n.put({id:e,value:r});return new Promise((A,i)=>{s.onerror=()=>i(s.error),s.onsuccess=()=>A()})})}getDb(){const e=self.indexedDB.open(this.dbName,1);return new Promise((r,n)=>{e.onsuccess=()=>{r(e.result)},e.onerror=()=>{n(e.error)},e.onblocked=()=>{n(new Error("Unable to access DB"))},e.onupgradeneeded=()=>{const s=e.result;s.onerror=()=>{n(new Error("Failed to create object store"))},s.createObjectStore(nB,{keyPath:"id"})}})}withObjectStore(e,r){return this.getDb().then(n=>{const s=n.transaction(nB,e);return s.oncomplete=()=>n.close(),new Promise((A,i)=>{s.onerror=()=>i(s.error),A(r(s.objectStore(nB)))}).catch(A=>{throw n.close(),A})})}}class Kwe{constructor(e={}){S(this,"store");this.store=e}getItem(e){return e in this.store?this.store[e]:null}removeItem(e){delete this.store[e]}setItem(e,r){this.store[e]=r}}const jwe=new Kwe;function Gwe(){return typeof self=="object"&&self.indexedDB?new Vwe:typeof window=="object"&&window.localStorage?window.localStorage:jwe}function zwe({accountId:t,cache:e=Gwe(),client:r,clientConfig:n,customRoleArn:s,identityPoolId:A,logins:i,userIdentifier:o=!i||Object.keys(i).length===0?"ANONYMOUS":void 0,logger:a,parentClientConfig:c}){a==null||a.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const l=o?`aws:cognito-identity-credentials:${A}:${o}`:void 0;let h=async d=>{const{GetIdCommand:p,CognitoIdentityClient:w}=await Promise.resolve().then(()=>ZN),B=T=>{var v;return(n==null?void 0:n[T])??(c==null?void 0:c[T])??((v=d==null?void 0:d.callerClientConfig)==null?void 0:v[T])},C=r??new w(Object.assign({},n??{},{region:B("region"),profile:B("profile"),userAgentAppId:B("userAgentAppId")}));let _=l&&await e.getItem(l);if(!_){const{IdentityId:T=qwe(a)}=await C.send(new p({AccountId:t,IdentityPoolId:A,Logins:i?await MN(i):void 0}));_=T,l&&Promise.resolve(e.setItem(l,_)).catch(()=>{})}return h=NN({client:C,customRoleArn:s,logins:i,identityId:_}),h(d)};return d=>h(d).catch(async p=>{throw l&&Promise.resolve(e.removeItem(l)).catch(()=>{}),p})}function qwe(t){throw new vo("Response from Amazon Cognito contained no identity ID",{logger:t})}const Wwe=Object.freeze(Object.defineProperty({__proto__:null,fromCognitoIdentity:NN,fromCognitoIdentityPool:zwe},Symbol.toStringTag,{value:"Module"})),Jwe=async(t,e,r)=>({operation:xs(e).operation,region:await Kr(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Xwe(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function HN(t){return{schemeId:"smithy.api#noAuth"}}const Ywe=t=>{const e=[];switch(t.operation){case"GetCredentialsForIdentity":{e.push(HN());break}case"GetId":{e.push(HN());break}default:e.push(Xwe(t))}return e},Zwe=t=>{const e=Xx(t);return Object.assign(e,{authSchemePreference:Kr(t.authSchemePreference??[])})},eye=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),$N={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},tye={version:"3.997.23"},yu="ref",Ti=-1,Qf=!0,VN="isSet",KN="PartitionResult",Df="booleanEquals",sB="getAttr",Bu="stringEquals",jN={[yu]:"Endpoint"},AB={[yu]:KN},Cu={[yu]:"Region"},fs={},GN=[Cu],zN={conditions:[[VN,[jN]],[VN,GN],["aws.partition",GN,KN],[Df,[{[yu]:"UseFIPS"},Qf]],[Df,[{fn:sB,argv:[AB,"supportsFIPS"]},Qf]],[Df,[{[yu]:"UseDualStack"},Qf]],[Df,[{fn:sB,argv:[AB,"supportsDualStack"]},Qf]],[Bu,[{fn:sB,argv:[AB,"name"]},"aws"]],[Bu,[Cu,"us-east-1"]],[Bu,[Cu,"us-east-2"]],[Bu,[Cu,"us-west-1"]],[Bu,[Cu,"us-west-2"]]],results:[[Ti],[Ti,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Ti,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[jN,fs],["https://cognito-identity-fips.us-east-1.amazonaws.com",fs],["https://cognito-identity-fips.us-east-2.amazonaws.com",fs],["https://cognito-identity-fips.us-west-1.amazonaws.com",fs],["https://cognito-identity-fips.us-west-2.amazonaws.com",fs],["https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",fs],[Ti,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",fs],[Ti,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-identity.{Region}.amazonaws.com",fs],["https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",fs],[Ti,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",fs],[Ti,"Invalid Configuration: Missing Region"]]},rye=2,Gt=1e8,nye=new Int32Array([-1,1,-1,0,17,3,1,4,Gt+16,2,5,Gt+16,3,9,6,5,7,Gt+15,6,8,Gt+14,7,Gt+12,Gt+13,4,11,10,5,Gt+9,Gt+11,5,12,Gt+10,6,13,Gt+9,8,Gt+4,14,9,Gt+5,15,10,Gt+6,16,11,Gt+7,Gt+8,3,Gt+1,18,5,Gt+2,Gt+3]),sye=qh.from(nye,rye,zN.conditions,zN.results),Aye=new eI({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),iye=(t,e={})=>Aye.get(t,()=>cI(sye,{endpointParams:t,logger:e.logger}));Jh.aws=Lw;class hn extends di{constructor(e){super(e),Object.setPrototypeOf(this,hn.prototype)}}class iB extends hn{constructor(r){super({name:"ExternalServiceException",$fault:"client",...r});S(this,"name","ExternalServiceException");S(this,"$fault","client");Object.setPrototypeOf(this,iB.prototype)}}class oB extends hn{constructor(r){super({name:"InternalErrorException",$fault:"server",...r});S(this,"name","InternalErrorException");S(this,"$fault","server");Object.setPrototypeOf(this,oB.prototype)}}class aB extends hn{constructor(r){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...r});S(this,"name","InvalidIdentityPoolConfigurationException");S(this,"$fault","client");Object.setPrototypeOf(this,aB.prototype)}}class cB extends hn{constructor(r){super({name:"InvalidParameterException",$fault:"client",...r});S(this,"name","InvalidParameterException");S(this,"$fault","client");Object.setPrototypeOf(this,cB.prototype)}}class uB extends hn{constructor(r){super({name:"NotAuthorizedException",$fault:"client",...r});S(this,"name","NotAuthorizedException");S(this,"$fault","client");Object.setPrototypeOf(this,uB.prototype)}}class lB extends hn{constructor(r){super({name:"ResourceConflictException",$fault:"client",...r});S(this,"name","ResourceConflictException");S(this,"$fault","client");Object.setPrototypeOf(this,lB.prototype)}}class hB extends hn{constructor(r){super({name:"ResourceNotFoundException",$fault:"client",...r});S(this,"name","ResourceNotFoundException");S(this,"$fault","client");Object.setPrototypeOf(this,hB.prototype)}}class dB extends hn{constructor(r){super({name:"TooManyRequestsException",$fault:"client",...r});S(this,"name","TooManyRequestsException");S(this,"$fault","client");Object.setPrototypeOf(this,dB.prototype)}}class fB extends hn{constructor(r){super({name:"LimitExceededException",$fault:"client",...r});S(this,"name","LimitExceededException");S(this,"$fault","client");Object.setPrototypeOf(this,fB.prototype)}}const oye="AccountId",aye="AccessKeyId",qN="Credentials",cye="CustomRoleArn",uye="Expiration",lye="ExternalServiceException",hye="GetCredentialsForIdentity",dye="GetCredentialsForIdentityInput",fye="GetCredentialsForIdentityResponse",pye="GetId",gye="GetIdInput",mye="GetIdResponse",wye="InternalErrorException",pB="IdentityId",yye="InvalidIdentityPoolConfigurationException",Bye="InvalidParameterException",Cye="IdentityPoolId",Eye="IdentityProviderToken",WN="Logins",_ye="LimitExceededException",bye="LoginsMap",vye="NotAuthorizedException",Sye="ResourceConflictException",Tye="ResourceNotFoundException",Iye="SecretKey",xye="SecretKeyString",Rye="SessionToken",Uye="TooManyRequestsException",IA="client",$s="error",xA="httpError",Vs="message",JN="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",kye="server",mt="com.amazonaws.cognitoidentity",XN=Rs.for(JN);var Fye=[-3,JN,"CognitoIdentityServiceException",0,[],[]];XN.registerError(Fye,hn);const ps=Rs.for(mt);var Pye=[-3,mt,lye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Pye,iB);var Oye=[-3,mt,wye,{[$s]:kye},[Vs],[0]];ps.registerError(Oye,oB);var Qye=[-3,mt,yye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Qye,aB);var Dye=[-3,mt,Bye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Dye,cB);var Lye=[-3,mt,_ye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Lye,fB);var Mye=[-3,mt,vye,{[$s]:IA,[xA]:403},[Vs],[0]];ps.registerError(Mye,uB);var Nye=[-3,mt,Sye,{[$s]:IA,[xA]:409},[Vs],[0]];ps.registerError(Nye,lB);var Hye=[-3,mt,Tye,{[$s]:IA,[xA]:404},[Vs],[0]];ps.registerError(Hye,hB);var $ye=[-3,mt,Uye,{[$s]:IA,[xA]:429},[Vs],[0]];ps.registerError($ye,dB);const Vye=[XN,ps];var Kye=[0,mt,Eye,8,0],jye=[0,mt,xye,8,0],Gye=[3,mt,qN,0,[aye,Iye,Rye,uye],[0,[()=>jye,0],0,4]],zye=[3,mt,dye,0,[pB,WN,cye],[0,[()=>YN,0],0],1],qye=[3,mt,fye,0,[pB,qN],[0,[()=>Gye,0]]],Wye=[3,mt,gye,0,[Cye,oye,WN],[0,0,[()=>YN,0]],1],Jye=[3,mt,mye,0,[pB],[0]],YN=[2,mt,bye,0,[0,0],[()=>Kye,0]],Xye=[9,mt,hye,0,()=>zye,()=>qye],Yye=[9,mt,pye,0,()=>Wye,()=>Jye];const Zye=t=>({apiVersion:"2014-06-30",base64Decoder:(t==null?void 0:t.base64Decoder)??Us,base64Encoder:(t==null?void 0:t.base64Encoder)??Xn,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??iye,extensions:(t==null?void 0:t.extensions)??[],httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??Ywe,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new uy},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new wre}],logger:(t==null?void 0:t.logger)??new Vh,protocol:(t==null?void 0:t.protocol)??xse,protocolSettings:(t==null?void 0:t.protocolSettings)??{defaultNamespace:"com.amazonaws.cognitoidentity",errorTypeRegistries:Vye,xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:(t==null?void 0:t.serviceId)??"Cognito Identity",urlParser:(t==null?void 0:t.urlParser)??kc,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Jn,utf8Encoder:(t==null?void 0:t.utf8Encoder)??ks}),e0e=t=>{const e=WI(t),r=()=>e().then(kT),n=Zye(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JT,defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??$I({serviceId:n.serviceId,clientVersion:tye.version}),maxAttempts:(t==null?void 0:t.maxAttempts)??_o,region:(t==null?void 0:t.region)??TT("Region is missing"),requestHandler:kf.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||SI),sha256:(t==null?void 0:t.sha256)??v3,streamCollector:(t==null?void 0:t.streamCollector)??I3,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(JI)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(XI))}},t0e=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(s){const A=e.findIndex(i=>i.schemeId===s.schemeId);A===-1?e.push(s):e.splice(A,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},r0e=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),n0e=(t,e)=>{const r=Object.assign(YI(t),PT(t),wI(t),t0e(t));return e.forEach(n=>n.configure(r)),Object.assign(t,ZI(r),OT(r),yI(r),r0e(r))};class s0e extends lw{constructor(...[r]){const n=e0e(r||{});super(n);S(this,"config");this.initConfig=n;const s=eye(n),A=DI(s),i=TI(A),o=qI(i),a=o,c=uI(a),l=Zwe(c),h=n0e(l,(r==null?void 0:r.extensions)||[]);this.config=h,this.middlewareStack.use(RT(this.config)),this.middlewareStack.use(HI(this.config)),this.middlewareStack.use(II(this.config)),this.middlewareStack.use(CI(this.config)),this.middlewareStack.use(xI(this.config)),this.middlewareStack.use(RI(this.config)),this.middlewareStack.use(UI(this.config)),this.middlewareStack.use(kI(this.config,{httpAuthSchemeParametersProvider:Jwe,identityProviderConfigProvider:async d=>new OI({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(PI(this.config))}destroy(){super.destroy()}}class A0e extends H.classBuilder().ep($N).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(Xye).build(){}class i0e extends H.classBuilder().ep($N).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(Yye).build(){}const ZN=Object.freeze(Object.defineProperty({__proto__:null,CognitoIdentityClient:s0e,GetCredentialsForIdentityCommand:A0e,GetIdCommand:i0e},Symbol.toStringTag,{value:"Module"}));Wr.initFeedbackPlugin=v5,Object.defineProperty(Wr,Symbol.toStringTag,{value:"Module"})});
3044
+ ${Mr(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const A of e.split("/"))(A==null?void 0:A.length)!==0&&A!=="."&&(A===".."?r.pop():r.push(A));const n=`${e!=null&&e.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&(e!=null&&e.endsWith("/"))?"/":""}`;return pi(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const r=jne(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}const nd={},ty=[],ry=(t,e,r)=>`${t}/${e}/${r}/${wx}`,qne=async(t,e,r,n,s)=>{const A=await yx(t,e.secretAccessKey,e.accessKeyId),i=`${r}:${n}:${s}:${Mr(A)}:${e.sessionToken}`;if(i in nd)return nd[i];for(ty.push(i);ty.length>$ne;)delete nd[ty.shift()];let o=`AWS4${e.secretAccessKey}`;for(const a of[r,n,s,wx])o=await yx(t,o,a);return nd[i]=o},yx=(t,e,r)=>{const n=new t(e);return n.update(Eo(r)),n.digest()},Bx=({headers:t},e,r)=>{const n={};for(const s of Object.keys(t).sort()){if(t[s]==null)continue;const A=s.toLowerCase();(A in Dne||e!=null&&e.has(A)||Lne.test(A)||Mne.test(A))&&(!r||r&&!r.has(A))||(n[A]=t[s].trim().replace(/\s+/g," "))}return n},ny=async({headers:t,body:e},r)=>{for(const n of Object.keys(t))if(n.toLowerCase()===Zw)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||XT(e)){const n=new r;return n.update(Eo(e)),Mr(await n.digest())}return Hne},Wne=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},Jne=(t,e={})=>{var s,A;const{headers:r,query:n={}}=ot.clone(t);for(const i of Object.keys(r)){const o=i.toLowerCase();(o.slice(0,6)==="x-amz-"&&!((s=e.unhoistableHeaders)!=null&&s.has(o))||(A=e.hoistableHeaders)!=null&&A.has(o))&&(n[i]=r[i],delete r[i])}return{...t,headers:r,query:n}},Cx=t=>{t=ot.clone(t);for(const e of Object.keys(t.headers))Pne.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t};class sy extends zne{constructor({applyChecksum:r,credentials:n,region:s,service:A,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:r,credentials:n,region:s,service:A,sha256:i,uriEscapePath:o});S(this,"headerFormatter",new Tne)}async presign(r,n={}){const{signingDate:s=new Date,expiresIn:A=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:c,signingRegion:l,signingService:h}=n,d=await this.credentialProvider();this.validateResolvedCredentials(d);const p=l??await this.regionProvider(),{longDate:w,shortDate:B}=this.formatDate(s);if(A>Vne)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const C=ry(B,p,h??this.service),_=Jne(Cx(r),{unhoistableHeaders:o,hoistableHeaders:c});d.sessionToken&&(_.query[px]=d.sessionToken),_.query[Rne]=ey,_.query[Une]=`${d.accessKeyId}/${C}`,_.query[dx]=w,_.query[Fne]=A.toString(10);const T=Bx(_,i,a);return _.query[kne]=this.getCanonicalHeaderList(T),_.query[fx]=await this.getSignature(w,C,this.getSigningKey(d,p,B,h),this.createCanonicalRequest(_,T,await ny(r,this.sha256))),_}async sign(r,n){return typeof r=="string"?this.signString(r,n):r.headers&&r.payload?this.signEvent(r,n):r.message?this.signMessage(r,n):this.signRequest(r,n)}async signEvent({headers:r,payload:n},{signingDate:s=new Date,priorSignature:A,signingRegion:i,signingService:o,eventStreamCredentials:a}){const c=i??await this.regionProvider(),{shortDate:l,longDate:h}=this.formatDate(s),d=ry(l,c,o??this.service),p=await ny({headers:{},body:n},this.sha256),w=new this.sha256;w.update(r);const B=Mr(await w.digest()),C=[Nne,h,d,A,B,p].join(`
3045
+ `);return this.signString(C,{signingDate:s,signingRegion:c,signingService:o,eventStreamCredentials:a})}async signMessage(r,{signingDate:n=new Date,signingRegion:s,signingService:A,eventStreamCredentials:i}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:n,signingRegion:s,signingService:A,priorSignature:r.priorSignature,eventStreamCredentials:i}).then(a=>({message:r.message,signature:a}))}async signString(r,{signingDate:n=new Date,signingRegion:s,signingService:A,eventStreamCredentials:i}={}){const o=i??await this.credentialProvider();this.validateResolvedCredentials(o);const a=s??await this.regionProvider(),{shortDate:c}=this.formatDate(n),l=new this.sha256(await this.getSigningKey(o,a,c,A));return l.update(Eo(r)),Mr(await l.digest())}async signRequest(r,{signingDate:n=new Date,signableHeaders:s,unsignableHeaders:A,signingRegion:i,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const c=i??await this.regionProvider(),l=Cx(r),{longDate:h,shortDate:d}=this.formatDate(n),p=ry(d,c,o??this.service);l.headers[mx]=h,a.sessionToken&&(l.headers[Qne]=a.sessionToken);const w=await ny(l,this.sha256);!Wne(Zw,l.headers)&&this.applyChecksum&&(l.headers[Zw]=w);const B=Bx(l,A,s),C=await this.getSignature(h,p,this.getSigningKey(a,c,d,o),this.createCanonicalRequest(l,B,w));return l.headers[gx]=`${ey} Credential=${a.accessKeyId}/${p}, SignedHeaders=${this.getCanonicalHeaderList(B)}, Signature=${C}`,l}async getSignature(r,n,s,A){const i=await this.createStringToSign(r,n,A,ey),o=new this.sha256(await s);return o.update(Eo(i)),Mr(await o.digest())}getSigningKey(r,n,s,A){return qne(this.sha256,r,s,n,A||this.service)}}const Ay="X-Amz-S3session-Token",Ex=Ay.toLowerCase();class Xne extends sy{async signWithCredentials(e,r,n){const s=_x(r);e.headers[Ex]=r.sessionToken;const A=this;return bx(A,s),A.signRequest(e,n??{})}async presignWithCredentials(e,r,n){const s=_x(r);return delete e.headers[Ex],e.headers[Ay]=r.sessionToken,e.query=e.query??{},e.query[Ay]=r.sessionToken,bx(this,s),this.presign(e,n)}}function _x(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function bx(t,e){const r=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=r,Promise.resolve(e))}class vx{constructor(e){S(this,"sigv4aSigner");S(this,"sigv4Signer");S(this,"signerOptions");this.sigv4Signer=new Xne(e),this.signerOptions=e}static sigv4aDependency(){return"none"}async sign(e,r={}){return r.signingRegion==="*"?this.getSigv4aSigner().sign(e,r):this.sigv4Signer.sign(e,r)}async signWithCredentials(e,r,n={}){if(n.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(e,r,n)}async presign(e,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(e,r)}async presignWithCredentials(e,r,n={}){if(n.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const Yne="Directory",Zne="S3Express",ese="sigv4-s3express",tse="X-Amz-S3session-Token".toLowerCase(),rse=t=>(e,r)=>async n=>{var s,A,i,o,a;if(r.endpointV2){const c=r.endpointV2,l=((i=(A=(s=c.properties)==null?void 0:s.authSchemes)==null?void 0:A[0])==null?void 0:i.name)===ese;if((((o=c.properties)==null?void 0:o.backend)===Zne||((a=c.properties)==null?void 0:a.bucketType)===Yne)&&(bt(r,"S3_EXPRESS_BUCKET","J"),r.isS3ExpressBucket=!0),l){const d=n.input.Bucket;if(d){const p=await t.s3ExpressIdentityProvider.getS3ExpressIdentity(await t.credentials(),{Bucket:d});r.s3ExpressIdentity=p,ot.isInstance(n.request)&&p.sessionToken&&(n.request.headers[tse]=p.sessionToken)}}}return e(n)},nse={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},sse=t=>({applyToStack:e=>{e.add(rse(t),nse)}}),Ase=async(t,e,r,n)=>{const s=await n.signWithCredentials(r,t,{});if(s.headers["X-Amz-Security-Token"]||s.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return s},ise=t=>e=>{throw e},ose=(t,e)=>{},ase=t=>(e,r)=>async n=>{if(!ot.isInstance(n.request))return e(n);const A=xs(r).selectedHttpAuthScheme;if(!A)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=A;let c;r.s3ExpressIdentity?c=await Ase(r.s3ExpressIdentity,i,n.request,await t.signer()):c=await a.sign(n.request,o,i);const l=await e({...n,request:c}).catch((a.errorHandler||ise)(i));return(a.successHandler||ose)(l.response,i),l},cse=t=>({applyToStack:e=>{e.addRelativeTo(ase(t),FI)}});function use(t){return new ReadableStream({start(e){e.enqueue(t),e.close()}})}const lse={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},hse=t=>(e,r)=>async n=>{const s=await e(n),{response:A}=s;if(!dA.isInstance(A))return s;const{statusCode:i,body:o}=A;if(i<200||i>=300)return s;const a=await dse(o,t);if(A.body=use(a),a.length===0&&lse[r.commandName]){const l=new Error("S3 aborted request");throw l.$metadata={httpStatusCode:503},l.name="InternalError",l}const c=t.utf8Encoder(a.subarray(a.length-16));return c&&c.endsWith("</Error>")&&(A.statusCode=503),s},dse=(t=new Uint8Array,e)=>t instanceof Uint8Array?Promise.resolve(t):e.streamCollector(t)||Promise.resolve(new Uint8Array),fse={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ee=t=>({applyToStack:e=>{e.addRelativeTo(hse(t),fse)}}),pse=t=>typeof t=="string"&&t.indexOf("arn:")===0&&t.split(":").length>=6;function gse(t){return(e,r)=>async n=>{var s,A,i,o;if(t.bucketEndpoint){const a=r.endpointV2;if(a){const c=n.input.Bucket;if(typeof c=="string")try{const l=new URL(c);r.endpointV2={...a,url:l}}catch(l){const h=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${c} could not be parsed as URL.`;throw((A=(s=r.logger)==null?void 0:s.constructor)==null?void 0:A.name)==="NoOpLogger"?console.warn(h):(o=(i=r.logger)==null?void 0:i.warn)==null||o.call(i,h),l}}}return e(n)}}const mse={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function wse({bucketEndpoint:t}){return e=>async r=>{const{input:{Bucket:n}}=r;if(!t&&typeof n=="string"&&!pse(n)&&n.indexOf("/")>=0){const s=new Error(`Bucket name shouldn't contain '/', received '${n}'`);throw s.name="InvalidBucketName",s}return e({...r})}}const yse={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Bse=t=>({applyToStack:e=>{e.add(wse(t),yse),e.addRelativeTo(gse(t),mse)}});class Sx{constructor(e=!1){S(this,"queryCompat");S(this,"errorRegistry");this.queryCompat=e}resolveRestContentType(e,r){const n=r.getMemberSchemas(),s=Object.values(n).find(A=>!!A.getMergedTraits().httpPayload);if(s){const A=s.getMergedTraits().mediaType;return A||(s.isStringSchema()?"text/plain":s.isBlobSchema()?"application/octet-stream":e)}else if(!r.isUnitSchema()&&Object.values(n).find(i=>{const{httpQuery:o,httpQueryParams:a,httpHeader:c,httpLabel:l,httpPrefixHeaders:h}=i.getMergedTraits();return!o&&!a&&!c&&!l&&h===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,r,n,s,A,i){var c,l;let o=e;e.includes("#")&&([,o]=e.split("#"));const a={$metadata:A,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:(i==null?void 0:i(this.errorRegistry,o))??this.errorRegistry.getSchema(e),errorMetadata:a}}catch{s.message=s.message??s.Message??"UnknownError";const d=this.errorRegistry,p=d.getBaseException();if(p){const C=d.getErrorCtor(p)??Error;throw this.decorateServiceException(Object.assign(new C({name:o}),a),s)}const w=s,B=(w==null?void 0:w.message)??(w==null?void 0:w.Message)??((c=w==null?void 0:w.Error)==null?void 0:c.Message)??((l=w==null?void 0:w.Error)==null?void 0:l.message);throw this.decorateServiceException(Object.assign(new Error(B),{name:o},a),s)}}compose(e,r,n){let s=n;r.includes("#")&&([s]=r.split("#"));const A=Rs.for(s),i=Rs.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(A),e.copyFrom(i),this.errorRegistry=e}decorateServiceException(e,r={}){var n,s,A,i;if(this.queryCompat){const o=e.Message??r.Message,a=UT(e,r);o&&(a.message=o);const c=a.Error??{};c.Type=(n=a.Error)==null?void 0:n.Type,c.Code=(s=a.Error)==null?void 0:s.Code,c.Message=((A=a.Error)==null?void 0:A.message)??((i=a.Error)==null?void 0:i.Message)??o,a.Error=c;const l=a.$metadata.requestId;return l&&(a.RequestId=l),a}return UT(e,r)}setQueryCompatError(e,r){var s;const n=(s=r.headers)==null?void 0:s["x-amzn-query-error"];if(e!==void 0&&n!=null){const[A,i]=n.split(";"),o=Object.keys(e),a={Code:A,Type:i};e.Code=A,e.Type=i;for(let c=0;c<o.length;c++){const l=o[c];a[l==="message"?"Message":l]=e[l]}delete a.__type,e.Error=a}}queryCompatOutput(e,r){e.Error&&(r.Error=e.Error),e.Type&&(r.Type=e.Type),e.Code&&(r.Code=e.Code)}findQueryCompatibleError(e,r){try{return e.getSchema(r)}catch{return e.find(s=>{var A;return((A=Oe.of(s).getMergedTraits().awsQueryError)==null?void 0:A[0])===r})}}}class To{constructor(){S(this,"serdeContext")}setSerdeContext(e){this.serdeContext=e}}class Tx{constructor(e,r){S(this,"from");S(this,"to");S(this,"keys");this.from=e,this.to=r;const n=Object.keys(this.from),s=new Set(n);s.delete("__type"),this.keys=s}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,r=this.from[e];this.to.$unknown=[e,r]}}}function Cse(t,e,r){if(r!=null&&r.source){const n=r.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new rn(n,"bigDecimal"):BigInt(n)}return e}const Ese=(t,e)=>fi(t,e).then(r=>((e==null?void 0:e.utf8Encoder)??ks)(r)),_se=(t,e)=>Ese(t,e).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw(n==null?void 0:n.name)==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),Ix=(t,e)=>Object.keys(t).find(r=>r.toLowerCase()===e.toLowerCase()),iy=t=>{let e=t;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},bse=(t,e,r=!1)=>vse(t,e,r?["code","header","type"]:["type","code","header"]),vse=({headers:t},e,r)=>{for(;r.length>0;)switch(r.shift()){case"header":const s=Ix(t??{},"x-amzn-errortype");if(s!==void 0)return iy(t[s]);break;case"code":const A=Ix(e??{},"code");if(A&&e[A]!==void 0)return iy(e[A]);break;case"type":if((e==null?void 0:e.__type)!==void 0)return iy(e.__type);break}};class Sse extends To{constructor(r){super();S(this,"settings");this.settings=r}async read(r,n){return this._read(r,typeof n=="string"?JSON.parse(n,Cse):await _se(n,this.serdeContext))}readObject(r,n){return this._read(r,n)}_read(r,n){const s=n!==null&&typeof n=="object",A=Oe.of(r);if(s){if(A.isStructSchema()){const o=n,a=A.isUnionSchema(),c={};let l;const{jsonName:h}=this.settings;h&&(l={});let d;a&&(d=new Tx(o,c));for(const[p,w]of A.structIterator()){let B=p;h&&(B=w.getMergedTraits().jsonName??B,l[B]=p),a&&d.mark(B),o[B]!=null&&(c[p]=this._read(w,o[B]))}if(a)d.writeUnknown();else if(typeof o.__type=="string")for(const p in o){const w=o[p],B=h?l[p]??p:p;B in c||(c[B]=w)}return c}if(Array.isArray(n)&&A.isListSchema()){const o=A.getValueSchema(),a=[];for(const c of n)a.push(this._read(o,c));return a}if(A.isMapSchema()){const o=A.getValueSchema(),a={};for(const c in n)a[c]=this._read(o,n[c]);return a}}if(A.isBlobSchema()&&typeof n=="string")return Us(n);const i=A.getMergedTraits().mediaType;if(A.isStringSchema()&&typeof n=="string"&&i)return i==="application/json"||i.endsWith("+json")?Yn.from(n):n;if(A.isTimestampSchema()&&n!=null)switch(Lc(A,this.settings)){case 5:return wee(n);case 6:return Cw(n);case 7:return Eee(n);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",n),new Date(n)}if(A.isBigIntegerSchema()&&(typeof n=="number"||typeof n=="string"))return BigInt(n);if(A.isBigDecimalSchema()&&n!=null){if(n instanceof rn)return n;const o=n;return o.type==="bigDecimal"&&"string"in o?new rn(o.string,o.type):new rn(String(n),"bigDecimal")}if(A.isNumericSchema()&&typeof n=="string"){switch(n){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return n}if(A.isDocumentSchema())if(s){const o=Array.isArray(n)?[]:{};for(const a in n){const c=n[a];c instanceof rn?o[a]=c:o[a]=this._read(A,c)}return o}else return structuredClone(n);return n}}const xx="Ν";class Tse{constructor(){S(this,"values",new Map);S(this,"counter",0);S(this,"stage",0)}createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,r)=>{if(r instanceof rn){const n=`${xx+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r=="bigint"){const n=r.toString(),s=`${xx+"b"+this.counter++}_`+n;return this.values.set(`"${s}"`,n),s}return r}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[r,n]of this.values)e=e.replace(r,n);return e}}class Ise extends To{constructor(r){super();S(this,"settings");S(this,"buffer");S(this,"useReplacer",!1);S(this,"rootSchema");this.settings=r}write(r,n){this.rootSchema=Oe.of(r),this.buffer=this._write(this.rootSchema,n)}flush(){const{rootSchema:r,useReplacer:n}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r!=null&&r.isStructSchema()||r!=null&&r.isDocumentSchema()){if(!n)return JSON.stringify(this.buffer);const s=new Tse;return s.replaceInJson(JSON.stringify(this.buffer,s.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(r,n){this.write(r,n),typeof this.buffer=="object"&&(this.buffer.__type=Oe.of(r).getName(!0))}_write(r,n,s){var o,a;const A=n!==null&&typeof n=="object",i=Oe.of(r);if(A){if(i.isStructSchema()){const c=n,l={},{jsonName:h}=this.settings;let d;h&&(d={});let p=0;for(const[w,B]of i.structIterator()){const C=this._write(B,c[w],i);if(C!==void 0){let _=w;h&&(_=B.getMergedTraits().jsonName??w,d[w]=_),l[_]=C,p++}}if(i.isUnionSchema()&&p===0){const{$unknown:w}=c;if(Array.isArray(w)){const[B,C]=w;l[B]=this._write(15,C)}}else if(typeof c.__type=="string")for(const w in c){const B=c[w],C=h?d[w]??w:w;C in l||(l[C]=this._write(15,B))}return l}if(Array.isArray(n)&&i.isListSchema()){const c=i.getValueSchema(),l=[],h=!!i.getMergedTraits().sparse;for(const d of n)(h||d!=null)&&l.push(this._write(c,d));return l}if(i.isMapSchema()){const c=i.getValueSchema(),l={},h=!!i.getMergedTraits().sparse;for(const d in n){const p=n[d];(h||p!=null)&&(l[d]=this._write(c,p))}return l}if(n instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?n:(((o=this.serdeContext)==null?void 0:o.base64Encoder)??Xn)(n);if(n instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(Lc(i,this.settings)){case 5:return n.toISOString().replace(".000Z","Z");case 6:return Gh(n);case 7:return n.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",n),n.getTime()/1e3}n instanceof rn&&(this.useReplacer=!0)}if(!(n===null&&(s!=null&&s.isStructSchema()))){if(i.isStringSchema()){if(typeof n>"u"&&i.isIdempotencyToken())return kw();const c=i.getMergedTraits().mediaType;return n!=null&&c&&(c==="application/json"||c.endsWith("+json"))?Yn.from(n):n}if(typeof n=="number"&&i.isNumericSchema())return Math.abs(n)===1/0||isNaN(n)?String(n):n;if(typeof n=="string"&&i.isBlobSchema())return i===this.rootSchema?n:(((a=this.serdeContext)==null?void 0:a.base64Encoder)??Xn)(n);if(typeof n=="bigint"&&(this.useReplacer=!0),i.isDocumentSchema())if(A){const c=Array.isArray(n)?[]:{};for(const l in n){const h=n[l];h instanceof rn?(this.useReplacer=!0,c[l]=h):c[l]=this._write(i,h)}return c}else return structuredClone(n);return n}}}class xse extends To{constructor(r){super();S(this,"settings");this.settings=r}createSerializer(){const r=new Ise(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){const r=new Sse(this.settings);return r.setSerdeContext(this.serdeContext),r}}class Rse extends xte{constructor({defaultNamespace:r,errorTypeRegistries:n,serviceTarget:s,awsQueryCompatible:A,jsonCodec:i}){super({defaultNamespace:r,errorTypeRegistries:n});S(this,"serializer");S(this,"deserializer");S(this,"serviceTarget");S(this,"codec");S(this,"mixin");S(this,"awsQueryCompatible");this.serviceTarget=s,this.codec=i??new xse({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!A,this.mixin=new Sx(this.awsQueryCompatible)}async serializeRequest(r,n,s){const A=await super.serializeRequest(r,n,s);return A.path.endsWith("/")||(A.path+="/"),A.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,A.headers["x-amz-target"]=`${this.serviceTarget}.${r.name}`,this.awsQueryCompatible&&(A.headers["x-amzn-query-mode"]="true"),($h(r.input)==="unit"||!A.body)&&(A.body="{}"),A}getPayloadCodec(){return this.codec}async handleError(r,n,s,A,i){const{awsQueryCompatible:o}=this;o&&this.mixin.setQueryCompatError(A,s);const a=bse(s,A,o)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);const{errorSchema:c,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,s,A,i,o?this.mixin.findQueryCompatibleError:void 0),h=Oe.of(c),d=A.message??A.Message??"UnknownError",p=this.compositeErrorRegistry.getErrorCtor(c)??Error,w=new p({}),B={},C=this.codec.createDeserializer();for(const[_,T]of h.structIterator())A[_]!=null&&(B[_]=C.readObject(T,A[_]));throw o&&this.mixin.queryCompatOutput(A,B),this.mixin.decorateServiceException(Object.assign(w,l,{$fault:h.getMergedTraits().error,message:d},B),A)}}class Use extends Rse{constructor({defaultNamespace:e,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:A}){super({defaultNamespace:e,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:A})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const kse=/[&<>"]/g,Fse={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Pse(t){return t.replace(kse,e=>Fse[e])}const Ose=/[&"'<>\r\n\u0085\u2028]/g,Qse={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","…":"&#x85;","\u2028":"&#x2028;"};function Dse(t){return t.replace(Ose,e=>Qse[e])}class oy{constructor(e){S(this,"value");this.value=e}toString(){return Dse(""+this.value)}}class br{constructor(e,r=[]){S(this,"name");S(this,"children");S(this,"attributes",{});this.name=e,this.children=r}static of(e,r,n){const s=new br(e);return r!==void 0&&s.addChildNode(new oy(r)),n!==void 0&&s.withName(n),s}withName(e){return this.name=e,this}addAttribute(e,r){return this.attributes[e]=r,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,r){return r!=null&&(this.attributes[e]=r),this}cc(e,r,n=r){if(e[r]!=null){const s=br.of(r,e[r]).withName(n);this.c(s)}}l(e,r,n,s){e[r]!=null&&s().map(i=>{i.withName(n),this.c(i)})}lc(e,r,n,s){if(e[r]!=null){const A=s(),i=new br(n);A.map(o=>{i.c(o)}),this.c(i)}}toString(){const e=!!this.children.length;let r=`<${this.name}`;const n=this.attributes;for(const s of Object.keys(n)){const A=n[s];A!=null&&(r+=` ${s}="${Pse(""+A)}"`)}return r+=e?`>${this.children.map(s=>s.toString()).join("")}</${this.name}>`:"/>"}}let ay;function Lse(t){ay||(ay=new DOMParser);const e=ay.parseFromString(t,"application/xml");if(e.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const r=n=>{var s;if(n.nodeType===Node.TEXT_NODE&&(s=n.textContent)!=null&&s.trim())return n.textContent;if(n.nodeType===Node.ELEMENT_NODE){const A=n;if(A.attributes.length===0&&A.childNodes.length===0)return"";const i={},o=Array.from(A.attributes);for(const c of o)i[`${c.name}`]=c.value;const a=Array.from(A.childNodes);for(const c of a){const l=r(c);if(l!=null){const h=c.nodeName;if(a.length===1&&o.length===0&&h==="#text")return l;h in i?Array.isArray(i[h])?i[h].push(l):i[h]=[i[h],l]:i[h]=l}else if(a.length===1&&o.length===0)return A.textContent}return i}return null};return{[e.documentElement.nodeName]:r(e.documentElement)}}class Mse extends To{constructor(r){super();S(this,"settings");S(this,"stringDeserializer");this.settings=r,this.stringDeserializer=new mI(r)}setSerdeContext(r){this.serdeContext=r,this.stringDeserializer.setSerdeContext(r)}read(r,n,s){var l;const A=Oe.of(r),i=A.getMemberSchemas();if(A.isStructSchema()&&A.isMemberSchema()&&!!Object.values(i).find(h=>!!h.getMemberTraits().eventPayload)){const h={},d=Object.keys(i)[0];return i[d].isBlobSchema()?h[d]=n:h[d]=this.read(i[d],n),h}const a=(((l=this.serdeContext)==null?void 0:l.utf8Encoder)??ks)(n),c=this.parseXml(a);return this.readSchema(r,s?c[s]:c)}readSchema(r,n){const s=Oe.of(r);if(s.isUnitSchema())return;const A=s.getMergedTraits();if(s.isListSchema()&&!Array.isArray(n))return this.readSchema(s,[n]);if(n==null)return n;if(typeof n=="object"){const i=!!A.xmlFlattened;if(s.isListSchema()){const a=s.getValueSchema(),c=[],l=a.getMergedTraits().xmlName??"member",h=i?n:(n[0]??n)[l];if(h==null)return c;const d=Array.isArray(h)?h:[h];for(const p of d)c.push(this.readSchema(a,p));return c}const o={};if(s.isMapSchema()){const a=s.getKeySchema(),c=s.getValueSchema();let l;i?l=Array.isArray(n)?n:[n]:l=Array.isArray(n.entry)?n.entry:[n.entry];const h=a.getMergedTraits().xmlName??"key",d=c.getMergedTraits().xmlName??"value";for(const p of l){const w=p[h],B=p[d];o[w]=this.readSchema(c,B)}return o}if(s.isStructSchema()){const a=s.isUnionSchema();let c;a&&(c=new Tx(n,o));for(const[l,h]of s.structIterator()){const d=h.getMergedTraits(),p=d.httpPayload?d.xmlName??h.getName():h.getMemberTraits().xmlName??l;a&&c.mark(p),n[p]!=null&&(o[l]=this.readSchema(h,n[p]))}return a&&c.writeUnknown(),o}if(s.isDocumentSchema())return n;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${s.getName(!0)}`)}return s.isListSchema()?[]:s.isMapSchema()||s.isStructSchema()?{}:this.stringDeserializer.read(s,n)}parseXml(r){if(r.length){let n;try{n=Lse(r)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:r}),o}const s="#text",A=Object.keys(n)[0],i=n[A];return i[s]&&(i[A]=i[s],delete i[s]),QT(i)}return{}}}const Nse=(t,e)=>{var r;if(((r=e==null?void 0:e.Error)==null?void 0:r.Code)!==void 0)return e.Error.Code;if((e==null?void 0:e.Code)!==void 0)return e.Code;if(t.statusCode==404)return"NotFound"};class Hse extends To{constructor(r){super();S(this,"settings");S(this,"stringBuffer");S(this,"byteBuffer");S(this,"buffer");this.settings=r}write(r,n){var A;const s=Oe.of(r);if(s.isStringSchema()&&typeof n=="string")this.stringBuffer=n;else if(s.isBlobSchema())this.byteBuffer="byteLength"in n?n:(((A=this.serdeContext)==null?void 0:A.base64Decoder)??Us)(n);else{this.buffer=this.writeStruct(s,n,void 0);const i=s.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(s.getName())}}flush(){var n;if(this.byteBuffer!==void 0){const s=this.byteBuffer;return delete this.byteBuffer,s}if(this.stringBuffer!==void 0){const s=this.stringBuffer;return delete this.stringBuffer,s}const r=this.buffer;return this.settings.xmlNamespace&&((n=r==null?void 0:r.attributes)!=null&&n.xmlns||r.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,r.toString()}writeStruct(r,n,s){const A=r.getMergedTraits(),i=r.isMemberSchema()&&!A.httpPayload?r.getMemberTraits().xmlName??r.getMemberName():A.xmlName??r.getName();if(!i||!r.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${r.getName(!0)}.`);const o=br.of(i),[a,c]=this.getXmlnsAttribute(r,s);for(const[h,d]of r.structIterator()){const p=n[h];if(p!=null||d.isIdempotencyToken()){if(d.getMergedTraits().xmlAttribute){o.addAttribute(d.getMergedTraits().xmlName??h,this.writeSimple(d,p));continue}if(d.isListSchema())this.writeList(d,p,o,c);else if(d.isMapSchema())this.writeMap(d,p,o,c);else if(d.isStructSchema())o.addChildNode(this.writeStruct(d,p,c));else{const w=br.of(d.getMergedTraits().xmlName??d.getMemberName());this.writeSimpleInto(d,p,w,c),o.addChildNode(w)}}}const{$unknown:l}=n;if(l&&r.isUnionSchema()&&Array.isArray(l)&&Object.keys(n).length===1){const[h,d]=l,p=br.of(h);if(typeof d!="string")if(n instanceof br||n instanceof oy)o.addChildNode(n);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,d,p,c),o.addChildNode(p)}return c&&o.addAttribute(a,c),o}writeList(r,n,s,A){if(!r.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${r.getName(!0)}`);const i=r.getMergedTraits(),o=r.getValueSchema(),a=o.getMergedTraits(),c=!!a.sparse,l=!!i.xmlFlattened,[h,d]=this.getXmlnsAttribute(r,A),p=(w,B)=>{if(o.isListSchema())this.writeList(o,Array.isArray(B)?B:[B],w,d);else if(o.isMapSchema())this.writeMap(o,B,w,d);else if(o.isStructSchema()){const C=this.writeStruct(o,B,d);w.addChildNode(C.withName(l?i.xmlName??r.getMemberName():a.xmlName??"member"))}else{const C=br.of(l?i.xmlName??r.getMemberName():a.xmlName??"member");this.writeSimpleInto(o,B,C,d),w.addChildNode(C)}};if(l)for(const w of n)(c||w!=null)&&p(s,w);else{const w=br.of(i.xmlName??r.getMemberName());d&&w.addAttribute(h,d);for(const B of n)(c||B!=null)&&p(w,B);s.addChildNode(w)}}writeMap(r,n,s,A,i=!1){if(!r.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${r.getName(!0)}`);const o=r.getMergedTraits(),a=r.getKeySchema(),l=a.getMergedTraits().xmlName??"key",h=r.getValueSchema(),d=h.getMergedTraits(),p=d.xmlName??"value",w=!!d.sparse,B=!!o.xmlFlattened,[C,_]=this.getXmlnsAttribute(r,A),T=(v,k,L)=>{const V=br.of(l,k),[x,I]=this.getXmlnsAttribute(a,_);I&&V.addAttribute(x,I),v.addChildNode(V);let R=br.of(p);h.isListSchema()?this.writeList(h,L,R,_):h.isMapSchema()?this.writeMap(h,L,R,_,!0):h.isStructSchema()?R=this.writeStruct(h,L,_):this.writeSimpleInto(h,L,R,_),v.addChildNode(R)};if(B)for(const v in n){const k=n[v];if(w||k!=null){const L=br.of(o.xmlName??r.getMemberName());T(L,v,k),s.addChildNode(L)}}else{let v;i||(v=br.of(o.xmlName??r.getMemberName()),_&&v.addAttribute(C,_),s.addChildNode(v));for(const k in n){const L=n[k];if(w||L!=null){const V=br.of("entry");T(V,k,L),(i?s:v).addChildNode(V)}}}}writeSimple(r,n){var i;if(n===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const s=Oe.of(r);let A=null;if(n&&typeof n=="object")if(s.isBlobSchema())A=(((i=this.serdeContext)==null?void 0:i.base64Encoder)??Xn)(n);else if(s.isTimestampSchema()&&n instanceof Date)switch(Lc(s,this.settings)){case 5:A=n.toISOString().replace(".000Z","Z");break;case 6:A=Gh(n);break;case 7:A=String(n.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",n),A=Gh(n);break}else{if(s.isBigDecimalSchema()&&n)return n instanceof rn?n.string:String(n);throw s.isMapSchema()||s.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${s.getName(!0)}`)}if((s.isBooleanSchema()||s.isNumericSchema()||s.isBigIntegerSchema()||s.isBigDecimalSchema())&&(A=String(n)),s.isStringSchema()&&(n===void 0&&s.isIdempotencyToken()?A=kw():A=String(n)),A===null)throw new Error(`Unhandled schema-value pair ${s.getName(!0)}=${n}`);return A}writeSimpleInto(r,n,s,A){const i=this.writeSimple(r,n),o=Oe.of(r),a=new oy(i),[c,l]=this.getXmlnsAttribute(o,A);l&&s.addAttribute(c,l),s.addChildNode(a)}getXmlnsAttribute(r,n){const s=r.getMergedTraits(),[A,i]=s.xmlNamespace??[];return i&&i!==n?[A?`xmlns:${A}`:"xmlns",i]:[void 0,void 0]}}class $se extends To{constructor(r){super();S(this,"settings");this.settings=r}createSerializer(){const r=new Hse(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){const r=new Mse(this.settings);return r.setSerdeContext(this.serdeContext),r}}class Vse extends Ite{constructor(r){super(r);S(this,"codec");S(this,"serializer");S(this,"deserializer");S(this,"mixin",new Sx);const n={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:r.xmlNamespace,serviceNamespace:r.defaultNamespace};this.codec=new $se(n),this.serializer=new kte(this.codec.createSerializer(),n),this.deserializer=new Rte(this.codec.createDeserializer(),n)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(r,n,s){const A=await super.serializeRequest(r,n,s),i=Oe.of(r.input);if(!A.headers["content-type"]){const o=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);o&&(A.headers["content-type"]=o)}return typeof A.body=="string"&&A.headers["content-type"]===this.getDefaultContentType()&&!A.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(i)&&(A.body='<?xml version="1.0" encoding="UTF-8"?>'+A.body),A}async deserializeResponse(r,n,s){return super.deserializeResponse(r,n,s)}async handleError(r,n,s,A,i){var C,_,T;const o=Nse(s,A)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace),A.Error&&typeof A.Error=="object")for(const v of Object.keys(A.Error))A[v]=A.Error[v],v.toLowerCase()==="message"&&(A.message=A.Error[v]);A.RequestId&&!i.requestId&&(i.requestId=A.RequestId);const{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,s,A,i),l=Oe.of(a),h=((C=A.Error)==null?void 0:C.message)??((_=A.Error)==null?void 0:_.Message)??A.message??A.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(a)??Error,p=new d({});await this.deserializeHttpMessage(a,n,s,A);const w={},B=this.codec.createDeserializer();for(const[v,k]of l.structIterator()){const L=k.getMergedTraits().xmlName??v,V=((T=A.Error)==null?void 0:T[L])??A[L];w[v]=B.readSchema(k,V)}throw this.mixin.decorateServiceException(Object.assign(p,c,{$fault:l.getMergedTraits().error,message:h},w),A)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(r){for(const[,n]of r.structIterator())if(n.getMergedTraits().httpPayload)return!(n.isStructSchema()||n.isMapSchema()||n.isListSchema());return!1}}class Kse extends Vse{async serializeRequest(e,r,n){const s=await super.serializeRequest(e,r,n),A=Oe.of(e.input),i=A.getSchema();let o=0;const a=i[6]??0;if(r&&typeof r=="object")for(const[c,l]of A.structIterator()){if(++o>a)break;if(c==="Bucket"){if(!r.Bucket&&l.getMergedTraits().httpLabel)throw new Error("No value provided for input HTTP label: Bucket.");break}}return s}}function jse(t){return e=>async r=>{var s,A,i,o;const{request:n}=r;if(t.expectContinueHeader!==!1&&ot.isInstance(n)&&n.body&&t.runtime==="node"&&((A=(s=t.requestHandler)==null?void 0:s.constructor)==null?void 0:A.name)!=="FetchHttpHandler"){let a=!0;if(typeof t.expectContinueHeader=="number")try{a=(Number((i=n.headers)==null?void 0:i["content-length"])??((o=t.bodyLengthChecker)==null?void 0:o.call(t,n.body))??1/0)>=t.expectContinueHeader}catch{}else a=!!t.expectContinueHeader;a&&(n.headers.Expect="100-continue")}return e({...r,request:n})}}const Gse={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},zse=t=>({applyToStack:e=>{e.add(jse(t),Gse)}});function qse(t){return e=>async r=>{const{CreateBucketConfiguration:n}=r.input,s=await t.region();return!(n!=null&&n.LocationConstraint)&&!(n!=null&&n.Location)&&s!=="us-east-1"&&(r.input.CreateBucketConfiguration=r.input.CreateBucketConfiguration??{},r.input.CreateBucketConfiguration.LocationConstraint=s),e(r)}}const Wse={step:"initialize",tags:["LOCATION_CONSTRAINT","CREATE_BUCKET_CONFIGURATION"],name:"locationConstraintMiddleware",override:!0},Jse=t=>({applyToStack:e=>{e.add(qse(t),Wse)}});function Xse(t){return e=>async r=>{const n={...r.input},s=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const A of s){const i=n[A.target];if(i){let o;typeof i=="string"?Zse(i,t)?o=t.base64Decoder(i):(o=t.utf8Decoder(i),n[A.target]=t.base64Encoder(o)):(o=ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i),n[A.target]=t.base64Encoder(o));const a=new t.md5;a.update(o),n[A.hash]=t.base64Encoder(await a.digest())}}return e({...r,input:n})}}const Yse={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},In=t=>({applyToStack:e=>{e.add(Xse(t),Yse)}});function Zse(t,e){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return!1;try{return e.base64Decoder(t).length===32}catch{return!1}}class Io{constructor(e){S(this,"bytes");if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(e));n>-1&&s>0;n--,s/=256)r[n]=s;return e<0&&Rx(r),new Io(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&Rx(e),parseInt(Mr(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Rx(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}class Ux{constructor(e,r){S(this,"toUtf8");S(this,"fromUtf8");this.toUtf8=e,this.fromUtf8=r}format(e){const r=[];for(const A of Object.keys(e)){const i=this.fromUtf8(A);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[A]))}const n=new Uint8Array(r.reduce((A,i)=>A+i.byteLength,0));let s=0;for(const A of r)n.set(A,s),s+=A.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const A=new DataView(new ArrayBuffer(3+e.value.byteLength));A.setUint8(0,6),A.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(A.buffer);return i.set(e.value,3),i;case"string":const o=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case"timestamp":const l=new Uint8Array(9);return l[0]=8,l.set(Io.fromNumber(e.value.valueOf()).bytes,1),l;case"uuid":if(!aAe.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(qT(e.value.replace(/\-/g,"")),1),h}}parse(e){const r={};let n=0;for(;n<e.byteLength;){const s=e.getUint8(n++),A=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s));switch(n+=s,e.getUint8(n++)){case 0:r[A]={type:Fx,value:!0};break;case 1:r[A]={type:Fx,value:!1};break;case 2:r[A]={type:eAe,value:e.getInt8(n++)};break;case 3:r[A]={type:tAe,value:e.getInt16(n,!1)},n+=2;break;case 4:r[A]={type:rAe,value:e.getInt32(n,!1)},n+=4;break;case 5:r[A]={type:nAe,value:new Io(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:const i=e.getUint16(n,!1);n+=2,r[A]={type:sAe,value:new Uint8Array(e.buffer,e.byteOffset+n,i)},n+=i;break;case 7:const o=e.getUint16(n,!1);n+=2,r[A]={type:AAe,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,o))},n+=o;break;case 8:r[A]={type:iAe,value:new Date(new Io(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const a=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,r[A]={type:oAe,value:`${Mr(a.subarray(0,4))}-${Mr(a.subarray(4,6))}-${Mr(a.subarray(6,8))}-${Mr(a.subarray(8,10))}-${Mr(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var kx;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(kx||(kx={}));const Fx="boolean",eAe="byte",tAe="short",rAe="integer",nAe="long",sAe="binary",AAe="string",iAe="timestamp",oAe="uuid",aAe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,Px=4,wA=Px*2,gi=4,cAe=wA+gi*2;function uAe({byteLength:t,byteOffset:e,buffer:r}){if(t<cAe)throw new Error("Provided message too short to accommodate event stream message overhead");const n=new DataView(r,e,t),s=n.getUint32(0,!1);if(t!==s)throw new Error("Reported message length does not match received message length");const A=n.getUint32(Px,!1),i=n.getUint32(wA,!1),o=n.getUint32(t-gi,!1),a=new rd().update(new Uint8Array(r,e,wA));if(i!==a.digest())throw new Error(`The prelude checksum specified in the message (${i}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(r,e+wA,t-(wA+gi))),o!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${o}`);return{headers:new DataView(r,e+wA+gi,A),body:new Uint8Array(r,e+wA+gi+A,s-A-(wA+gi+gi))}}class Ox{constructor(e,r){S(this,"headerMarshaller");S(this,"messageBuffer");S(this,"isEndOfStream");this.headerMarshaller=new Ux(e,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return r}}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return r}}}encode({headers:e,body:r}){const n=this.headerMarshaller.format(e),s=n.byteLength+r.byteLength+16,A=new Uint8Array(s),i=new DataView(A.buffer,A.byteOffset,A.byteLength),o=new rd;return i.setUint32(0,s,!1),i.setUint32(4,n.byteLength,!1),i.setUint32(8,o.update(A.subarray(0,8)).digest(),!1),A.set(n,12),A.set(r,n.byteLength+12),i.setUint32(s-4,o.update(A.subarray(8,s-4)).digest(),!1),A}decode(e){const{headers:r,body:n}=uAe(e);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}}class Qx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.decoder.decode(e)}}class Dx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class Lx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const r=await this.options.deserializer(e);r!==void 0&&(yield r)}}}class Mx{constructor(e){S(this,"options");this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.serializer(e)}}function Nx(t){let e=0,r=0,n=null,s=null;const A=o=>{if(typeof o!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+o);e=o,r=4,n=new Uint8Array(o),new DataView(n.buffer).setUint32(0,o,!1)},i=async function*(){const o=t[Symbol.asyncIterator]();for(;;){const{value:a,done:c}=await o.next();if(c){if(e)if(e===r)yield n;else throw new Error("Truncated event message received.");else return;return}const l=a.length;let h=0;for(;h<l;){if(!n){const p=l-h;s||(s=new Uint8Array(4));const w=Math.min(4-r,p);if(s.set(a.slice(h,h+w),r),r+=w,h+=w,r<4)break;A(new DataView(s.buffer).getUint32(0,!1)),s=null}const d=Math.min(e-r,l-h);n.set(a.slice(h,h+d),r),r+=d,h+=d,e&&e===r&&(yield n,n=null,e=0,r=0)}}};return{[Symbol.asyncIterator]:i}}function Hx(t,e){return async function(r){const{value:n}=r.headers[":message-type"];if(n==="error"){const s=new Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){const s=r.headers[":exception-type"].value,A={[s]:r},i=await t(A);if(i.$unknown){const o=new Error(e(r.body));throw o.name=s,o}throw i[s]}else if(n==="event"){const s={[r.headers[":event-type"].value]:r},A=await t(s);return A.$unknown?void 0:A}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let $x=class{constructor({utf8Encoder:e,utf8Decoder:r}){S(this,"eventStreamCodec");S(this,"utfEncoder");this.eventStreamCodec=new Ox(e,r),this.utfEncoder=e}deserialize(e,r){const n=Nx(e);return new Lx({messageStream:new Qx({inputStream:n,decoder:this.eventStreamCodec}),deserializer:Hx(r,this.utfEncoder)})}serialize(e,r){return new Dx({messageStream:new Mx({inputStream:e,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const Vx=t=>({[Symbol.asyncIterator]:async function*(){const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}}),Kx=t=>{const e=t[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:n,value:s}=await e.next();if(n)return r.close();r.enqueue(s)}})};class jx{constructor({utf8Encoder:e,utf8Decoder:r}){S(this,"universalMarshaller");this.universalMarshaller=new $x({utf8Decoder:r,utf8Encoder:e})}deserialize(e,r){const n=lAe(e)?Vx(e):e;return this.universalMarshaller.deserialize(n,r)}serialize(e,r){const n=this.universalMarshaller.serialize(e,r);return typeof ReadableStream=="function"?Kx(n):n}}const lAe=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream,Gx=t=>new jx(t),zx=t=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)});class hAe{constructor({marshaller:e,serializer:r,deserializer:n,serdeContext:s,defaultContentType:A}){S(this,"marshaller");S(this,"serializer");S(this,"deserializer");S(this,"serdeContext");S(this,"defaultContentType");this.marshaller=e,this.serializer=r,this.deserializer=n,this.serdeContext=s,this.defaultContentType=A}async serializeEventStream({eventStream:e,requestSchema:r,initialRequest:n}){const s=this.marshaller,A=r.getEventStreamMember(),i=r.getMemberSchema(A),o=this.serializer,a=this.defaultContentType,c=Symbol("initialRequestMarker"),l={async*[Symbol.asyncIterator](){if(n){const h={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a}};o.write(r,n);const d=o.flush();yield{[c]:!0,headers:h,body:d}}for await(const h of e)yield h}};return s.serialize(l,h=>{if(h[c])return{headers:h.headers,body:h.body};let d="";for(const T in h)if(T!=="__type"){d=T;break}const{additionalHeaders:p,body:w,eventType:B,explicitPayloadContentType:C}=this.writeEventBody(d,i,h);return{headers:{":event-type":{type:"string",value:B},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:C??a},...p},body:w}})}async deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:n}){var d;const s=this.marshaller,A=r.getEventStreamMember(),o=r.getMemberSchema(A).getMemberSchemas(),a=Symbol("initialResponseMarker"),c=s.deserialize(e.body,async p=>{var C,_;let w="";for(const T in p)if(T!=="__type"){w=T;break}const B=p[w].body;if(w==="initial-response"){const T=await this.deserializer.read(r,B);return delete T[A],{[a]:!0,...T}}else if(w in o){const T=o[w];if(T.isStructSchema()){const v={};let k=!1;for(const[L,V]of T.structIterator()){const{eventHeader:x,eventPayload:I}=V.getMergedTraits();if(k=k||!!(x||I),I)V.isBlobSchema()?v[L]=B:V.isStringSchema()?v[L]=(((C=this.serdeContext)==null?void 0:C.utf8Encoder)??ks)(B):V.isStructSchema()&&(v[L]=await this.deserializer.read(V,B));else if(x){const R=(_=p[w].headers[L])==null?void 0:_.value;R!=null&&(V.isNumericSchema()?R&&typeof R=="object"&&"bytes"in R?v[L]=BigInt(R.toString()):v[L]=Number(R):v[L]=R)}}if(k)return{[w]:v};if(B.byteLength===0)return{[w]:{}}}return{[w]:await this.deserializer.read(T,B)}}else return{$unknown:p}}),l=c[Symbol.asyncIterator](),h=await l.next();if(h.done)return c;if((d=h.value)!=null&&d[a]){if(!r)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const p in h.value)n[p]=h.value[p]}return{async*[Symbol.asyncIterator](){var p;for((p=h==null?void 0:h.value)!=null&&p[a]||(yield h.value);;){const{done:w,value:B}=await l.next();if(w)break;yield B}}}}writeEventBody(e,r,n){var d;const s=this.serializer;let A=e,i=null,o;const a=r.getSchema()[4].includes(e),c={};if(a){const p=r.getMemberSchema(e);if(p.isStructSchema()){for(const[w,B]of p.structIterator()){const{eventHeader:C,eventPayload:_}=B.getMergedTraits();if(_)i=w;else if(C){const T=n[e][w];let v="binary";B.isNumericSchema()?(-2)**31<=T&&T<=2**31-1?v="integer":v="long":B.isTimestampSchema()?v="timestamp":B.isStringSchema()?v="string":B.isBooleanSchema()&&(v="boolean"),T!=null&&(c[w]={type:v,value:T},delete n[e][w])}}if(i!==null){const w=p.getMemberSchema(i);w.isBlobSchema()?o="application/octet-stream":w.isStringSchema()&&(o="text/plain"),s.write(w,n[e][i])}else s.write(p,n[e])}else if(p.isUnitSchema())s.write(p,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[p,w]=n[e];A=p,s.write(15,w)}const l=s.flush()??new Uint8Array;return{body:typeof l=="string"?(((d=this.serdeContext)==null?void 0:d.utf8Decoder)??Jn)(l):l,eventType:A,explicitPayloadContentType:o,additionalHeaders:c}}}const dAe=Object.freeze(Object.defineProperty({__proto__:null,EventStreamCodec:Ox,EventStreamMarshaller:jx,EventStreamSerde:hAe,HeaderMarshaller:Ux,Int64:Io,MessageDecoderStream:Qx,MessageEncoderStream:Dx,SmithyMessageDecoderStream:Lx,SmithyMessageEncoderStream:Mx,UniversalEventStreamMarshaller:$x,eventStreamSerdeProvider:Gx,getChunkedStream:Nx,getMessageUnmarshaller:Hx,iterableToReadableStream:Kx,readableStreamToIterable:Vx,resolveEventStreamSerdeConfig:zx},Symbol.toStringTag,{value:"Module"})),qx=t=>{var e,r;return dA.isInstance(t)?((e=t.headers)==null?void 0:e.date)??((r=t.headers)==null?void 0:r.Date):void 0},cy=t=>new Date(Date.now()+t),fAe=(t,e)=>Math.abs(cy(e).getTime()-t)>=3e5,Wx=(t,e)=>{const r=Date.parse(t);return fAe(r,e)?r-Date.now():e},$c=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},Jx=async t=>{var c,l,h;const e=$c("context",t.context),r=$c("config",t.config),n=(h=(l=(c=e.endpointV2)==null?void 0:c.properties)==null?void 0:l.authSchemes)==null?void 0:h[0],A=await $c("signer",r.signer)(n),i=t==null?void 0:t.signingRegion,o=t==null?void 0:t.signingRegionSet,a=t==null?void 0:t.signingName;return{config:r,signer:A,signingRegion:i,signingRegionSet:o,signingName:a}};class uy{async sign(e,r,n){var h;if(!ot.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const s=await Jx(n),{config:A,signer:i}=s;let{signingRegion:o,signingName:a}=s;const c=n.context;if(((h=c==null?void 0:c.authSchemes)==null?void 0:h.length)??!1){const[d,p]=c.authSchemes;(d==null?void 0:d.name)==="sigv4a"&&(p==null?void 0:p.name)==="sigv4"&&(o=(p==null?void 0:p.signingRegion)??o,a=(p==null?void 0:p.signingName)??a)}return n._preRequestSystemClockOffset=A.systemClockOffset,await i.sign(e,{signingDate:cy(A.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return r=>{const n=r,s=n.ServerTime??qx(n.$response);if(s){const A=$c("config",e.config),i=e._preRequestSystemClockOffset,o=Wx(s,A.systemClockOffset);(o!==A.systemClockOffset||i!==void 0&&i!==o)&&n.$metadata&&(A.systemClockOffset=o,n.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const n=qx(e);if(n){const s=$c("config",r.config);s.systemClockOffset=Wx(n,s.systemClockOffset)}}}class pAe extends uy{async sign(e,r,n){var d;if(!ot.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:s,signer:A,signingRegion:i,signingRegionSet:o,signingName:a}=await Jx(n),l=(await((d=s.sigv4aSigningRegionSet)==null?void 0:d.call(s))??o??[i]).join(",");return n._preRequestSystemClockOffset=s.systemClockOffset,await A.sign(e,{signingDate:cy(s.systemClockOffset),signingRegion:l,signingService:a})}}const gAe=t=>(t.sigv4aSigningRegionSet=bo(t.sigv4aSigningRegionSet),t),Xx=t=>{let e=t.credentials,r=!!t.credentials,n;Object.defineProperty(t,"credentials",{set(c){c&&c!==e&&c!==n&&(r=!0),e=c;const l=mAe(t,{credentials:e,credentialDefaultProvider:t.credentialDefaultProvider}),h=wAe(t,l);if(r&&!h.attributed){const d=typeof e=="object"&&e!==null;n=async p=>{const B=await h(p);return d&&(!B.$source||Object.keys(B.$source).length===0)?FZ(B,"CREDENTIALS_CODE","e"):B},n.memoized=h.memoized,n.configBound=h.configBound,n.attributed=!0}else n=h},get(){return n},enumerable:!0,configurable:!0}),t.credentials=e;const{signingEscapePath:s=!0,systemClockOffset:A=t.systemClockOffset||0,sha256:i}=t;let o;return t.signer?o=bo(t.signer):t.regionInfoProvider?o=()=>bo(t.region)().then(async c=>[await t.regionInfoProvider(c,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},c]).then(([c,l])=>{const{signingRegion:h,signingService:d}=c;t.signingRegion=t.signingRegion||h||l,t.signingName=t.signingName||d||t.serviceId;const p={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:s},w=t.signerConstructor||sy;return new w(p)}):o=async c=>{c=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await bo(t.region)(),properties:{}},c);const l=c.signingRegion,h=c.signingName;t.signingRegion=t.signingRegion||l,t.signingName=t.signingName||h||t.serviceId;const d={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:s},p=t.signerConstructor||sy;return new p(d)},Object.assign(t,{systemClockOffset:A,signingEscapePath:s,signer:o})};function mAe(t,{credentials:e,credentialDefaultProvider:r}){let n;return e?e!=null&&e.memoized?n=e:n=Ere(e,Cre,QI):r?n=bo(r(Object.assign({},t,{parentClientConfig:t}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function wAe(t,e){if(e.configBound)return e;const r=async n=>e({...n,callerClientConfig:t});return r.memoized=e.memoized,r.configBound=!0,r}const Le="ref",we="argv",Yx="backend",Zn="authSchemes",nn="disableDoubleEncoding",sn="signingName",Ps="signingRegion",ly="signingRegionSet",Ae=-1,Qe=!0,An=!1,hy="isSet",xn="booleanEquals",xe="stringEquals",or="coalesce",vr="substring",vt="",Zx="aws.partition",e1="partitionResult",t1="accessPointSuffix",r1="regionPrefix",sd=t=>"outpostId_ssa_"+t+vt,n1="hardwareType",dy="ite",Os="isValidHostLabel",Qs="sigv4",s1="aws.isVirtualHostableS3Bucket",A1="url",Sr="getAttr",i1="bucketArn",Ds="--",o1="arnType",a1="accesspoint",fy=t=>"accessPointName_ssa_"+t+vt,py="s3-object-lambda",Vc="s3-outposts",c1="bucketPartition",u1="us-east-1",l1="outpostType",jr="name",Kc="s3",gy="{url#scheme}://{Bucket}.{url#authority}{url#path}",Ad="{url#scheme}://{url#authority}{url#path}",h1="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",d1="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",f1="https://{Bucket}.s3.{partitionResult#dnsSuffix}",p1=t=>"{url#scheme}://{accessPointName_ssa_"+t+"}-{bucketArn#accountId}.{url#authority}{url#path}",g1=t=>"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName_ssa_"+t+"}`",my="sigv4a",m1="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",w1="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",y1="https://s3.{partitionResult#dnsSuffix}",B1={[Le]:"UseFIPS"},C1={[Le]:"UseDualStack"},kt={[Le]:"Bucket"},wy={fn:Sr,[we]:[{[Le]:e1},jr]},E1={[Le]:A1},xo={[Le]:"Region"},Ls={[Le]:i1},_1={[Le]:o1},yy={[Le]:"accessPointName_ssa_1"},id={fn:Sr,[we]:[Ls,"region"]},b1={[Le]:n1},By={fn:Sr,[we]:[Ls,"service"]},v1={fn:Sr,[we]:[Ls,"accountId"]},od={[Yx]:"S3Express",[Zn]:[{[nn]:!0,[jr]:"{_s3e_auth}",[sn]:"s3express",[Ps]:"{Region}"}]},S1={[Yx]:"S3Express",[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:"s3express",[Ps]:"{Region}"}]},ad={[Zn]:[{[nn]:!0,[jr]:my,[sn]:Vc,[ly]:["*"]},{[nn]:!0,[jr]:Qs,[sn]:Vc,[Ps]:"{Region}"}]},Ft={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:u1}]},at={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:"{Region}"}]},Cy={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:py,[Ps]:"{bucketArn#region}"}]},jc={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:Kc,[Ps]:"{bucketArn#region}"}]},T1={[Zn]:[{[nn]:!0,[jr]:my,[sn]:Vc,[ly]:["*"]},{[nn]:!0,[jr]:Qs,[sn]:Vc,[Ps]:"{bucketArn#region}"}]},Ey={[Zn]:[{[nn]:!0,[jr]:Qs,[sn]:py,[Ps]:"{Region}"}]},I1=[xo],x1=[{[Le]:"Endpoint"}],_y=[kt],R1=[kt,0,7,!0],U1=[Ls,"resourceId[1]"],yAe=["*"],k1={conditions:[[hy,I1],[xn,[{[Le]:"Accelerate"},Qe]],[xn,[B1,Qe]],[xn,[C1,Qe]],[hy,x1],[hy,_y],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,0,6,Qe]},vt]},"--x-s3"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:R1},vt]},"--xa-s3"]],[Zx,I1,e1],[vr,R1,t1],[xe,[{[Le]:t1},"--op-s3"]],[vr,[kt,8,12,Qe],r1],[vr,[kt,32,49,Qe],sd(2)],[vr,[kt,49,50,Qe],n1],[xn,[{[Le]:"ForcePathStyle"},Qe]],[xe,[wy,"aws-cn"]],[dy,[C1,".dualstack",vt],"_s3e_ds"],[Os,[{[Le]:sd(2)},An]],[dy,[B1,"-fips",vt],"_s3e_fips"],[dy,[{fn:or,[we]:[{[Le]:"DisableS3ExpressSessionAuth"},An]},Qs,"sigv4-s3express"],"_s3e_auth"],[s1,[kt,An]],["parseURL",x1,A1],[xn,[{fn:or,[we]:[{[Le]:"UseS3ExpressControlEndpoint"},An]},Qe]],[s1,[kt,Qe]],[xe,[{fn:Sr,[we]:[E1,"scheme"]},"http"]],[Os,[xo,An]],["aws.parseArn",_y,i1],[Sr,[{fn:"split",[we]:[kt,Ds,0]},"[-2]"],"s3expressAvailabilityZoneId"],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,0,4,An]},vt]},"arn:"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,16,18,Qe]},vt]},Ds]],[xn,[{fn:Sr,[we]:[E1,"isIp"]},Qe]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,21,23,Qe]},vt]},Ds]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,27,29,Qe]},vt]},Ds]],[xe,[{[Le]:r1},"beta"]],["uriEncode",_y,"uri_encoded_bucket"],[Os,[xo,Qe]],[xn,[{fn:or,[we]:[{[Le]:"UseObjectLambdaEndpoint"},An]},Qe]],[Sr,[Ls,"resourceId[0]"],o1],[xe,[_1,vt]],[xe,[_1,a1]],[Sr,U1,fy(1)],[xe,[yy,vt]],[xe,[id,vt]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,14,16,Qe]},vt]},Ds]],[xe,[b1,"e"]],[xe,[b1,"o"]],[xe,[xo,"aws-global"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,19,21,Qe]},vt]},Ds]],[xe,[By,py]],[xn,[{fn:or,[we]:[{[Le]:"DisableAccessPoints"},An]},Qe]],[xe,[By,Vc]],[Zx,[id],c1],[Os,[yy,Qe]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,26,28,Qe]},vt]},Ds]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,15,17,Qe]},vt]},Ds]],[Sr,[Ls,"resourceId[4]"]],[xe,[{fn:or,[we]:[{fn:vr,[we]:[kt,20,22,Qe]},vt]},Ds]],[xn,[{[Le]:"UseGlobalEndpoint"},Qe]],[xe,[xo,u1]],[Sr,U1,sd(1)],[xn,[{fn:or,[we]:[{[Le]:"UseArnRegion"},Qe]},Qe]],[Os,[{[Le]:sd(1)},An]],[Sr,[Ls,"resourceId[2]"],l1],[xe,[xo,id]],[xe,[{fn:Sr,[we]:[{[Le]:c1},jr]},wy]],[xn,[{[Le]:"DisableMultiRegionAccessPoints"},Qe]],[Os,[id,Qe]],[xe,[{fn:Sr,[we]:[Ls,"partition"]},wy]],[xe,[v1,vt]],[xe,[By,Kc]],[Os,[v1,An]],[Sr,[Ls,"resourceId[3]"],fy(2)],[Os,[yy,An]],[xe,[{[Le]:l1},a1]],[Os,[{[Le]:fy(2)},An]]],results:[[Ae],[Ae,"Accelerate cannot be used with FIPS"],[Ae,"Cannot set dual-stack in combination with a custom endpoint."],[Ae,"A custom endpoint cannot be combined with FIPS"],[Ae,"A custom endpoint cannot be combined with S3 Accelerate"],[Ae,"Partition does not support FIPS"],[Ae,"S3Express does not support S3 Accelerate."],["{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",od],[gy,od],[Ae,"S3Express bucket name is not a valid virtual hostable name."],["https://s3express-control{_s3e_fips}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",S1],["https://{Bucket}.s3express{_s3e_fips}-{s3expressAvailabilityZoneId}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}",od],[Ae,"Unrecognized S3Express bucket name format."],[Ad,od],["https://s3express-control{_s3e_fips}{_s3e_ds}.{Region}.{partitionResult#dnsSuffix}",S1],[Ae,"Expected a endpoint to be specified but no endpoint was found"],["https://{Bucket}.ec2.{url#authority}",ad],["https://{Bucket}.ec2.s3-outposts.{Region}.{partitionResult#dnsSuffix}",ad],["https://{Bucket}.op-{outpostId_ssa_2}.{url#authority}",ad],["https://{Bucket}.op-{outpostId_ssa_2}.s3-outposts.{Region}.{partitionResult#dnsSuffix}",ad],[Ae,'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"'],[Ae,"Invalid Outposts Bucket alias - it must be a valid bucket name."],[Ae,"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`."],[Ae,"Custom endpoint `{Endpoint}` was not a valid URI"],[Ae,"S3 Accelerate cannot be used in this region"],["https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",at],["https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",at],[h1,Ft],[gy,Ft],[h1,at],[gy,at],[d1,Ft],[d1,at],[f1,Ft],[f1,at],["https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",at],[Ae,"Invalid region: region was not a valid DNS name."],[Ae,"S3 Object Lambda does not support Dual-stack"],[Ae,"S3 Object Lambda does not support S3 Accelerate"],[Ae,"Access points are not supported for this operation"],[Ae,"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`"],[Ae,"Invalid ARN: Missing account id"],[p1(1),Cy],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",Cy],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",Cy],[Ae,g1(1)],[Ae,"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`"],[Ae,"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)"],[Ae,"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`"],[Ae,"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`."],[Ae,"Invalid ARN: bucket ARN is missing a region"],[Ae,"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided"],[Ae,"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`"],[Ae,"Access Points do not support S3 Accelerate"],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],[p1(1),jc],["https://{accessPointName_ssa_1}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",jc],[Ae,"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}"],[Ae,"S3 MRAP does not support dual-stack"],[Ae,"S3 MRAP does not support FIPS"],[Ae,"S3 MRAP does not support S3 Accelerate"],[Ae,"Invalid configuration: Multi-Region Access Point ARNs are disabled."],["https://{accessPointName_ssa_1}.accesspoint.s3-global.{partitionResult#dnsSuffix}",{[Zn]:[{[nn]:Qe,name:my,[sn]:Kc,[ly]:yAe}]}],[Ae,"Client was configured for partition `{partitionResult#name}` but bucket referred to partition `{bucketArn#partition}`"],[Ae,"Invalid Access Point Name"],[Ae,"S3 Outposts does not support Dual-stack"],[Ae,"S3 Outposts does not support FIPS"],[Ae,"S3 Outposts does not support S3 Accelerate"],[Ae,"Invalid Arn: Outpost Access Point ARN contains sub resources"],["https://{accessPointName_ssa_2}-{bucketArn#accountId}.{outpostId_ssa_1}.{url#authority}",T1],["https://{accessPointName_ssa_2}-{bucketArn#accountId}.{outpostId_ssa_1}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",T1],[Ae,g1(2)],[Ae,"Expected an outpost type `accesspoint`, found {outpostType}"],[Ae,"Invalid ARN: expected an access point name"],[Ae,"Invalid ARN: Expected a 4-component resource"],[Ae,"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId_ssa_1}`"],[Ae,"Invalid ARN: The Outpost Id was not set"],[Ae,"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})"],[Ae,"Invalid ARN: No ARN type specified"],[Ae,"Invalid ARN: `{Bucket}` was not a valid ARN"],[Ae,"Path-style addressing cannot be used with ARN buckets"],["https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],["https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],["https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ft],["https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],[m1,Ft],[m1,at],[w1,Ft],[w1,at],["https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",at],[Ae,"Path-style addressing cannot be used with S3 Accelerate"],[Ad,Ey],["https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",Ey],["https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",Ey],["https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",at],["https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3-fips.{Region}.{partitionResult#dnsSuffix}",at],["https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",Ft],["https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",at],[Ad,Ft],[Ad,at],[y1,Ft],[y1,at],["https://s3.{Region}.{partitionResult#dnsSuffix}",at],[Ae,"A region must be set when sending requests to S3."]]},BAe=2,E=1e8,CAe=new Int32Array([-1,1,-1,0,3,E+115,1,424,4,2,272,5,3,233,6,4,85,7,5,15,8,8,9,E+115,16,10,13,18,11,13,19,12,13,22,E+14,13,35,14,E+42,36,E+103,435,6,271,16,7,270,17,8,19,18,14,501,106,9,20,24,10,21,24,11,22,24,12,23,24,13,547,24,14,77,25,20,73,26,26,27,78,37,28,E+86,38,E+86,29,39,47,30,48,E+58,31,50,32,E+85,51,33,136,55,E+76,34,59,35,E+84,60,39,36,61,37,E+83,62,38,146,63,41,E+46,61,40,E+83,62,41,150,64,42,E+54,66,43,E+53,70,44,E+52,71,45,E+81,73,46,E+80,74,E+78,E+79,40,48,E+57,41,E+57,49,42,185,50,48,62,51,49,E+45,52,51,53,526,60,56,54,62,E+55,55,63,57,E+46,62,E+55,57,64,58,E+54,66,59,E+53,69,60,E+65,70,61,E+52,72,E+64,E+51,49,E+45,63,51,64,526,60,67,65,62,E+55,66,63,68,E+46,62,E+55,68,64,69,E+54,66,70,E+53,68,E+47,71,70,72,E+52,72,E+50,E+51,25,74,E+42,46,E+39,75,57,76,E+41,58,E+40,E+41,26,E+88,78,28,E+87,79,34,82,80,35,81,545,36,E+103,E+115,46,E+97,83,57,84,E+99,58,E+98,E+99,5,101,86,8,87,E+115,16,88,89,18,91,89,19,90,92,21,97,95,19,93,92,21,98,95,21,97,94,22,E+14,95,35,96,E+42,36,E+103,E+42,22,E+13,98,35,99,E+42,36,E+101,100,46,E+110,E+111,6,214,102,7,208,103,8,119,104,14,118,105,21,106,E+23,26,107,502,37,108,E+86,38,E+86,109,39,112,110,48,E+58,111,50,136,E+85,40,113,E+57,41,E+57,114,42,115,500,48,E+56,116,52,117,E+72,65,E+69,E+72,21,501,E+23,9,120,124,10,121,124,11,122,124,12,123,124,13,202,124,14,195,125,20,190,126,21,127,E+23,23,128,129,24,189,129,26,130,197,37,131,E+86,38,E+86,132,39,159,133,48,E+58,134,50,135,E+85,51,141,136,55,E+76,137,59,138,E+84,60,E+83,139,61,140,E+83,63,E+83,E+46,55,E+76,142,59,143,E+84,60,148,144,61,145,E+83,62,147,146,63,150,E+46,63,153,E+46,61,149,E+83,62,153,150,64,151,E+54,66,152,E+53,70,E+82,E+52,64,154,E+54,66,155,E+53,70,156,E+52,71,157,E+81,73,158,E+80,74,E+77,E+79,40,160,E+57,41,E+57,161,42,185,162,48,174,163,49,E+45,164,51,165,526,60,168,166,62,E+55,167,63,169,E+46,62,E+55,169,64,170,E+54,66,171,E+53,69,172,E+65,70,173,E+52,72,E+63,E+51,49,E+45,175,51,176,526,60,179,177,62,E+55,178,63,180,E+46,62,E+55,180,64,181,E+54,66,182,E+53,68,E+47,183,70,184,E+52,72,E+48,E+51,48,E+56,186,52,187,E+72,65,E+69,188,67,E+70,E+71,25,E+36,E+42,21,191,E+23,25,192,E+42,30,194,193,46,E+34,E+36,46,E+33,E+35,21,196,E+23,26,E+88,197,28,E+87,198,34,201,199,35,200,545,36,E+101,E+115,46,E+95,E+96,17,203,E+22,20,204,E+21,21,205,550,33,206,550,44,E+16,207,45,E+18,E+20,8,209,215,16,210,220,18,211,220,19,212,224,20,213,227,21,231,401,8,218,215,19,216,E+9,20,217,227,21,231,E+9,16,219,220,18,223,220,19,221,224,20,222,227,21,231,E+12,19,226,224,20,225,E+9,21,E+9,E+12,20,230,227,21,228,E+9,30,229,E+9,34,E+7,E+9,21,231,415,30,232,E+8,34,E+7,E+8,4,E+2,234,5,235,480,6,271,236,7,270,237,8,238,491,9,239,243,10,240,243,11,241,243,12,242,243,13,547,243,14,266,244,20,264,245,26,246,267,37,247,E+86,38,E+86,248,39,249,518,40,250,E+57,41,E+57,251,42,538,252,48,E+43,253,49,E+45,254,51,255,526,60,258,256,62,E+55,257,63,259,E+46,62,E+55,259,64,260,E+54,66,261,E+53,69,262,E+65,70,263,E+52,72,E+62,E+51,25,265,E+42,46,E+31,E+32,26,E+88,267,28,E+87,268,34,269,544,46,E+93,E+94,8,397,E+9,8,407,E+9,3,346,273,4,E+3,274,5,284,275,8,276,E+115,15,E+5,277,16,278,281,18,279,281,19,280,281,22,E+14,281,35,282,E+42,36,E+102,283,46,E+106,E+107,6,405,285,7,395,286,8,295,287,14,501,288,26,289,502,37,290,E+86,38,E+86,291,39,292,307,40,293,E+57,41,E+57,294,42,335,500,9,296,300,10,297,300,11,298,300,12,299,300,13,394,300,14,339,301,15,E+5,302,20,337,303,26,304,341,37,305,E+86,38,E+86,306,39,309,307,48,E+58,308,50,E+74,E+85,40,310,E+57,41,E+57,311,42,335,312,48,324,313,49,E+45,314,51,315,526,60,318,316,62,E+55,317,63,319,E+46,62,E+55,319,64,320,E+54,66,321,E+53,69,322,E+65,70,323,E+52,72,E+61,E+51,49,E+45,325,51,326,526,60,329,327,62,E+55,328,63,330,E+46,62,E+55,330,64,331,E+54,66,332,E+53,68,E+47,333,70,334,E+52,72,E+49,E+51,48,E+56,336,52,E+67,E+72,25,338,E+42,46,E+27,E+28,15,E+5,340,26,E+88,341,28,E+87,342,34,345,343,35,344,545,36,E+102,E+115,46,E+91,E+92,4,E+2,347,5,357,348,8,349,E+115,15,E+5,350,16,351,354,18,352,354,19,353,354,22,E+14,354,35,355,E+42,36,E+43,356,46,E+104,E+105,6,405,358,7,395,359,8,360,491,9,361,365,10,362,365,11,363,365,12,364,365,13,394,365,14,389,366,15,E+5,367,20,387,368,26,369,391,37,370,E+86,38,E+86,371,39,372,518,40,373,E+57,41,E+57,374,42,538,375,48,E+43,376,49,E+45,377,51,378,526,60,381,379,62,E+55,380,63,382,E+46,62,E+55,382,64,383,E+54,66,384,E+53,69,385,E+65,70,386,E+52,72,E+60,E+51,25,388,E+42,46,E+25,E+26,15,E+5,390,26,E+88,391,28,E+87,392,34,393,544,46,E+89,E+90,15,E+5,547,8,396,E+9,15,E+5,397,16,398,410,18,399,410,19,400,410,20,401,E+9,27,402,E+12,29,E+11,403,31,E+11,404,32,E+11,422,8,406,E+9,15,E+5,407,16,408,410,18,409,410,19,411,410,20,E+12,E+9,20,414,412,22,413,E+9,34,E+10,E+9,22,416,415,27,419,E+12,27,418,417,34,E+10,E+12,34,E+10,419,43,E+11,420,47,E+11,421,53,E+11,422,54,E+11,423,56,E+11,E+12,2,E+1,425,3,478,426,4,E+4,427,5,438,428,8,429,E+115,16,430,433,18,431,433,19,432,433,22,E+14,433,35,434,E+42,36,E+44,435,46,E+112,436,57,437,E+114,58,E+113,E+114,6,E+6,439,7,E+6,440,8,450,441,14,501,442,26,443,502,37,444,E+86,38,E+86,445,39,446,465,40,447,E+57,41,E+57,448,42,471,449,48,E+44,500,9,451,455,10,452,455,11,453,455,12,454,455,13,547,455,14,473,456,15,460,457,20,458,461,25,459,E+42,46,E+37,E+38,20,540,461,26,462,474,37,463,E+86,38,E+86,464,39,467,465,48,E+58,466,50,E+75,E+85,40,468,E+57,41,E+57,469,42,471,470,48,E+44,524,48,E+44,472,52,E+68,E+72,26,E+88,474,28,E+87,475,34,E+100,476,35,477,545,36,E+44,E+115,4,E+2,479,5,488,480,8,481,E+115,16,482,485,18,483,485,19,484,485,22,E+14,485,35,486,E+42,36,E+43,487,46,E+108,E+109,6,E+6,489,7,E+6,490,8,503,491,14,501,492,26,493,502,37,494,E+86,38,E+86,495,39,496,518,40,497,E+57,41,E+57,498,42,538,499,48,E+43,500,49,E+45,526,26,E+88,502,28,E+87,E+115,9,504,508,10,505,508,11,506,508,12,507,508,13,547,508,14,541,509,15,513,510,20,511,514,25,512,E+42,46,E+29,E+30,20,540,514,26,515,542,37,516,E+86,38,E+86,517,39,520,518,48,E+58,519,50,E+73,E+85,40,521,E+57,41,E+57,522,42,538,523,48,E+43,524,49,E+45,525,51,529,526,60,E+55,527,62,E+55,528,63,E+55,E+46,60,532,530,62,E+55,531,63,533,E+46,62,E+55,533,64,534,E+54,66,535,E+53,69,536,E+65,70,537,E+52,72,E+59,E+51,48,E+43,539,52,E+66,E+72,25,E+24,E+42,26,E+88,542,28,E+87,543,34,E+100,544,35,546,545,36,E+42,E+115,36,E+43,E+115,17,548,E+22,20,549,E+21,33,552,550,44,E+17,551,45,E+19,E+20,44,E+15,553,45,E+15,E+20]),EAe=qh.from(CAe,BAe,k1.conditions,k1.results),_Ae=new eI({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),F1=(t,e={})=>_Ae.get(t,()=>cI(EAe,{endpointParams:t,logger:e.logger}));Jh.aws=Lw;const bAe=(t=>async(e,r,n)=>{var o,a,c;if(!n)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const s=await t(e,r,n),A=(c=(a=(o=xs(r))==null?void 0:o.commandInstance)==null?void 0:a.constructor)==null?void 0:c.getEndpointParameterInstructions;if(!A)throw new Error(`getEndpointParameterInstructions() is not defined on '${r.commandName}'`);const i=await ZT(n,{getEndpointParameterInstructions:A},e);return Object.assign(s,i)})(async(t,e,r)=>({operation:xs(e).operation,region:await Kr(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}));function P1(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function O1(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}const vAe=((t,e,r)=>s=>{var a;const i=(a=t(s).properties)==null?void 0:a.authSchemes;if(!i)return e(s);const o=[];for(const c of i){const{name:l,properties:h={},...d}=c,p=l.toLowerCase();l!==p&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${l}' to '${p}'`);let w;if(p==="sigv4a"){w="aws.auth#sigv4a";const _=i.find(T=>{const v=T.name.toLowerCase();return v!=="sigv4a"&&v.startsWith("sigv4")});if(vx.sigv4aDependency()==="none"&&_)continue}else if(p.startsWith("sigv4"))w="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);const B=r[w];if(!B)throw new Error(`Could not find HttpAuthOption create function for '${w}'`);const C=B(s);C.schemeId=w,C.signingProperties={...C.signingProperties||{},...d,...h},o.push(C)}return o})(F1,t=>{const e=[];switch(t.operation){default:e.push(P1(t)),e.push(O1(t))}return e},{"aws.auth#sigv4":P1,"aws.auth#sigv4a":O1}),SAe=t=>{const e=Xx(t),r=gAe(e);return Object.assign(r,{authSchemePreference:Kr(t.authSchemePreference??[])})},TAe=t=>Object.assign(t,{useFipsEndpoint:t.useFipsEndpoint??!1,useDualstackEndpoint:t.useDualstackEndpoint??!1,forcePathStyle:t.forcePathStyle??!1,useAccelerateEndpoint:t.useAccelerateEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,disableMultiregionAccessPoints:t.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:t.clientContextParams??{}}),K={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class je extends di{constructor(e){super(e),Object.setPrototypeOf(this,je.prototype)}}class cd extends je{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});S(this,"name","NoSuchUpload");S(this,"$fault","client");Object.setPrototypeOf(this,cd.prototype)}}class ud extends je{constructor(r){super({name:"AccessDenied",$fault:"client",...r});S(this,"name","AccessDenied");S(this,"$fault","client");Object.setPrototypeOf(this,ud.prototype)}}class ld extends je{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});S(this,"name","ObjectNotInActiveTierError");S(this,"$fault","client");Object.setPrototypeOf(this,ld.prototype)}}class hd extends je{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});S(this,"name","BucketAlreadyExists");S(this,"$fault","client");Object.setPrototypeOf(this,hd.prototype)}}class dd extends je{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});S(this,"name","BucketAlreadyOwnedByYou");S(this,"$fault","client");Object.setPrototypeOf(this,dd.prototype)}}class fd extends je{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});S(this,"name","NoSuchBucket");S(this,"$fault","client");Object.setPrototypeOf(this,fd.prototype)}}class pd extends je{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});S(this,"name","NoSuchKey");S(this,"$fault","client");Object.setPrototypeOf(this,pd.prototype)}}class gd extends je{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});S(this,"name","InvalidObjectState");S(this,"$fault","client");S(this,"StorageClass");S(this,"AccessTier");Object.setPrototypeOf(this,gd.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class md extends je{constructor(r){super({name:"NoSuchAnnotation",$fault:"client",...r});S(this,"name","NoSuchAnnotation");S(this,"$fault","client");Object.setPrototypeOf(this,md.prototype)}}class wd extends je{constructor(r){super({name:"NotFound",$fault:"client",...r});S(this,"name","NotFound");S(this,"$fault","client");Object.setPrototypeOf(this,wd.prototype)}}class yd extends je{constructor(r){super({name:"InvalidPrefix",$fault:"client",...r});S(this,"name","InvalidPrefix");S(this,"$fault","client");Object.setPrototypeOf(this,yd.prototype)}}class Bd extends je{constructor(r){super({name:"EncryptionTypeMismatch",$fault:"client",...r});S(this,"name","EncryptionTypeMismatch");S(this,"$fault","client");Object.setPrototypeOf(this,Bd.prototype)}}class Cd extends je{constructor(r){super({name:"InvalidRequest",$fault:"client",...r});S(this,"name","InvalidRequest");S(this,"$fault","client");Object.setPrototypeOf(this,Cd.prototype)}}class Ed extends je{constructor(r){super({name:"InvalidWriteOffset",$fault:"client",...r});S(this,"name","InvalidWriteOffset");S(this,"$fault","client");Object.setPrototypeOf(this,Ed.prototype)}}class _d extends je{constructor(r){super({name:"TooManyParts",$fault:"client",...r});S(this,"name","TooManyParts");S(this,"$fault","client");Object.setPrototypeOf(this,_d.prototype)}}class bd extends je{constructor(r){super({name:"AnnotationLimitExceeded",$fault:"client",...r});S(this,"name","AnnotationLimitExceeded");S(this,"$fault","client");Object.setPrototypeOf(this,bd.prototype)}}class vd extends je{constructor(r){super({name:"AnnotationNameTooLong",$fault:"client",...r});S(this,"name","AnnotationNameTooLong");S(this,"$fault","client");Object.setPrototypeOf(this,vd.prototype)}}class Sd extends je{constructor(r){super({name:"InvalidAnnotationName",$fault:"client",...r});S(this,"name","InvalidAnnotationName");S(this,"$fault","client");Object.setPrototypeOf(this,Sd.prototype)}}class Td extends je{constructor(r){super({name:"UnsupportedMediaType",$fault:"client",...r});S(this,"name","UnsupportedMediaType");S(this,"$fault","client");Object.setPrototypeOf(this,Td.prototype)}}class Id extends je{constructor(r){super({name:"IdempotencyParameterMismatch",$fault:"client",...r});S(this,"name","IdempotencyParameterMismatch");S(this,"$fault","client");Object.setPrototypeOf(this,Id.prototype)}}class xd extends je{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});S(this,"name","ObjectAlreadyInActiveTierError");S(this,"$fault","client");Object.setPrototypeOf(this,xd.prototype)}}const IAe="Account",xAe="AnalyticsAndOperator",Rd="AccelerateConfiguration",Ud="AccessControlList",Ro="ACL",Q1="AnalyticsConfigurationList",mi="AccessControlPolicy",D1="AccessControlTranslation",Gc="AnalyticsConfiguration",RAe="AnnotationCount",UAe="AccessDenied",L1="AbortDate",kAe="AnnotationDirective",M1="AnnotationEntry",FAe="AnalyticsExportDestination",PAe="AnalyticsFilter",OAe="AllowedHeaders",QAe="AllowedHeader",DAe="AccountId",N1="AbortIncompleteMultipartUpload",H1="AccessKeyId",LAe="AnnotationList",MAe="AnnotationLimitExceeded",NAe="AllowedMethods",HAe="AbortMultipartUpload",$Ae="AbortMultipartUploadOutput",VAe="AbortMultipartUploadRequest",KAe="AllowedMethod",zc="AnnotationName",jAe="AnnotationNameTooLong",GAe="AllowedOrigins",zAe="AllowedOrigin",$1="AnnotationPayload",qAe="AccessPointAlias",V1="AccessPointArn",K1="AnnotationPrefix",WAe="AllowQuotedRecordDelimiter",by="AcceptRanges",j1="AbortRuleId",kd="AbacStatus",JAe="AnalyticsS3BucketDestination",XAe="ApplyServerSideEncryptionByDefault",YAe="ArchiveStatus",G1="AccessTier",Fd="AnnotationTableConfiguration",z1="AnnotationTableConfigurationResult",ZAe="AnnotationTableConfigurationUpdates",qc="And",eie="Annotations",N="Bucket",vy="BucketArn",tie="BucketAlreadyExists",rie="BucketAccountId",nie="BucketAlreadyOwnedByYou",q1="BlockedEncryptionTypes",Sy="BypassGovernanceRetention",sie="BucketInfo",ar="BucketKeyEnabled",Aie="BucketLifecycleConfiguration",iie="BucketLocationName",Pd="BucketLoggingStatus",oie="BucketLocationType",aie="BucketNamespace",cie="BucketName",W1="BytesProcessed",J1="BlockPublicAcls",X1="BlockPublicPolicy",Ty="BucketRegion",Y1="BytesReturned",Z1="BytesScanned",Wc="Body",Iy="Buckets",eR="Checksum",pe="ChecksumAlgorithm",uie="CannedACL",lie="CreateBucket",xy="CreateBucketConfiguration",hie="CreateBucketMetadataConfiguration",die="CreateBucketMetadataConfigurationRequest",fie="CreateBucketMetadataTableConfiguration",pie="CreateBucketMetadataTableConfigurationRequest",gie="CreateBucketOutput",mie="CreateBucketRequest",Uo="CacheControl",Pt="ChecksumCRC32",Ot="ChecksumCRC32C",Qt="ChecksumCRC64NVME",Jc="Cache-Control",wie="CreationDate",Xc="Content-Disposition",ko="ContentDisposition",yie="ContinuationEvent",Yc="Content-Encoding",Fo="ContentEncoding",Bie="CloudFunction",Cie="CloudFunctionConfiguration",Po="ContentLanguage",Zc="Content-Language",Oo="Content-Length",Qo="ContentLength",Me="Content-MD5",Dt="ChecksumMD5",Ne="ContentMD5",Eie="CompletedMultipartUpload",_ie="CompleteMultipartUploadOutput",bie="CreateMultipartUploadOutput",vie="CompleteMultipartUploadResult",Sie="CompleteMultipartUploadRequest",Tie="CreateMultipartUploadRequest",tR="CompleteMultipartUpload",Iie="CreateMultipartUpload",Ry="ChecksumMode",xie="CopyObject",Rie="CopyObjectOutput",rR="CopyObjectResult",Od="CORSConfiguration",Uy="CORSRules",ky="CORSRule",Uie="CopyObjectRequest",kie="CommonPrefix",Fie="CommonPrefixList",Pie="CompletedPartList",nR="CopyPartResult",Oie="CompletedPart",Qd="CommonPrefixes",Fy="ContentRange",Qie="ConfirmRemoveSelfBucketAccess",sR="Content-Range",Do="ConfigurationState",Lt="ChecksumSHA1",Mt="ChecksumSHA256",Nt="ChecksumSHA512",AR="CopySourceIfMatch",iR="CopySourceIfModifiedSince",oR="CopySourceIfNoneMatch",aR="CopySourceIfUnmodifiedSince",Die="CreateSessionOutput",Lie="CreateSessionResult",Mie="CopySourceRange",Nie="CreateSessionRequest",cR="CopySourceSSECustomerAlgorithm",Py="CopySourceSSECustomerKey",uR="CopySourceSSECustomerKeyMD5",lR="CSV",hR="CopySourceVersionId",Hie="CSVInput",$ie="CSVOutput",dR="CopySource",Vie="CreateSession",Tr="ChecksumType",eu="Content-Type",Kie="ClientToken",Lo="ContentType",jie="CompressionType",cr="ContinuationToken",Ht="ChecksumXXHASH64",$t="ChecksumXXHASH3",Vt="ChecksumXXHASH128",fR="Condition",Gie="Code",zie="Comments",pR="Contents",qie="Cont",gR="Credentials",Mo="Days",Wie="DaysAfterInitiation",Jie="DeleteBucket",Xie="DeleteBucketAnalyticsConfiguration",Yie="DeleteBucketAnalyticsConfigurationRequest",Zie="DeleteBucketCors",eoe="DeleteBucketCorsRequest",toe="DeleteBucketEncryption",roe="DeleteBucketEncryptionRequest",noe="DeleteBucketInventoryConfiguration",soe="DeleteBucketInventoryConfigurationRequest",Aoe="DeleteBucketIntelligentTieringConfiguration",ioe="DeleteBucketIntelligentTieringConfigurationRequest",ooe="DeleteBucketLifecycle",aoe="DeleteBucketLifecycleRequest",coe="DeleteBucketMetadataConfiguration",uoe="DeleteBucketMetadataConfigurationRequest",loe="DeleteBucketMetricsConfigurationRequest",hoe="DeleteBucketMetricsConfiguration",doe="DeleteBucketMetadataTableConfiguration",foe="DeleteBucketMetadataTableConfigurationRequest",poe="DeleteBucketOwnershipControls",goe="DeleteBucketOwnershipControlsRequest",moe="DeleteBucketPolicy",woe="DeleteBucketPolicyRequest",yoe="DeleteBucketRequest",Boe="DeleteBucketReplicationRequest",Coe="DeleteBucketReplication",Eoe="DeleteBucketTagging",_oe="DeleteBucketTaggingRequest",boe="DeleteBucketWebsite",voe="DeleteBucketWebsiteRequest",Soe="DataExport",Toe="DestinationIfMatch",Ioe="DestinationIfModifiedSince",xoe="DestinationIfNoneMatch",Roe="DestinationIfUnmodifiedSince",wi="DeleteMarker",Uoe="DeleteMarkerEntry",mR="DeleteMarkerReplication",koe="DeleteMarkerVersionId",wR="DeleteMarkers",Oy="DisplayName",Foe="DeletedObject",Poe="DeleteObjectAnnotation",Ooe="DeleteObjectAnnotationOutput",Qoe="DeleteObjectAnnotationRequest",Doe="DeleteObjectOutput",Loe="DeleteObjectsOutput",Moe="DeleteObjectRequest",Noe="DeleteObjectsRequest",Hoe="DeleteObjectTagging",$oe="DeleteObjectTaggingOutput",Voe="DeleteObjectTaggingRequest",Koe="DeletedObjects",joe="DeleteObject",Goe="DeleteObjects",zoe="DeletePublicAccessBlock",qoe="DeletePublicAccessBlockRequest",Woe="DataRedundancy",yR="DefaultRetention",Joe="DeleteResult",BR="DestinationResult",CR="Date",Qy="Delete",Xoe="Deleted",yA="Delimiter",Dd="Destination",Yoe="Description",ER="Details",No="Error",Zoe="EmailAddress",_R="EventBridgeConfiguration",z="ExpectedBucketOwner",yi="EncryptionConfiguration",bR="ErrorCode",eae="ErrorDetails",Dy="ErrorDocument",tae="EndEvent",rae="ExposeHeaders",nae="ExposeHeader",vR="ErrorMessage",sae="ExpiredObjectDeleteMarker",SR="ExistingObjectReplication",Ld="ExpiresString",TR="ExpectedSourceBucketOwner",We="ETag",Aae="EncryptionTypeList",iae="EncryptionTypeMismatch",Ly="EncryptionType",BA="EncodingType",oae="EventThreshold",IR="ExpressionType",My="Encryption",aae="Enabled",xR="End",RR="Errors",Ny="Events",Hy="Event",es="Expiration",Rn="Expires",UR="Expression",Ms="Filter",kR="FieldDelimiter",cae="FileHeaderInfo",uae="FetchOwner",FR="FilterRule",lae="FilterRuleList",hae="FilterRules",dae="Field",PR="Format",fae="Frequency",Md="Grants",pae="GetBucketAbac",gae="GetBucketAccelerateConfiguration",mae="GetBucketAccelerateConfigurationOutput",wae="GetBucketAnalyticsConfigurationOutput",yae="GetBucketAccelerateConfigurationRequest",Bae="GetBucketAnalyticsConfigurationRequest",Cae="GetBucketAnalyticsConfiguration",Eae="GetBucketAbacOutput",_ae="GetBucketAclOutput",bae="GetBucketAbacRequest",vae="GetBucketAclRequest",Sae="GetBucketAcl",Tae="GetBucketCors",Iae="GetBucketCorsOutput",xae="GetBucketCorsRequest",Rae="GetBucketEncryption",Uae="GetBucketEncryptionOutput",kae="GetBucketEncryptionRequest",Fae="GetBucketInventoryConfiguration",Pae="GetBucketInventoryConfigurationOutput",Oae="GetBucketInventoryConfigurationRequest",Qae="GetBucketIntelligentTieringConfiguration",Dae="GetBucketIntelligentTieringConfigurationOutput",Lae="GetBucketIntelligentTieringConfigurationRequest",Mae="GetBucketLocation",Nae="GetBucketLifecycleConfiguration",Hae="GetBucketLifecycleConfigurationOutput",$ae="GetBucketLifecycleConfigurationRequest",Vae="GetBucketLocationOutput",Kae="GetBucketLoggingOutput",jae="GetBucketLocationRequest",Gae="GetBucketLoggingRequest",zae="GetBucketLogging",qae="GetBucketMetadataConfiguration",Wae="GetBucketMetadataConfigurationOutput",Jae="GetBucketMetricsConfigurationOutput",OR="GetBucketMetadataConfigurationResult",Xae="GetBucketMetadataConfigurationRequest",Yae="GetBucketMetricsConfigurationRequest",Zae="GetBucketMetricsConfiguration",ece="GetBucketMetadataTableConfiguration",tce="GetBucketMetadataTableConfigurationOutput",QR="GetBucketMetadataTableConfigurationResult",rce="GetBucketMetadataTableConfigurationRequest",nce="GetBucketNotificationConfiguration",sce="GetBucketNotificationConfigurationRequest",Ace="GetBucketOwnershipControls",ice="GetBucketOwnershipControlsOutput",oce="GetBucketOwnershipControlsRequest",ace="GetBucketPolicy",cce="GetBucketPolicyOutput",uce="GetBucketPolicyRequest",lce="GetBucketPolicyStatus",hce="GetBucketPolicyStatusOutput",dce="GetBucketPolicyStatusRequest",fce="GetBucketReplication",pce="GetBucketReplicationOutput",gce="GetBucketRequestPayment",mce="GetBucketRequestPaymentOutput",wce="GetBucketRequestPaymentRequest",yce="GetBucketReplicationRequest",Bce="GetBucketTagging",Cce="GetBucketTaggingOutput",Ece="GetBucketTaggingRequest",_ce="GetBucketVersioning",bce="GetBucketVersioningOutput",vce="GetBucketVersioningRequest",Sce="GetBucketWebsite",Tce="GetBucketWebsiteOutput",Ice="GetBucketWebsiteRequest",Ho="GrantFullControl",DR="GlacierJobParameters",xce="GetObject",Rce="GetObjectAcl",Uce="GetObjectAclOutput",kce="GetObjectAnnotationOutput",Fce="GetObjectAttributesOutput",Pce="GetObjectAttributesParts",Oce="GetObjectAclRequest",Qce="GetObjectAnnotationRequest",Dce="GetObjectAttributesResponse",Lce="GetObjectAttributesRequest",Mce="GetObjectAnnotation",Nce="GetObjectAttributes",Hce="GetObjectLockConfiguration",$ce="GetObjectLockConfigurationOutput",Vce="GetObjectLockConfigurationRequest",Kce="GetObjectLegalHold",jce="GetObjectLegalHoldOutput",Gce="GetObjectLegalHoldRequest",zce="GetObjectOutput",qce="GetObjectRequest",Wce="GetObjectRetentionOutput",Jce="GetObjectRetentionRequest",Xce="GetObjectRetention",Yce="GetObjectTagging",Zce="GetObjectTaggingOutput",eue="GetObjectTorrentOutput",tue="GetObjectTaggingRequest",rue="GetObjectTorrentRequest",nue="GetObjectTorrent",sue="GetPublicAccessBlock",Aue="GetPublicAccessBlockOutput",iue="GetPublicAccessBlockRequest",$o="GrantRead",Vo="GrantReadACP",$y="GrantWrite",Ko="GrantWriteACP",Vy="Grant",Ky="Grantee",oue="HeadBucket",aue="HeadBucketOutput",cue="HeadBucketRequest",uue="HttpErrorCodeReturnedEquals",LR="HostName",lue="HeadObject",hue="HeadObjectOutput",due="HeadObjectRequest",fue="HttpRedirectCode",St="Id",pue="InvalidAnnotationName",tu="InventoryConfiguration",MR="InventoryConfigurationList",jo="ID",jy="IndexDocument",gue="InventoryDestination",mue="IsEnabled",wue="InventoryEncryption",yue="InventoryFilter",NR="IsLatest",Go="IfMatch",Bue="IfMatchInitiatedTime",Cue="IfMatchLastModifiedTime",Eue="IfMatchSize",Gy="If-Modified-Since",HR="IfModifiedSince",_ue="InitiateMultipartUploadResult",Bi="If-Match",ru="IfNoneMatch",zo="If-None-Match",bue="InventoryOptionalFields",vue="InvalidObjectState",Sue="IncludedObjectVersions",Tue="InvalidPrefix",$R="IgnorePublicAcls",Iue="IdempotencyParameterMismatch",VR="IsPublic",xue="InvalidRequest",Rue="IsRestoreInProgress",zy="InputSerialization",Uue="InventoryS3BucketDestination",kue="InventorySchedule",ts="IsTruncated",Fue="IntelligentTieringAndOperator",nu="IntelligentTieringConfiguration",KR="IntelligentTieringConfigurationList",jR="InventoryTableConfigurationResult",Pue="InventoryTableConfigurationUpdates",Nd="InventoryTableConfiguration",Oue="IntelligentTieringFilter",GR="IfUnmodifiedSince",qy="If-Unmodified-Since",Que="InvalidWriteOffset",Wy="Initiator",Due="Initiated",zR="JSON",Lue="JSONInput",Mue="JSONOutput",Hd="JournalTableConfiguration",qR="JournalTableConfigurationResult",Nue="JournalTableConfigurationUpdates",le="Key",Hue="KeyCount",$ue="KeyId",Vue="KmsKeyArn",$d="KeyMarker",Kue="KMSContext",jue="KMSKeyArn",Gue="KMSKeyId",zue="KMSMasterKeyID",que="KeyPrefixEquals",Vd="Location",Wue="ListAllMyBucketsResult",Jue="ListAllMyDirectoryBucketsResult",Xue="ListBuckets",Yue="ListBucketAnalyticsConfigurations",Zue="ListBucketAnalyticsConfigurationsOutput",ele="ListBucketAnalyticsConfigurationResult",tle="ListBucketAnalyticsConfigurationsRequest",rle="ListBucketInventoryConfigurations",nle="ListBucketInventoryConfigurationsOutput",sle="ListBucketInventoryConfigurationsRequest",Ale="ListBucketIntelligentTieringConfigurations",ile="ListBucketIntelligentTieringConfigurationsOutput",ole="ListBucketIntelligentTieringConfigurationsRequest",ale="ListBucketMetricsConfigurations",cle="ListBucketMetricsConfigurationsOutput",ule="ListBucketMetricsConfigurationsRequest",lle="ListBucketsOutput",hle="ListBucketsRequest",WR="ListBucketResult",Jy="LocationConstraint",Xy="LifecycleConfiguration",dle="ListDirectoryBuckets",fle="ListDirectoryBucketsOutput",ple="ListDirectoryBucketsRequest",Yy="LoggingEnabled",gle="LifecycleExpiration",mle="LambdaFunctionArn",wle="LambdaFunctionConfiguration",yle="LambdaFunctionConfigurationList",Ble="LambdaFunctionConfigurations",Kd="LegalHold",Cle="LocationInfo",Ele="ListInventoryConfigurationsResult",on="LastModified",_le="ListMetricsConfigurationsResult",ble="LastModifiedTime",vle="ListMultipartUploads",Sle="ListMultipartUploadsOutput",Tle="ListMultipartUploadsResult",Ile="ListMultipartUploadsRequest",jd="Last-Modified",xle="ListObjects",Rle="ListObjectAnnotations",Ule="ListObjectAnnotationsOutput",kle="ListObjectAnnotationsRequest",Fle="ListObjectsOutput",Ple="ListObjectsRequest",Ole="ListObjectsV2",Qle="ListObjectsV2Output",Dle="ListObjectVersionsOutput",Lle="ListObjectsV2Request",Mle="ListObjectVersionsRequest",Nle="ListObjectVersions",Hle="ListParts",$le="ListPartsOutput",Vle="ListPartsResult",Kle="ListPartsRequest",jle="LifecycleRule",Gle="LifecycleRuleAndOperator",zle="LifecycleRuleFilter",qle="LifecycleRules",Wle="ListVersionsResult",qo="Metadata",Jle="MetricsAndOperator",JR="MaxAnnotationResults",Xle="MaxAgeSeconds",Yle="MaxBuckets",Zy="MetadataConfiguration",XR="MetricsConfigurationList",YR="MetadataConfigurationResult",su="MetricsConfiguration",Zle="MetadataDirective",ehe="MaxDirectoryBuckets",ZR="MfaDelete",eU="MetadataEntry",the="MetricsFilter",e0="MFA",tU="MFADelete",Wo="MaxKeys",t0="MissingMeta",rhe="MpuObjectSize",Gd="MaxParts",r0="MetadataTableConfiguration",rU="MetadataTableConfigurationResult",nhe="MetadataTableEncryptionConfiguration",nU="MultipartUpload",she="MultipartUploadList",sU="MaxUploads",AU="Marker",iU="Metrics",Ahe="Message",ihe="Minutes",oU="Mode",Ci="Name",n0="NotificationConfiguration",ohe="NotificationConfigurationFilter",Jo="NextContinuationToken",aU="NoncurrentDays",ahe="NonEmptyKmsKeyArnString",che="NotFound",cU="NextKeyMarker",uhe="NextMarker",uU="NewerNoncurrentVersions",lU="NextPartNumberMarker",lhe="NoSuchAnnotation",hhe="NoSuchBucket",dhe="NoSuchKey",fhe="NoSuchUpload",phe="NextUploadIdMarker",hU="NoncurrentVersionExpiration",ghe="NextVersionIdMarker",mhe="NoncurrentVersionTransitions",whe="NoncurrentVersionTransitionList",dU="NoncurrentVersionTransition",Un="Owner",yhe="ObjectAttributes",Bhe="ObjectAlreadyInActiveTierError",zd="OwnershipControls",Che="OwnershipControlsRule",Ehe="OwnershipControlsRules",fU="ObjectEncryption",_he="OptionalFields",bhe="ObjectIdentifier",vhe="ObjectIdentifierList",pU="ObjectIfMatch",gU="OutputLocation",qd="ObjectLockConfiguration",She="ObjectLockEnabled",The="ObjectLockEnabledForBucket",Ihe="ObjectLockLegalHold",Xo="ObjectLockLegalHoldStatus",Yo="ObjectLockMode",xhe="ObjectLockRetention",Zo="ObjectLockRetainUntilDate",Rhe="ObjectLockRule",Uhe="ObjectList",khe="ObjectNotInActiveTierError",mU="ObjectOwnership",s0="OptionalObjectAttributes",Fhe="ObjectParts",Phe="ObjectPart",Ohe="ObjectSize",wU="ObjectSizeGreaterThan",yU="ObjectSizeLessThan",Qhe="OutputSchemaVersion",A0="OutputSerialization",Dhe="ObjectVersion",Wd="ObjectVersionId",Lhe="ObjectVersionList",Mhe="Objects",BU="Object",He="Prefix",Jd="PublicAccessBlockConfiguration",Nhe="PutBucketAbac",Hhe="PutBucketAccelerateConfiguration",$he="PutBucketAccelerateConfigurationRequest",Vhe="PutBucketAnalyticsConfigurationRequest",Khe="PutBucketAnalyticsConfiguration",jhe="PutBucketAbacRequest",Ghe="PutBucketAclRequest",zhe="PutBucketAcl",qhe="PutBucketCors",Whe="PutBucketCorsRequest",Jhe="PutBucketEncryption",Xhe="PutBucketEncryptionRequest",Yhe="PutBucketInventoryConfiguration",Zhe="PutBucketInventoryConfigurationRequest",ede="PutBucketIntelligentTieringConfiguration",tde="PutBucketIntelligentTieringConfigurationRequest",rde="PutBucketLogging",nde="PutBucketLifecycleConfiguration",sde="PutBucketLifecycleConfigurationOutput",Ade="PutBucketLifecycleConfigurationRequest",ide="PutBucketLoggingRequest",ode="PutBucketMetricsConfiguration",ade="PutBucketMetricsConfigurationRequest",cde="PutBucketNotificationConfiguration",ude="PutBucketNotificationConfigurationRequest",lde="PutBucketOwnershipControls",hde="PutBucketOwnershipControlsRequest",dde="PutBucketPolicy",fde="PutBucketPolicyRequest",pde="PutBucketReplication",gde="PutBucketRequestPayment",mde="PutBucketRequestPaymentRequest",wde="PutBucketReplicationRequest",yde="PutBucketTagging",Bde="PutBucketTaggingRequest",Cde="PutBucketVersioning",Ede="PutBucketVersioningRequest",_de="PutBucketWebsite",bde="PutBucketWebsiteRequest",Xd="PartsCount",vde="PartitionDateSource",Sde="ProgressEvent",Tde="ParquetInput",Ide="PartsList",Ei="PartNumber",Yd="PartNumberMarker",xde="PutObject",Rde="PutObjectAcl",Ude="PutObjectAclOutput",kde="PutObjectAnnotationOutput",Fde="PutObjectAclRequest",Pde="PutObjectAnnotationRequest",Ode="PutObjectAnnotation",Qde="PutObjectLockConfiguration",Dde="PutObjectLockConfigurationOutput",Lde="PutObjectLockConfigurationRequest",Mde="PutObjectLegalHold",Nde="PutObjectLegalHoldOutput",Hde="PutObjectLegalHoldRequest",$de="PutObjectOutput",Vde="PutObjectRequest",Kde="PutObjectRetentionOutput",jde="PutObjectRetentionRequest",Gde="PutObjectRetention",zde="PutObjectTagging",qde="PutObjectTaggingOutput",Wde="PutObjectTaggingRequest",Zd="PartitionedPrefix",Jde="PutPublicAccessBlock",Xde="PutPublicAccessBlockRequest",CU="PolicyStatus",ef="Parts",tf="Part",Yde="Parquet",EU="Payer",_U="Payload",bU="Permission",vU="Policy",SU="Progress",Zde="Priority",TU="Protocol",efe="Quiet",tfe="QueueArn",IU="QuoteCharacter",rfe="QueueConfigurationList",nfe="QueueConfigurations",xU="QueueConfiguration",RU="QuoteEscapeCharacter",sfe="QuoteFields",Afe="Queue",rf="Role",i0="RedirectAllRequestsTo",Re="RequestCharged",UU="ResponseCacheControl",kU="ResponseContentDisposition",FU="ResponseContentEncoding",PU="ResponseContentLanguage",OU="ResponseContentType",nf="ReplicationConfiguration",o0="RecordDelimiter",QU="ResponseExpires",ife="RestoreExpiryDate",sf="RecordExpiration",ofe="RecordsEvent",afe="ReplicaKmsKeyID",cfe="ReplaceKeyPrefixWith",ufe="ReplaceKeyWith",DU="ReplicaModifications",lfe="RenameObject",hfe="RenameObjectOutput",dfe="RestoreObjectOutput",ffe="RestoreOutputPath",pfe="RenameObjectRequest",gfe="RestoreObjectRequest",mfe="RestoreObject",Ee="RequestPayer",LU="RestrictPublicBuckets",Af="RequestPaymentConfiguration",MU="RequestProgress",a0="RoutingRules",wfe="ReplicationRuleAndOperator",yfe="ReplicationRuleFilter",Bfe="ReplicationRule",Cfe="ReplicationRules",Efe="RequestRoute",c0="RestoreRequest",NU="RoutingRule",Au="ReplicationStatus",u0="RestoreStatus",_fe="RenameSource",HU="ReplicationTime",bfe="ReplicationTimeValue",vfe="RequestToken",Sfe="RetainUntilDate",of="Range",l0="Restore",Tfe="Records",$U="Redirect",af="Retention",iu="Rules",ea="Rule",ur="Status",VU="StartAfter",KU="SecretAccessKey",Ife="SseAlgorithm",xfe="StreamingBlob",jU="S3BucketDestination",lr="StorageClass",GU="StorageClassAnalysis",Rfe="StorageClassAnalysisDataExport",Ufe="SessionCredentialValue",kfe="SessionCredentials",Ffe="StatusCode",Pfe="SkipDestinationValidation",Ofe="StatsEvent",Qfe="SourceIfMatch",Dfe="SourceIfModifiedSince",Lfe="SourceIfNoneMatch",Mfe="SourceIfUnmodifiedSince",cf="SSE-KMS",zU="SseKmsEncryptedObjects",Nfe="S3KeyFilter",Hfe="S3Key",$fe="S3Location",Vfe="SessionMode",Kfe="SelectObjectContent",jfe="SelectObjectContentEventStream",Gfe="SelectObjectContentOutput",zfe="SelectObjectContentRequest",qU="SelectParameters",uf="SimplePrefix",WU="ScanRange",JU="SSE-S3",XU="SourceSelectionCriteria",hr="ServerSideEncryption",qfe="SSEAlgorithm",Wfe="ServerSideEncryptionByDefault",lf="ServerSideEncryptionConfiguration",Tt="SSECustomerAlgorithm",an="SSECustomerKey",It="SSECustomerKeyMD5",h0="SSEKMS",Jfe="SSEKMSEncryption",Ns="SSEKMSEncryptionContext",Ir="SSEKMSKeyId",Xfe="ServerSideEncryptionRule",Yfe="ServerSideEncryptionRules",YU="SSES3",ZU="SessionToken",ek="S3TablesDestination",tk="S3TablesDestinationResult",Zfe="S3",epe="Schedule",_i="Size",tpe="Start",rk="Stats",rpe="Suffix",ta="Tags",hf="TableArn",npe="TopicArn",spe="TargetBucket",d0="TableBucketArn",Ape="TableBucketType",f0="TagCount",ipe="TopicConfigurationList",ope="TopicConfigurations",nk="TopicConfiguration",ape="TaggingDirective",p0="TransitionDefaultMinimumObjectSize",sk="TargetGrants",cpe="TargetGrant",upe="TieringList",lpe="TransitionList",hpe="TooManyParts",ou="TableName",Ak="TableNamespace",ik="TargetObjectKeyFormat",dpe="TargetPrefix",fpe="TotalPartsCount",g0="TableStatus",df="TagSet",cn="Tag",kn="Tagging",ok="Tier",ppe="Tierings",ak="Tiering",gpe="Time",ck="Token",mpe="Topic",wpe="Transitions",uk="Transition",au="Type",ype="Uploads",Bpe="UpdateBucketMetadataAnnotationTableConfiguration",Cpe="UpdateBucketMetadataAnnotationTableConfigurationRequest",Epe="UpdateBucketMetadataInventoryTableConfiguration",_pe="UpdateBucketMetadataInventoryTableConfigurationRequest",bpe="UpdateBucketMetadataJournalTableConfiguration",vpe="UpdateBucketMetadataJournalTableConfigurationRequest",CA="UploadId",lk="UploadIdMarker",hk="UserMetadata",Spe="UnsupportedMediaType",Tpe="UpdateObjectEncryption",Ipe="UpdateObjectEncryptionRequest",xpe="UpdateObjectEncryptionResponse",Rpe="UploadPart",Upe="UploadPartCopy",kpe="UploadPartCopyOutput",Fpe="UploadPartCopyRequest",Ppe="UploadPartOutput",Ope="UploadPartRequest",Qpe="URI",Dpe="Upload",m0="Value",ff="VersioningConfiguration",ye="VersionId",dk="VersionIdMarker",Lpe="Versions",Mpe="Version",pf="WebsiteConfiguration",Npe="WriteGetObjectResponse",Hpe="WriteGetObjectResponseRequest",$pe="WriteOffsetBytes",cu="WebsiteRedirectLocation",Vpe="Years",w0="annotationName",Kpe="annotation-prefix",fk="accept-ranges",jpe="bucket-region",ct="client",EA="continuation-token",gf="delimiter",ut="error",y0="eventPayload",Gpe="endpoint",mf="encoding-type",zpe="fetch-owner",j="http",Se="httpChecksum",gt="httpError",f="httpHeader",qpe="hostLabel",Be="httpPayload",ra="httpPrefixHeaders",J="httpQuery",pk="http://www.w3.org/2001/XMLSchema-instance",un="id",Wpe="idempotencyToken",gk="key-marker",Jpe="marker",Xpe="max-annotation-results",Ype="max-buckets",Zpe="max-directory-buckets",B0="max-keys",ege="max-parts",tge="max-uploads",uu="prefix",wf="partNumber",rge="part-number-marker",mk="response-cache-control",wk="response-content-disposition",yk="response-content-encoding",Bk="response-content-language",Ck="response-content-type",Ek="response-expires",_k="smithy.ts.sdk.synthetic.com.amazonaws.s3",nge="start-after",bk="streaming",lu="uploadId",sge="upload-id-marker",xt="versionId",Age="version-id-marker",vk="xsi",ige="xmlAttribute",ae="xmlFlattened",D="xmlName",Sk="xmlNamespace",na="x-amz-acl",Tk="x-amz-abort-date",oge="x-amz-access-point-alias",Ik="x-amz-abort-rule-id",age="x-amz-archive-status",xk="x-amz-bucket-arn",C0="x-amz-bypass-governance-retention",cge="x-amz-bucket-location-name",uge="x-amz-bucket-location-type",lge="x-amz-bucket-namespace",hge="x-amz-bucket-object-lock-enabled",Rk="x-amz-bucket-object-lock-token",dge="x-amz-bucket-region",E0="x-amz-checksum-algorithm",rs="x-amz-checksum-crc32",ns="x-amz-checksum-crc32c",ss="x-amz-checksum-crc64nvme",As="x-amz-checksum-md5",_0="x-amz-checksum-mode",fge="x-amz-confirm-remove-self-bucket-access",is="x-amz-checksum-sha1",os="x-amz-checksum-sha256",as="x-amz-checksum-sha512",Uk="x-amz-copy-source",kk="x-amz-copy-source-if-match",Fk="x-amz-copy-source-if-modified-since",Pk="x-amz-copy-source-if-none-match",Ok="x-amz-copy-source-if-unmodified-since",pge="x-amz-create-session-mode",gge="x-amz-copy-source-range",Qk="x-amz-copy-source-server-side-encryption-customer-algorithm",Dk="x-amz-copy-source-server-side-encryption-customer-key",Lk="x-amz-copy-source-server-side-encryption-customer-key-MD5",Mk="x-amz-copy-source-version-id",_A="x-amz-checksum-type",mge="x-amz-client-token",cs="x-amz-checksum-xxhash64",us="x-amz-checksum-xxhash3",ls="x-amz-checksum-xxhash128",yf="x-amz-delete-marker",hu="x-amz-expiration",q="x-amz-expected-bucket-owner",wge="x-amz-fwd-error-code",yge="x-amz-fwd-error-message",Bge="x-amz-fwd-header-Cache-Control",Cge="x-amz-fwd-header-Content-Disposition",Ege="x-amz-fwd-header-Content-Encoding",_ge="x-amz-fwd-header-Content-Language",bge="x-amz-fwd-header-Content-Range",vge="x-amz-fwd-header-Content-Type",Sge="x-amz-fwd-header-ETag",Tge="x-amz-fwd-header-Expires",Ige="x-amz-fwd-header-Last-Modified",xge="x-amz-fwd-header-accept-ranges",Rge="x-amz-fwd-header-x-amz-checksum-crc32",Uge="x-amz-fwd-header-x-amz-checksum-crc32c",kge="x-amz-fwd-header-x-amz-checksum-crc64nvme",Fge="x-amz-fwd-header-x-amz-checksum-md5",Pge="x-amz-fwd-header-x-amz-checksum-sha1",Oge="x-amz-fwd-header-x-amz-checksum-sha256",Qge="x-amz-fwd-header-x-amz-checksum-sha512",Dge="x-amz-fwd-header-x-amz-checksum-xxhash64",Lge="x-amz-fwd-header-x-amz-checksum-xxhash3",Mge="x-amz-fwd-header-x-amz-checksum-xxhash128",Nge="x-amz-fwd-header-x-amz-delete-marker",Hge="x-amz-fwd-header-x-amz-expiration",$ge="x-amz-fwd-header-x-amz-missing-meta",Vge="x-amz-fwd-header-x-amz-mp-parts-count",Kge="x-amz-fwd-header-x-amz-object-lock-legal-hold",jge="x-amz-fwd-header-x-amz-object-lock-mode",Gge="x-amz-fwd-header-x-amz-object-lock-retain-until-date",zge="x-amz-fwd-header-x-amz-restore",qge="x-amz-fwd-header-x-amz-request-charged",Wge="x-amz-fwd-header-x-amz-replication-status",Jge="x-amz-fwd-header-x-amz-storage-class",Xge="x-amz-fwd-header-x-amz-server-side-encryption",Yge="x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id",Zge="x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled",eme="x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm",tme="x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5",rme="x-amz-fwd-header-x-amz-tagging-count",nme="x-amz-fwd-header-x-amz-version-id",sme="x-amz-fwd-status",sa="x-amz-grant-full-control",Aa="x-amz-grant-read",ia="x-amz-grant-read-acp",b0="x-amz-grant-write",oa="x-amz-grant-write-acp",Ame="x-amz-if-match-initiated-time",ime="x-amz-if-match-last-modified-time",ome="x-amz-if-match-size",aa="x-amz-meta-",v0="x-amz-mfa",ame="x-amz-metadata-directive",Nk="x-amz-missing-meta",cme="x-amz-mp-object-size",ume="x-amz-max-parts",Hk="x-amz-mp-parts-count",lme="x-amz-object-attributes",hme="x-amz-object-annotation-directive",$k="x-amz-object-if-match",du="x-amz-object-lock-legal-hold",fu="x-amz-object-lock-mode",pu="x-amz-object-lock-retain-until-date",dme="x-amz-object-ownership",S0="x-amz-optional-object-attributes",fme="x-amz-object-size",Bf="x-amz-object-version-id",pme="x-amz-part-number-marker",Vk="x-amz-restore",Fe="x-amz-request-charged",gme="x-amz-restore-output-path",_e="x-amz-request-payer",mme="x-amz-request-route",T0="x-amz-replication-status",wme="x-amz-rename-source",yme="x-amz-rename-source-if-match",Bme="x-amz-rename-source-if-modified-since",Cme="x-amz-rename-source-if-none-match",Eme="x-amz-rename-source-if-unmodified-since",_me="x-amz-request-token",gu="x-amz-storage-class",Ue="x-amz-sdk-checksum-algorithm",bme="x-amz-skip-destination-validation",Kk="x-amz-source-expected-bucket-owner",xr="x-amz-server-side-encryption",Gr="x-amz-server-side-encryption-aws-kms-key-id",zr="x-amz-server-side-encryption-bucket-key-enabled",bA="x-amz-server-side-encryption-context",Kt="x-amz-server-side-encryption-customer-algorithm",Fn="x-amz-server-side-encryption-customer-key",jt="x-amz-server-side-encryption-customer-key-MD5",I0="x-amz-tagging",jk="x-amz-tagging-count",vme="x-amz-tagging-directive",x0="x-amz-transition-default-minimum-object-size",hs="x-amz-version-id",Sme="x-amz-write-offset-bytes",mu="x-amz-website-redirect-location",Tme="xsi:type",m="com.amazonaws.s3",Gk=Rs.for(_k);var zk=[-3,_k,"S3ServiceException",0,[],[]];Gk.registerError(zk,je);const et=Rs.for(m);var qk=[-3,m,UAe,{[ut]:ct,[gt]:403},[],[]];et.registerError(qk,ud);var Wk=[-3,m,MAe,{[ut]:ct,[gt]:400},[],[]];et.registerError(Wk,bd);var Jk=[-3,m,jAe,{[ut]:ct,[gt]:400},[],[]];et.registerError(Jk,vd);var Xk=[-3,m,tie,{[ut]:ct,[gt]:409},[],[]];et.registerError(Xk,hd);var Yk=[-3,m,nie,{[ut]:ct,[gt]:409},[],[]];et.registerError(Yk,dd);var Zk=[-3,m,iae,{[ut]:ct,[gt]:400},[],[]];et.registerError(Zk,Bd);var eF=[-3,m,Iue,{[ut]:ct,[gt]:400},[],[]];et.registerError(eF,Id);var tF=[-3,m,pue,{[ut]:ct,[gt]:400},[],[]];et.registerError(tF,Sd);var rF=[-3,m,vue,{[ut]:ct,[gt]:403},[lr,G1],[0,0]];et.registerError(rF,gd);var nF=[-3,m,Tue,{[ut]:ct,[gt]:400},[],[]];et.registerError(nF,yd);var sF=[-3,m,xue,{[ut]:ct,[gt]:400},[],[]];et.registerError(sF,Cd);var AF=[-3,m,Que,{[ut]:ct,[gt]:400},[],[]];et.registerError(AF,Ed);var iF=[-3,m,lhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(iF,md);var oF=[-3,m,hhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(oF,fd);var aF=[-3,m,dhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(aF,pd);var cF=[-3,m,fhe,{[ut]:ct,[gt]:404},[],[]];et.registerError(cF,cd);var uF=[-3,m,che,{[ut]:ct},[],[]];et.registerError(uF,wd);var lF=[-3,m,Bhe,{[ut]:ct,[gt]:403},[],[]];et.registerError(lF,xd);var hF=[-3,m,khe,{[ut]:ct,[gt]:403},[],[]];et.registerError(hF,ld);var dF=[-3,m,hpe,{[ut]:ct,[gt]:400},[],[]];et.registerError(dF,_d);var fF=[-3,m,Spe,{[ut]:ct,[gt]:415},[],[]];et.registerError(fF,Td);const pF=[Gk,et];var gF=[0,m,Py,8,0],Ime=[0,m,ahe,8,0],mF=[0,m,Ufe,8,0],Pn=[0,m,an,8,0],vA=[0,m,Ns,8,0],Zt=[0,m,Ir,8,0],bi=[0,m,xfe,{[bk]:1},42],R0=[3,m,kd,0,[ur],[0]],wF=[3,m,N1,0,[Wie],[1]],yF=[3,m,$Ae,0,[Re],[[0,{[f]:Fe}]]],BF=[3,m,VAe,0,[N,le,CA,Ee,z,Bue],[[0,1],[0,1],[0,{[J]:lu}],[0,{[f]:_e}],[0,{[f]:q}],[6,{[f]:Ame}]],3],CF=[3,m,Rd,0,[ur],[0]],U0=[3,m,mi,0,[Md,Un],[[()=>xf,{[D]:Ud}],()=>ds]],EF=[3,m,D1,0,[Un],[0],1],_F=[3,m,xAe,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],Cf=[3,m,Gc,0,[St,GU,Ms],[0,()=>N4,[()=>uD,0]],2],bF=[3,m,FAe,0,[jU],[()=>vF],1],vF=[3,m,JAe,0,[PR,N,rie,He],[0,0,0,0],2],SF=[3,m,M1,0,[zc,on,_i,We,pe,Au],[0,4,1,0,[64,{[ae]:1}],0],3],TF=[3,m,Fd,0,[Do,yi,rf],[0,()=>ca,0],1],IF=[3,m,z1,0,[Do,g0,No,ou,hf,rf],[0,0,()=>wu,0,0,0],1],xF=[3,m,ZAe,0,[Do,yi,rf],[0,()=>ca,0],1],RF=[3,m,q1,0,[Ly],[[()=>Pme,{[ae]:1}]]],UF=[3,m,N,0,[Ci,wie,Ty,vy],[0,4,0,0]],kF=[3,m,sie,0,[Woe,au],[0,0]],FF=[3,m,Aie,0,[iu],[[()=>oD,{[ae]:1,[D]:ea}]],1],PF=[3,m,Pd,0,[Yy],[[()=>D0,0]]],OF=[3,m,eR,0,[Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr],[0,0,0,0,0,0,0,0,0,0,0]],QF=[3,m,kie,0,[He],[0]],DF=[3,m,Eie,0,[ef],[[()=>Ume,{[ae]:1,[D]:tf}]]],LF=[3,m,Oie,0,[We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Ei],[0,0,0,0,0,0,0,0,0,0,0,1]],MF=[3,m,_ie,{[D]:vie},[Vd,N,le,es,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,ye,Ir,ar,Re],[0,0,0,[0,{[f]:hu}],0,0,0,0,0,0,0,0,0,0,0,0,[0,{[f]:xr}],[0,{[f]:hs}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],NF=[3,m,Sie,0,[N,le,CA,nU,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,rhe,Ee,z,Go,ru,Tt,an,It],[[0,1],[0,1],[0,{[J]:lu}],[()=>DF,{[Be]:1,[D]:tR}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[1,{[f]:cme}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Bi}],[0,{[f]:zo}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}]],3],HF=[3,m,fR,0,[uue,que],[0,0]],$F=[3,m,yie,0,[],[]],VF=[3,m,Rie,0,[rR,es,hR,ye,hr,Tt,It,Ir,Ns,ar,Re],[[()=>jF,16],[0,{[f]:hu}],[0,{[f]:Mk}],[0,{[f]:hs}],[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Fe}]]],KF=[3,m,Uie,0,[N,dR,le,Ro,Uo,pe,ko,Fo,Po,Lo,AR,iR,oR,aR,Rn,Ho,$o,Vo,Ko,Go,ru,qo,Zle,ape,kAe,hr,lr,cu,Tt,an,It,Ir,Ns,ar,cR,Py,uR,Ee,kn,Yo,Zo,Xo,z,TR],[[0,1],[0,{[f]:Uk}],[0,1],[0,{[f]:na}],[0,{[f]:Jc}],[0,{[f]:E0}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[0,{[f]:kk}],[4,{[f]:Fk}],[0,{[f]:Pk}],[4,{[f]:Ok}],[4,{[f]:Rn}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[0,{[f]:Bi}],[0,{[f]:zo}],[128,{[ra]:aa}],[0,{[f]:ame}],[0,{[f]:vme}],[0,{[f]:hme}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Qk}],[()=>gF,{[f]:Dk}],[0,{[f]:Lk}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}],[0,{[f]:Kk}]],3],jF=[3,m,rR,0,[We,on,Tr,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[0,4,0,0,0,0,0,0,0,0,0,0,0]],GF=[3,m,nR,0,[We,on,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[0,4,0,0,0,0,0,0,0,0,0,0]],zF=[3,m,Od,0,[Uy],[[()=>iD,{[ae]:1,[D]:ky}]],1],qF=[3,m,ky,0,[NAe,GAe,jo,OAe,rae,Xle],[[64,{[ae]:1,[D]:KAe}],[64,{[ae]:1,[D]:zAe}],0,[64,{[ae]:1,[D]:QAe}],[64,{[ae]:1,[D]:nae}],1],2],WF=[3,m,xy,0,[Jy,Vd,N,ta],[0,()=>eQ,()=>kF,[()=>Hs,0]]],JF=[3,m,die,0,[N,Zy,Ne,pe,z],[[0,1],[()=>tQ,{[Be]:1,[D]:Zy}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],XF=[3,m,pie,0,[N,r0,Ne,pe,z],[[0,1],[()=>sQ,{[Be]:1,[D]:r0}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],YF=[3,m,gie,0,[Vd,vy],[[0,{[f]:Vd}],[0,{[f]:xk}]]],ZF=[3,m,mie,0,[N,Ro,xy,Ho,$o,Vo,$y,Ko,The,mU,aie],[[0,1],[0,{[f]:na}],[()=>WF,{[Be]:1,[D]:xy}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[2,{[f]:hge}],[0,{[f]:dme}],[0,{[f]:lge}]],1],e2=[3,m,bie,{[D]:_ue},[L1,j1,N,le,CA,hr,Tt,It,Ir,Ns,ar,Re,pe,Tr],[[4,{[f]:Tk}],[0,{[f]:Ik}],[0,{[D]:N}],0,0,[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:Fe}],[0,{[f]:E0}],[0,{[f]:_A}]]],t2=[3,m,Tie,0,[N,le,Ro,Uo,ko,Fo,Po,Lo,Rn,Ho,$o,Vo,Ko,qo,hr,lr,cu,Tt,an,It,Ir,Ns,ar,Ee,kn,Yo,Zo,Xo,z,pe,Tr],[[0,1],[0,1],[0,{[f]:na}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[4,{[f]:Rn}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[128,{[ra]:aa}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}],[0,{[f]:E0}],[0,{[f]:_A}]],2],r2=[3,m,Die,{[D]:Lie},[gR,hr,Ir,Ns,ar],[[()=>U4,{[D]:gR}],[0,{[f]:xr}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}]],1],n2=[3,m,Nie,0,[N,Vfe,hr,Ir,Ns,ar],[[0,1],[0,{[f]:pge}],[0,{[f]:xr}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}]],1],s2=[3,m,Hie,0,[cae,zie,RU,o0,kR,IU,WAe],[0,0,0,0,0,0,2]],A2=[3,m,$ie,0,[sfe,RU,o0,kR,IU],[0,0,0,0,0]],i2=[3,m,yR,0,[oU,Mo,Vpe],[0,1,1]],o2=[3,m,Qy,0,[Mhe,efe],[[()=>Kme,{[ae]:1,[D]:BU}],2],1],a2=[3,m,Yie,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],c2=[3,m,eoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],u2=[3,m,roe,0,[N,z],[[0,1],[0,{[f]:q}]],1],l2=[3,m,ioe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],h2=[3,m,soe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],d2=[3,m,aoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],f2=[3,m,uoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],p2=[3,m,foe,0,[N,z],[[0,1],[0,{[f]:q}]],1],g2=[3,m,loe,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],m2=[3,m,goe,0,[N,z],[[0,1],[0,{[f]:q}]],1],w2=[3,m,woe,0,[N,z],[[0,1],[0,{[f]:q}]],1],y2=[3,m,Boe,0,[N,z],[[0,1],[0,{[f]:q}]],1],B2=[3,m,yoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],C2=[3,m,_oe,0,[N,z],[[0,1],[0,{[f]:q}]],1],E2=[3,m,voe,0,[N,z],[[0,1],[0,{[f]:q}]],1],_2=[3,m,Foe,0,[le,ye,wi,koe],[0,0,2,0]],b2=[3,m,Uoe,0,[Un,le,ye,NR,on],[()=>ds,0,0,2,4]],v2=[3,m,mR,0,[ur],[0]],S2=[3,m,Ooe,0,[Wd,Re],[[0,{[f]:Bf}],[0,{[f]:Fe}]]],T2=[3,m,Qoe,0,[N,le,zc,ye,Ee,z,pU],[[0,1],[0,1],[0,{[J]:w0}],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:$k}]],3],I2=[3,m,Doe,0,[wi,ye,Re],[[2,{[f]:yf}],[0,{[f]:hs}],[0,{[f]:Fe}]]],x2=[3,m,Moe,0,[N,le,e0,ye,Ee,Sy,z,Go,Cue,Eue],[[0,1],[0,1],[0,{[f]:v0}],[0,{[J]:xt}],[0,{[f]:_e}],[2,{[f]:C0}],[0,{[f]:q}],[0,{[f]:Bi}],[6,{[f]:ime}],[1,{[f]:ome}]],2],R2=[3,m,Loe,{[D]:Joe},[Xoe,Re,RR],[[()=>kme,{[ae]:1}],[0,{[f]:Fe}],[()=>Ome,{[ae]:1,[D]:No}]]],U2=[3,m,Noe,0,[N,Qy,e0,Ee,Sy,z,pe],[[0,1],[()=>o2,{[Be]:1,[D]:Qy}],[0,{[f]:v0}],[0,{[f]:_e}],[2,{[f]:C0}],[0,{[f]:q}],[0,{[f]:Ue}]],2],k2=[3,m,$oe,0,[ye],[[0,{[f]:hs}]]],F2=[3,m,Voe,0,[N,le,ye,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:q}]],2],P2=[3,m,qoe,0,[N,z],[[0,1],[0,{[f]:q}]],1],O2=[3,m,Dd,0,[N,IAe,lr,D1,yi,HU,iU],[0,0,0,()=>EF,()=>L2,()=>f4,()=>iQ],1],Q2=[3,m,BR,0,[Ape,d0,Ak],[0,0,0]],D2=[3,m,My,0,[Ly,Gue,Kue],[0,[()=>Zt,0],0],1],L2=[3,m,yi,0,[afe],[0]],M2=[3,m,tae,0,[],[]],N2=[3,m,No,0,[le,ye,Gie,Ahe],[0,0,0,0]],wu=[3,m,eae,0,[bR,vR],[0,0]],k0=[3,m,Dy,0,[le],[0],1],H2=[3,m,_R,0,[],[]],$2=[3,m,SR,0,[ur],[0],1],V2=[3,m,FR,0,[Ci,m0],[0,0]],K2=[3,m,Eae,0,[kd],[[()=>R0,16]]],j2=[3,m,bae,0,[N,z],[[0,1],[0,{[f]:q}]],1],G2=[3,m,mae,{[D]:Rd},[ur,Re],[0,[0,{[f]:Fe}]]],z2=[3,m,yae,0,[N,z,Ee],[[0,1],[0,{[f]:q}],[0,{[f]:_e}]],1],q2=[3,m,_ae,{[D]:mi},[Un,Md],[()=>ds,[()=>xf,{[D]:Ud}]]],W2=[3,m,vae,0,[N,z],[[0,1],[0,{[f]:q}]],1],J2=[3,m,wae,0,[Gc],[[()=>Cf,16]]],X2=[3,m,Bae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],Y2=[3,m,Iae,{[D]:Od},[Uy],[[()=>iD,{[ae]:1,[D]:ky}]]],Z2=[3,m,xae,0,[N,z],[[0,1],[0,{[f]:q}]],1],eP=[3,m,Uae,0,[lf],[[()=>W0,16]]],tP=[3,m,kae,0,[N,z],[[0,1],[0,{[f]:q}]],1],rP=[3,m,Dae,0,[nu],[[()=>Ef,16]]],nP=[3,m,Lae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],sP=[3,m,Pae,0,[tu],[[()=>_f,16]]],AP=[3,m,Oae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],iP=[3,m,Hae,{[D]:Xy},[iu,p0],[[()=>oD,{[ae]:1,[D]:ea}],[0,{[f]:x0}]]],oP=[3,m,$ae,0,[N,z],[[0,1],[0,{[f]:q}]],1],aP=[3,m,Vae,{[D]:Jy},[Jy],[0]],cP=[3,m,jae,0,[N,z],[[0,1],[0,{[f]:q}]],1],uP=[3,m,Kae,{[D]:Pd},[Yy],[[()=>D0,0]]],lP=[3,m,Gae,0,[N,z],[[0,1],[0,{[f]:q}]],1],hP=[3,m,Wae,0,[OR],[[()=>fP,16]]],dP=[3,m,Xae,0,[N,z],[[0,1],[0,{[f]:q}]],1],fP=[3,m,OR,0,[YR],[()=>rQ],1],pP=[3,m,tce,0,[QR],[[()=>mP,16]]],gP=[3,m,rce,0,[N,z],[[0,1],[0,{[f]:q}]],1],mP=[3,m,QR,0,[rU,ur,No],[()=>AQ,0,()=>wu],2],wP=[3,m,Jae,0,[su],[[()=>bf,16]]],yP=[3,m,Yae,0,[N,St,z],[[0,1],[0,{[J]:un}],[0,{[f]:q}]],2],BP=[3,m,sce,0,[N,z],[[0,1],[0,{[f]:q}]],1],CP=[3,m,ice,0,[zd],[[()=>V0,16]]],EP=[3,m,oce,0,[N,z],[[0,1],[0,{[f]:q}]],1],_P=[3,m,cce,0,[vU],[[0,16]]],bP=[3,m,uce,0,[N,z],[[0,1],[0,{[f]:q}]],1],vP=[3,m,hce,0,[CU],[[()=>CQ,16]]],SP=[3,m,dce,0,[N,z],[[0,1],[0,{[f]:q}]],1],TP=[3,m,pce,0,[nf],[[()=>G0,16]]],IP=[3,m,yce,0,[N,z],[[0,1],[0,{[f]:q}]],1],xP=[3,m,mce,{[D]:Af},[EU],[0]],RP=[3,m,wce,0,[N,z],[[0,1],[0,{[f]:q}]],1],UP=[3,m,Cce,{[D]:kn},[df],[[()=>Hs,0]],1],kP=[3,m,Ece,0,[N,z],[[0,1],[0,{[f]:q}]],1],FP=[3,m,bce,{[D]:ff},[ur,tU],[0,[0,{[D]:ZR}]]],PP=[3,m,vce,0,[N,z],[[0,1],[0,{[f]:q}]],1],OP=[3,m,Tce,{[D]:pf},[i0,jy,Dy,a0],[()=>j0,()=>P0,()=>k0,[()=>cD,0]]],QP=[3,m,Ice,0,[N,z],[[0,1],[0,{[f]:q}]],1],DP=[3,m,Uce,{[D]:mi},[Un,Md,Re],[()=>ds,[()=>xf,{[D]:Ud}],[0,{[f]:Fe}]]],LP=[3,m,Oce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],MP=[3,m,kce,0,[$1,Wd,on,Qo,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,Re,Au],[[()=>bi,16],[0,{[f]:Bf}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:Fe}],[0,{[f]:T0}]]],NP=[3,m,Qce,0,[N,le,zc,ye,Ee,z,Ry],[[0,1],[0,1],[0,{[J]:w0}],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:_0}]],3],HP=[3,m,Fce,{[D]:Dce},[wi,on,ye,Re,We,eR,Fhe,lr,Ohe],[[2,{[f]:yf}],[4,{[f]:jd}],[0,{[f]:hs}],[0,{[f]:Fe}],0,()=>OF,[()=>$P,0],0,1]],$P=[3,m,Pce,0,[fpe,Yd,lU,Gd,ts,ef],[[1,{[D]:Xd}],0,0,1,2,[()=>qme,{[ae]:1,[D]:tf}]]],VP=[3,m,Lce,0,[N,le,yhe,ye,Gd,Yd,Tt,an,It,Ee,z],[[0,1],[0,1],[64,{[f]:lme}],[0,{[J]:xt}],[1,{[f]:ume}],[0,{[f]:pme}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[0,{[f]:q}]],3],KP=[3,m,jce,0,[Kd],[[()=>N0,{[Be]:1,[D]:Kd}]]],jP=[3,m,Gce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],GP=[3,m,$ce,0,[qd],[[()=>M0,16]]],zP=[3,m,Vce,0,[N,z],[[0,1],[0,{[f]:q}]],1],qP=[3,m,zce,0,[Wc,wi,by,es,l0,on,Qo,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,t0,ye,Uo,ko,Fo,Po,Fy,Lo,Rn,Ld,cu,hr,qo,Tt,It,Ir,ar,lr,Re,Au,Xd,f0,Yo,Zo,Xo],[[()=>bi,16],[2,{[f]:yf}],[0,{[f]:fk}],[0,{[f]:hu}],[0,{[f]:Vk}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[1,{[f]:Nk}],[0,{[f]:hs}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:sR}],[0,{[f]:eu}],[4,{[f]:Rn}],[0,{[f]:Ld}],[0,{[f]:mu}],[0,{[f]:xr}],[128,{[ra]:aa}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:gu}],[0,{[f]:Fe}],[0,{[f]:T0}],[1,{[f]:Hk}],[1,{[f]:jk}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}]]],WP=[3,m,qce,0,[N,le,Go,HR,ru,GR,of,UU,kU,FU,PU,OU,QU,ye,Tt,an,It,Ee,Ei,z,Ry],[[0,1],[0,1],[0,{[f]:Bi}],[4,{[f]:Gy}],[0,{[f]:zo}],[4,{[f]:qy}],[0,{[f]:of}],[0,{[J]:mk}],[0,{[J]:wk}],[0,{[J]:yk}],[0,{[J]:Bk}],[0,{[J]:Ck}],[6,{[J]:Ek}],[0,{[J]:xt}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[1,{[J]:wf}],[0,{[f]:q}],[0,{[f]:_0}]],2],JP=[3,m,Wce,0,[af],[[()=>H0,{[Be]:1,[D]:af}]]],XP=[3,m,Jce,0,[N,le,ye,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}]],2],YP=[3,m,Zce,{[D]:kn},[df,ye],[[()=>Hs,0],[0,{[f]:hs}]],1],ZP=[3,m,tue,0,[N,le,ye,z,Ee],[[0,1],[0,1],[0,{[J]:xt}],[0,{[f]:q}],[0,{[f]:_e}]],2],eO=[3,m,eue,0,[Wc,Re],[[()=>bi,16],[0,{[f]:Fe}]]],tO=[3,m,rue,0,[N,le,Ee,z],[[0,1],[0,1],[0,{[f]:_e}],[0,{[f]:q}]],2],rO=[3,m,Aue,0,[Jd],[[()=>K0,16]]],nO=[3,m,iue,0,[N,z],[[0,1],[0,{[f]:q}]],1],sO=[3,m,DR,0,[ok],[0],1],AO=[3,m,Vy,0,[Ky,bU],[[()=>F0,{[Sk]:[vk,pk]}],0]],F0=[3,m,Ky,0,[au,Oy,Zoe,jo,Qpe],[[0,{[ige]:1,[D]:Tme}],0,0,0,0],1],iO=[3,m,aue,0,[vy,oie,iie,Ty,qAe],[[0,{[f]:xk}],[0,{[f]:uge}],[0,{[f]:cge}],[0,{[f]:dge}],[2,{[f]:oge}]]],oO=[3,m,cue,0,[N,z],[[0,1],[0,{[f]:q}]],1],aO=[3,m,hue,0,[wi,by,es,l0,YAe,on,Qo,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,We,t0,ye,Uo,ko,Fo,Po,Lo,Fy,Rn,Ld,cu,hr,qo,Tt,It,Ir,ar,lr,Re,Au,Xd,f0,Yo,Zo,Xo],[[2,{[f]:yf}],[0,{[f]:fk}],[0,{[f]:hu}],[0,{[f]:Vk}],[0,{[f]:age}],[4,{[f]:jd}],[1,{[f]:Oo}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:We}],[1,{[f]:Nk}],[0,{[f]:hs}],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[0,{[f]:eu}],[0,{[f]:sR}],[4,{[f]:Rn}],[0,{[f]:Ld}],[0,{[f]:mu}],[0,{[f]:xr}],[128,{[ra]:aa}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:gu}],[0,{[f]:Fe}],[0,{[f]:T0}],[1,{[f]:Hk}],[1,{[f]:jk}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}]]],cO=[3,m,due,0,[N,le,Go,HR,ru,GR,of,UU,kU,FU,PU,OU,QU,ye,Tt,an,It,Ee,Ei,z,Ry],[[0,1],[0,1],[0,{[f]:Bi}],[4,{[f]:Gy}],[0,{[f]:zo}],[4,{[f]:qy}],[0,{[f]:of}],[0,{[J]:mk}],[0,{[J]:wk}],[0,{[J]:yk}],[0,{[J]:Bk}],[0,{[J]:Ck}],[6,{[J]:Ek}],[0,{[J]:xt}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[1,{[J]:wf}],[0,{[f]:q}],[0,{[f]:_0}]],2],P0=[3,m,jy,0,[rpe],[0],1],O0=[3,m,Wy,0,[jo,Oy],[0,0]],Q0=[3,m,zy,0,[lR,jie,zR,Yde],[()=>s2,0,()=>_O,()=>wQ]],uO=[3,m,Fue,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],Ef=[3,m,nu,0,[St,ur,ppe,Ms],[0,0,[()=>Zme,{[ae]:1,[D]:ak}],[()=>lO,0]],3],lO=[3,m,Oue,0,[He,cn,qc],[0,()=>vi,[()=>uO,0]]],_f=[3,m,tu,0,[Dd,mue,St,Sue,epe,Ms,_he],[[()=>hO,0],2,0,0,()=>gO,()=>fO,[()=>Mme,0]],5],hO=[3,m,gue,0,[jU],[[()=>pO,0]],1],dO=[3,m,wue,0,[YU,h0],[[()=>D4,{[D]:JU}],[()=>P4,{[D]:cf}]]],fO=[3,m,yue,0,[He],[0],1],pO=[3,m,Uue,0,[N,PR,DAe,He,My],[0,0,0,0,[()=>dO,0]],2],gO=[3,m,kue,0,[fae],[0],1],mO=[3,m,Nd,0,[Do,yi],[0,()=>ca],1],wO=[3,m,jR,0,[Do,g0,No,ou,hf],[0,0,()=>wu,0,0],1],yO=[3,m,Pue,0,[Do,yi],[0,()=>ca],1],BO=[3,m,Hd,0,[sf,yi],[()=>Sf,()=>ca],1],CO=[3,m,qR,0,[g0,ou,sf,No,hf],[0,0,()=>Sf,()=>wu,0],3],EO=[3,m,Nue,0,[sf],[()=>Sf],1],_O=[3,m,Lue,0,[au],[0]],bO=[3,m,Mue,0,[o0],[0]],vO=[3,m,wle,0,[mle,Ny,St,Ms],[[0,{[D]:Bie}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],SO=[3,m,gle,0,[CR,Mo,sae],[5,1,2]],TO=[3,m,jle,0,[ur,es,jo,He,Ms,wpe,mhe,hU,N1],[0,()=>SO,0,0,[()=>xO,0],[()=>twe,{[ae]:1,[D]:uk}],[()=>Vme,{[ae]:1,[D]:dU}],()=>cQ,()=>wF],1],IO=[3,m,Gle,0,[He,ta,wU,yU],[0,[()=>Hs,{[ae]:1,[D]:cn}],1,1]],xO=[3,m,zle,0,[He,cn,wU,yU,qc],[0,()=>vi,1,1,[()=>IO,0]]],RO=[3,m,Zue,{[D]:ele},[ts,cr,Jo,Q1],[2,0,0,[()=>xme,{[ae]:1,[D]:Gc}]]],UO=[3,m,tle,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],kO=[3,m,ile,0,[ts,cr,Jo,KR],[2,0,0,[()=>Dme,{[ae]:1,[D]:nu}]]],FO=[3,m,ole,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],PO=[3,m,nle,{[D]:Ele},[cr,MR,ts,Jo],[0,[()=>Lme,{[ae]:1,[D]:tu}],2,0]],OO=[3,m,sle,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],QO=[3,m,cle,{[D]:_le},[ts,cr,Jo,XR],[2,0,0,[()=>Hme,{[ae]:1,[D]:su}]]],DO=[3,m,ule,0,[N,cr,z],[[0,1],[0,{[J]:EA}],[0,{[f]:q}]],1],LO=[3,m,lle,{[D]:Wue},[Iy,Un,cr,He],[[()=>AD,0],()=>ds,0,0]],MO=[3,m,hle,0,[Yle,cr,He,Ty],[[1,{[J]:Ype}],[0,{[J]:EA}],[0,{[J]:uu}],[0,{[J]:jpe}]]],NO=[3,m,fle,{[D]:Jue},[Iy,cr],[[()=>AD,0],0]],HO=[3,m,ple,0,[cr,ehe],[[0,{[J]:EA}],[1,{[J]:Zpe}]]],$O=[3,m,Sle,{[D]:Tle},[N,$d,lk,cU,He,yA,phe,sU,ts,ype,Qd,BA,Re],[0,0,0,0,0,0,0,1,2,[()=>$me,{[ae]:1,[D]:Dpe}],[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],VO=[3,m,Ile,0,[N,yA,BA,$d,sU,He,lk,z,Ee],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:gk}],[1,{[J]:tge}],[0,{[J]:uu}],[0,{[J]:sge}],[0,{[f]:q}],[0,{[f]:_e}]],1],KO=[3,m,Ule,0,[eie,N,le,Wd,K1,JR,RAe,cr,Jo,Re],[[()=>Rme,0],0,0,[0,{[f]:Bf}],0,1,1,0,0,[0,{[f]:Fe}]]],jO=[3,m,kle,0,[N,le,ye,JR,K1,cr,Ee,z],[[0,1],[0,1],[0,{[J]:xt}],[1,{[J]:Xpe}],[0,{[J]:Kpe}],[0,{[J]:EA}],[0,{[f]:_e}],[0,{[f]:q}]],2],GO=[3,m,Fle,{[D]:WR},[ts,AU,uhe,pR,Ci,He,yA,Wo,Qd,BA,Re],[2,0,0,[()=>aD,{[ae]:1}],0,0,0,1,[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],zO=[3,m,Ple,0,[N,yA,BA,AU,Wo,He,Ee,z,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:Jpe}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[f]:_e}],[0,{[f]:q}],[64,{[f]:S0}]],1],qO=[3,m,Qle,{[D]:WR},[ts,pR,Ci,He,yA,Wo,Qd,BA,Hue,cr,Jo,VU,Re],[2,[()=>aD,{[ae]:1}],0,0,0,1,[()=>If,{[ae]:1}],0,1,0,0,0,[0,{[f]:Fe}]]],WO=[3,m,Lle,0,[N,yA,BA,Wo,He,cr,uae,VU,Ee,z,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[J]:EA}],[2,{[J]:zpe}],[0,{[J]:nge}],[0,{[f]:_e}],[0,{[f]:q}],[64,{[f]:S0}]],1],JO=[3,m,Dle,{[D]:Wle},[ts,$d,dk,cU,ghe,Lpe,wR,Ci,He,yA,Wo,Qd,BA,Re],[2,0,0,0,0,[()=>jme,{[ae]:1,[D]:Mpe}],[()=>Fme,{[ae]:1,[D]:wi}],0,0,0,1,[()=>If,{[ae]:1}],0,[0,{[f]:Fe}]]],XO=[3,m,Mle,0,[N,yA,BA,$d,Wo,He,dk,z,Ee,s0],[[0,1],[0,{[J]:gf}],[0,{[J]:mf}],[0,{[J]:gk}],[1,{[J]:B0}],[0,{[J]:uu}],[0,{[J]:Age}],[0,{[f]:q}],[0,{[f]:_e}],[64,{[f]:S0}]],1],YO=[3,m,$le,{[D]:Vle},[L1,j1,N,le,CA,Yd,lU,Gd,ts,ef,Wy,Un,lr,Re,pe,Tr],[[4,{[f]:Tk}],[0,{[f]:Ik}],0,0,0,0,0,1,2,[()=>zme,{[ae]:1,[D]:tf}],()=>O0,()=>ds,0,[0,{[f]:Fe}],0,0]],ZO=[3,m,Kle,0,[N,le,CA,Gd,Yd,Ee,z,Tt,an,It],[[0,1],[0,1],[0,{[J]:lu}],[1,{[J]:ege}],[0,{[J]:rge}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}]],3],eQ=[3,m,Cle,0,[au,Ci],[0,0]],D0=[3,m,Yy,0,[spe,dpe,sk,ik],[0,0,[()=>Yme,0],[()=>V4,0]],2],tQ=[3,m,Zy,0,[Hd,Nd,Fd],[()=>BO,()=>mO,()=>TF],1],rQ=[3,m,YR,0,[BR,qR,jR,z1],[()=>Q2,()=>CO,()=>wO,()=>IF],1],nQ=[3,m,eU,0,[Ci,m0],[0,0]],sQ=[3,m,r0,0,[ek],[()=>_4],1],AQ=[3,m,rU,0,[tk],[()=>b4],1],ca=[3,m,nhe,0,[Ife,Vue],[0,0],1],iQ=[3,m,iU,0,[ur,oae],[0,()=>z0],1],oQ=[3,m,Jle,0,[He,ta,V1],[0,[()=>Hs,{[ae]:1,[D]:cn}],0]],bf=[3,m,su,0,[St,Ms],[0,[()=>lD,0]],1],aQ=[3,m,nU,0,[CA,le,Due,lr,Un,Wy,pe,Tr],[0,0,4,0,()=>ds,()=>O0,0,0]],cQ=[3,m,hU,0,[aU,uU],[1,1]],uQ=[3,m,dU,0,[aU,lr,uU],[1,0,1]],L0=[3,m,n0,0,[ope,nfe,Ble,_R],[[()=>ewe,{[ae]:1,[D]:nk}],[()=>Wme,{[ae]:1,[D]:xU}],[()=>Nme,{[ae]:1,[D]:Cie}],()=>H2]],vf=[3,m,ohe,0,[le],[[()=>C4,{[D]:Hfe}]]],lQ=[3,m,BU,0,[le,on,We,pe,Tr,_i,lr,Un,u0],[0,4,0,[64,{[ae]:1}],0,1,0,()=>ds,()=>q0]],hQ=[3,m,bhe,0,[le,ye,We,ble,_i],[0,0,0,6,1],1],M0=[3,m,qd,0,[She,ea],[0,()=>dQ]],N0=[3,m,Ihe,0,[ur],[0]],H0=[3,m,xhe,0,[oU,Sfe],[0,5]],dQ=[3,m,Rhe,0,[yR],[()=>i2]],fQ=[3,m,Phe,0,[Ei,_i,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[1,1,0,0,0,0,0,0,0,0,0,0]],pQ=[3,m,Dhe,0,[We,pe,Tr,_i,lr,le,ye,NR,on,Un,u0],[0,[64,{[ae]:1}],0,1,0,0,0,2,4,()=>ds,()=>q0]],gQ=[3,m,gU,0,[Zfe],[[()=>E4,0]]],$0=[3,m,A0,0,[lR,zR],[()=>A2,()=>bO]],ds=[3,m,Un,0,[Oy,jo],[0,0]],V0=[3,m,zd,0,[iu],[[()=>Gme,{[ae]:1,[D]:ea}]],1],mQ=[3,m,Che,0,[mU],[0],1],wQ=[3,m,Tde,0,[],[]],yQ=[3,m,tf,0,[Ei,on,We,_i,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt],[1,4,0,1,0,0,0,0,0,0,0,0,0,0]],BQ=[3,m,Zd,{[D]:Zd},[vde],[0]],CQ=[3,m,CU,0,[VR],[[2,{[D]:VR}]]],EQ=[3,m,SU,0,[Z1,W1,Y1],[1,1,1]],_Q=[3,m,Sde,0,[ER],[[()=>EQ,{[y0]:1}]]],K0=[3,m,Jd,0,[J1,$R,X1,LU],[[2,{[D]:J1}],[2,{[D]:$R}],[2,{[D]:X1}],[2,{[D]:LU}]]],bQ=[3,m,jhe,0,[N,kd,Ne,pe,z],[[0,1],[()=>R0,{[Be]:1,[D]:kd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],vQ=[3,m,$he,0,[N,Rd,z,pe],[[0,1],[()=>CF,{[Be]:1,[D]:Rd}],[0,{[f]:q}],[0,{[f]:Ue}]],2],SQ=[3,m,Ghe,0,[N,Ro,mi,Ne,pe,Ho,$o,Vo,$y,Ko,z],[[0,1],[0,{[f]:na}],[()=>U0,{[Be]:1,[D]:mi}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[0,{[f]:q}]],1],TQ=[3,m,Vhe,0,[N,St,Gc,z],[[0,1],[0,{[J]:un}],[()=>Cf,{[Be]:1,[D]:Gc}],[0,{[f]:q}]],3],IQ=[3,m,Whe,0,[N,Od,Ne,pe,z],[[0,1],[()=>zF,{[Be]:1,[D]:Od}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],xQ=[3,m,Xhe,0,[N,lf,Ne,pe,z],[[0,1],[()=>W0,{[Be]:1,[D]:lf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],RQ=[3,m,tde,0,[N,St,nu,z],[[0,1],[0,{[J]:un}],[()=>Ef,{[Be]:1,[D]:nu}],[0,{[f]:q}]],3],UQ=[3,m,Zhe,0,[N,St,tu,z],[[0,1],[0,{[J]:un}],[()=>_f,{[Be]:1,[D]:tu}],[0,{[f]:q}]],3],kQ=[3,m,sde,0,[p0],[[0,{[f]:x0}]]],FQ=[3,m,Ade,0,[N,pe,Xy,z,p0],[[0,1],[0,{[f]:Ue}],[()=>FF,{[Be]:1,[D]:Xy}],[0,{[f]:q}],[0,{[f]:x0}]],1],PQ=[3,m,ide,0,[N,Pd,Ne,pe,z],[[0,1],[()=>PF,{[Be]:1,[D]:Pd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],OQ=[3,m,ade,0,[N,St,su,z],[[0,1],[0,{[J]:un}],[()=>bf,{[Be]:1,[D]:su}],[0,{[f]:q}]],3],QQ=[3,m,ude,0,[N,n0,z,Pfe],[[0,1],[()=>L0,{[Be]:1,[D]:n0}],[0,{[f]:q}],[2,{[f]:bme}]],2],DQ=[3,m,hde,0,[N,zd,Ne,z,pe],[[0,1],[()=>V0,{[Be]:1,[D]:zd}],[0,{[f]:Me}],[0,{[f]:q}],[0,{[f]:Ue}]],2],LQ=[3,m,fde,0,[N,vU,Ne,pe,Qie,z],[[0,1],[0,16],[0,{[f]:Me}],[0,{[f]:Ue}],[2,{[f]:fge}],[0,{[f]:q}]],2],MQ=[3,m,wde,0,[N,nf,Ne,pe,ck,z],[[0,1],[()=>G0,{[Be]:1,[D]:nf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:Rk}],[0,{[f]:q}]],2],NQ=[3,m,mde,0,[N,Af,Ne,pe,z],[[0,1],[()=>p4,{[Be]:1,[D]:Af}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],HQ=[3,m,Bde,0,[N,kn,Ne,pe,z],[[0,1],[()=>Tf,{[Be]:1,[D]:kn}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],$Q=[3,m,Ede,0,[N,ff,Ne,pe,e0,z],[[0,1],[()=>rD,{[Be]:1,[D]:ff}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:v0}],[0,{[f]:q}]],2],VQ=[3,m,bde,0,[N,pf,Ne,pe,z],[[0,1],[()=>nD,{[Be]:1,[D]:pf}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],KQ=[3,m,Ude,0,[Re],[[0,{[f]:Fe}]]],jQ=[3,m,Fde,0,[N,le,Ro,mi,Ne,pe,Ho,$o,Vo,$y,Ko,Ee,ye,z],[[0,1],[0,1],[0,{[f]:na}],[()=>U0,{[Be]:1,[D]:mi}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:b0}],[0,{[f]:oa}],[0,{[f]:_e}],[0,{[J]:xt}],[0,{[f]:q}]],2],GQ=[3,m,kde,0,[le,zc,Wd,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,Re],[0,0,[0,{[f]:Bf}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:Fe}]]],zQ=[3,m,Pde,0,[N,le,zc,$1,ye,pU,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Ne,Ee,z],[[0,1],[0,1],[0,{[J]:w0}],[()=>bi,16],[0,{[J]:xt}],[0,{[f]:$k}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Me}],[0,{[f]:_e}],[0,{[f]:q}]],4],qQ=[3,m,Nde,0,[Re],[[0,{[f]:Fe}]]],WQ=[3,m,Hde,0,[N,le,Kd,Ee,ye,Ne,pe,z],[[0,1],[0,1],[()=>N0,{[Be]:1,[D]:Kd}],[0,{[f]:_e}],[0,{[J]:xt}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],JQ=[3,m,Dde,0,[Re],[[0,{[f]:Fe}]]],XQ=[3,m,Lde,0,[N,qd,Ee,ck,Ne,pe,z],[[0,1],[()=>M0,{[Be]:1,[D]:qd}],[0,{[f]:_e}],[0,{[f]:Rk}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],1],YQ=[3,m,$de,0,[es,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tr,hr,ye,Tt,It,Ir,Ns,ar,_i,Re],[[0,{[f]:hu}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:_A}],[0,{[f]:xr}],[0,{[f]:hs}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[1,{[f]:fme}],[0,{[f]:Fe}]]],ZQ=[3,m,Vde,0,[N,le,Ro,Wc,Uo,ko,Fo,Po,Qo,Ne,Lo,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Rn,Go,ru,Ho,$o,Vo,Ko,$pe,qo,hr,lr,cu,Tt,an,It,Ir,Ns,ar,Ee,kn,Yo,Zo,Xo,z],[[0,1],[0,1],[0,{[f]:na}],[()=>bi,16],[0,{[f]:Jc}],[0,{[f]:Xc}],[0,{[f]:Yc}],[0,{[f]:Zc}],[1,{[f]:Oo}],[0,{[f]:Me}],[0,{[f]:eu}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[4,{[f]:Rn}],[0,{[f]:Bi}],[0,{[f]:zo}],[0,{[f]:sa}],[0,{[f]:Aa}],[0,{[f]:ia}],[0,{[f]:oa}],[1,{[f]:Sme}],[128,{[ra]:aa}],[0,{[f]:xr}],[0,{[f]:gu}],[0,{[f]:mu}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[()=>vA,{[f]:bA}],[2,{[f]:zr}],[0,{[f]:_e}],[0,{[f]:I0}],[0,{[f]:fu}],[5,{[f]:pu}],[0,{[f]:du}],[0,{[f]:q}]],2],e4=[3,m,Kde,0,[Re],[[0,{[f]:Fe}]]],t4=[3,m,jde,0,[N,le,af,Ee,ye,Sy,Ne,pe,z],[[0,1],[0,1],[()=>H0,{[Be]:1,[D]:af}],[0,{[f]:_e}],[0,{[J]:xt}],[2,{[f]:C0}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],r4=[3,m,qde,0,[ye],[[0,{[f]:hs}]]],n4=[3,m,Wde,0,[N,le,kn,ye,Ne,pe,z,Ee],[[0,1],[0,1],[()=>Tf,{[Be]:1,[D]:kn}],[0,{[J]:xt}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}],[0,{[f]:_e}]],3],s4=[3,m,Xde,0,[N,Jd,Ne,pe,z],[[0,1],[()=>K0,{[Be]:1,[D]:Jd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],A4=[3,m,xU,0,[tfe,Ny,St,Ms],[[0,{[D]:Afe}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],Sf=[3,m,sf,0,[es,Mo],[0,1],1],i4=[3,m,ofe,0,[_U],[[21,{[y0]:1}]]],o4=[3,m,$U,0,[LR,fue,TU,cfe,ufe],[0,0,0,0,0]],j0=[3,m,i0,0,[LR,TU],[0,0],1],a4=[3,m,hfe,0,[],[]],c4=[3,m,pfe,0,[N,le,_fe,Toe,xoe,Ioe,Roe,Qfe,Lfe,Dfe,Mfe,Kie],[[0,1],[0,1],[0,{[f]:wme}],[0,{[f]:Bi}],[0,{[f]:zo}],[4,{[f]:Gy}],[4,{[f]:qy}],[0,{[f]:yme}],[0,{[f]:Cme}],[6,{[f]:Bme}],[6,{[f]:Eme}],[0,{[f]:mge,[Wpe]:1}]],3],u4=[3,m,DU,0,[ur],[0],1],G0=[3,m,nf,0,[rf,iu],[0,[()=>Jme,{[ae]:1,[D]:ea}]],2],l4=[3,m,Bfe,0,[ur,Dd,jo,Zde,He,Ms,XU,SR,mR],[0,()=>O2,0,1,0,[()=>d4,0],()=>F4,()=>$2,()=>v2],2],h4=[3,m,wfe,0,[He,ta],[0,[()=>Hs,{[ae]:1,[D]:cn}]]],d4=[3,m,yfe,0,[He,cn,qc],[0,()=>vi,[()=>h4,0]]],f4=[3,m,HU,0,[ur,gpe],[0,()=>z0],2],z0=[3,m,bfe,0,[ihe],[1]],p4=[3,m,Af,0,[EU],[0],1],g4=[3,m,MU,0,[aae],[2]],m4=[3,m,dfe,0,[Re,ffe],[[0,{[f]:Fe}],[0,{[f]:gme}]]],w4=[3,m,gfe,0,[N,le,ye,c0,Ee,pe,z],[[0,1],[0,1],[0,{[J]:xt}],[()=>y4,{[Be]:1,[D]:c0}],[0,{[f]:_e}],[0,{[f]:Ue}],[0,{[f]:q}]],2],y4=[3,m,c0,0,[Mo,DR,au,ok,Yoe,qU,gU],[1,()=>sO,0,0,0,()=>I4,[()=>gQ,0]]],q0=[3,m,u0,0,[Rue,ife],[2,4]],B4=[3,m,NU,0,[$U,fR],[()=>o4,()=>HF],1],C4=[3,m,Nfe,0,[hae],[[()=>Qme,{[ae]:1,[D]:FR}]]],E4=[3,m,$fe,0,[cie,He,My,uie,Ud,kn,hk,lr],[0,0,[()=>D2,0],0,[()=>xf,0],[()=>Tf,0],[()=>rwe,0],0],2],_4=[3,m,ek,0,[d0,ou],[0,0],2],b4=[3,m,tk,0,[d0,ou,hf,Ak],[0,0,0,0],4],v4=[3,m,WU,0,[tpe,xR],[1,1]],S4=[3,m,Gfe,0,[_U],[[()=>dD,16]]],T4=[3,m,zfe,0,[N,le,UR,IR,zy,A0,Tt,an,It,MU,WU,z],[[0,1],[0,1],0,0,()=>Q0,()=>$0,[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],()=>g4,()=>v4,[0,{[f]:q}]],6],I4=[3,m,qU,0,[zy,IR,UR,A0],[()=>Q0,0,0,()=>$0],4],x4=[3,m,Wfe,0,[qfe,zue],[0,[()=>Zt,0]],1],W0=[3,m,lf,0,[iu],[[()=>Xme,{[ae]:1,[D]:ea}]],1],R4=[3,m,Xfe,0,[XAe,ar,q1],[[()=>x4,0],2,[()=>RF,0]]],U4=[3,m,kfe,0,[H1,KU,ZU,es],[[0,{[D]:H1}],[()=>mF,{[D]:KU}],[()=>mF,{[D]:ZU}],[4,{[D]:es}]],4],k4=[3,m,uf,{[D]:uf},[],[]],F4=[3,m,XU,0,[zU,DU],[()=>O4,()=>u4]],P4=[3,m,h0,{[D]:cf},[$ue],[[()=>Zt,0]],1],O4=[3,m,zU,0,[ur],[0],1],Q4=[3,m,Jfe,{[D]:cf},[jue,ar],[[()=>Ime,0],2],1],D4=[3,m,YU,{[D]:JU},[],[]],L4=[3,m,rk,0,[Z1,W1,Y1],[1,1,1]],M4=[3,m,Ofe,0,[ER],[[()=>L4,{[y0]:1}]]],N4=[3,m,GU,0,[Soe],[()=>H4]],H4=[3,m,Rfe,0,[Qhe,Dd],[0,()=>bF],2],vi=[3,m,cn,0,[le,m0],[0,0],2],Tf=[3,m,kn,0,[df],[[()=>Hs,0]],1],$4=[3,m,cpe,0,[Ky,bU],[[()=>F0,{[Sk]:[vk,pk]}],0]],V4=[3,m,ik,0,[uf,Zd],[[()=>k4,{[D]:uf}],[()=>BQ,{[D]:Zd}]]],K4=[3,m,ak,0,[Mo,G1],[1,0],2],j4=[3,m,nk,0,[npe,Ny,St,Ms],[[0,{[D]:mpe}],[64,{[ae]:1,[D]:Hy}],0,[()=>vf,0]],2],G4=[3,m,uk,0,[CR,Mo,lr],[5,1,0]],z4=[3,m,Cpe,0,[N,Fd,Ne,pe,z],[[0,1],[()=>xF,{[Be]:1,[D]:Fd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],q4=[3,m,_pe,0,[N,Nd,Ne,pe,z],[[0,1],[()=>yO,{[Be]:1,[D]:Nd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],W4=[3,m,vpe,0,[N,Hd,Ne,pe,z],[[0,1],[()=>EO,{[Be]:1,[D]:Hd}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:q}]],2],J4=[3,m,Ipe,0,[N,le,fU,ye,Ee,z,Ne,pe],[[0,1],[0,1],[()=>hD,16],[0,{[J]:xt}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Me}],[0,{[f]:Ue}]],3],X4=[3,m,xpe,0,[Re],[[0,{[f]:Fe}]]],Y4=[3,m,kpe,0,[hR,nR,hr,Tt,It,Ir,ar,Re],[[0,{[f]:Mk}],[()=>GF,16],[0,{[f]:xr}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],Z4=[3,m,Fpe,0,[N,dR,le,Ei,CA,AR,iR,oR,aR,Mie,Tt,an,It,cR,Py,uR,Ee,z,TR],[[0,1],[0,{[f]:Uk}],[0,1],[1,{[J]:wf}],[0,{[J]:lu}],[0,{[f]:kk}],[4,{[f]:Fk}],[0,{[f]:Pk}],[4,{[f]:Ok}],[0,{[f]:gge}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:Qk}],[()=>gF,{[f]:Dk}],[0,{[f]:Lk}],[0,{[f]:_e}],[0,{[f]:q}],[0,{[f]:Kk}]],5],eD=[3,m,Ppe,0,[hr,We,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tt,It,Ir,ar,Re],[[0,{[f]:xr}],[0,{[f]:We}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Kt}],[0,{[f]:jt}],[()=>Zt,{[f]:Gr}],[2,{[f]:zr}],[0,{[f]:Fe}]]],tD=[3,m,Ope,0,[N,le,Ei,CA,Wc,Qo,Ne,pe,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,Tt,an,It,Ee,z],[[0,1],[0,1],[1,{[J]:wf}],[0,{[J]:lu}],[()=>bi,16],[1,{[f]:Oo}],[0,{[f]:Me}],[0,{[f]:Ue}],[0,{[f]:rs}],[0,{[f]:ns}],[0,{[f]:ss}],[0,{[f]:is}],[0,{[f]:os}],[0,{[f]:as}],[0,{[f]:As}],[0,{[f]:cs}],[0,{[f]:us}],[0,{[f]:ls}],[0,{[f]:Kt}],[()=>Pn,{[f]:Fn}],[0,{[f]:jt}],[0,{[f]:_e}],[0,{[f]:q}]],4],rD=[3,m,ff,0,[tU,ur],[[0,{[D]:ZR}],0]],nD=[3,m,pf,0,[Dy,jy,i0,a0],[()=>k0,()=>P0,()=>j0,[()=>cD,0]]],sD=[3,m,Hpe,0,[Efe,vfe,Wc,Ffe,bR,vR,by,Uo,ko,Fo,Po,Qo,Fy,Lo,Pt,Ot,Qt,Lt,Mt,Nt,Dt,Ht,$t,Vt,wi,We,Rn,es,on,t0,qo,Yo,Xo,Zo,Xd,Au,Re,l0,hr,Tt,Ir,It,lr,f0,ye,ar],[[0,{[qpe]:1,[f]:mme}],[0,{[f]:_me}],[()=>bi,16],[1,{[f]:sme}],[0,{[f]:wge}],[0,{[f]:yge}],[0,{[f]:xge}],[0,{[f]:Bge}],[0,{[f]:Cge}],[0,{[f]:Ege}],[0,{[f]:_ge}],[1,{[f]:Oo}],[0,{[f]:bge}],[0,{[f]:vge}],[0,{[f]:Rge}],[0,{[f]:Uge}],[0,{[f]:kge}],[0,{[f]:Pge}],[0,{[f]:Oge}],[0,{[f]:Qge}],[0,{[f]:Fge}],[0,{[f]:Dge}],[0,{[f]:Lge}],[0,{[f]:Mge}],[2,{[f]:Nge}],[0,{[f]:Sge}],[4,{[f]:Tge}],[0,{[f]:Hge}],[4,{[f]:Ige}],[1,{[f]:$ge}],[128,{[ra]:aa}],[0,{[f]:jge}],[0,{[f]:Kge}],[5,{[f]:Gge}],[1,{[f]:Vge}],[0,{[f]:Wge}],[0,{[f]:qge}],[0,{[f]:zge}],[0,{[f]:Xge}],[0,{[f]:eme}],[()=>Zt,{[f]:Yge}],[0,{[f]:tme}],[0,{[f]:Jge}],[1,{[f]:rme}],[0,{[f]:nme}],[2,{[f]:Zge}]],2],fe="unit",xme=[1,m,Q1,0,[()=>Cf,0]],Rme=[1,m,LAe,0,[()=>SF,{[D]:M1}]],AD=[1,m,Iy,0,[()=>UF,{[D]:N}]],If=[1,m,Fie,0,()=>QF],Ume=[1,m,Pie,0,()=>LF],iD=[1,m,Uy,0,[()=>qF,0]],kme=[1,m,Koe,0,()=>_2],Fme=[1,m,wR,0,()=>b2],Pme=[1,m,Aae,0,[0,{[D]:Ly}]],Ome=[1,m,RR,0,()=>N2],Qme=[1,m,lae,0,()=>V2],xf=[1,m,Md,0,[()=>AO,{[D]:Vy}]],Dme=[1,m,KR,0,[()=>Ef,0]],Lme=[1,m,MR,0,[()=>_f,0]],Mme=[1,m,bue,0,[0,{[D]:dae}]],Nme=[1,m,yle,0,[()=>vO,0]],oD=[1,m,qle,0,[()=>TO,0]],Hme=[1,m,XR,0,[()=>bf,0]],$me=[1,m,she,0,()=>aQ],Vme=[1,m,whe,0,()=>uQ],Kme=[1,m,vhe,0,()=>hQ],aD=[1,m,Uhe,0,[()=>lQ,0]],jme=[1,m,Lhe,0,[()=>pQ,0]],Gme=[1,m,Ehe,0,()=>mQ],zme=[1,m,ef,0,()=>yQ],qme=[1,m,Ide,0,()=>fQ],Wme=[1,m,rfe,0,[()=>A4,0]],Jme=[1,m,Cfe,0,[()=>l4,0]],cD=[1,m,a0,0,[()=>B4,{[D]:NU}]],Xme=[1,m,Yfe,0,[()=>R4,0]],Hs=[1,m,df,0,[()=>vi,{[D]:cn}]],Yme=[1,m,sk,0,[()=>$4,{[D]:Vy}]],Zme=[1,m,upe,0,()=>K4],ewe=[1,m,ipe,0,[()=>j4,0]],twe=[1,m,lpe,0,()=>G4],rwe=[1,m,hk,0,[()=>nQ,{[D]:eU}]],uD=[4,m,PAe,0,[He,cn,qc],[0,()=>vi,[()=>_F,0]]],lD=[4,m,the,0,[He,cn,V1,qc],[0,()=>vi,0,[()=>oQ,0]]],hD=[4,m,fU,0,[h0],[[()=>Q4,{[D]:cf}]]],dD=[4,m,jfe,{[bk]:1},[Tfe,rk,SU,qie,xR],[[()=>i4,0],[()=>M4,0],[()=>_Q,0],()=>$F,()=>M2]],fD=[9,m,HAe,{[j]:["DELETE","/{Key+}?x-id=AbortMultipartUpload",204]},()=>BF,()=>yF],pD=[9,m,tR,{[j]:["POST","/{Key+}",200]},()=>NF,()=>MF],gD=[9,m,xie,{[j]:["PUT","/{Key+}?x-id=CopyObject",200]},()=>KF,()=>VF],mD=[9,m,lie,{[j]:["PUT","/",200]},()=>ZF,()=>YF],wD=[9,m,hie,{[Se]:"-",[j]:["POST","/?metadataConfiguration",200]},()=>JF,()=>fe],yD=[9,m,fie,{[Se]:"-",[j]:["POST","/?metadataTable",200]},()=>XF,()=>fe],BD=[9,m,Iie,{[j]:["POST","/{Key+}?uploads",200]},()=>t2,()=>e2],CD=[9,m,Vie,{[j]:["GET","/?session",200]},()=>n2,()=>r2],ED=[9,m,Jie,{[j]:["DELETE","/",204]},()=>B2,()=>fe],_D=[9,m,Xie,{[j]:["DELETE","/?analytics",204]},()=>a2,()=>fe],bD=[9,m,Zie,{[j]:["DELETE","/?cors",204]},()=>c2,()=>fe],vD=[9,m,toe,{[j]:["DELETE","/?encryption",204]},()=>u2,()=>fe],SD=[9,m,Aoe,{[j]:["DELETE","/?intelligent-tiering",204]},()=>l2,()=>fe],TD=[9,m,noe,{[j]:["DELETE","/?inventory",204]},()=>h2,()=>fe],ID=[9,m,ooe,{[j]:["DELETE","/?lifecycle",204]},()=>d2,()=>fe],xD=[9,m,coe,{[j]:["DELETE","/?metadataConfiguration",204]},()=>f2,()=>fe],RD=[9,m,doe,{[j]:["DELETE","/?metadataTable",204]},()=>p2,()=>fe],UD=[9,m,hoe,{[j]:["DELETE","/?metrics",204]},()=>g2,()=>fe],kD=[9,m,poe,{[j]:["DELETE","/?ownershipControls",204]},()=>m2,()=>fe],FD=[9,m,moe,{[j]:["DELETE","/?policy",204]},()=>w2,()=>fe],PD=[9,m,Coe,{[j]:["DELETE","/?replication",204]},()=>y2,()=>fe],OD=[9,m,Eoe,{[j]:["DELETE","/?tagging",204]},()=>C2,()=>fe],QD=[9,m,boe,{[j]:["DELETE","/?website",204]},()=>E2,()=>fe],DD=[9,m,joe,{[j]:["DELETE","/{Key+}?x-id=DeleteObject",204]},()=>x2,()=>I2],LD=[9,m,Poe,{[j]:["DELETE","/{Key+}?annotation",204]},()=>T2,()=>S2],MD=[9,m,Goe,{[Se]:"-",[j]:["POST","/?delete",200]},()=>U2,()=>R2],ND=[9,m,Hoe,{[j]:["DELETE","/{Key+}?tagging",204]},()=>F2,()=>k2],HD=[9,m,zoe,{[j]:["DELETE","/?publicAccessBlock",204]},()=>P2,()=>fe],$D=[9,m,pae,{[j]:["GET","/?abac",200]},()=>j2,()=>K2],VD=[9,m,gae,{[j]:["GET","/?accelerate",200]},()=>z2,()=>G2],KD=[9,m,Sae,{[j]:["GET","/?acl",200]},()=>W2,()=>q2],jD=[9,m,Cae,{[j]:["GET","/?analytics&x-id=GetBucketAnalyticsConfiguration",200]},()=>X2,()=>J2],GD=[9,m,Tae,{[j]:["GET","/?cors",200]},()=>Z2,()=>Y2],zD=[9,m,Rae,{[j]:["GET","/?encryption",200]},()=>tP,()=>eP],qD=[9,m,Qae,{[j]:["GET","/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration",200]},()=>nP,()=>rP],WD=[9,m,Fae,{[j]:["GET","/?inventory&x-id=GetBucketInventoryConfiguration",200]},()=>AP,()=>sP],JD=[9,m,Nae,{[j]:["GET","/?lifecycle",200]},()=>oP,()=>iP],XD=[9,m,Mae,{[j]:["GET","/?location",200]},()=>cP,()=>aP],YD=[9,m,zae,{[j]:["GET","/?logging",200]},()=>lP,()=>uP],ZD=[9,m,qae,{[j]:["GET","/?metadataConfiguration",200]},()=>dP,()=>hP],eL=[9,m,ece,{[j]:["GET","/?metadataTable",200]},()=>gP,()=>pP],tL=[9,m,Zae,{[j]:["GET","/?metrics&x-id=GetBucketMetricsConfiguration",200]},()=>yP,()=>wP],rL=[9,m,nce,{[j]:["GET","/?notification",200]},()=>BP,()=>L0],nL=[9,m,Ace,{[j]:["GET","/?ownershipControls",200]},()=>EP,()=>CP],sL=[9,m,ace,{[j]:["GET","/?policy",200]},()=>bP,()=>_P],AL=[9,m,lce,{[j]:["GET","/?policyStatus",200]},()=>SP,()=>vP],iL=[9,m,fce,{[j]:["GET","/?replication",200]},()=>IP,()=>TP],oL=[9,m,gce,{[j]:["GET","/?requestPayment",200]},()=>RP,()=>xP],aL=[9,m,Bce,{[j]:["GET","/?tagging",200]},()=>kP,()=>UP],cL=[9,m,_ce,{[j]:["GET","/?versioning",200]},()=>PP,()=>FP],uL=[9,m,Sce,{[j]:["GET","/?website",200]},()=>QP,()=>OP],lL=[9,m,xce,{[Se]:"-",[j]:["GET","/{Key+}?x-id=GetObject",200]},()=>WP,()=>qP],hL=[9,m,Rce,{[j]:["GET","/{Key+}?acl",200]},()=>LP,()=>DP],dL=[9,m,Mce,{[Se]:"-",[j]:["GET","/{Key+}?annotation&x-id=GetObjectAnnotation",200]},()=>NP,()=>MP],fL=[9,m,Nce,{[j]:["GET","/{Key+}?attributes",200]},()=>VP,()=>HP],pL=[9,m,Kce,{[j]:["GET","/{Key+}?legal-hold",200]},()=>jP,()=>KP],gL=[9,m,Hce,{[j]:["GET","/?object-lock",200]},()=>zP,()=>GP],mL=[9,m,Xce,{[j]:["GET","/{Key+}?retention",200]},()=>XP,()=>JP],wL=[9,m,Yce,{[j]:["GET","/{Key+}?tagging",200]},()=>ZP,()=>YP],yL=[9,m,nue,{[j]:["GET","/{Key+}?torrent",200]},()=>tO,()=>eO],BL=[9,m,sue,{[j]:["GET","/?publicAccessBlock",200]},()=>nO,()=>rO],CL=[9,m,oue,{[j]:["HEAD","/",200]},()=>oO,()=>iO],EL=[9,m,lue,{[j]:["HEAD","/{Key+}",200]},()=>cO,()=>aO],_L=[9,m,Yue,{[j]:["GET","/?analytics&x-id=ListBucketAnalyticsConfigurations",200]},()=>UO,()=>RO],bL=[9,m,Ale,{[j]:["GET","/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations",200]},()=>FO,()=>kO],vL=[9,m,rle,{[j]:["GET","/?inventory&x-id=ListBucketInventoryConfigurations",200]},()=>OO,()=>PO],SL=[9,m,ale,{[j]:["GET","/?metrics&x-id=ListBucketMetricsConfigurations",200]},()=>DO,()=>QO],TL=[9,m,Xue,{[j]:["GET","/?x-id=ListBuckets",200]},()=>MO,()=>LO],IL=[9,m,dle,{[j]:["GET","/?x-id=ListDirectoryBuckets",200]},()=>HO,()=>NO],xL=[9,m,vle,{[j]:["GET","/?uploads",200]},()=>VO,()=>$O],RL=[9,m,Rle,{[j]:["GET","/{Key+}?annotation&x-id=ListObjectAnnotations",200]},()=>jO,()=>KO],UL=[9,m,xle,{[j]:["GET","/",200]},()=>zO,()=>GO],kL=[9,m,Ole,{[j]:["GET","/?list-type=2",200]},()=>WO,()=>qO],FL=[9,m,Nle,{[j]:["GET","/?versions",200]},()=>XO,()=>JO],PL=[9,m,Hle,{[j]:["GET","/{Key+}?x-id=ListParts",200]},()=>ZO,()=>YO],OL=[9,m,Nhe,{[Se]:"-",[j]:["PUT","/?abac",200]},()=>bQ,()=>fe],QL=[9,m,Hhe,{[Se]:"-",[j]:["PUT","/?accelerate",200]},()=>vQ,()=>fe],DL=[9,m,zhe,{[Se]:"-",[j]:["PUT","/?acl",200]},()=>SQ,()=>fe],LL=[9,m,Khe,{[j]:["PUT","/?analytics",200]},()=>TQ,()=>fe],ML=[9,m,qhe,{[Se]:"-",[j]:["PUT","/?cors",200]},()=>IQ,()=>fe],NL=[9,m,Jhe,{[Se]:"-",[j]:["PUT","/?encryption",200]},()=>xQ,()=>fe],HL=[9,m,ede,{[j]:["PUT","/?intelligent-tiering",200]},()=>RQ,()=>fe],$L=[9,m,Yhe,{[j]:["PUT","/?inventory",200]},()=>UQ,()=>fe],VL=[9,m,nde,{[Se]:"-",[j]:["PUT","/?lifecycle",200]},()=>FQ,()=>kQ],KL=[9,m,rde,{[Se]:"-",[j]:["PUT","/?logging",200]},()=>PQ,()=>fe],jL=[9,m,ode,{[j]:["PUT","/?metrics",200]},()=>OQ,()=>fe],GL=[9,m,cde,{[j]:["PUT","/?notification",200]},()=>QQ,()=>fe],zL=[9,m,lde,{[Se]:"-",[j]:["PUT","/?ownershipControls",200]},()=>DQ,()=>fe],qL=[9,m,dde,{[Se]:"-",[j]:["PUT","/?policy",200]},()=>LQ,()=>fe],WL=[9,m,pde,{[Se]:"-",[j]:["PUT","/?replication",200]},()=>MQ,()=>fe],JL=[9,m,gde,{[Se]:"-",[j]:["PUT","/?requestPayment",200]},()=>NQ,()=>fe],XL=[9,m,yde,{[Se]:"-",[j]:["PUT","/?tagging",200]},()=>HQ,()=>fe],YL=[9,m,Cde,{[Se]:"-",[j]:["PUT","/?versioning",200]},()=>$Q,()=>fe],ZL=[9,m,_de,{[Se]:"-",[j]:["PUT","/?website",200]},()=>VQ,()=>fe],e3=[9,m,xde,{[Se]:"-",[j]:["PUT","/{Key+}?x-id=PutObject",200]},()=>ZQ,()=>YQ],t3=[9,m,Rde,{[Se]:"-",[j]:["PUT","/{Key+}?acl",200]},()=>jQ,()=>KQ],r3=[9,m,Ode,{[Se]:"-",[j]:["PUT","/{Key+}?annotation",200]},()=>zQ,()=>GQ],n3=[9,m,Mde,{[Se]:"-",[j]:["PUT","/{Key+}?legal-hold",200]},()=>WQ,()=>qQ],s3=[9,m,Qde,{[Se]:"-",[j]:["PUT","/?object-lock",200]},()=>XQ,()=>JQ],A3=[9,m,Gde,{[Se]:"-",[j]:["PUT","/{Key+}?retention",200]},()=>t4,()=>e4],i3=[9,m,zde,{[Se]:"-",[j]:["PUT","/{Key+}?tagging",200]},()=>n4,()=>r4],o3=[9,m,Jde,{[Se]:"-",[j]:["PUT","/?publicAccessBlock",200]},()=>s4,()=>fe],a3=[9,m,lfe,{[j]:["PUT","/{Key+}?renameObject",200]},()=>c4,()=>a4],c3=[9,m,mfe,{[Se]:"-",[j]:["POST","/{Key+}?restore",200]},()=>w4,()=>m4],u3=[9,m,Kfe,{[j]:["POST","/{Key+}?select&select-type=2",200]},()=>T4,()=>S4],l3=[9,m,Bpe,{[Se]:"-",[j]:["PUT","/?metadataAnnotationTable",200]},()=>z4,()=>fe],h3=[9,m,Epe,{[Se]:"-",[j]:["PUT","/?metadataInventoryTable",200]},()=>q4,()=>fe],d3=[9,m,bpe,{[Se]:"-",[j]:["PUT","/?metadataJournalTable",200]},()=>W4,()=>fe],f3=[9,m,Tpe,{[Se]:"-",[j]:["PUT","/{Key+}?encryption",200]},()=>J4,()=>X4],p3=[9,m,Rpe,{[Se]:"-",[j]:["PUT","/{Key+}?x-id=UploadPart",200]},()=>tD,()=>eD],g3=[9,m,Upe,{[j]:["PUT","/{Key+}?x-id=UploadPartCopy",200]},()=>Z4,()=>Y4],m3=[9,m,Npe,{[Gpe]:["{RequestRoute}."],[j]:["POST","/WriteGetObjectResponse",200]},()=>sD,()=>fe];class J0 extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(CD).build(){}const nwe={version:"3.1075.0"};function w3(t){return typeof t=="string"?t.length===0:t.byteLength===0}var y3={name:"SHA-1"},B3={name:"HMAC",hash:y3},swe=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);const Awe={};function SA(){return typeof window<"u"?window:typeof self<"u"?self:Awe}var iwe=function(){function t(e){this.toHash=new Uint8Array(0),e!==void 0&&(this.key=new Promise(function(r,n){SA().crypto.subtle.importKey("raw",C3(e),B3,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))}return t.prototype.update=function(e){if(!w3(e)){var r=C3(e),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return SA().crypto.subtle.sign(B3,r,e.toHash).then(function(n){return new Uint8Array(n)})}):w3(this.toHash)?Promise.resolve(swe):Promise.resolve().then(function(){return SA().crypto.subtle.digest(y3,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){this.toHash=new Uint8Array(0)},t}();function C3(t){return typeof t=="string"?rx(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}var owe=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function E3(t){if(awe(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return cwe(e)}return!1}function awe(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}function cwe(t){return t&&owe.every(function(e){return typeof t[e]=="function"})}var uwe=function(){function t(e){if(E3(SA()))this.hash=new iwe(e);else throw new Error("SHA1 not supported")}return t.prototype.update=function(e,r){this.hash.update(mA(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}(),_3={name:"SHA-256"},b3={name:"HMAC",hash:_3},lwe=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]),hwe=function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!Hc(e)){var r=mA(e),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return SA().crypto.subtle.sign(b3,r,e.toHash).then(function(n){return new Uint8Array(n)})}):Hc(this.toHash)?Promise.resolve(lwe):Promise.resolve().then(function(){return SA().crypto.subtle.digest(_3,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,n){SA().crypto.subtle.importKey("raw",mA(e.secret),b3,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))},t}(),ln=64,dwe=32,fwe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pwe=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],gwe=Math.pow(2,53)-1,Rf=function(){function t(){this.state=Int32Array.from(pwe),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>gwe)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[r++],n--,this.bufferLength===ln&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(r.setUint8(this.bufferLength++,128),n%ln>=ln-8){for(var s=this.bufferLength;s<ln;s++)r.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(var s=this.bufferLength;s<ln-8;s++)r.setUint8(s,0);r.setUint32(ln-8,Math.floor(e/4294967296),!0),r.setUint32(ln-4,e),this.hashBuffer(),this.finished=!0}for(var A=new Uint8Array(dwe),s=0;s<8;s++)A[s*4]=this.state[s]>>>24&255,A[s*4+1]=this.state[s]>>>16&255,A[s*4+2]=this.state[s]>>>8&255,A[s*4+3]=this.state[s]>>>0&255;return A},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,n=e.state,s=n[0],A=n[1],i=n[2],o=n[3],a=n[4],c=n[5],l=n[6],h=n[7],d=0;d<ln;d++){if(d<16)this.temp[d]=(r[d*4]&255)<<24|(r[d*4+1]&255)<<16|(r[d*4+2]&255)<<8|r[d*4+3]&255;else{var p=this.temp[d-2],w=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[d-15];var B=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[d]=(w+this.temp[d-7]|0)+(B+this.temp[d-16]|0)}var C=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&l)|0)+(h+(fwe[d]+this.temp[d]|0)|0)|0,_=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&A^s&i^A&i)|0;h=l,l=c,c=a,a=o+C|0,o=i,i=A,A=s,s=C+_|0}n[0]+=s,n[1]+=A,n[2]+=i,n[3]+=o,n[4]+=a,n[5]+=c,n[6]+=l,n[7]+=h},t}(),mwe=function(){function t(e){this.secret=e,this.hash=new Rf,this.reset()}return t.prototype.update=function(e){if(!(Hc(e)||this.error))try{this.hash.update(mA(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return gh(this,void 0,void 0,function(){return Dm(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Rf,this.secret){this.outer=new Rf;var e=wwe(this.secret),r=new Uint8Array(ln);r.set(e);for(var n=0;n<ln;n++)e[n]^=54,r[n]^=92;this.hash.update(e),this.outer.update(r);for(var n=0;n<e.byteLength;n++)e[n]=0}},t}();function wwe(t){var e=mA(t);if(e.byteLength>ln){var r=new Rf;r.update(e),e=r.digest()}var n=new Uint8Array(ln);return n.set(e),n}var v3=function(){function t(e){E3(SA())?this.hash=new hwe(e):this.hash=new mwe(e)}return t.prototype.update=function(e,r){this.hash.update(mA(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}();async function ywe(t,e,r=1024*1024){const n=t.size;let s=0;for(;s<n;){const A=t.slice(s,Math.min(n,s+r));e(new Uint8Array(await A.arrayBuffer())),s+=A.size}}const Bwe=async function(e,r){const n=new e;return await ywe(r,s=>{n.update(s)}),n.digest()},TA=64,Cwe=16,Ewe=[1732584193,4023233417,2562383102,271733878];class _we{constructor(){S(this,"state");S(this,"buffer");S(this,"bufferLength");S(this,"bytesHashed");S(this,"finished");this.reset()}update(e){if(bwe(e))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=vwe(e);let n=0,{byteLength:s}=r;for(this.bytesHashed+=s;s>0;)this.buffer.setUint8(this.bufferLength++,r[n++]),s--,this.bufferLength===TA&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:n,bytesHashed:s}=this,A=s*8;if(r.setUint8(this.bufferLength++,128),n%TA>=TA-8){for(let i=this.bufferLength;i<TA;i++)r.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(let i=this.bufferLength;i<TA-8;i++)r.setUint8(i,0);r.setUint32(TA-8,A>>>0,!0),r.setUint32(TA-4,Math.floor(A/4294967296),!0),this.hashBuffer(),this.finished=!0}const e=new DataView(new ArrayBuffer(Cwe));for(let r=0;r<4;r++)e.setUint32(r*4,this.state[r],!0);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}hashBuffer(){const{buffer:e,state:r}=this;let n=r[0],s=r[1],A=r[2],i=r[3];n=dr(n,s,A,i,e.getUint32(0,!0),7,3614090360),i=dr(i,n,s,A,e.getUint32(4,!0),12,3905402710),A=dr(A,i,n,s,e.getUint32(8,!0),17,606105819),s=dr(s,A,i,n,e.getUint32(12,!0),22,3250441966),n=dr(n,s,A,i,e.getUint32(16,!0),7,4118548399),i=dr(i,n,s,A,e.getUint32(20,!0),12,1200080426),A=dr(A,i,n,s,e.getUint32(24,!0),17,2821735955),s=dr(s,A,i,n,e.getUint32(28,!0),22,4249261313),n=dr(n,s,A,i,e.getUint32(32,!0),7,1770035416),i=dr(i,n,s,A,e.getUint32(36,!0),12,2336552879),A=dr(A,i,n,s,e.getUint32(40,!0),17,4294925233),s=dr(s,A,i,n,e.getUint32(44,!0),22,2304563134),n=dr(n,s,A,i,e.getUint32(48,!0),7,1804603682),i=dr(i,n,s,A,e.getUint32(52,!0),12,4254626195),A=dr(A,i,n,s,e.getUint32(56,!0),17,2792965006),s=dr(s,A,i,n,e.getUint32(60,!0),22,1236535329),n=fr(n,s,A,i,e.getUint32(4,!0),5,4129170786),i=fr(i,n,s,A,e.getUint32(24,!0),9,3225465664),A=fr(A,i,n,s,e.getUint32(44,!0),14,643717713),s=fr(s,A,i,n,e.getUint32(0,!0),20,3921069994),n=fr(n,s,A,i,e.getUint32(20,!0),5,3593408605),i=fr(i,n,s,A,e.getUint32(40,!0),9,38016083),A=fr(A,i,n,s,e.getUint32(60,!0),14,3634488961),s=fr(s,A,i,n,e.getUint32(16,!0),20,3889429448),n=fr(n,s,A,i,e.getUint32(36,!0),5,568446438),i=fr(i,n,s,A,e.getUint32(56,!0),9,3275163606),A=fr(A,i,n,s,e.getUint32(12,!0),14,4107603335),s=fr(s,A,i,n,e.getUint32(32,!0),20,1163531501),n=fr(n,s,A,i,e.getUint32(52,!0),5,2850285829),i=fr(i,n,s,A,e.getUint32(8,!0),9,4243563512),A=fr(A,i,n,s,e.getUint32(28,!0),14,1735328473),s=fr(s,A,i,n,e.getUint32(48,!0),20,2368359562),n=pr(n,s,A,i,e.getUint32(20,!0),4,4294588738),i=pr(i,n,s,A,e.getUint32(32,!0),11,2272392833),A=pr(A,i,n,s,e.getUint32(44,!0),16,1839030562),s=pr(s,A,i,n,e.getUint32(56,!0),23,4259657740),n=pr(n,s,A,i,e.getUint32(4,!0),4,2763975236),i=pr(i,n,s,A,e.getUint32(16,!0),11,1272893353),A=pr(A,i,n,s,e.getUint32(28,!0),16,4139469664),s=pr(s,A,i,n,e.getUint32(40,!0),23,3200236656),n=pr(n,s,A,i,e.getUint32(52,!0),4,681279174),i=pr(i,n,s,A,e.getUint32(0,!0),11,3936430074),A=pr(A,i,n,s,e.getUint32(12,!0),16,3572445317),s=pr(s,A,i,n,e.getUint32(24,!0),23,76029189),n=pr(n,s,A,i,e.getUint32(36,!0),4,3654602809),i=pr(i,n,s,A,e.getUint32(48,!0),11,3873151461),A=pr(A,i,n,s,e.getUint32(60,!0),16,530742520),s=pr(s,A,i,n,e.getUint32(8,!0),23,3299628645),n=gr(n,s,A,i,e.getUint32(0,!0),6,4096336452),i=gr(i,n,s,A,e.getUint32(28,!0),10,1126891415),A=gr(A,i,n,s,e.getUint32(56,!0),15,2878612391),s=gr(s,A,i,n,e.getUint32(20,!0),21,4237533241),n=gr(n,s,A,i,e.getUint32(48,!0),6,1700485571),i=gr(i,n,s,A,e.getUint32(12,!0),10,2399980690),A=gr(A,i,n,s,e.getUint32(40,!0),15,4293915773),s=gr(s,A,i,n,e.getUint32(4,!0),21,2240044497),n=gr(n,s,A,i,e.getUint32(32,!0),6,1873313359),i=gr(i,n,s,A,e.getUint32(60,!0),10,4264355552),A=gr(A,i,n,s,e.getUint32(24,!0),15,2734768916),s=gr(s,A,i,n,e.getUint32(52,!0),21,1309151649),n=gr(n,s,A,i,e.getUint32(16,!0),6,4149444226),i=gr(i,n,s,A,e.getUint32(44,!0),10,3174756917),A=gr(A,i,n,s,e.getUint32(8,!0),15,718787259),s=gr(s,A,i,n,e.getUint32(36,!0),21,3951481745),r[0]=n+r[0]&4294967295,r[1]=s+r[1]&4294967295,r[2]=A+r[2]&4294967295,r[3]=i+r[3]&4294967295}reset(){this.state=Uint32Array.from(Ewe),this.buffer=new DataView(new ArrayBuffer(TA)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function Uf(t,e,r,n,s,A){return e=(e+t&4294967295)+(n+A&4294967295)&4294967295,(e<<s|e>>>32-s)+r&4294967295}function dr(t,e,r,n,s,A,i){return Uf(e&r|~e&n,t,e,s,A,i)}function fr(t,e,r,n,s,A,i){return Uf(e&n|r&~n,t,e,s,A,i)}function pr(t,e,r,n,s,A,i){return Uf(e^r^n,t,e,s,A,i)}function gr(t,e,r,n,s,A,i){return Uf(r^(e|~n),t,e,s,A,i)}function bwe(t){return typeof t=="string"?t.length===0:t.byteLength===0}function vwe(t){return typeof t=="string"?Jn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function S3(t,e){return new Request(t,e)}function Swe(t=0){return new Promise((e,r)=>{t&&setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}const X0={supported:void 0};class kf{constructor(e){S(this,"config");S(this,"configProvider");typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),X0.supported===void 0&&(X0.supported=typeof Request<"u"&&"keepalive"in S3("https://[::1]"))}static create(e){return typeof(e==null?void 0:e.handle)=="function"?e:new kf(e)}destroy(){}async handle(e,{abortSignal:r,requestTimeout:n}={}){var T;this.config||(this.config=await this.configProvider);const s=n??this.config.requestTimeout,A=this.config.keepAlive===!0,i=this.config.credentials;if(r!=null&&r.aborted){const v=T3(r);return Promise.reject(v)}let o=e.path;const a=Qte(e.query||{});a&&(o+=`?${a}`),e.fragment&&(o+=`#${e.fragment}`);let c="";if(e.username!=null||e.password!=null){const v=e.username??"",k=e.password??"";c=`${v}:${k}@`}const{port:l,method:h}=e,d=`${e.protocol}//${c}${e.hostname}${l?`:${l}`:""}${o}`,p=h==="GET"||h==="HEAD"?void 0:e.body,w={body:p,headers:new Headers(e.headers),method:h,credentials:i};(T=this.config)!=null&&T.cache&&(w.cache=this.config.cache),p&&(w.duplex="half"),typeof AbortController<"u"&&(w.signal=r),X0.supported&&(w.keepalive=A),typeof this.config.requestInit=="function"&&Object.assign(w,this.config.requestInit(e));let B=()=>{};const C=S3(d,w),_=[fetch(C).then(v=>{const k=v.headers,L={};for(const x of k.entries())L[x[0]]=x[1];return v.body!=null?{response:new dA({headers:L,reason:v.statusText,statusCode:v.status,body:v.body})}:v.blob().then(x=>({response:new dA({headers:L,reason:v.statusText,statusCode:v.status,body:x})}))}),Swe(s)];return r&&_.push(new Promise((v,k)=>{const L=()=>{const V=T3(r);k(V)};if(typeof r.addEventListener=="function"){const V=r;V.addEventListener("abort",L,{once:!0}),B=()=>V.removeEventListener("abort",L)}else r.onabort=L})),Promise.race(_).finally(B)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=r,n))}httpHandlerConfigs(){return this.config??{}}}function T3(t){const e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){const s=new Error("Request aborted");return s.name="AbortError",s.cause=e,s}const n=new Error(String(e));return n.name="AbortError",n}const r=new Error("Request aborted");return r.name="AbortError",r}const I3=async t=>{var e;return typeof Blob=="function"&&t instanceof Blob||((e=t.constructor)==null?void 0:e.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await t.arrayBuffer()):Twe(t):Iwe(t)};async function Twe(t){const e=await xwe(t),r=Us(e);return new Uint8Array(r)}async function Iwe(t){const e=[],r=t.getReader();let n=!1,s=0;for(;!n;){const{done:o,value:a}=await r.read();a&&(e.push(a),s+=a.length),n=o}const A=new Uint8Array(s);let i=0;for(const o of e)A.set(o,i),i+=o.length;return A}function xwe(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",A=s.indexOf(","),i=A>-1?A+1:s.length;e(s.substring(i))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const Rwe=t=>({apiVersion:"2006-03-01",base64Decoder:(t==null?void 0:t.base64Decoder)??Us,base64Encoder:(t==null?void 0:t.base64Encoder)??Xn,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??F1,extensions:(t==null?void 0:t.extensions)??[],getAwsChunkedEncodingStream:(t==null?void 0:t.getAwsChunkedEncodingStream)??_te,httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??vAe,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new uy},{schemeId:"aws.auth#sigv4a",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4a"),signer:new pAe}],logger:(t==null?void 0:t.logger)??new Vh,protocol:(t==null?void 0:t.protocol)??Kse,protocolSettings:(t==null?void 0:t.protocolSettings)??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:pF,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:(t==null?void 0:t.sdkStreamMixin)??hI,serviceId:(t==null?void 0:t.serviceId)??"S3",signerConstructor:(t==null?void 0:t.signerConstructor)??vx,signingEscapePath:(t==null?void 0:t.signingEscapePath)??!1,urlParser:(t==null?void 0:t.urlParser)??kc,useArnRegion:(t==null?void 0:t.useArnRegion)??void 0,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Jn,utf8Encoder:(t==null?void 0:t.utf8Encoder)??ks}),Uwe=t=>{const e=WI(t),r=()=>e().then(kT),n=Rwe(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JT,credentialDefaultProvider:(t==null?void 0:t.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??$I({serviceId:n.serviceId,clientVersion:nwe.version}),eventStreamSerdeProvider:(t==null?void 0:t.eventStreamSerdeProvider)??Gx,maxAttempts:(t==null?void 0:t.maxAttempts)??_o,md5:(t==null?void 0:t.md5)??_we,region:(t==null?void 0:t.region)??TT("Region is missing"),requestHandler:kf.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||SI),sha1:(t==null?void 0:t.sha1)??uwe,sha256:(t==null?void 0:t.sha256)??v3,streamCollector:(t==null?void 0:t.streamCollector)??I3,streamHasher:(t==null?void 0:t.streamHasher)??Bwe,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(JI)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(XI))}},kwe=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(s){const A=e.findIndex(i=>i.schemeId===s.schemeId);A===-1?e.push(s):e.splice(A,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},Fwe=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),Pwe=(t,e)=>{const r=Object.assign(YI(t),PT(t),wI(t),kwe(t));return e.forEach(n=>n.configure(r)),Object.assign(t,ZI(r),OT(r),yI(r),Fwe(r))};class Si extends lw{constructor(...[r]){const n=Uwe(r||{});super(n);S(this,"config");this.initConfig=n;const s=TAe(n),A=DI(s),i=dne(A),o=TI(i),a=qI(o),c=a,l=uI(c),h=zx(l),d=SAe(h),p=bne(d,{session:[()=>this,J0]}),w=Pwe(p,(r==null?void 0:r.extensions)||[]);this.config=w,this.middlewareStack.use(RT(this.config)),this.middlewareStack.use(HI(this.config)),this.middlewareStack.use(II(this.config)),this.middlewareStack.use(CI(this.config)),this.middlewareStack.use(xI(this.config)),this.middlewareStack.use(RI(this.config)),this.middlewareStack.use(UI(this.config)),this.middlewareStack.use(kI(this.config,{httpAuthSchemeParametersProvider:bAe,identityProviderConfigProvider:async B=>new OI({"aws.auth#sigv4":B.credentials,"aws.auth#sigv4a":B.credentials})})),this.middlewareStack.use(PI(this.config)),this.middlewareStack.use(Bse(this.config)),this.middlewareStack.use(zse(this.config)),this.middlewareStack.use(_ne(this.config)),this.middlewareStack.use(sse(this.config)),this.middlewareStack.use(cse(this.config))}destroy(){super.destroy()}}class x3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","AbortMultipartUpload",{}).n("S3Client","AbortMultipartUploadCommand").sc(fD).build(){}class R3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CompleteMultipartUpload",{}).n("S3Client","CompleteMultipartUploadCommand").sc(pD).build(){}class U3 extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"},CopySource:{type:"contextParams",name:"CopySource"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CopyObject",{}).n("S3Client","CopyObjectCommand").sc(gD).build(){}class k3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},DisableAccessPoints:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),Jse(n)]}).s("AmazonS3","CreateBucket",{}).n("S3Client","CreateBucketCommand").sc(mD).build(){}class F3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataConfiguration",{}).n("S3Client","CreateBucketMetadataConfigurationCommand").sc(wD).build(){}class P3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataTableConfiguration",{}).n("S3Client","CreateBucketMetadataTableConfigurationCommand").sc(yD).build(){}class O3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","CreateMultipartUpload",{}).n("S3Client","CreateMultipartUploadCommand").sc(BD).build(){}class Q3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketAnalyticsConfiguration",{}).n("S3Client","DeleteBucketAnalyticsConfigurationCommand").sc(_D).build(){}class D3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucket",{}).n("S3Client","DeleteBucketCommand").sc(ED).build(){}class L3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketCors",{}).n("S3Client","DeleteBucketCorsCommand").sc(bD).build(){}class M3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketEncryption",{}).n("S3Client","DeleteBucketEncryptionCommand").sc(vD).build(){}class N3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketIntelligentTieringConfiguration",{}).n("S3Client","DeleteBucketIntelligentTieringConfigurationCommand").sc(SD).build(){}class H3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketInventoryConfiguration",{}).n("S3Client","DeleteBucketInventoryConfigurationCommand").sc(TD).build(){}class $3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketLifecycle",{}).n("S3Client","DeleteBucketLifecycleCommand").sc(ID).build(){}class V3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataConfiguration",{}).n("S3Client","DeleteBucketMetadataConfigurationCommand").sc(xD).build(){}class K3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataTableConfiguration",{}).n("S3Client","DeleteBucketMetadataTableConfigurationCommand").sc(RD).build(){}class j3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetricsConfiguration",{}).n("S3Client","DeleteBucketMetricsConfigurationCommand").sc(UD).build(){}class G3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketOwnershipControls",{}).n("S3Client","DeleteBucketOwnershipControlsCommand").sc(kD).build(){}class z3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketPolicy",{}).n("S3Client","DeleteBucketPolicyCommand").sc(FD).build(){}class q3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketReplication",{}).n("S3Client","DeleteBucketReplicationCommand").sc(PD).build(){}class W3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketTagging",{}).n("S3Client","DeleteBucketTaggingCommand").sc(OD).build(){}class J3 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketWebsite",{}).n("S3Client","DeleteBucketWebsiteCommand").sc(QD).build(){}class X3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObjectAnnotation",{}).n("S3Client","DeleteObjectAnnotationCommand").sc(LD).build(){}class Y3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObject",{}).n("S3Client","DeleteObjectCommand").sc(DD).build(){}class Z3 extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","DeleteObjects",{}).n("S3Client","DeleteObjectsCommand").sc(MD).build(){}class eM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","DeleteObjectTagging",{}).n("S3Client","DeleteObjectTaggingCommand").sc(ND).build(){}class tM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","DeletePublicAccessBlock",{}).n("S3Client","DeletePublicAccessBlockCommand").sc(HD).build(){}class rM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAbac",{}).n("S3Client","GetBucketAbacCommand").sc($D).build(){}class nM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAccelerateConfiguration",{}).n("S3Client","GetBucketAccelerateConfigurationCommand").sc(VD).build(){}class sM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAcl",{}).n("S3Client","GetBucketAclCommand").sc(KD).build(){}class AM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketAnalyticsConfiguration",{}).n("S3Client","GetBucketAnalyticsConfigurationCommand").sc(jD).build(){}class iM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketCors",{}).n("S3Client","GetBucketCorsCommand").sc(GD).build(){}class oM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketEncryption",{}).n("S3Client","GetBucketEncryptionCommand").sc(zD).build(){}class aM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketIntelligentTieringConfiguration",{}).n("S3Client","GetBucketIntelligentTieringConfigurationCommand").sc(qD).build(){}class cM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketInventoryConfiguration",{}).n("S3Client","GetBucketInventoryConfigurationCommand").sc(WD).build(){}class uM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLifecycleConfiguration",{}).n("S3Client","GetBucketLifecycleConfigurationCommand").sc(JD).build(){}class lM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLocation",{}).n("S3Client","GetBucketLocationCommand").sc(XD).build(){}class hM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketLogging",{}).n("S3Client","GetBucketLoggingCommand").sc(YD).build(){}class dM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetadataConfiguration",{}).n("S3Client","GetBucketMetadataConfigurationCommand").sc(ZD).build(){}class fM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetadataTableConfiguration",{}).n("S3Client","GetBucketMetadataTableConfigurationCommand").sc(eL).build(){}class pM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketMetricsConfiguration",{}).n("S3Client","GetBucketMetricsConfigurationCommand").sc(tL).build(){}class gM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketNotificationConfiguration",{}).n("S3Client","GetBucketNotificationConfigurationCommand").sc(rL).build(){}class mM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketOwnershipControls",{}).n("S3Client","GetBucketOwnershipControlsCommand").sc(nL).build(){}class wM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","GetBucketPolicy",{}).n("S3Client","GetBucketPolicyCommand").sc(sL).build(){}class yM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketPolicyStatus",{}).n("S3Client","GetBucketPolicyStatusCommand").sc(AL).build(){}class BM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketReplication",{}).n("S3Client","GetBucketReplicationCommand").sc(iL).build(){}class CM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketRequestPayment",{}).n("S3Client","GetBucketRequestPaymentCommand").sc(oL).build(){}class EM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketTagging",{}).n("S3Client","GetBucketTaggingCommand").sc(aL).build(){}class _M extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketVersioning",{}).n("S3Client","GetBucketVersioningCommand").sc(cL).build(){}class bM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetBucketWebsite",{}).n("S3Client","GetBucketWebsiteCommand").sc(uL).build(){}class vM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectAcl",{}).n("S3Client","GetObjectAclCommand").sc(hL).build(){}class SM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1","SHA512","MD5","XXHASH64","XXHASH3","XXHASH128"]})]}).s("AmazonS3","GetObjectAnnotation",{}).n("S3Client","GetObjectAnnotationCommand").sc(dL).build(){}class TM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","GetObjectAttributes",{}).n("S3Client","GetObjectAttributesCommand").sc(fL).build(){}class IM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1","SHA512","MD5","XXHASH64","XXHASH3","XXHASH128"]}),In(n),ux()]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(lL).build(){}class xM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectLegalHold",{}).n("S3Client","GetObjectLegalHoldCommand").sc(pL).build(){}class RM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectLockConfiguration",{}).n("S3Client","GetObjectLockConfigurationCommand").sc(gL).build(){}class UM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectRetention",{}).n("S3Client","GetObjectRetentionCommand").sc(mL).build(){}class kM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetObjectTagging",{}).n("S3Client","GetObjectTaggingCommand").sc(wL).build(){}class FM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","GetObjectTorrent",{}).n("S3Client","GetObjectTorrentCommand").sc(yL).build(){}class PM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","GetPublicAccessBlock",{}).n("S3Client","GetPublicAccessBlockCommand").sc(BL).build(){}class Ff extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","HeadBucket",{}).n("S3Client","HeadBucketCommand").sc(CL).build(){}class Pf extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n),ux()]}).s("AmazonS3","HeadObject",{}).n("S3Client","HeadObjectCommand").sc(EL).build(){}class OM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketAnalyticsConfigurations",{}).n("S3Client","ListBucketAnalyticsConfigurationsCommand").sc(_L).build(){}class QM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketIntelligentTieringConfigurations",{}).n("S3Client","ListBucketIntelligentTieringConfigurationsCommand").sc(bL).build(){}class DM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketInventoryConfigurations",{}).n("S3Client","ListBucketInventoryConfigurationsCommand").sc(vL).build(){}class LM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBucketMetricsConfigurations",{}).n("S3Client","ListBucketMetricsConfigurationsCommand").sc(SL).build(){}class Y0 extends H.classBuilder().ep(K).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListBuckets",{}).n("S3Client","ListBucketsCommand").sc(TL).build(){}class Z0 extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListDirectoryBuckets",{}).n("S3Client","ListDirectoryBucketsCommand").sc(IL).build(){}class MM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListMultipartUploads",{}).n("S3Client","ListMultipartUploadsCommand").sc(xL).build(){}class eB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectAnnotations",{}).n("S3Client","ListObjectAnnotationsCommand").sc(RL).build(){}class NM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjects",{}).n("S3Client","ListObjectsCommand").sc(UL).build(){}class tB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(kL).build(){}class HM extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","ListObjectVersions",{}).n("S3Client","ListObjectVersionsCommand").sc(FL).build(){}class rB extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","ListParts",{}).n("S3Client","ListPartsCommand").sc(PL).build(){}class $M extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAbac",{}).n("S3Client","PutBucketAbacCommand").sc(OL).build(){}class VM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAccelerateConfiguration",{}).n("S3Client","PutBucketAccelerateConfigurationCommand").sc(QL).build(){}class KM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketAcl",{}).n("S3Client","PutBucketAclCommand").sc(DL).build(){}class jM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketAnalyticsConfiguration",{}).n("S3Client","PutBucketAnalyticsConfigurationCommand").sc(LL).build(){}class GM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketCors",{}).n("S3Client","PutBucketCorsCommand").sc(ML).build(){}class zM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketEncryption",{}).n("S3Client","PutBucketEncryptionCommand").sc(NL).build(){}class qM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketIntelligentTieringConfiguration",{}).n("S3Client","PutBucketIntelligentTieringConfigurationCommand").sc(HL).build(){}class WM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketInventoryConfiguration",{}).n("S3Client","PutBucketInventoryConfigurationCommand").sc($L).build(){}class JM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutBucketLifecycleConfiguration",{}).n("S3Client","PutBucketLifecycleConfigurationCommand").sc(VL).build(){}class XM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketLogging",{}).n("S3Client","PutBucketLoggingCommand").sc(KL).build(){}class YM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketMetricsConfiguration",{}).n("S3Client","PutBucketMetricsConfigurationCommand").sc(jL).build(){}class ZM extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketNotificationConfiguration",{}).n("S3Client","PutBucketNotificationConfigurationCommand").sc(GL).build(){}class eN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketOwnershipControls",{}).n("S3Client","PutBucketOwnershipControlsCommand").sc(zL).build(){}class tN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketPolicy",{}).n("S3Client","PutBucketPolicyCommand").sc(qL).build(){}class rN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketReplication",{}).n("S3Client","PutBucketReplicationCommand").sc(WL).build(){}class nN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketRequestPayment",{}).n("S3Client","PutBucketRequestPaymentCommand").sc(JL).build(){}class sN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketTagging",{}).n("S3Client","PutBucketTaggingCommand").sc(XL).build(){}class AN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketVersioning",{}).n("S3Client","PutBucketVersioningCommand").sc(YL).build(){}class iN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketWebsite",{}).n("S3Client","PutBucketWebsiteCommand").sc(ZL).build(){}class oN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectAcl",{}).n("S3Client","PutObjectAclCommand").sc(t3).build(){}class aN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n)]}).s("AmazonS3","PutObjectAnnotation",{}).n("S3Client","PutObjectAnnotationCommand").sc(r3).build(){}class cN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),wne(),ee(n),In(n)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(e3).build(){}class uN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectLegalHold",{}).n("S3Client","PutObjectLegalHoldCommand").sc(n3).build(){}class lN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectLockConfiguration",{}).n("S3Client","PutObjectLockConfigurationCommand").sc(s3).build(){}class hN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectRetention",{}).n("S3Client","PutObjectRetentionCommand").sc(A3).build(){}class dN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","PutObjectTagging",{}).n("S3Client","PutObjectTaggingCommand").sc(i3).build(){}class fN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutPublicAccessBlock",{}).n("S3Client","PutPublicAccessBlockCommand").sc(o3).build(){}class pN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n)]}).s("AmazonS3","RenameObject",{}).n("S3Client","RenameObjectCommand").sc(a3).build(){}class gN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n)]}).s("AmazonS3","RestoreObject",{}).n("S3Client","RestoreObjectCommand").sc(c3).build(){}class mN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),In(n)]}).s("AmazonS3","SelectObjectContent",{eventStream:{output:!0}}).n("S3Client","SelectObjectContentCommand").sc(u3).build(){}class wN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataAnnotationTableConfiguration",{}).n("S3Client","UpdateBucketMetadataAnnotationTableConfigurationCommand").sc(l3).build(){}class yN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataInventoryTableConfiguration",{}).n("S3Client","UpdateBucketMetadataInventoryTableConfigurationCommand").sc(h3).build(){}class BN extends H.classBuilder().ep({...K,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataJournalTableConfiguration",{}).n("S3Client","UpdateBucketMetadataJournalTableConfigurationCommand").sc(d3).build(){}class CN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),ee(n)]}).s("AmazonS3","UpdateObjectEncryption",{}).n("S3Client","UpdateObjectEncryptionCommand").sc(f3).build(){}class EN extends H.classBuilder().ep({...K,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ve(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ee(n),In(n)]}).s("AmazonS3","UploadPart",{}).n("S3Client","UploadPartCommand").sc(p3).build(){}class _N extends H.classBuilder().ep({...K,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions()),ee(n),In(n)]}).s("AmazonS3","UploadPartCopy",{}).n("S3Client","UploadPartCopyCommand").sc(g3).build(){}class bN extends H.classBuilder().ep({...K,UseObjectLambdaEndpoint:{type:"staticContextParams",value:!0}}).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AmazonS3","WriteGetObjectResponse",{}).n("S3Client","WriteGetObjectResponseCommand").sc(m3).build(){}const vN=Mc(Si,Y0,"ContinuationToken","ContinuationToken","MaxBuckets"),SN=Mc(Si,Z0,"ContinuationToken","ContinuationToken","MaxDirectoryBuckets"),TN=Mc(Si,eB,"ContinuationToken","NextContinuationToken","MaxAnnotationResults"),IN=Mc(Si,tB,"ContinuationToken","NextContinuationToken","MaxKeys"),xN=Mc(Si,rB,"PartNumberMarker","NextPartNumberMarker","MaxParts"),RN=async(t,e)=>{let r;try{return r=await t.send(new Ff(e)),{state:_t.SUCCESS,reason:r}}catch(n){if(r=n,n.name==="NotFound")return{state:_t.RETRY,reason:r}}return{state:_t.RETRY,reason:r}},Owe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,RN),UN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,RN);return Hh(n)},kN=async(t,e)=>{let r;try{r=await t.send(new Ff(e))}catch(n){if(r=n,n.name==="NotFound")return{state:_t.SUCCESS,reason:r}}return{state:_t.RETRY,reason:r}},Qwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,kN),FN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,kN);return Hh(n)},PN=async(t,e)=>{let r;try{return r=await t.send(new Pf(e)),{state:_t.SUCCESS,reason:r}}catch(n){if(r=n,n.name==="NotFound")return{state:_t.RETRY,reason:r}}return{state:_t.RETRY,reason:r}},Dwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,PN),ON=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,PN);return Hh(n)},QN=async(t,e)=>{let r;try{r=await t.send(new Pf(e))}catch(n){if(r=n,n.name==="NotFound")return{state:_t.SUCCESS,reason:r}}return{state:_t.RETRY,reason:r}},Lwe=async(t,e)=>fA({...{minDelay:5,maxDelay:120},...t},e,QN),DN=async(t,e)=>{const n=await fA({...{minDelay:5,maxDelay:120},...t},e,QN);return Hh(n)},Mwe={AbortMultipartUploadCommand:x3,CompleteMultipartUploadCommand:R3,CopyObjectCommand:U3,CreateBucketCommand:k3,CreateBucketMetadataConfigurationCommand:F3,CreateBucketMetadataTableConfigurationCommand:P3,CreateMultipartUploadCommand:O3,CreateSessionCommand:J0,DeleteBucketCommand:D3,DeleteBucketAnalyticsConfigurationCommand:Q3,DeleteBucketCorsCommand:L3,DeleteBucketEncryptionCommand:M3,DeleteBucketIntelligentTieringConfigurationCommand:N3,DeleteBucketInventoryConfigurationCommand:H3,DeleteBucketLifecycleCommand:$3,DeleteBucketMetadataConfigurationCommand:V3,DeleteBucketMetadataTableConfigurationCommand:K3,DeleteBucketMetricsConfigurationCommand:j3,DeleteBucketOwnershipControlsCommand:G3,DeleteBucketPolicyCommand:z3,DeleteBucketReplicationCommand:q3,DeleteBucketTaggingCommand:W3,DeleteBucketWebsiteCommand:J3,DeleteObjectCommand:Y3,DeleteObjectAnnotationCommand:X3,DeleteObjectsCommand:Z3,DeleteObjectTaggingCommand:eM,DeletePublicAccessBlockCommand:tM,GetBucketAbacCommand:rM,GetBucketAccelerateConfigurationCommand:nM,GetBucketAclCommand:sM,GetBucketAnalyticsConfigurationCommand:AM,GetBucketCorsCommand:iM,GetBucketEncryptionCommand:oM,GetBucketIntelligentTieringConfigurationCommand:aM,GetBucketInventoryConfigurationCommand:cM,GetBucketLifecycleConfigurationCommand:uM,GetBucketLocationCommand:lM,GetBucketLoggingCommand:hM,GetBucketMetadataConfigurationCommand:dM,GetBucketMetadataTableConfigurationCommand:fM,GetBucketMetricsConfigurationCommand:pM,GetBucketNotificationConfigurationCommand:gM,GetBucketOwnershipControlsCommand:mM,GetBucketPolicyCommand:wM,GetBucketPolicyStatusCommand:yM,GetBucketReplicationCommand:BM,GetBucketRequestPaymentCommand:CM,GetBucketTaggingCommand:EM,GetBucketVersioningCommand:_M,GetBucketWebsiteCommand:bM,GetObjectCommand:IM,GetObjectAclCommand:vM,GetObjectAnnotationCommand:SM,GetObjectAttributesCommand:TM,GetObjectLegalHoldCommand:xM,GetObjectLockConfigurationCommand:RM,GetObjectRetentionCommand:UM,GetObjectTaggingCommand:kM,GetObjectTorrentCommand:FM,GetPublicAccessBlockCommand:PM,HeadBucketCommand:Ff,HeadObjectCommand:Pf,ListBucketAnalyticsConfigurationsCommand:OM,ListBucketIntelligentTieringConfigurationsCommand:QM,ListBucketInventoryConfigurationsCommand:DM,ListBucketMetricsConfigurationsCommand:LM,ListBucketsCommand:Y0,ListDirectoryBucketsCommand:Z0,ListMultipartUploadsCommand:MM,ListObjectAnnotationsCommand:eB,ListObjectsCommand:NM,ListObjectsV2Command:tB,ListObjectVersionsCommand:HM,ListPartsCommand:rB,PutBucketAbacCommand:$M,PutBucketAccelerateConfigurationCommand:VM,PutBucketAclCommand:KM,PutBucketAnalyticsConfigurationCommand:jM,PutBucketCorsCommand:GM,PutBucketEncryptionCommand:zM,PutBucketIntelligentTieringConfigurationCommand:qM,PutBucketInventoryConfigurationCommand:WM,PutBucketLifecycleConfigurationCommand:JM,PutBucketLoggingCommand:XM,PutBucketMetricsConfigurationCommand:YM,PutBucketNotificationConfigurationCommand:ZM,PutBucketOwnershipControlsCommand:eN,PutBucketPolicyCommand:tN,PutBucketReplicationCommand:rN,PutBucketRequestPaymentCommand:nN,PutBucketTaggingCommand:sN,PutBucketVersioningCommand:AN,PutBucketWebsiteCommand:iN,PutObjectCommand:cN,PutObjectAclCommand:oN,PutObjectAnnotationCommand:aN,PutObjectLegalHoldCommand:uN,PutObjectLockConfigurationCommand:lN,PutObjectRetentionCommand:hN,PutObjectTaggingCommand:dN,PutPublicAccessBlockCommand:fN,RenameObjectCommand:pN,RestoreObjectCommand:gN,SelectObjectContentCommand:mN,UpdateBucketMetadataAnnotationTableConfigurationCommand:wN,UpdateBucketMetadataInventoryTableConfigurationCommand:yN,UpdateBucketMetadataJournalTableConfigurationCommand:BN,UpdateObjectEncryptionCommand:CN,UploadPartCommand:EN,UploadPartCopyCommand:_N,WriteGetObjectResponseCommand:bN},Nwe={paginateListBuckets:vN,paginateListDirectoryBuckets:SN,paginateListObjectAnnotations:TN,paginateListObjectsV2:IN,paginateListParts:xN},Hwe={waitUntilBucketExists:UN,waitUntilBucketNotExists:FN,waitUntilObjectExists:ON,waitUntilObjectNotExists:DN};class LN extends Si{}YZ(Mwe,LN,{paginators:Nwe,waiters:Hwe});const Of=Object.freeze(Object.defineProperty({__proto__:null,$Command:H,AbacStatus$:R0,AbortIncompleteMultipartUpload$:wF,AbortMultipartUpload$:fD,AbortMultipartUploadCommand:x3,AbortMultipartUploadOutput$:yF,AbortMultipartUploadRequest$:BF,AccelerateConfiguration$:CF,AccessControlPolicy$:U0,AccessControlTranslation$:EF,AccessDenied:ud,AccessDenied$:qk,AnalyticsAndOperator$:_F,AnalyticsConfiguration$:Cf,AnalyticsExportDestination$:bF,AnalyticsFilter$:uD,AnalyticsS3BucketDestination$:vF,AnalyticsS3ExportFileFormat:{CSV:"CSV"},AnnotationConfigurationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},AnnotationDirective:{COPY:"COPY",EXCLUDE:"EXCLUDE"},AnnotationEntry$:SF,AnnotationLimitExceeded:bd,AnnotationLimitExceeded$:Wk,AnnotationNameTooLong:vd,AnnotationNameTooLong$:Jk,AnnotationTableConfiguration$:TF,AnnotationTableConfigurationResult$:IF,AnnotationTableConfigurationUpdates$:xF,ArchiveStatus:{ARCHIVE_ACCESS:"ARCHIVE_ACCESS",DEEP_ARCHIVE_ACCESS:"DEEP_ARCHIVE_ACCESS"},BlockedEncryptionTypes$:RF,Bucket$:UF,BucketAbacStatus:{Disabled:"Disabled",Enabled:"Enabled"},BucketAccelerateStatus:{Enabled:"Enabled",Suspended:"Suspended"},BucketAlreadyExists:hd,BucketAlreadyExists$:Xk,BucketAlreadyOwnedByYou:dd,BucketAlreadyOwnedByYou$:Yk,BucketCannedACL:{authenticated_read:"authenticated-read",private:"private",public_read:"public-read",public_read_write:"public-read-write"},BucketInfo$:kF,BucketLifecycleConfiguration$:FF,BucketLocationConstraint:{EU:"EU",af_south_1:"af-south-1",ap_east_1:"ap-east-1",ap_east_2:"ap-east-2",ap_northeast_1:"ap-northeast-1",ap_northeast_2:"ap-northeast-2",ap_northeast_3:"ap-northeast-3",ap_south_1:"ap-south-1",ap_south_2:"ap-south-2",ap_southeast_1:"ap-southeast-1",ap_southeast_2:"ap-southeast-2",ap_southeast_3:"ap-southeast-3",ap_southeast_4:"ap-southeast-4",ap_southeast_5:"ap-southeast-5",ap_southeast_6:"ap-southeast-6",ap_southeast_7:"ap-southeast-7",ca_central_1:"ca-central-1",ca_west_1:"ca-west-1",cn_north_1:"cn-north-1",cn_northwest_1:"cn-northwest-1",eu_central_1:"eu-central-1",eu_central_2:"eu-central-2",eu_north_1:"eu-north-1",eu_south_1:"eu-south-1",eu_south_2:"eu-south-2",eu_west_1:"eu-west-1",eu_west_2:"eu-west-2",eu_west_3:"eu-west-3",il_central_1:"il-central-1",me_central_1:"me-central-1",me_south_1:"me-south-1",mx_central_1:"mx-central-1",sa_east_1:"sa-east-1",us_east_2:"us-east-2",us_gov_east_1:"us-gov-east-1",us_gov_west_1:"us-gov-west-1",us_west_1:"us-west-1",us_west_2:"us-west-2"},BucketLoggingStatus$:PF,BucketLogsPermission:{FULL_CONTROL:"FULL_CONTROL",READ:"READ",WRITE:"WRITE"},BucketNamespace:{ACCOUNT_REGIONAL:"account-regional",GLOBAL:"global"},BucketType:{Directory:"Directory"},BucketVersioningStatus:{Enabled:"Enabled",Suspended:"Suspended"},CORSConfiguration$:zF,CORSRule$:qF,CSVInput$:s2,CSVOutput$:A2,Checksum$:OF,ChecksumAlgorithm:{CRC32:"CRC32",CRC32C:"CRC32C",CRC64NVME:"CRC64NVME",MD5:"MD5",SHA1:"SHA1",SHA256:"SHA256",SHA512:"SHA512",XXHASH128:"XXHASH128",XXHASH3:"XXHASH3",XXHASH64:"XXHASH64"},ChecksumMode:{ENABLED:"ENABLED"},ChecksumType:{COMPOSITE:"COMPOSITE",FULL_OBJECT:"FULL_OBJECT"},CommonPrefix$:QF,CompleteMultipartUpload$:pD,CompleteMultipartUploadCommand:R3,CompleteMultipartUploadOutput$:MF,CompleteMultipartUploadRequest$:NF,CompletedMultipartUpload$:DF,CompletedPart$:LF,CompressionType:{BZIP2:"BZIP2",GZIP:"GZIP",NONE:"NONE"},Condition$:HF,ContinuationEvent$:$F,CopyObject$:gD,CopyObjectCommand:U3,CopyObjectOutput$:VF,CopyObjectRequest$:KF,CopyObjectResult$:jF,CopyPartResult$:GF,CreateBucket$:mD,CreateBucketCommand:k3,CreateBucketConfiguration$:WF,CreateBucketMetadataConfiguration$:wD,CreateBucketMetadataConfigurationCommand:F3,CreateBucketMetadataConfigurationRequest$:JF,CreateBucketMetadataTableConfiguration$:yD,CreateBucketMetadataTableConfigurationCommand:P3,CreateBucketMetadataTableConfigurationRequest$:XF,CreateBucketOutput$:YF,CreateBucketRequest$:ZF,CreateMultipartUpload$:BD,CreateMultipartUploadCommand:O3,CreateMultipartUploadOutput$:e2,CreateMultipartUploadRequest$:t2,CreateSession$:CD,CreateSessionCommand:J0,CreateSessionOutput$:r2,CreateSessionRequest$:n2,DataRedundancy:{SingleAvailabilityZone:"SingleAvailabilityZone",SingleLocalZone:"SingleLocalZone"},DefaultRetention$:i2,Delete$:o2,DeleteBucket$:ED,DeleteBucketAnalyticsConfiguration$:_D,DeleteBucketAnalyticsConfigurationCommand:Q3,DeleteBucketAnalyticsConfigurationRequest$:a2,DeleteBucketCommand:D3,DeleteBucketCors$:bD,DeleteBucketCorsCommand:L3,DeleteBucketCorsRequest$:c2,DeleteBucketEncryption$:vD,DeleteBucketEncryptionCommand:M3,DeleteBucketEncryptionRequest$:u2,DeleteBucketIntelligentTieringConfiguration$:SD,DeleteBucketIntelligentTieringConfigurationCommand:N3,DeleteBucketIntelligentTieringConfigurationRequest$:l2,DeleteBucketInventoryConfiguration$:TD,DeleteBucketInventoryConfigurationCommand:H3,DeleteBucketInventoryConfigurationRequest$:h2,DeleteBucketLifecycle$:ID,DeleteBucketLifecycleCommand:$3,DeleteBucketLifecycleRequest$:d2,DeleteBucketMetadataConfiguration$:xD,DeleteBucketMetadataConfigurationCommand:V3,DeleteBucketMetadataConfigurationRequest$:f2,DeleteBucketMetadataTableConfiguration$:RD,DeleteBucketMetadataTableConfigurationCommand:K3,DeleteBucketMetadataTableConfigurationRequest$:p2,DeleteBucketMetricsConfiguration$:UD,DeleteBucketMetricsConfigurationCommand:j3,DeleteBucketMetricsConfigurationRequest$:g2,DeleteBucketOwnershipControls$:kD,DeleteBucketOwnershipControlsCommand:G3,DeleteBucketOwnershipControlsRequest$:m2,DeleteBucketPolicy$:FD,DeleteBucketPolicyCommand:z3,DeleteBucketPolicyRequest$:w2,DeleteBucketReplication$:PD,DeleteBucketReplicationCommand:q3,DeleteBucketReplicationRequest$:y2,DeleteBucketRequest$:B2,DeleteBucketTagging$:OD,DeleteBucketTaggingCommand:W3,DeleteBucketTaggingRequest$:C2,DeleteBucketWebsite$:QD,DeleteBucketWebsiteCommand:J3,DeleteBucketWebsiteRequest$:E2,DeleteMarkerEntry$:b2,DeleteMarkerReplication$:v2,DeleteMarkerReplicationStatus:{Disabled:"Disabled",Enabled:"Enabled"},DeleteObject$:DD,DeleteObjectAnnotation$:LD,DeleteObjectAnnotationCommand:X3,DeleteObjectAnnotationOutput$:S2,DeleteObjectAnnotationRequest$:T2,DeleteObjectCommand:Y3,DeleteObjectOutput$:I2,DeleteObjectRequest$:x2,DeleteObjectTagging$:ND,DeleteObjectTaggingCommand:eM,DeleteObjectTaggingOutput$:k2,DeleteObjectTaggingRequest$:F2,DeleteObjects$:MD,DeleteObjectsCommand:Z3,DeleteObjectsOutput$:R2,DeleteObjectsRequest$:U2,DeletePublicAccessBlock$:HD,DeletePublicAccessBlockCommand:tM,DeletePublicAccessBlockRequest$:P2,DeletedObject$:_2,Destination$:O2,DestinationResult$:Q2,EncodingType:{url:"url"},Encryption$:D2,EncryptionConfiguration$:L2,EncryptionType:{NONE:"NONE",SSE_C:"SSE-C"},EncryptionTypeMismatch:Bd,EncryptionTypeMismatch$:Zk,EndEvent$:M2,ErrorDetails$:wu,ErrorDocument$:k0,Event:{s3_IntelligentTiering:"s3:IntelligentTiering",s3_LifecycleExpiration_:"s3:LifecycleExpiration:*",s3_LifecycleExpiration_Delete:"s3:LifecycleExpiration:Delete",s3_LifecycleExpiration_DeleteMarkerCreated:"s3:LifecycleExpiration:DeleteMarkerCreated",s3_LifecycleTransition:"s3:LifecycleTransition",s3_ObjectAcl_Put:"s3:ObjectAcl:Put",s3_ObjectAnnotation_:"s3:ObjectAnnotation:*",s3_ObjectAnnotation_Delete:"s3:ObjectAnnotation:Delete",s3_ObjectAnnotation_Put:"s3:ObjectAnnotation:Put",s3_ObjectCreated_:"s3:ObjectCreated:*",s3_ObjectCreated_CompleteMultipartUpload:"s3:ObjectCreated:CompleteMultipartUpload",s3_ObjectCreated_Copy:"s3:ObjectCreated:Copy",s3_ObjectCreated_Post:"s3:ObjectCreated:Post",s3_ObjectCreated_Put:"s3:ObjectCreated:Put",s3_ObjectRemoved_:"s3:ObjectRemoved:*",s3_ObjectRemoved_Delete:"s3:ObjectRemoved:Delete",s3_ObjectRemoved_DeleteMarkerCreated:"s3:ObjectRemoved:DeleteMarkerCreated",s3_ObjectRestore_:"s3:ObjectRestore:*",s3_ObjectRestore_Completed:"s3:ObjectRestore:Completed",s3_ObjectRestore_Delete:"s3:ObjectRestore:Delete",s3_ObjectRestore_Post:"s3:ObjectRestore:Post",s3_ObjectTagging_:"s3:ObjectTagging:*",s3_ObjectTagging_Delete:"s3:ObjectTagging:Delete",s3_ObjectTagging_Put:"s3:ObjectTagging:Put",s3_ReducedRedundancyLostObject:"s3:ReducedRedundancyLostObject",s3_Replication_:"s3:Replication:*",s3_Replication_OperationFailedReplication:"s3:Replication:OperationFailedReplication",s3_Replication_OperationMissedThreshold:"s3:Replication:OperationMissedThreshold",s3_Replication_OperationNotTracked:"s3:Replication:OperationNotTracked",s3_Replication_OperationReplicatedAfterThreshold:"s3:Replication:OperationReplicatedAfterThreshold"},EventBridgeConfiguration$:H2,ExistingObjectReplication$:$2,ExistingObjectReplicationStatus:{Disabled:"Disabled",Enabled:"Enabled"},ExpirationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},ExpirationStatus:{Disabled:"Disabled",Enabled:"Enabled"},ExpressionType:{SQL:"SQL"},FileHeaderInfo:{IGNORE:"IGNORE",NONE:"NONE",USE:"USE"},FilterRule$:V2,FilterRuleName:{prefix:"prefix",suffix:"suffix"},GetBucketAbac$:$D,GetBucketAbacCommand:rM,GetBucketAbacOutput$:K2,GetBucketAbacRequest$:j2,GetBucketAccelerateConfiguration$:VD,GetBucketAccelerateConfigurationCommand:nM,GetBucketAccelerateConfigurationOutput$:G2,GetBucketAccelerateConfigurationRequest$:z2,GetBucketAcl$:KD,GetBucketAclCommand:sM,GetBucketAclOutput$:q2,GetBucketAclRequest$:W2,GetBucketAnalyticsConfiguration$:jD,GetBucketAnalyticsConfigurationCommand:AM,GetBucketAnalyticsConfigurationOutput$:J2,GetBucketAnalyticsConfigurationRequest$:X2,GetBucketCors$:GD,GetBucketCorsCommand:iM,GetBucketCorsOutput$:Y2,GetBucketCorsRequest$:Z2,GetBucketEncryption$:zD,GetBucketEncryptionCommand:oM,GetBucketEncryptionOutput$:eP,GetBucketEncryptionRequest$:tP,GetBucketIntelligentTieringConfiguration$:qD,GetBucketIntelligentTieringConfigurationCommand:aM,GetBucketIntelligentTieringConfigurationOutput$:rP,GetBucketIntelligentTieringConfigurationRequest$:nP,GetBucketInventoryConfiguration$:WD,GetBucketInventoryConfigurationCommand:cM,GetBucketInventoryConfigurationOutput$:sP,GetBucketInventoryConfigurationRequest$:AP,GetBucketLifecycleConfiguration$:JD,GetBucketLifecycleConfigurationCommand:uM,GetBucketLifecycleConfigurationOutput$:iP,GetBucketLifecycleConfigurationRequest$:oP,GetBucketLocation$:XD,GetBucketLocationCommand:lM,GetBucketLocationOutput$:aP,GetBucketLocationRequest$:cP,GetBucketLogging$:YD,GetBucketLoggingCommand:hM,GetBucketLoggingOutput$:uP,GetBucketLoggingRequest$:lP,GetBucketMetadataConfiguration$:ZD,GetBucketMetadataConfigurationCommand:dM,GetBucketMetadataConfigurationOutput$:hP,GetBucketMetadataConfigurationRequest$:dP,GetBucketMetadataConfigurationResult$:fP,GetBucketMetadataTableConfiguration$:eL,GetBucketMetadataTableConfigurationCommand:fM,GetBucketMetadataTableConfigurationOutput$:pP,GetBucketMetadataTableConfigurationRequest$:gP,GetBucketMetadataTableConfigurationResult$:mP,GetBucketMetricsConfiguration$:tL,GetBucketMetricsConfigurationCommand:pM,GetBucketMetricsConfigurationOutput$:wP,GetBucketMetricsConfigurationRequest$:yP,GetBucketNotificationConfiguration$:rL,GetBucketNotificationConfigurationCommand:gM,GetBucketNotificationConfigurationRequest$:BP,GetBucketOwnershipControls$:nL,GetBucketOwnershipControlsCommand:mM,GetBucketOwnershipControlsOutput$:CP,GetBucketOwnershipControlsRequest$:EP,GetBucketPolicy$:sL,GetBucketPolicyCommand:wM,GetBucketPolicyOutput$:_P,GetBucketPolicyRequest$:bP,GetBucketPolicyStatus$:AL,GetBucketPolicyStatusCommand:yM,GetBucketPolicyStatusOutput$:vP,GetBucketPolicyStatusRequest$:SP,GetBucketReplication$:iL,GetBucketReplicationCommand:BM,GetBucketReplicationOutput$:TP,GetBucketReplicationRequest$:IP,GetBucketRequestPayment$:oL,GetBucketRequestPaymentCommand:CM,GetBucketRequestPaymentOutput$:xP,GetBucketRequestPaymentRequest$:RP,GetBucketTagging$:aL,GetBucketTaggingCommand:EM,GetBucketTaggingOutput$:UP,GetBucketTaggingRequest$:kP,GetBucketVersioning$:cL,GetBucketVersioningCommand:_M,GetBucketVersioningOutput$:FP,GetBucketVersioningRequest$:PP,GetBucketWebsite$:uL,GetBucketWebsiteCommand:bM,GetBucketWebsiteOutput$:OP,GetBucketWebsiteRequest$:QP,GetObject$:lL,GetObjectAcl$:hL,GetObjectAclCommand:vM,GetObjectAclOutput$:DP,GetObjectAclRequest$:LP,GetObjectAnnotation$:dL,GetObjectAnnotationCommand:SM,GetObjectAnnotationOutput$:MP,GetObjectAnnotationRequest$:NP,GetObjectAttributes$:fL,GetObjectAttributesCommand:TM,GetObjectAttributesOutput$:HP,GetObjectAttributesParts$:$P,GetObjectAttributesRequest$:VP,GetObjectCommand:IM,GetObjectLegalHold$:pL,GetObjectLegalHoldCommand:xM,GetObjectLegalHoldOutput$:KP,GetObjectLegalHoldRequest$:jP,GetObjectLockConfiguration$:gL,GetObjectLockConfigurationCommand:RM,GetObjectLockConfigurationOutput$:GP,GetObjectLockConfigurationRequest$:zP,GetObjectOutput$:qP,GetObjectRequest$:WP,GetObjectRetention$:mL,GetObjectRetentionCommand:UM,GetObjectRetentionOutput$:JP,GetObjectRetentionRequest$:XP,GetObjectTagging$:wL,GetObjectTaggingCommand:kM,GetObjectTaggingOutput$:YP,GetObjectTaggingRequest$:ZP,GetObjectTorrent$:yL,GetObjectTorrentCommand:FM,GetObjectTorrentOutput$:eO,GetObjectTorrentRequest$:tO,GetPublicAccessBlock$:BL,GetPublicAccessBlockCommand:PM,GetPublicAccessBlockOutput$:rO,GetPublicAccessBlockRequest$:nO,GlacierJobParameters$:sO,Grant$:AO,Grantee$:F0,HeadBucket$:CL,HeadBucketCommand:Ff,HeadBucketOutput$:iO,HeadBucketRequest$:oO,HeadObject$:EL,HeadObjectCommand:Pf,HeadObjectOutput$:aO,HeadObjectRequest$:cO,IdempotencyParameterMismatch:Id,IdempotencyParameterMismatch$:eF,IndexDocument$:P0,Initiator$:O0,InputSerialization$:Q0,IntelligentTieringAccessTier:{ARCHIVE_ACCESS:"ARCHIVE_ACCESS",DEEP_ARCHIVE_ACCESS:"DEEP_ARCHIVE_ACCESS"},IntelligentTieringAndOperator$:uO,IntelligentTieringConfiguration$:Ef,IntelligentTieringFilter$:lO,IntelligentTieringStatus:{Disabled:"Disabled",Enabled:"Enabled"},InvalidAnnotationName:Sd,InvalidAnnotationName$:tF,InvalidObjectState:gd,InvalidObjectState$:rF,InvalidPrefix:yd,InvalidPrefix$:nF,InvalidRequest:Cd,InvalidRequest$:sF,InvalidWriteOffset:Ed,InvalidWriteOffset$:AF,InventoryConfiguration$:_f,InventoryConfigurationState:{DISABLED:"DISABLED",ENABLED:"ENABLED"},InventoryDestination$:hO,InventoryEncryption$:dO,InventoryFilter$:fO,InventoryFormat:{CSV:"CSV",ORC:"ORC",Parquet:"Parquet"},InventoryFrequency:{Daily:"Daily",Weekly:"Weekly"},InventoryIncludedObjectVersions:{All:"All",Current:"Current"},InventoryOptionalField:{BucketKeyStatus:"BucketKeyStatus",ChecksumAlgorithm:"ChecksumAlgorithm",ETag:"ETag",EncryptionStatus:"EncryptionStatus",IntelligentTieringAccessTier:"IntelligentTieringAccessTier",IsMultipartUploaded:"IsMultipartUploaded",LastModifiedDate:"LastModifiedDate",LifecycleExpirationDate:"LifecycleExpirationDate",ObjectAccessControlList:"ObjectAccessControlList",ObjectLockLegalHoldStatus:"ObjectLockLegalHoldStatus",ObjectLockMode:"ObjectLockMode",ObjectLockRetainUntilDate:"ObjectLockRetainUntilDate",ObjectOwner:"ObjectOwner",ReplicationStatus:"ReplicationStatus",Size:"Size",StorageClass:"StorageClass"},InventoryS3BucketDestination$:pO,InventorySchedule$:gO,InventoryTableConfiguration$:mO,InventoryTableConfigurationResult$:wO,InventoryTableConfigurationUpdates$:yO,JSONInput$:_O,JSONOutput$:bO,JSONType:{DOCUMENT:"DOCUMENT",LINES:"LINES"},JournalTableConfiguration$:BO,JournalTableConfigurationResult$:CO,JournalTableConfigurationUpdates$:EO,LambdaFunctionConfiguration$:vO,LifecycleExpiration$:SO,LifecycleRule$:TO,LifecycleRuleAndOperator$:IO,LifecycleRuleFilter$:xO,ListBucketAnalyticsConfigurations$:_L,ListBucketAnalyticsConfigurationsCommand:OM,ListBucketAnalyticsConfigurationsOutput$:RO,ListBucketAnalyticsConfigurationsRequest$:UO,ListBucketIntelligentTieringConfigurations$:bL,ListBucketIntelligentTieringConfigurationsCommand:QM,ListBucketIntelligentTieringConfigurationsOutput$:kO,ListBucketIntelligentTieringConfigurationsRequest$:FO,ListBucketInventoryConfigurations$:vL,ListBucketInventoryConfigurationsCommand:DM,ListBucketInventoryConfigurationsOutput$:PO,ListBucketInventoryConfigurationsRequest$:OO,ListBucketMetricsConfigurations$:SL,ListBucketMetricsConfigurationsCommand:LM,ListBucketMetricsConfigurationsOutput$:QO,ListBucketMetricsConfigurationsRequest$:DO,ListBuckets$:TL,ListBucketsCommand:Y0,ListBucketsOutput$:LO,ListBucketsRequest$:MO,ListDirectoryBuckets$:IL,ListDirectoryBucketsCommand:Z0,ListDirectoryBucketsOutput$:NO,ListDirectoryBucketsRequest$:HO,ListMultipartUploads$:xL,ListMultipartUploadsCommand:MM,ListMultipartUploadsOutput$:$O,ListMultipartUploadsRequest$:VO,ListObjectAnnotations$:RL,ListObjectAnnotationsCommand:eB,ListObjectAnnotationsOutput$:KO,ListObjectAnnotationsRequest$:jO,ListObjectVersions$:FL,ListObjectVersionsCommand:HM,ListObjectVersionsOutput$:JO,ListObjectVersionsRequest$:XO,ListObjects$:UL,ListObjectsCommand:NM,ListObjectsOutput$:GO,ListObjectsRequest$:zO,ListObjectsV2$:kL,ListObjectsV2Command:tB,ListObjectsV2Output$:qO,ListObjectsV2Request$:WO,ListParts$:PL,ListPartsCommand:rB,ListPartsOutput$:YO,ListPartsRequest$:ZO,LocationInfo$:eQ,LocationType:{AvailabilityZone:"AvailabilityZone",LocalZone:"LocalZone"},LoggingEnabled$:D0,MFADelete:{Disabled:"Disabled",Enabled:"Enabled"},MFADeleteStatus:{Disabled:"Disabled",Enabled:"Enabled"},MetadataConfiguration$:tQ,MetadataConfigurationResult$:rQ,MetadataDirective:{COPY:"COPY",REPLACE:"REPLACE"},MetadataEntry$:nQ,MetadataTableConfiguration$:sQ,MetadataTableConfigurationResult$:AQ,MetadataTableEncryptionConfiguration$:ca,Metrics$:iQ,MetricsAndOperator$:oQ,MetricsConfiguration$:bf,MetricsFilter$:lD,MetricsStatus:{Disabled:"Disabled",Enabled:"Enabled"},MultipartUpload$:aQ,NoSuchAnnotation:md,NoSuchAnnotation$:iF,NoSuchBucket:fd,NoSuchBucket$:oF,NoSuchKey:pd,NoSuchKey$:aF,NoSuchUpload:cd,NoSuchUpload$:cF,NoncurrentVersionExpiration$:cQ,NoncurrentVersionTransition$:uQ,NotFound:wd,NotFound$:uF,NotificationConfiguration$:L0,NotificationConfigurationFilter$:vf,ObjectAlreadyInActiveTierError:xd,ObjectAlreadyInActiveTierError$:lF,ObjectAttributes:{CHECKSUM:"Checksum",ETAG:"ETag",OBJECT_PARTS:"ObjectParts",OBJECT_SIZE:"ObjectSize",STORAGE_CLASS:"StorageClass"},ObjectCannedACL:{authenticated_read:"authenticated-read",aws_exec_read:"aws-exec-read",bucket_owner_full_control:"bucket-owner-full-control",bucket_owner_read:"bucket-owner-read",private:"private",public_read:"public-read",public_read_write:"public-read-write"},ObjectEncryption$:hD,ObjectIdentifier$:hQ,ObjectLockConfiguration$:M0,ObjectLockEnabled:{Enabled:"Enabled"},ObjectLockLegalHold$:N0,ObjectLockLegalHoldStatus:{OFF:"OFF",ON:"ON"},ObjectLockMode:{COMPLIANCE:"COMPLIANCE",GOVERNANCE:"GOVERNANCE"},ObjectLockRetention$:H0,ObjectLockRetentionMode:{COMPLIANCE:"COMPLIANCE",GOVERNANCE:"GOVERNANCE"},ObjectLockRule$:dQ,ObjectNotInActiveTierError:ld,ObjectNotInActiveTierError$:hF,ObjectOwnership:{BucketOwnerEnforced:"BucketOwnerEnforced",BucketOwnerPreferred:"BucketOwnerPreferred",ObjectWriter:"ObjectWriter"},ObjectPart$:fQ,ObjectStorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",EXPRESS_ONEZONE:"EXPRESS_ONEZONE",FSX_ONTAP:"FSX_ONTAP",FSX_OPENZFS:"FSX_OPENZFS",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",OUTPOSTS:"OUTPOSTS",REDUCED_REDUNDANCY:"REDUCED_REDUNDANCY",SNOW:"SNOW",STANDARD:"STANDARD",STANDARD_IA:"STANDARD_IA"},ObjectVersion$:pQ,ObjectVersionStorageClass:{STANDARD:"STANDARD"},OptionalObjectAttributes:{RESTORE_STATUS:"RestoreStatus"},OutputLocation$:gQ,OutputSerialization$:$0,Owner$:ds,OwnerOverride:{Destination:"Destination"},OwnershipControls$:V0,OwnershipControlsRule$:mQ,ParquetInput$:wQ,Part$:yQ,PartitionDateSource:{DeliveryTime:"DeliveryTime",EventTime:"EventTime"},PartitionedPrefix$:BQ,Payer:{BucketOwner:"BucketOwner",Requester:"Requester"},Permission:{FULL_CONTROL:"FULL_CONTROL",READ:"READ",READ_ACP:"READ_ACP",WRITE:"WRITE",WRITE_ACP:"WRITE_ACP"},PolicyStatus$:CQ,Progress$:EQ,ProgressEvent$:_Q,Protocol:{http:"http",https:"https"},PublicAccessBlockConfiguration$:K0,PutBucketAbac$:OL,PutBucketAbacCommand:$M,PutBucketAbacRequest$:bQ,PutBucketAccelerateConfiguration$:QL,PutBucketAccelerateConfigurationCommand:VM,PutBucketAccelerateConfigurationRequest$:vQ,PutBucketAcl$:DL,PutBucketAclCommand:KM,PutBucketAclRequest$:SQ,PutBucketAnalyticsConfiguration$:LL,PutBucketAnalyticsConfigurationCommand:jM,PutBucketAnalyticsConfigurationRequest$:TQ,PutBucketCors$:ML,PutBucketCorsCommand:GM,PutBucketCorsRequest$:IQ,PutBucketEncryption$:NL,PutBucketEncryptionCommand:zM,PutBucketEncryptionRequest$:xQ,PutBucketIntelligentTieringConfiguration$:HL,PutBucketIntelligentTieringConfigurationCommand:qM,PutBucketIntelligentTieringConfigurationRequest$:RQ,PutBucketInventoryConfiguration$:$L,PutBucketInventoryConfigurationCommand:WM,PutBucketInventoryConfigurationRequest$:UQ,PutBucketLifecycleConfiguration$:VL,PutBucketLifecycleConfigurationCommand:JM,PutBucketLifecycleConfigurationOutput$:kQ,PutBucketLifecycleConfigurationRequest$:FQ,PutBucketLogging$:KL,PutBucketLoggingCommand:XM,PutBucketLoggingRequest$:PQ,PutBucketMetricsConfiguration$:jL,PutBucketMetricsConfigurationCommand:YM,PutBucketMetricsConfigurationRequest$:OQ,PutBucketNotificationConfiguration$:GL,PutBucketNotificationConfigurationCommand:ZM,PutBucketNotificationConfigurationRequest$:QQ,PutBucketOwnershipControls$:zL,PutBucketOwnershipControlsCommand:eN,PutBucketOwnershipControlsRequest$:DQ,PutBucketPolicy$:qL,PutBucketPolicyCommand:tN,PutBucketPolicyRequest$:LQ,PutBucketReplication$:WL,PutBucketReplicationCommand:rN,PutBucketReplicationRequest$:MQ,PutBucketRequestPayment$:JL,PutBucketRequestPaymentCommand:nN,PutBucketRequestPaymentRequest$:NQ,PutBucketTagging$:XL,PutBucketTaggingCommand:sN,PutBucketTaggingRequest$:HQ,PutBucketVersioning$:YL,PutBucketVersioningCommand:AN,PutBucketVersioningRequest$:$Q,PutBucketWebsite$:ZL,PutBucketWebsiteCommand:iN,PutBucketWebsiteRequest$:VQ,PutObject$:e3,PutObjectAcl$:t3,PutObjectAclCommand:oN,PutObjectAclOutput$:KQ,PutObjectAclRequest$:jQ,PutObjectAnnotation$:r3,PutObjectAnnotationCommand:aN,PutObjectAnnotationOutput$:GQ,PutObjectAnnotationRequest$:zQ,PutObjectCommand:cN,PutObjectLegalHold$:n3,PutObjectLegalHoldCommand:uN,PutObjectLegalHoldOutput$:qQ,PutObjectLegalHoldRequest$:WQ,PutObjectLockConfiguration$:s3,PutObjectLockConfigurationCommand:lN,PutObjectLockConfigurationOutput$:JQ,PutObjectLockConfigurationRequest$:XQ,PutObjectOutput$:YQ,PutObjectRequest$:ZQ,PutObjectRetention$:A3,PutObjectRetentionCommand:hN,PutObjectRetentionOutput$:e4,PutObjectRetentionRequest$:t4,PutObjectTagging$:i3,PutObjectTaggingCommand:dN,PutObjectTaggingOutput$:r4,PutObjectTaggingRequest$:n4,PutPublicAccessBlock$:o3,PutPublicAccessBlockCommand:fN,PutPublicAccessBlockRequest$:s4,QueueConfiguration$:A4,QuoteFields:{ALWAYS:"ALWAYS",ASNEEDED:"ASNEEDED"},RecordExpiration$:Sf,RecordsEvent$:i4,Redirect$:o4,RedirectAllRequestsTo$:j0,RenameObject$:a3,RenameObjectCommand:pN,RenameObjectOutput$:a4,RenameObjectRequest$:c4,ReplicaModifications$:u4,ReplicaModificationsStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationConfiguration$:G0,ReplicationRule$:l4,ReplicationRuleAndOperator$:h4,ReplicationRuleFilter$:d4,ReplicationRuleStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationStatus:{COMPLETE:"COMPLETE",COMPLETED:"COMPLETED",FAILED:"FAILED",PENDING:"PENDING",REPLICA:"REPLICA"},ReplicationTime$:f4,ReplicationTimeStatus:{Disabled:"Disabled",Enabled:"Enabled"},ReplicationTimeValue$:z0,RequestCharged:{requester:"requester"},RequestPayer:{requester:"requester"},RequestPaymentConfiguration$:p4,RequestProgress$:g4,RestoreObject$:c3,RestoreObjectCommand:gN,RestoreObjectOutput$:m4,RestoreObjectRequest$:w4,RestoreRequest$:y4,RestoreRequestType:{SELECT:"SELECT"},RestoreStatus$:q0,RoutingRule$:B4,S3:LN,S3Client:Si,S3KeyFilter$:C4,S3Location$:E4,S3ServiceException:je,S3ServiceException$:zk,S3TablesBucketType:{aws:"aws",customer:"customer"},S3TablesDestination$:_4,S3TablesDestinationResult$:b4,SSEKMS$:P4,SSEKMSEncryption$:Q4,SSES3$:D4,ScanRange$:v4,SelectObjectContent$:u3,SelectObjectContentCommand:mN,SelectObjectContentEventStream$:dD,SelectObjectContentOutput$:S4,SelectObjectContentRequest$:T4,SelectParameters$:I4,ServerSideEncryption:{AES256:"AES256",aws_fsx:"aws:fsx",aws_kms:"aws:kms",aws_kms_dsse:"aws:kms:dsse"},ServerSideEncryptionByDefault$:x4,ServerSideEncryptionConfiguration$:W0,ServerSideEncryptionRule$:R4,SessionCredentials$:U4,SessionMode:{ReadOnly:"ReadOnly",ReadWrite:"ReadWrite"},SimplePrefix$:k4,SourceSelectionCriteria$:F4,SseKmsEncryptedObjects$:O4,SseKmsEncryptedObjectsStatus:{Disabled:"Disabled",Enabled:"Enabled"},Stats$:L4,StatsEvent$:M4,StorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",EXPRESS_ONEZONE:"EXPRESS_ONEZONE",FSX_ONTAP:"FSX_ONTAP",FSX_OPENZFS:"FSX_OPENZFS",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",OUTPOSTS:"OUTPOSTS",REDUCED_REDUNDANCY:"REDUCED_REDUNDANCY",SNOW:"SNOW",STANDARD:"STANDARD",STANDARD_IA:"STANDARD_IA"},StorageClassAnalysis$:N4,StorageClassAnalysisDataExport$:H4,StorageClassAnalysisSchemaVersion:{V_1:"V_1"},TableSseAlgorithm:{AES256:"AES256",aws_kms:"aws:kms"},Tag$:vi,Tagging$:Tf,TaggingDirective:{COPY:"COPY",REPLACE:"REPLACE"},TargetGrant$:$4,TargetObjectKeyFormat$:V4,Tier:{Bulk:"Bulk",Expedited:"Expedited",Standard:"Standard"},Tiering$:K4,TooManyParts:_d,TooManyParts$:dF,TopicConfiguration$:j4,Transition$:G4,TransitionDefaultMinimumObjectSize:{all_storage_classes_128K:"all_storage_classes_128K",varies_by_storage_class:"varies_by_storage_class"},TransitionStorageClass:{DEEP_ARCHIVE:"DEEP_ARCHIVE",GLACIER:"GLACIER",GLACIER_IR:"GLACIER_IR",INTELLIGENT_TIERING:"INTELLIGENT_TIERING",ONEZONE_IA:"ONEZONE_IA",STANDARD_IA:"STANDARD_IA"},Type:{AmazonCustomerByEmail:"AmazonCustomerByEmail",CanonicalUser:"CanonicalUser",Group:"Group"},UnsupportedMediaType:Td,UnsupportedMediaType$:fF,UpdateBucketMetadataAnnotationTableConfiguration$:l3,UpdateBucketMetadataAnnotationTableConfigurationCommand:wN,UpdateBucketMetadataAnnotationTableConfigurationRequest$:z4,UpdateBucketMetadataInventoryTableConfiguration$:h3,UpdateBucketMetadataInventoryTableConfigurationCommand:yN,UpdateBucketMetadataInventoryTableConfigurationRequest$:q4,UpdateBucketMetadataJournalTableConfiguration$:d3,UpdateBucketMetadataJournalTableConfigurationCommand:BN,UpdateBucketMetadataJournalTableConfigurationRequest$:W4,UpdateObjectEncryption$:f3,UpdateObjectEncryptionCommand:CN,UpdateObjectEncryptionRequest$:J4,UpdateObjectEncryptionResponse$:X4,UploadPart$:p3,UploadPartCommand:EN,UploadPartCopy$:g3,UploadPartCopyCommand:_N,UploadPartCopyOutput$:Y4,UploadPartCopyRequest$:Z4,UploadPartOutput$:eD,UploadPartRequest$:tD,VersioningConfiguration$:rD,WebsiteConfiguration$:nD,WriteGetObjectResponse$:m3,WriteGetObjectResponseCommand:bN,WriteGetObjectResponseRequest$:sD,_Error$:N2,_Object$:lQ,__Client:lw,errorTypeRegistries:pF,paginateListBuckets:vN,paginateListDirectoryBuckets:SN,paginateListObjectAnnotations:TN,paginateListObjectsV2:IN,paginateListParts:xN,waitForBucketExists:Owe,waitForBucketNotExists:Qwe,waitForObjectExists:Dwe,waitForObjectNotExists:Lwe,waitUntilBucketExists:UN,waitUntilBucketNotExists:FN,waitUntilObjectExists:ON,waitUntilObjectNotExists:DN},Symbol.toStringTag,{value:"Module"}));function MN(t){return Promise.all(Object.keys(t).reduce((e,r)=>{const n=t[r];return typeof n=="string"?e.push([r,n]):e.push(n().then(s=>[r,s])),e},[])).then(e=>e.reduce((r,[n,s])=>(r[n]=s,r),{}))}function NN(t){return async e=>{var c;(c=t.logger)==null||c.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:r,CognitoIdentityClient:n}=await Promise.resolve().then(()=>ZN),s=l=>{var h,d,p;return((h=t.clientConfig)==null?void 0:h[l])??((d=t.parentClientConfig)==null?void 0:d[l])??((p=e==null?void 0:e.callerClientConfig)==null?void 0:p[l])},{Credentials:{AccessKeyId:A=$we(t.logger),Expiration:i,SecretKey:o=Kwe(t.logger),SessionToken:a}=Vwe(t.logger)}=await(t.client??new n(Object.assign({},t.clientConfig??{},{region:s("region"),profile:s("profile"),userAgentAppId:s("userAgentAppId")}))).send(new r({CustomRoleArn:t.customRoleArn,IdentityId:t.identityId,Logins:t.logins?await MN(t.logins):void 0}));return{identityId:t.identityId,accessKeyId:A,secretAccessKey:o,sessionToken:a,expiration:i}}}function $we(t){throw new vo("Response from Amazon Cognito contained no access key ID",{logger:t})}function Vwe(t){throw new vo("Response from Amazon Cognito contained no credentials",{logger:t})}function Kwe(t){throw new vo("Response from Amazon Cognito contained no secret key",{logger:t})}const nB="IdentityIds";class jwe{constructor(e="aws:cognito-identity-ids"){S(this,"dbName");this.dbName=e}getItem(e){return this.withObjectStore("readonly",r=>{const n=r.get(e);return new Promise(s=>{n.onerror=()=>s(null),n.onsuccess=()=>s(n.result?n.result.value:null)})}).catch(()=>null)}removeItem(e){return this.withObjectStore("readwrite",r=>{const n=r.delete(e);return new Promise((s,A)=>{n.onerror=()=>A(n.error),n.onsuccess=()=>s()})})}setItem(e,r){return this.withObjectStore("readwrite",n=>{const s=n.put({id:e,value:r});return new Promise((A,i)=>{s.onerror=()=>i(s.error),s.onsuccess=()=>A()})})}getDb(){const e=self.indexedDB.open(this.dbName,1);return new Promise((r,n)=>{e.onsuccess=()=>{r(e.result)},e.onerror=()=>{n(e.error)},e.onblocked=()=>{n(new Error("Unable to access DB"))},e.onupgradeneeded=()=>{const s=e.result;s.onerror=()=>{n(new Error("Failed to create object store"))},s.createObjectStore(nB,{keyPath:"id"})}})}withObjectStore(e,r){return this.getDb().then(n=>{const s=n.transaction(nB,e);return s.oncomplete=()=>n.close(),new Promise((A,i)=>{s.onerror=()=>i(s.error),A(r(s.objectStore(nB)))}).catch(A=>{throw n.close(),A})})}}class Gwe{constructor(e={}){S(this,"store");this.store=e}getItem(e){return e in this.store?this.store[e]:null}removeItem(e){delete this.store[e]}setItem(e,r){this.store[e]=r}}const zwe=new Gwe;function qwe(){return typeof self=="object"&&self.indexedDB?new jwe:typeof window=="object"&&window.localStorage?window.localStorage:zwe}function Wwe({accountId:t,cache:e=qwe(),client:r,clientConfig:n,customRoleArn:s,identityPoolId:A,logins:i,userIdentifier:o=!i||Object.keys(i).length===0?"ANONYMOUS":void 0,logger:a,parentClientConfig:c}){a==null||a.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const l=o?`aws:cognito-identity-credentials:${A}:${o}`:void 0;let h=async d=>{const{GetIdCommand:p,CognitoIdentityClient:w}=await Promise.resolve().then(()=>ZN),B=T=>{var v;return(n==null?void 0:n[T])??(c==null?void 0:c[T])??((v=d==null?void 0:d.callerClientConfig)==null?void 0:v[T])},C=r??new w(Object.assign({},n??{},{region:B("region"),profile:B("profile"),userAgentAppId:B("userAgentAppId")}));let _=l&&await e.getItem(l);if(!_){const{IdentityId:T=Jwe(a)}=await C.send(new p({AccountId:t,IdentityPoolId:A,Logins:i?await MN(i):void 0}));_=T,l&&Promise.resolve(e.setItem(l,_)).catch(()=>{})}return h=NN({client:C,customRoleArn:s,logins:i,identityId:_}),h(d)};return d=>h(d).catch(async p=>{throw l&&Promise.resolve(e.removeItem(l)).catch(()=>{}),p})}function Jwe(t){throw new vo("Response from Amazon Cognito contained no identity ID",{logger:t})}const Xwe=Object.freeze(Object.defineProperty({__proto__:null,fromCognitoIdentity:NN,fromCognitoIdentityPool:Wwe},Symbol.toStringTag,{value:"Module"})),Ywe=async(t,e,r)=>({operation:xs(e).operation,region:await Kr(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Zwe(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function HN(t){return{schemeId:"smithy.api#noAuth"}}const eye=t=>{const e=[];switch(t.operation){case"GetCredentialsForIdentity":{e.push(HN());break}case"GetId":{e.push(HN());break}default:e.push(Zwe(t))}return e},tye=t=>{const e=Xx(t);return Object.assign(e,{authSchemePreference:Kr(t.authSchemePreference??[])})},rye=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),$N={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},nye={version:"3.997.23"},yu="ref",Ti=-1,Qf=!0,VN="isSet",KN="PartitionResult",Df="booleanEquals",sB="getAttr",Bu="stringEquals",jN={[yu]:"Endpoint"},AB={[yu]:KN},Cu={[yu]:"Region"},fs={},GN=[Cu],zN={conditions:[[VN,[jN]],[VN,GN],["aws.partition",GN,KN],[Df,[{[yu]:"UseFIPS"},Qf]],[Df,[{fn:sB,argv:[AB,"supportsFIPS"]},Qf]],[Df,[{[yu]:"UseDualStack"},Qf]],[Df,[{fn:sB,argv:[AB,"supportsDualStack"]},Qf]],[Bu,[{fn:sB,argv:[AB,"name"]},"aws"]],[Bu,[Cu,"us-east-1"]],[Bu,[Cu,"us-east-2"]],[Bu,[Cu,"us-west-1"]],[Bu,[Cu,"us-west-2"]]],results:[[Ti],[Ti,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Ti,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[jN,fs],["https://cognito-identity-fips.us-east-1.amazonaws.com",fs],["https://cognito-identity-fips.us-east-2.amazonaws.com",fs],["https://cognito-identity-fips.us-west-1.amazonaws.com",fs],["https://cognito-identity-fips.us-west-2.amazonaws.com",fs],["https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",fs],[Ti,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",fs],[Ti,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-identity.{Region}.amazonaws.com",fs],["https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",fs],[Ti,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",fs],[Ti,"Invalid Configuration: Missing Region"]]},sye=2,Gt=1e8,Aye=new Int32Array([-1,1,-1,0,17,3,1,4,Gt+16,2,5,Gt+16,3,9,6,5,7,Gt+15,6,8,Gt+14,7,Gt+12,Gt+13,4,11,10,5,Gt+9,Gt+11,5,12,Gt+10,6,13,Gt+9,8,Gt+4,14,9,Gt+5,15,10,Gt+6,16,11,Gt+7,Gt+8,3,Gt+1,18,5,Gt+2,Gt+3]),iye=qh.from(Aye,sye,zN.conditions,zN.results),oye=new eI({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),aye=(t,e={})=>oye.get(t,()=>cI(iye,{endpointParams:t,logger:e.logger}));Jh.aws=Lw;class hn extends di{constructor(e){super(e),Object.setPrototypeOf(this,hn.prototype)}}class iB extends hn{constructor(r){super({name:"ExternalServiceException",$fault:"client",...r});S(this,"name","ExternalServiceException");S(this,"$fault","client");Object.setPrototypeOf(this,iB.prototype)}}class oB extends hn{constructor(r){super({name:"InternalErrorException",$fault:"server",...r});S(this,"name","InternalErrorException");S(this,"$fault","server");Object.setPrototypeOf(this,oB.prototype)}}class aB extends hn{constructor(r){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...r});S(this,"name","InvalidIdentityPoolConfigurationException");S(this,"$fault","client");Object.setPrototypeOf(this,aB.prototype)}}class cB extends hn{constructor(r){super({name:"InvalidParameterException",$fault:"client",...r});S(this,"name","InvalidParameterException");S(this,"$fault","client");Object.setPrototypeOf(this,cB.prototype)}}class uB extends hn{constructor(r){super({name:"NotAuthorizedException",$fault:"client",...r});S(this,"name","NotAuthorizedException");S(this,"$fault","client");Object.setPrototypeOf(this,uB.prototype)}}class lB extends hn{constructor(r){super({name:"ResourceConflictException",$fault:"client",...r});S(this,"name","ResourceConflictException");S(this,"$fault","client");Object.setPrototypeOf(this,lB.prototype)}}class hB extends hn{constructor(r){super({name:"ResourceNotFoundException",$fault:"client",...r});S(this,"name","ResourceNotFoundException");S(this,"$fault","client");Object.setPrototypeOf(this,hB.prototype)}}class dB extends hn{constructor(r){super({name:"TooManyRequestsException",$fault:"client",...r});S(this,"name","TooManyRequestsException");S(this,"$fault","client");Object.setPrototypeOf(this,dB.prototype)}}class fB extends hn{constructor(r){super({name:"LimitExceededException",$fault:"client",...r});S(this,"name","LimitExceededException");S(this,"$fault","client");Object.setPrototypeOf(this,fB.prototype)}}const cye="AccountId",uye="AccessKeyId",qN="Credentials",lye="CustomRoleArn",hye="Expiration",dye="ExternalServiceException",fye="GetCredentialsForIdentity",pye="GetCredentialsForIdentityInput",gye="GetCredentialsForIdentityResponse",mye="GetId",wye="GetIdInput",yye="GetIdResponse",Bye="InternalErrorException",pB="IdentityId",Cye="InvalidIdentityPoolConfigurationException",Eye="InvalidParameterException",_ye="IdentityPoolId",bye="IdentityProviderToken",WN="Logins",vye="LimitExceededException",Sye="LoginsMap",Tye="NotAuthorizedException",Iye="ResourceConflictException",xye="ResourceNotFoundException",Rye="SecretKey",Uye="SecretKeyString",kye="SessionToken",Fye="TooManyRequestsException",IA="client",$s="error",xA="httpError",Vs="message",JN="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",Pye="server",mt="com.amazonaws.cognitoidentity",XN=Rs.for(JN);var Oye=[-3,JN,"CognitoIdentityServiceException",0,[],[]];XN.registerError(Oye,hn);const ps=Rs.for(mt);var Qye=[-3,mt,dye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Qye,iB);var Dye=[-3,mt,Bye,{[$s]:Pye},[Vs],[0]];ps.registerError(Dye,oB);var Lye=[-3,mt,Cye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Lye,aB);var Mye=[-3,mt,Eye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Mye,cB);var Nye=[-3,mt,vye,{[$s]:IA,[xA]:400},[Vs],[0]];ps.registerError(Nye,fB);var Hye=[-3,mt,Tye,{[$s]:IA,[xA]:403},[Vs],[0]];ps.registerError(Hye,uB);var $ye=[-3,mt,Iye,{[$s]:IA,[xA]:409},[Vs],[0]];ps.registerError($ye,lB);var Vye=[-3,mt,xye,{[$s]:IA,[xA]:404},[Vs],[0]];ps.registerError(Vye,hB);var Kye=[-3,mt,Fye,{[$s]:IA,[xA]:429},[Vs],[0]];ps.registerError(Kye,dB);const jye=[XN,ps];var Gye=[0,mt,bye,8,0],zye=[0,mt,Uye,8,0],qye=[3,mt,qN,0,[uye,Rye,kye,hye],[0,[()=>zye,0],0,4]],Wye=[3,mt,pye,0,[pB,WN,lye],[0,[()=>YN,0],0],1],Jye=[3,mt,gye,0,[pB,qN],[0,[()=>qye,0]]],Xye=[3,mt,wye,0,[_ye,cye,WN],[0,0,[()=>YN,0]],1],Yye=[3,mt,yye,0,[pB],[0]],YN=[2,mt,Sye,0,[0,0],[()=>Gye,0]],Zye=[9,mt,fye,0,()=>Wye,()=>Jye],e0e=[9,mt,mye,0,()=>Xye,()=>Yye];const t0e=t=>({apiVersion:"2014-06-30",base64Decoder:(t==null?void 0:t.base64Decoder)??Us,base64Encoder:(t==null?void 0:t.base64Encoder)??Xn,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??aye,extensions:(t==null?void 0:t.extensions)??[],httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??eye,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new uy},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Bre}],logger:(t==null?void 0:t.logger)??new Vh,protocol:(t==null?void 0:t.protocol)??Use,protocolSettings:(t==null?void 0:t.protocolSettings)??{defaultNamespace:"com.amazonaws.cognitoidentity",errorTypeRegistries:jye,xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:(t==null?void 0:t.serviceId)??"Cognito Identity",urlParser:(t==null?void 0:t.urlParser)??kc,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Jn,utf8Encoder:(t==null?void 0:t.utf8Encoder)??ks}),r0e=t=>{const e=WI(t),r=()=>e().then(kT),n=t0e(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JT,defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??$I({serviceId:n.serviceId,clientVersion:nye.version}),maxAttempts:(t==null?void 0:t.maxAttempts)??_o,region:(t==null?void 0:t.region)??TT("Region is missing"),requestHandler:kf.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||SI),sha256:(t==null?void 0:t.sha256)??v3,streamCollector:(t==null?void 0:t.streamCollector)??I3,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(JI)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(XI))}},n0e=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(s){const A=e.findIndex(i=>i.schemeId===s.schemeId);A===-1?e.push(s):e.splice(A,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},s0e=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),A0e=(t,e)=>{const r=Object.assign(YI(t),PT(t),wI(t),n0e(t));return e.forEach(n=>n.configure(r)),Object.assign(t,ZI(r),OT(r),yI(r),s0e(r))};class i0e extends lw{constructor(...[r]){const n=r0e(r||{});super(n);S(this,"config");this.initConfig=n;const s=rye(n),A=DI(s),i=TI(A),o=qI(i),a=o,c=uI(a),l=tye(c),h=A0e(l,(r==null?void 0:r.extensions)||[]);this.config=h,this.middlewareStack.use(RT(this.config)),this.middlewareStack.use(HI(this.config)),this.middlewareStack.use(II(this.config)),this.middlewareStack.use(CI(this.config)),this.middlewareStack.use(xI(this.config)),this.middlewareStack.use(RI(this.config)),this.middlewareStack.use(UI(this.config)),this.middlewareStack.use(kI(this.config,{httpAuthSchemeParametersProvider:Ywe,identityProviderConfigProvider:async d=>new OI({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(PI(this.config))}destroy(){super.destroy()}}class o0e extends H.classBuilder().ep($N).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(Zye).build(){}class a0e extends H.classBuilder().ep($N).m(function(e,r,n,s){return[$(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(e0e).build(){}const ZN=Object.freeze(Object.defineProperty({__proto__:null,CognitoIdentityClient:i0e,GetCredentialsForIdentityCommand:o0e,GetIdCommand:a0e},Symbol.toStringTag,{value:"Module"}));Wr.initFeedbackPlugin=v5,Object.defineProperty(Wr,Symbol.toStringTag,{value:"Module"})});
3046
3046
  //# sourceMappingURL=ui-feedback-plugin.umd.js.map