sst 2.1.3 → 2.1.5
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.
- package/cli/commands/plugins/kysely.js +3 -6
- package/credentials.js +3 -0
- package/package.json +4 -4
- package/sst.mjs +4 -5
- package/support/rds-migrator/index.mjs +21 -21
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var sp=Object.create;var ks=Object.defineProperty;var ap=Object.getOwnPropertyDescriptor;var up=Object.getOwnPropertyNames;var cp=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty;var o=(t,e)=>ks(t,"name",{value:e,configurable:!0}),re=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var fp=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of up(e))!lp.call(t,n)&&n!==r&&ks(t,n,{get:()=>e[n],enumerable:!(i=ap(e,n))||i.enumerable});return t};var dp=(t,e,r)=>(r=t!=null?sp(cp(t)):{},fp(e||!t||!t.__esModule?ks(r,"default",{value:t,enumerable:!0}):r,t));var Lo=P((R_,$u)=>{var ea=Oe();function Qu(){}o(Qu,"JsonBuilder");Qu.prototype.build=function(t,e){return JSON.stringify(qo(t,e))};function qo(t,e){if(!(!e||t===void 0||t===null))switch(e.type){case"structure":return Gp(t,e);case"map":return Yp(t,e);case"list":return Jp(t,e);default:return Qp(t,e)}}o(qo,"translate");function Gp(t,e){if(e.isDocument)return t;var r={};return ea.each(t,function(i,n){var s=e.members[i];if(s){if(s.location!=="body")return;var a=s.isLocationName?s.name:i,u=qo(n,s);u!==void 0&&(r[a]=u)}}),r}o(Gp,"translateStructure");function Jp(t,e){var r=[];return ea.arrayEach(t,function(i){var n=qo(i,e.member);n!==void 0&&r.push(n)}),r}o(Jp,"translateList");function Yp(t,e){var r={};return ea.each(t,function(i,n){var s=qo(n,e.value);s!==void 0&&(r[i]=s)}),r}o(Yp,"translateMap");function Qp(t,e){return e.toWireFormat(t)}o(Qp,"translateScalar");$u.exports=Qu});var Fo=P((P_,ec)=>{var ta=Oe();function Zu(){}o(Zu,"JsonParser");Zu.prototype.parse=function(t,e){return Mo(JSON.parse(t),e)};function Mo(t,e){if(!(!e||t===void 0))switch(e.type){case"structure":return $p(t,e);case"map":return em(t,e);case"list":return Zp(t,e);default:return tm(t,e)}}o(Mo,"translate");function $p(t,e){if(t!=null){if(e.isDocument)return t;var r={},i=e.members;return ta.each(i,function(n,s){var a=s.isLocationName?s.name:n;if(Object.prototype.hasOwnProperty.call(t,a)){var u=t[a],l=Mo(u,s);l!==void 0&&(r[n]=l)}}),r}}o($p,"translateStructure");function Zp(t,e){if(t!=null){var r=[];return ta.arrayEach(t,function(i){var n=Mo(i,e.member);n===void 0?r.push(null):r.push(n)}),r}}o(Zp,"translateList");function em(t,e){if(t!=null){var r={};return ta.each(t,function(i,n){var s=Mo(n,e.value);s===void 0?r[i]=null:r[i]=s}),r}}o(em,"translateMap");function tm(t,e){return e.toType(t)}o(tm,"translateScalar");ec.exports=Zu});var Wo=P((k_,tc)=>{var Pn=Oe(),rm=V();function im(t){var e=t.service.config.hostPrefixEnabled;if(!e)return t;var r=t.service.api.operations[t.operation];if(nm(t))return t;if(r.endpoint&&r.endpoint.hostPrefix){var i=r.endpoint.hostPrefix,n=om(i,t.params,r.input);sm(t.httpRequest.endpoint,n),am(t.httpRequest.endpoint.hostname)}return t}o(im,"populateHostPrefix");function nm(t){var e=t.service.api,r=e.operations[t.operation],i=e.endpointOperation&&e.endpointOperation===Pn.string.lowerFirst(r.name);return r.endpointDiscoveryRequired!=="NULL"||i===!0}o(nm,"hasEndpointDiscover");function om(t,e,r){return Pn.each(r.members,function(i,n){if(n.hostLabel===!0){if(typeof e[i]!="string"||e[i]==="")throw Pn.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var s=new RegExp("\\{"+i+"\\}","g");t=t.replace(s,e[i])}}),t}o(om,"expandHostPrefix");function sm(t,e){t.host&&(t.host=e+t.host),t.hostname&&(t.hostname=e+t.hostname)}o(sm,"prependEndpointPrefix");function am(t){var e=t.split("."),r=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;Pn.arrayEach(e,function(i){if(!i.length||i.length<1||i.length>63)throw Pn.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!r.test(i))throw rm.util.error(new Error,{code:"ValidationError",message:i+" is not hostname compatible."})})}o(am,"validateHostname");tc.exports={populateHostPrefix:im}});var Bo=P((L_,rc)=>{var um=Oe(),cm=Lo(),lm=Fo(),fm=Wo().populateHostPrefix;function dm(t){var e=t.httpRequest,r=t.service.api,i=r.targetPrefix+"."+r.operations[t.operation].name,n=r.jsonVersion||"1.0",s=r.operations[t.operation].input,a=new cm;n===1&&(n="1.0"),e.body=a.build(t.params||{},s),e.headers["Content-Type"]="application/x-amz-json-"+n,e.headers["X-Amz-Target"]=i,fm(t)}o(dm,"buildRequest");function hm(t){var e={},r=t.httpResponse;if(e.code=r.headers["x-amzn-errortype"]||"UnknownError",typeof e.code=="string"&&(e.code=e.code.split(":")[0]),r.body.length>0)try{var i=JSON.parse(r.body.toString()),n=i.__type||i.code||i.Code;n&&(e.code=n.split("#").pop()),e.code==="RequestEntityTooLarge"?e.message="Request body must be less than 1 MB":e.message=i.message||i.Message||null}catch{e.statusCode=r.statusCode,e.message=r.statusMessage}else e.statusCode=r.statusCode,e.message=r.statusCode.toString();t.error=um.error(new Error,e)}o(hm,"extractError");function pm(t){var e=t.httpResponse.body.toString()||"{}";if(t.request.service.config.convertResponseTypes===!1)t.data=JSON.parse(e);else{var r=t.request.service.api.operations[t.request.operation],i=r.output||{},n=new lm;t.data=n.parse(e,i)}}o(pm,"extractData");rc.exports={buildRequest:dm,extractError:hm,extractData:pm}});var ac=P((F_,sc)=>{var ra=Oe();function ic(){}o(ic,"QueryParamSerializer");ic.prototype.serialize=function(t,e,r){oc("",t,e,r)};function nc(t){return t.isQueryName||t.api.protocol!=="ec2"?t.name:t.name[0].toUpperCase()+t.name.substr(1)}o(nc,"ucfirst");function oc(t,e,r,i){ra.each(r.members,function(n,s){var a=e[n];if(a!=null){var u=nc(s);u=t?t+"."+u:u,Uo(u,a,s,i)}})}o(oc,"serializeStructure");function mm(t,e,r,i){var n=1;ra.each(e,function(s,a){var u=r.flattened?".":".entry.",l=u+n+++".",h=l+(r.key.name||"key"),y=l+(r.value.name||"value");Uo(t+h,s,r.key,i),Uo(t+y,a,r.value,i)})}o(mm,"serializeMap");function ym(t,e,r,i){var n=r.member||{};if(e.length===0){i.call(this,t,null);return}ra.arrayEach(e,function(s,a){var u="."+(a+1);if(r.api.protocol==="ec2")u=u+"";else if(r.flattened){if(n.name){var l=t.split(".");l.pop(),l.push(nc(n)),t=l.join(".")}}else u="."+(n.name?n.name:"member")+u;Uo(t+u,s,n,i)})}o(ym,"serializeList");function Uo(t,e,r,i){e!=null&&(r.type==="structure"?oc(t,e,r,i):r.type==="list"?ym(t,e,r,i):r.type==="map"?mm(t,e,r,i):i(t,r.toWireFormat(e).toString()))}o(Uo,"serializeMember");sc.exports=ic});var ia=P((B_,uc)=>{var vm=Oe().memoizedProperty;function gm(t,e,r,i){vm(this,i(t),function(){return r(t,e)})}o(gm,"memoize");function Nm(t,e,r,i,n){i=i||String;var s=this;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(gm.call(s,a,t[a],r,i),n&&n(a,t[a]))}o(Nm,"Collection");uc.exports=Nm});var _n=P((V_,yc)=>{var wm=ia(),pr=Oe();function j(t,e,r){r!=null&&pr.property.apply(this,arguments)}o(j,"property");function ui(t,e){t.constructor.prototype[e]||pr.memoizedProperty.apply(this,arguments)}o(ui,"memoizedProperty");function ve(t,e,r){e=e||{},j(this,"shape",t.shape),j(this,"api",e.api,!1),j(this,"type",t.type),j(this,"enum",t.enum),j(this,"min",t.min),j(this,"max",t.max),j(this,"pattern",t.pattern),j(this,"location",t.location||this.location||"body"),j(this,"name",this.name||t.xmlName||t.queryName||t.locationName||r),j(this,"isStreaming",t.streaming||this.isStreaming||!1),j(this,"requiresLength",t.requiresLength,!1),j(this,"isComposite",t.isComposite||!1),j(this,"isShape",!0,!1),j(this,"isQueryName",Boolean(t.queryName),!1),j(this,"isLocationName",Boolean(t.locationName),!1),j(this,"isIdempotent",t.idempotencyToken===!0),j(this,"isJsonValue",t.jsonvalue===!0),j(this,"isSensitive",t.sensitive===!0||t.prototype&&t.prototype.sensitive===!0),j(this,"isEventStream",Boolean(t.eventstream),!1),j(this,"isEvent",Boolean(t.event),!1),j(this,"isEventPayload",Boolean(t.eventpayload),!1),j(this,"isEventHeader",Boolean(t.eventheader),!1),j(this,"isTimestampFormatSet",Boolean(t.timestampFormat)||t.prototype&&t.prototype.isTimestampFormatSet===!0,!1),j(this,"endpointDiscoveryId",Boolean(t.endpointdiscoveryid),!1),j(this,"hostLabel",Boolean(t.hostLabel),!1),e.documentation&&(j(this,"documentation",t.documentation),j(this,"documentationUrl",t.documentationUrl)),t.xmlAttribute&&j(this,"isXmlAttribute",t.xmlAttribute||!1),j(this,"defaultValue",null),this.toWireFormat=function(i){return i??""},this.toType=function(i){return i}}o(ve,"Shape");ve.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"};ve.types={structure:cc,list:lc,map:fc,boolean:mc,timestamp:xm,float:Em,integer:Cm,string:dc,base64:pc,binary:hc};ve.resolve=o(function(e,r){if(e.shape){var i=r.api.shapes[e.shape];if(!i)throw new Error("Cannot find shape reference: "+e.shape);return i}else return null},"resolve");ve.create=o(function(e,r,i){if(e.isShape)return e;var n=ve.resolve(e,r);if(n){var s=Object.keys(e);r.documentation||(s=s.filter(function(l){return!l.match(/documentation/)}));var a=o(function(){n.constructor.call(this,e,r,i)},"InlineShape");return a.prototype=n,new a}else{e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var u=e.type;if(ve.normalizedTypes[e.type]&&(e.type=ve.normalizedTypes[e.type]),ve.types[e.type])return new ve.types[e.type](e,r,i);throw new Error("Unrecognized shape type: "+u)}},"create");function na(t){ve.apply(this,arguments),j(this,"isComposite",!0),t.flattened&&j(this,"flattened",t.flattened||!1)}o(na,"CompositeShape");function cc(t,e){var r=this,i=null,n=!this.isShape;na.apply(this,arguments),n&&(j(this,"defaultValue",function(){return{}}),j(this,"members",{}),j(this,"memberNames",[]),j(this,"required",[]),j(this,"isRequired",function(){return!1}),j(this,"isDocument",Boolean(t.document))),t.members&&(j(this,"members",new wm(t.members,e,function(s,a){return ve.create(a,e,s)})),ui(this,"memberNames",function(){return t.xmlOrder||Object.keys(t.members)}),t.event&&(ui(this,"eventPayloadMemberName",function(){for(var s=r.members,a=r.memberNames,u=0,l=a.length;u<l;u++)if(s[a[u]].isEventPayload)return a[u]}),ui(this,"eventHeaderMemberNames",function(){for(var s=r.members,a=r.memberNames,u=[],l=0,h=a.length;l<h;l++)s[a[l]].isEventHeader&&u.push(a[l]);return u}))),t.required&&(j(this,"required",t.required),j(this,"isRequired",function(s){if(!i){i={};for(var a=0;a<t.required.length;a++)i[t.required[a]]=!0}return i[s]},!1,!0)),j(this,"resultWrapper",t.resultWrapper||null),t.payload&&j(this,"payload",t.payload),typeof t.xmlNamespace=="string"?j(this,"xmlNamespaceUri",t.xmlNamespace):typeof t.xmlNamespace=="object"&&(j(this,"xmlNamespacePrefix",t.xmlNamespace.prefix),j(this,"xmlNamespaceUri",t.xmlNamespace.uri))}o(cc,"StructureShape");function lc(t,e){var r=this,i=!this.isShape;if(na.apply(this,arguments),i&&j(this,"defaultValue",function(){return[]}),t.member&&ui(this,"member",function(){return ve.create(t.member,e)}),this.flattened){var n=this.name;ui(this,"name",function(){return r.member.name||n})}}o(lc,"ListShape");function fc(t,e){var r=!this.isShape;na.apply(this,arguments),r&&(j(this,"defaultValue",function(){return{}}),j(this,"key",ve.create({type:"string"},e)),j(this,"value",ve.create({type:"string"},e))),t.key&&ui(this,"key",function(){return ve.create(t.key,e)}),t.value&&ui(this,"value",function(){return ve.create(t.value,e)})}o(fc,"MapShape");function xm(t){var e=this;if(ve.apply(this,arguments),t.timestampFormat)j(this,"timestampFormat",t.timestampFormat);else if(e.isTimestampFormatSet&&this.timestampFormat)j(this,"timestampFormat",this.timestampFormat);else if(this.location==="header")j(this,"timestampFormat","rfc822");else if(this.location==="querystring")j(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":j(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":j(this,"timestampFormat","iso8601");break}this.toType=function(r){return r==null?null:typeof r.toUTCString=="function"?r:typeof r=="string"||typeof r=="number"?pr.date.parseTimestamp(r):null},this.toWireFormat=function(r){return pr.date.format(r,e.timestampFormat)}}o(xm,"TimestampShape");function dc(){ve.apply(this,arguments);var t=["rest-xml","query","ec2"];this.toType=function(e){return e=this.api&&t.indexOf(this.api.protocol)>-1?e||"":e,this.isJsonValue?JSON.parse(e):e&&typeof e.toString=="function"?e.toString():e},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}o(dc,"StringShape");function Em(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseFloat(t)},this.toWireFormat=this.toType}o(Em,"FloatShape");function Cm(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseInt(t,10)},this.toWireFormat=this.toType}o(Cm,"IntegerShape");function hc(){ve.apply(this,arguments),this.toType=function(t){var e=pr.base64.decode(t);if(this.isSensitive&&pr.isNode()&&typeof pr.Buffer.alloc=="function"){var r=pr.Buffer.alloc(e.length,e);e.fill(0),e=r}return e},this.toWireFormat=pr.base64.encode}o(hc,"BinaryShape");function pc(){hc.apply(this,arguments)}o(pc,"Base64Shape");function mc(){ve.apply(this,arguments),this.toType=function(t){return typeof t=="boolean"?t:t==null?null:t==="true"}}o(mc,"BooleanShape");ve.shapes={StructureShape:cc,ListShape:lc,MapShape:fc,StringShape:dc,BooleanShape:mc,Base64Shape:pc};yc.exports=ve});var oa=P((H_,Nc)=>{var gc=V(),kn=Oe(),Sm=ac(),vc=_n(),Tm=Wo().populateHostPrefix;function bm(t){var e=t.service.api.operations[t.operation],r=t.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:t.service.api.apiVersion,Action:e.name};var i=new Sm;i.serialize(t.params,e.input,function(n,s){r.params[n]=s}),r.body=kn.queryParamsToString(r.params),Tm(t)}o(bm,"buildRequest");function Am(t){var e,r=t.httpResponse.body.toString();if(r.match("<UnknownOperationException"))e={Code:"UnknownOperation",Message:"Unknown operation "+t.request.operation};else try{e=new gc.XML.Parser().parse(r)}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.requestId&&!t.requestId&&(t.requestId=e.requestId),e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=kn.error(new Error,{code:e.Code,message:e.Message}):t.error=kn.error(new Error,{code:t.httpResponse.statusCode,message:null})}o(Am,"extractError");function Im(t){var e=t.request,r=e.service.api.operations[e.operation],i=r.output||{},n=i;if(n.resultWrapper){var s=vc.create({type:"structure"});s.members[n.resultWrapper]=i,s.memberNames=[n.resultWrapper],kn.property(i,"name",i.resultWrapper),i=s}var a=new gc.XML.Parser;if(i&&i.members&&!i.members._XAMZRequestId){var u=vc.create({type:"string"},{api:{protocol:"query"}},"requestId");i.members._XAMZRequestId=u}var l=a.parse(t.httpResponse.body.toString(),i);t.requestId=l._XAMZRequestId||l.requestId,l._XAMZRequestId&&delete l._XAMZRequestId,n.resultWrapper&&l[n.resultWrapper]&&(kn.update(l,l[n.resultWrapper]),delete l[n.resultWrapper]),t.data=l}o(Im,"extractData");Nc.exports={buildRequest:bm,extractError:Am,extractData:Im}});var qn=P((K_,xc)=>{var He=Oe(),Om=Wo().populateHostPrefix;function Rm(t){t.httpRequest.method=t.service.api.operations[t.operation].httpMethod}o(Rm,"populateMethod");function wc(t,e,r,i){var n=[t,e].join("/");n=n.replace(/\/+/g,"/");var s={},a=!1;if(He.each(r.members,function(l,h){var y=i[l];if(y!=null)if(h.location==="uri"){var v=new RegExp("\\{"+h.name+"(\\+)?\\}");n=n.replace(v,function(S,O){var g=O?He.uriEscapePath:He.uriEscape;return g(String(y))})}else h.location==="querystring"&&(a=!0,h.type==="list"?s[h.name]=y.map(function(S){return He.uriEscape(h.member.toWireFormat(S).toString())}):h.type==="map"?He.each(y,function(S,O){Array.isArray(O)?s[S]=O.map(function(g){return He.uriEscape(String(g))}):s[S]=He.uriEscape(String(O))}):s[h.name]=He.uriEscape(h.toWireFormat(y).toString()))}),a){n+=n.indexOf("?")>=0?"&":"?";var u=[];He.arrayEach(Object.keys(s).sort(),function(l){Array.isArray(s[l])||(s[l]=[s[l]]);for(var h=0;h<s[l].length;h++)u.push(He.uriEscape(String(l))+"="+s[l][h])}),n+=u.join("&")}return n}o(wc,"generateURI");function Dm(t){var e=t.service.api.operations[t.operation],r=e.input,i=wc(t.httpRequest.endpoint.path,e.httpPath,r,t.params);t.httpRequest.path=i}o(Dm,"populateURI");function Pm(t){var e=t.service.api.operations[t.operation];He.each(e.input.members,function(r,i){var n=t.params[r];n!=null&&(i.location==="headers"&&i.type==="map"?He.each(n,function(s,a){t.httpRequest.headers[i.name+s]=a}):i.location==="header"&&(n=i.toWireFormat(n).toString(),i.isJsonValue&&(n=He.base64.encode(n)),t.httpRequest.headers[i.name]=n))})}o(Pm,"populateHeaders");function _m(t){Rm(t),Dm(t),Pm(t),Om(t)}o(_m,"buildRequest");function km(){}o(km,"extractError");function qm(t){var e=t.request,r={},i=t.httpResponse,n=e.service.api.operations[e.operation],s=n.output,a={};He.each(i.headers,function(u,l){a[u.toLowerCase()]=l}),He.each(s.members,function(u,l){var h=(l.name||u).toLowerCase();if(l.location==="headers"&&l.type==="map"){r[u]={};var y=l.isLocationName?l.name:"",v=new RegExp("^"+y+"(.+)","i");He.each(i.headers,function(O,g){var N=O.match(v);N!==null&&(r[u][N[1]]=g)})}else if(l.location==="header"){if(a[h]!==void 0){var S=l.isJsonValue?He.base64.decode(a[h]):a[h];r[u]=l.toType(S)}}else l.location==="statusCode"&&(r[u]=parseInt(i.statusCode,10))}),t.data=r}o(qm,"extractData");xc.exports={buildRequest:_m,extractError:km,extractData:qm,generateURI:wc}});var ua=P((G_,bc)=>{var aa=Oe(),Cc=qn(),Sc=Bo(),Lm=Lo(),Ec=Fo(),Tc=["GET","HEAD","DELETE"];function Mm(t){var e=aa.getRequestPayloadShape(t);e===void 0&&Tc.indexOf(t.httpRequest.method)>=0&&delete t.httpRequest.headers["Content-Length"]}o(Mm,"unsetContentLength");function Fm(t){var e=new Lm,r=t.service.api.operations[t.operation].input;if(r.payload){var i={},n=r.members[r.payload];i=t.params[r.payload],n.type==="structure"?(t.httpRequest.body=e.build(i||{},n),sa(t)):i!==void 0&&(t.httpRequest.body=i,(n.type==="binary"||n.isStreaming)&&sa(t,!0))}else t.httpRequest.body=e.build(t.params,r),sa(t)}o(Fm,"populateBody");function sa(t,e){if(!t.httpRequest.headers["Content-Type"]){var r=e?"binary/octet-stream":"application/json";t.httpRequest.headers["Content-Type"]=r}}o(sa,"applyContentTypeHeader");function Wm(t){Cc.buildRequest(t),Tc.indexOf(t.httpRequest.method)<0&&Fm(t)}o(Wm,"buildRequest");function Bm(t){Sc.extractError(t)}o(Bm,"extractError");function Um(t){Cc.extractData(t);var e=t.request,r=e.service.api.operations[e.operation],i=e.service.api.operations[e.operation].output||{},n,s=r.hasEventOutput;if(i.payload){var a=i.members[i.payload],u=t.httpResponse.body;if(a.isEventStream)n=new Ec,t.data[payload]=aa.createEventStream(AWS.HttpClient.streamsApiVersion===2?t.httpResponse.stream:u,n,a);else if(a.type==="structure"||a.type==="list"){var n=new Ec;t.data[i.payload]=n.parse(u,a)}else a.type==="binary"||a.isStreaming?t.data[i.payload]=u:t.data[i.payload]=a.toType(u)}else{var l=t.data;Sc.extractData(t),t.data=aa.merge(l,t.data)}}o(Um,"extractData");bc.exports={buildRequest:Wm,extractError:Bm,extractData:Um,unsetContentLength:Mm}});var la=P((Y_,Ac)=>{var Ui=V(),Ln=Oe(),ca=qn();function Vm(t){var e=t.service.api.operations[t.operation].input,r=new Ui.XML.Builder,i=t.params,n=e.payload;if(n){var s=e.members[n];if(i=i[n],i===void 0)return;if(s.type==="structure"){var a=s.name;t.httpRequest.body=r.toXML(i,s,a,!0)}else t.httpRequest.body=i}else t.httpRequest.body=r.toXML(i,e,e.name||e.shape||Ln.string.upperFirst(t.operation)+"Request")}o(Vm,"populateBody");function zm(t){ca.buildRequest(t),["GET","HEAD"].indexOf(t.httpRequest.method)<0&&Vm(t)}o(zm,"buildRequest");function Hm(t){ca.extractError(t);var e;try{e=new Ui.XML.Parser().parse(t.httpResponse.body.toString())}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=Ln.error(new Error,{code:e.Code,message:e.Message}):t.error=Ln.error(new Error,{code:t.httpResponse.statusCode,message:null})}o(Hm,"extractError");function jm(t){ca.extractData(t);var e,r=t.request,i=t.httpResponse.body,n=r.service.api.operations[r.operation],s=n.output,a=n.hasEventOutput,u=s.payload;if(u){var l=s.members[u];l.isEventStream?(e=new Ui.XML.Parser,t.data[u]=Ln.createEventStream(Ui.HttpClient.streamsApiVersion===2?t.httpResponse.stream:t.httpResponse.body,e,l)):l.type==="structure"?(e=new Ui.XML.Parser,t.data[u]=e.parse(i.toString(),l)):l.type==="binary"||l.isStreaming?t.data[u]=i:t.data[u]=l.toType(i)}else if(i.length>0){e=new Ui.XML.Parser;var h=e.parse(i.toString(),s);Ln.update(t.data,h)}}o(jm,"extractData");Ac.exports={buildRequest:zm,extractError:Hm,extractData:jm}});var Oc=P(($_,Ic)=>{function Km(t){return t.replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}o(Km,"escapeAttribute");Ic.exports={escapeAttribute:Km}});var Dc=P((ek,Rc)=>{var Xm=Oc().escapeAttribute;function Mn(t,e){e===void 0&&(e=[]),this.name=t,this.children=e,this.attributes={}}o(Mn,"XmlNode");Mn.prototype.addAttribute=function(t,e){return this.attributes[t]=e,this};Mn.prototype.addChildNode=function(t){return this.children.push(t),this};Mn.prototype.removeAttribute=function(t){return delete this.attributes[t],this};Mn.prototype.toString=function(){for(var t=Boolean(this.children.length),e="<"+this.name,r=this.attributes,i=0,n=Object.keys(r);i<n.length;i++){var s=n[i],a=r[s];typeof a<"u"&&a!==null&&(e+=" "+s+'="'+Xm(""+a)+'"')}return e+=t?">"+this.children.map(function(u){return u.toString()}).join("")+"</"+this.name+">":"/>"};Rc.exports={XmlNode:Mn}});var _c=P((rk,Pc)=>{function Gm(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
").replace(/\n/g,"
").replace(/\u0085/g,"…").replace(/\u2028/,"
")}o(Gm,"escapeElement");Pc.exports={escapeElement:Gm}});var Lc=P((nk,qc)=>{var Jm=_c().escapeElement;function kc(t){this.value=t}o(kc,"XmlText");kc.prototype.toString=function(){return Jm(""+this.value)};qc.exports={XmlText:kc}});var Bc=P((sk,Wc)=>{var Vo=Oe(),ci=Dc().XmlNode,Ym=Lc().XmlText;function Mc(){}o(Mc,"XmlBuilder");Mc.prototype.toXML=function(t,e,r,i){var n=new ci(r);return Fc(n,e,!0),li(n,t,e),n.children.length>0||i?n.toString():""};function li(t,e,r){switch(r.type){case"structure":return Qm(t,e,r);case"map":return $m(t,e,r);case"list":return Zm(t,e,r);default:return ey(t,e,r)}}o(li,"serialize");function Qm(t,e,r){Vo.arrayEach(r.memberNames,function(i){var n=r.members[i];if(n.location==="body"){var s=e[i],a=n.name;if(s!=null)if(n.isXmlAttribute)t.addAttribute(a,s);else if(n.flattened)li(t,s,n);else{var u=new ci(a);t.addChildNode(u),Fc(u,n),li(u,s,n)}}})}o(Qm,"serializeStructure");function $m(t,e,r){var i=r.key.name||"key",n=r.value.name||"value";Vo.each(e,function(s,a){var u=new ci(r.flattened?r.name:"entry");t.addChildNode(u);var l=new ci(i),h=new ci(n);u.addChildNode(l),u.addChildNode(h),li(l,s,r.key),li(h,a,r.value)})}o($m,"serializeMap");function Zm(t,e,r){r.flattened?Vo.arrayEach(e,function(i){var n=r.member.name||r.name,s=new ci(n);t.addChildNode(s),li(s,i,r.member)}):Vo.arrayEach(e,function(i){var n=r.member.name||"member",s=new ci(n);t.addChildNode(s),li(s,i,r.member)})}o(Zm,"serializeList");function ey(t,e,r){t.addChildNode(new Ym(r.toWireFormat(e)))}o(ey,"serializeScalar");function Fc(t,e,r){var i,n="xmlns";e.xmlNamespaceUri?(i=e.xmlNamespaceUri,e.xmlNamespacePrefix&&(n+=":"+e.xmlNamespacePrefix)):r&&e.api.xmlNamespaceUri&&(i=e.api.xmlNamespaceUri),i&&t.addAttribute(n,i)}o(Fc,"applyNamespaces");Wc.exports=Mc});var fa=P((uk,Vc)=>{var Fn=_n(),Uc=Oe(),Xt=Uc.property,Vi=Uc.memoizedProperty;function ty(t,e,r){var i=this;r=r||{},Xt(this,"name",e.name||t),Xt(this,"api",r.api,!1),e.http=e.http||{},Xt(this,"endpoint",e.endpoint),Xt(this,"httpMethod",e.http.method||"POST"),Xt(this,"httpPath",e.http.requestUri||"/"),Xt(this,"authtype",e.authtype||""),Xt(this,"endpointDiscoveryRequired",e.endpointdiscovery?e.endpointdiscovery.required?"REQUIRED":"OPTIONAL":"NULL");var n=e.httpChecksumRequired||e.httpChecksum&&e.httpChecksum.requestChecksumRequired;Xt(this,"httpChecksumRequired",n,!1),Vi(this,"input",function(){return e.input?Fn.create(e.input,r):new Fn.create({type:"structure"},r)}),Vi(this,"output",function(){return e.output?Fn.create(e.output,r):new Fn.create({type:"structure"},r)}),Vi(this,"errors",function(){var s=[];if(!e.errors)return null;for(var a=0;a<e.errors.length;a++)s.push(Fn.create(e.errors[a],r));return s}),Vi(this,"paginator",function(){return r.api.paginators[t]}),r.documentation&&(Xt(this,"documentation",e.documentation),Xt(this,"documentationUrl",e.documentationUrl)),Vi(this,"idempotentMembers",function(){var s=[],a=i.input,u=a.members;if(!a.members)return s;for(var l in u)u.hasOwnProperty(l)&&u[l].isIdempotent===!0&&s.push(l);return s}),Vi(this,"hasEventOutput",function(){var s=i.output;return ry(s)})}o(ty,"Operation");function ry(t){var e=t.members,r=t.payload;if(!t.members)return!1;if(r){var i=e[r];return i.isEventStream}for(var n in e)if(!e.hasOwnProperty(n)&&e[n].isEventStream===!0)return!0;return!1}o(ry,"hasEventStream");Vc.exports=ty});var da=P((lk,zc)=>{var Wn=Oe().property;function iy(t,e){Wn(this,"inputToken",e.input_token),Wn(this,"limitKey",e.limit_key),Wn(this,"moreResults",e.more_results),Wn(this,"outputToken",e.output_token),Wn(this,"resultKey",e.result_key)}o(iy,"Paginator");zc.exports=iy});var ha=P((dk,jc)=>{var Hc=Oe(),zo=Hc.property;function ny(t,e,r){r=r||{},zo(this,"name",t),zo(this,"api",r.api,!1),e.operation&&zo(this,"operation",Hc.string.lowerFirst(e.operation));var i=this,n=["type","description","delay","maxAttempts","acceptors"];n.forEach(function(s){var a=e[s];a&&zo(i,s,a)})}o(ny,"ResourceWaiter");jc.exports=ny});var pa=P((pk,oy)=>{oy.exports={acm:{name:"ACM",cors:!0},apigateway:{name:"APIGateway",cors:!0},applicationautoscaling:{prefix:"application-autoscaling",name:"ApplicationAutoScaling",cors:!0},appstream:{name:"AppStream"},autoscaling:{name:"AutoScaling",cors:!0},batch:{name:"Batch"},budgets:{name:"Budgets"},clouddirectory:{name:"CloudDirectory",versions:["2016-05-10*"]},cloudformation:{name:"CloudFormation",cors:!0},cloudfront:{name:"CloudFront",versions:["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*","2019-03-26*"],cors:!0},cloudhsm:{name:"CloudHSM",cors:!0},cloudsearch:{name:"CloudSearch"},cloudsearchdomain:{name:"CloudSearchDomain"},cloudtrail:{name:"CloudTrail",cors:!0},cloudwatch:{prefix:"monitoring",name:"CloudWatch",cors:!0},cloudwatchevents:{prefix:"events",name:"CloudWatchEvents",versions:["2014-02-03*"],cors:!0},cloudwatchlogs:{prefix:"logs",name:"CloudWatchLogs",cors:!0},codebuild:{name:"CodeBuild",cors:!0},codecommit:{name:"CodeCommit",cors:!0},codedeploy:{name:"CodeDeploy",cors:!0},codepipeline:{name:"CodePipeline",cors:!0},cognitoidentity:{prefix:"cognito-identity",name:"CognitoIdentity",cors:!0},cognitoidentityserviceprovider:{prefix:"cognito-idp",name:"CognitoIdentityServiceProvider",cors:!0},cognitosync:{prefix:"cognito-sync",name:"CognitoSync",cors:!0},configservice:{prefix:"config",name:"ConfigService",cors:!0},cur:{name:"CUR",cors:!0},datapipeline:{name:"DataPipeline"},devicefarm:{name:"DeviceFarm",cors:!0},directconnect:{name:"DirectConnect",cors:!0},directoryservice:{prefix:"ds",name:"DirectoryService"},discovery:{name:"Discovery"},dms:{name:"DMS"},dynamodb:{name:"DynamoDB",cors:!0},dynamodbstreams:{prefix:"streams.dynamodb",name:"DynamoDBStreams",cors:!0},ec2:{name:"EC2",versions:["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],cors:!0},ecr:{name:"ECR",cors:!0},ecs:{name:"ECS",cors:!0},efs:{prefix:"elasticfilesystem",name:"EFS",cors:!0},elasticache:{name:"ElastiCache",versions:["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],cors:!0},elasticbeanstalk:{name:"ElasticBeanstalk",cors:!0},elb:{prefix:"elasticloadbalancing",name:"ELB",cors:!0},elbv2:{prefix:"elasticloadbalancingv2",name:"ELBv2",cors:!0},emr:{prefix:"elasticmapreduce",name:"EMR",cors:!0},es:{name:"ES"},elastictranscoder:{name:"ElasticTranscoder",cors:!0},firehose:{name:"Firehose",cors:!0},gamelift:{name:"GameLift",cors:!0},glacier:{name:"Glacier"},health:{name:"Health"},iam:{name:"IAM",cors:!0},importexport:{name:"ImportExport"},inspector:{name:"Inspector",versions:["2015-08-18*"],cors:!0},iot:{name:"Iot",cors:!0},iotdata:{prefix:"iot-data",name:"IotData",cors:!0},kinesis:{name:"Kinesis",cors:!0},kinesisanalytics:{name:"KinesisAnalytics"},kms:{name:"KMS",cors:!0},lambda:{name:"Lambda",cors:!0},lexruntime:{prefix:"runtime.lex",name:"LexRuntime",cors:!0},lightsail:{name:"Lightsail"},machinelearning:{name:"MachineLearning",cors:!0},marketplacecommerceanalytics:{name:"MarketplaceCommerceAnalytics",cors:!0},marketplacemetering:{prefix:"meteringmarketplace",name:"MarketplaceMetering"},mturk:{prefix:"mturk-requester",name:"MTurk",cors:!0},mobileanalytics:{name:"MobileAnalytics",cors:!0},opsworks:{name:"OpsWorks",cors:!0},opsworkscm:{name:"OpsWorksCM"},organizations:{name:"Organizations"},pinpoint:{name:"Pinpoint"},polly:{name:"Polly",cors:!0},rds:{name:"RDS",versions:["2014-09-01*"],cors:!0},redshift:{name:"Redshift",cors:!0},rekognition:{name:"Rekognition",cors:!0},resourcegroupstaggingapi:{name:"ResourceGroupsTaggingAPI"},route53:{name:"Route53",cors:!0},route53domains:{name:"Route53Domains",cors:!0},s3:{name:"S3",dualstackAvailable:!0,cors:!0},s3control:{name:"S3Control",dualstackAvailable:!0,xmlNoDefaultLists:!0},servicecatalog:{name:"ServiceCatalog",cors:!0},ses:{prefix:"email",name:"SES",cors:!0},shield:{name:"Shield"},simpledb:{prefix:"sdb",name:"SimpleDB"},sms:{name:"SMS"},snowball:{name:"Snowball"},sns:{name:"SNS",cors:!0},sqs:{name:"SQS",cors:!0},ssm:{name:"SSM",cors:!0},storagegateway:{name:"StorageGateway",cors:!0},stepfunctions:{prefix:"states",name:"StepFunctions"},sts:{name:"STS",cors:!0},support:{name:"Support"},swf:{name:"SWF"},xray:{name:"XRay",cors:!0},waf:{name:"WAF",cors:!0},wafregional:{prefix:"waf-regional",name:"WAFRegional"},workdocs:{name:"WorkDocs",cors:!0},workspaces:{name:"WorkSpaces"},codestar:{name:"CodeStar"},lexmodelbuildingservice:{prefix:"lex-models",name:"LexModelBuildingService",cors:!0},marketplaceentitlementservice:{prefix:"entitlement.marketplace",name:"MarketplaceEntitlementService"},athena:{name:"Athena",cors:!0},greengrass:{name:"Greengrass"},dax:{name:"DAX"},migrationhub:{prefix:"AWSMigrationHub",name:"MigrationHub"},cloudhsmv2:{name:"CloudHSMV2",cors:!0},glue:{name:"Glue"},mobile:{name:"Mobile"},pricing:{name:"Pricing",cors:!0},costexplorer:{prefix:"ce",name:"CostExplorer",cors:!0},mediaconvert:{name:"MediaConvert"},medialive:{name:"MediaLive"},mediapackage:{name:"MediaPackage"},mediastore:{name:"MediaStore"},mediastoredata:{prefix:"mediastore-data",name:"MediaStoreData",cors:!0},appsync:{name:"AppSync"},guardduty:{name:"GuardDuty"},mq:{name:"MQ"},comprehend:{name:"Comprehend",cors:!0},iotjobsdataplane:{prefix:"iot-jobs-data",name:"IoTJobsDataPlane"},kinesisvideoarchivedmedia:{prefix:"kinesis-video-archived-media",name:"KinesisVideoArchivedMedia",cors:!0},kinesisvideomedia:{prefix:"kinesis-video-media",name:"KinesisVideoMedia",cors:!0},kinesisvideo:{name:"KinesisVideo",cors:!0},sagemakerruntime:{prefix:"runtime.sagemaker",name:"SageMakerRuntime"},sagemaker:{name:"SageMaker"},translate:{name:"Translate",cors:!0},resourcegroups:{prefix:"resource-groups",name:"ResourceGroups",cors:!0},alexaforbusiness:{name:"AlexaForBusiness"},cloud9:{name:"Cloud9"},serverlessapplicationrepository:{prefix:"serverlessrepo",name:"ServerlessApplicationRepository"},servicediscovery:{name:"ServiceDiscovery"},workmail:{name:"WorkMail"},autoscalingplans:{prefix:"autoscaling-plans",name:"AutoScalingPlans"},transcribeservice:{prefix:"transcribe",name:"TranscribeService"},connect:{name:"Connect",cors:!0},acmpca:{prefix:"acm-pca",name:"ACMPCA"},fms:{name:"FMS"},secretsmanager:{name:"SecretsManager",cors:!0},iotanalytics:{name:"IoTAnalytics",cors:!0},iot1clickdevicesservice:{prefix:"iot1click-devices",name:"IoT1ClickDevicesService"},iot1clickprojects:{prefix:"iot1click-projects",name:"IoT1ClickProjects"},pi:{name:"PI"},neptune:{name:"Neptune"},mediatailor:{name:"MediaTailor"},eks:{name:"EKS"},macie:{name:"Macie"},dlm:{name:"DLM"},signer:{name:"Signer"},chime:{name:"Chime"},pinpointemail:{prefix:"pinpoint-email",name:"PinpointEmail"},ram:{name:"RAM"},route53resolver:{name:"Route53Resolver"},pinpointsmsvoice:{prefix:"sms-voice",name:"PinpointSMSVoice"},quicksight:{name:"QuickSight"},rdsdataservice:{prefix:"rds-data",name:"RDSDataService"},amplify:{name:"Amplify"},datasync:{name:"DataSync"},robomaker:{name:"RoboMaker"},transfer:{name:"Transfer"},globalaccelerator:{name:"GlobalAccelerator"},comprehendmedical:{name:"ComprehendMedical",cors:!0},kinesisanalyticsv2:{name:"KinesisAnalyticsV2"},mediaconnect:{name:"MediaConnect"},fsx:{name:"FSx"},securityhub:{name:"SecurityHub"},appmesh:{name:"AppMesh",versions:["2018-10-01*"]},licensemanager:{prefix:"license-manager",name:"LicenseManager"},kafka:{name:"Kafka"},apigatewaymanagementapi:{name:"ApiGatewayManagementApi"},apigatewayv2:{name:"ApiGatewayV2"},docdb:{name:"DocDB"},backup:{name:"Backup"},worklink:{name:"WorkLink"},textract:{name:"Textract"},managedblockchain:{name:"ManagedBlockchain"},mediapackagevod:{prefix:"mediapackage-vod",name:"MediaPackageVod"},groundstation:{name:"GroundStation"},iotthingsgraph:{name:"IoTThingsGraph"},iotevents:{name:"IoTEvents"},ioteventsdata:{prefix:"iotevents-data",name:"IoTEventsData"},personalize:{name:"Personalize",cors:!0},personalizeevents:{prefix:"personalize-events",name:"PersonalizeEvents",cors:!0},personalizeruntime:{prefix:"personalize-runtime",name:"PersonalizeRuntime",cors:!0},applicationinsights:{prefix:"application-insights",name:"ApplicationInsights"},servicequotas:{prefix:"service-quotas",name:"ServiceQuotas"},ec2instanceconnect:{prefix:"ec2-instance-connect",name:"EC2InstanceConnect"},eventbridge:{name:"EventBridge"},lakeformation:{name:"LakeFormation"},forecastservice:{prefix:"forecast",name:"ForecastService",cors:!0},forecastqueryservice:{prefix:"forecastquery",name:"ForecastQueryService",cors:!0},qldb:{name:"QLDB"},qldbsession:{prefix:"qldb-session",name:"QLDBSession"},workmailmessageflow:{name:"WorkMailMessageFlow"},codestarnotifications:{prefix:"codestar-notifications",name:"CodeStarNotifications"},savingsplans:{name:"SavingsPlans"},sso:{name:"SSO"},ssooidc:{prefix:"sso-oidc",name:"SSOOIDC"},marketplacecatalog:{prefix:"marketplace-catalog",name:"MarketplaceCatalog",cors:!0},dataexchange:{name:"DataExchange"},sesv2:{name:"SESV2"},migrationhubconfig:{prefix:"migrationhub-config",name:"MigrationHubConfig"},connectparticipant:{name:"ConnectParticipant"},appconfig:{name:"AppConfig"},iotsecuretunneling:{name:"IoTSecureTunneling"},wafv2:{name:"WAFV2"},elasticinference:{prefix:"elastic-inference",name:"ElasticInference"},imagebuilder:{name:"Imagebuilder"},schemas:{name:"Schemas"},accessanalyzer:{name:"AccessAnalyzer"},codegurureviewer:{prefix:"codeguru-reviewer",name:"CodeGuruReviewer"},codeguruprofiler:{name:"CodeGuruProfiler"},computeoptimizer:{prefix:"compute-optimizer",name:"ComputeOptimizer"},frauddetector:{name:"FraudDetector"},kendra:{name:"Kendra"},networkmanager:{name:"NetworkManager"},outposts:{name:"Outposts"},augmentedairuntime:{prefix:"sagemaker-a2i-runtime",name:"AugmentedAIRuntime"},ebs:{name:"EBS"},kinesisvideosignalingchannels:{prefix:"kinesis-video-signaling",name:"KinesisVideoSignalingChannels",cors:!0},detective:{name:"Detective"},codestarconnections:{prefix:"codestar-connections",name:"CodeStarconnections"},synthetics:{name:"Synthetics"},iotsitewise:{name:"IoTSiteWise"},macie2:{name:"Macie2"},codeartifact:{name:"CodeArtifact"},honeycode:{name:"Honeycode"},ivs:{name:"IVS"},braket:{name:"Braket"},identitystore:{name:"IdentityStore"},appflow:{name:"Appflow"},redshiftdata:{prefix:"redshift-data",name:"RedshiftData"},ssoadmin:{prefix:"sso-admin",name:"SSOAdmin"},timestreamquery:{prefix:"timestream-query",name:"TimestreamQuery"},timestreamwrite:{prefix:"timestream-write",name:"TimestreamWrite"},s3outposts:{name:"S3Outposts"},databrew:{name:"DataBrew"},servicecatalogappregistry:{prefix:"servicecatalog-appregistry",name:"ServiceCatalogAppRegistry"},networkfirewall:{prefix:"network-firewall",name:"NetworkFirewall"},mwaa:{name:"MWAA"},amplifybackend:{name:"AmplifyBackend"},appintegrations:{name:"AppIntegrations"},connectcontactlens:{prefix:"connect-contact-lens",name:"ConnectContactLens"},devopsguru:{prefix:"devops-guru",name:"DevOpsGuru"},ecrpublic:{prefix:"ecr-public",name:"ECRPUBLIC"},lookoutvision:{name:"LookoutVision"},sagemakerfeaturestoreruntime:{prefix:"sagemaker-featurestore-runtime",name:"SageMakerFeatureStoreRuntime"},customerprofiles:{prefix:"customer-profiles",name:"CustomerProfiles"},auditmanager:{name:"AuditManager"},emrcontainers:{prefix:"emr-containers",name:"EMRcontainers"},healthlake:{name:"HealthLake"},sagemakeredge:{prefix:"sagemaker-edge",name:"SagemakerEdge"},amp:{name:"Amp"},greengrassv2:{name:"GreengrassV2"},iotdeviceadvisor:{name:"IotDeviceAdvisor"},iotfleethub:{name:"IoTFleetHub"},iotwireless:{name:"IoTWireless"},location:{name:"Location",cors:!0},wellarchitected:{name:"WellArchitected"},lexmodelsv2:{prefix:"models.lex.v2",name:"LexModelsV2"},lexruntimev2:{prefix:"runtime.lex.v2",name:"LexRuntimeV2",cors:!0},fis:{name:"Fis"},lookoutmetrics:{name:"LookoutMetrics"},mgn:{name:"Mgn"},lookoutequipment:{name:"LookoutEquipment"},nimble:{name:"Nimble"},finspace:{name:"Finspace"},finspacedata:{prefix:"finspace-data",name:"Finspacedata"},ssmcontacts:{prefix:"ssm-contacts",name:"SSMContacts"},ssmincidents:{prefix:"ssm-incidents",name:"SSMIncidents"},applicationcostprofiler:{name:"ApplicationCostProfiler"},apprunner:{name:"AppRunner"},proton:{name:"Proton"},route53recoverycluster:{prefix:"route53-recovery-cluster",name:"Route53RecoveryCluster"},route53recoverycontrolconfig:{prefix:"route53-recovery-control-config",name:"Route53RecoveryControlConfig"},route53recoveryreadiness:{prefix:"route53-recovery-readiness",name:"Route53RecoveryReadiness"},chimesdkidentity:{prefix:"chime-sdk-identity",name:"ChimeSDKIdentity"},chimesdkmessaging:{prefix:"chime-sdk-messaging",name:"ChimeSDKMessaging"},snowdevicemanagement:{prefix:"snow-device-management",name:"SnowDeviceManagement"},memorydb:{name:"MemoryDB"},opensearch:{name:"OpenSearch"},kafkaconnect:{name:"KafkaConnect"},voiceid:{prefix:"voice-id",name:"VoiceID"},wisdom:{name:"Wisdom"},account:{name:"Account"},cloudcontrol:{name:"CloudControl"},grafana:{name:"Grafana"},panorama:{name:"Panorama"},chimesdkmeetings:{prefix:"chime-sdk-meetings",name:"ChimeSDKMeetings"},resiliencehub:{name:"Resiliencehub"},migrationhubstrategy:{name:"MigrationHubStrategy"},appconfigdata:{name:"AppConfigData"},drs:{name:"Drs"},migrationhubrefactorspaces:{prefix:"migration-hub-refactor-spaces",name:"MigrationHubRefactorSpaces"},evidently:{name:"Evidently"},inspector2:{name:"Inspector2"},rbin:{name:"Rbin"},rum:{name:"RUM"},backupgateway:{prefix:"backup-gateway",name:"BackupGateway"},iottwinmaker:{name:"IoTTwinMaker"},workspacesweb:{prefix:"workspaces-web",name:"WorkSpacesWeb"},amplifyuibuilder:{name:"AmplifyUIBuilder"},keyspaces:{name:"Keyspaces"},billingconductor:{name:"Billingconductor"},gamesparks:{name:"GameSparks"},pinpointsmsvoicev2:{prefix:"pinpoint-sms-voice-v2",name:"PinpointSMSVoiceV2"},ivschat:{name:"Ivschat"},chimesdkmediapipelines:{prefix:"chime-sdk-media-pipelines",name:"ChimeSDKMediaPipelines"},emrserverless:{prefix:"emr-serverless",name:"EMRServerless"},m2:{name:"M2"},connectcampaigns:{name:"ConnectCampaigns"},redshiftserverless:{prefix:"redshift-serverless",name:"RedshiftServerless"},rolesanywhere:{name:"RolesAnywhere"},licensemanagerusersubscriptions:{prefix:"license-manager-user-subscriptions",name:"LicenseManagerUserSubscriptions"},backupstorage:{name:"BackupStorage"},privatenetworks:{name:"PrivateNetworks"},supportapp:{prefix:"support-app",name:"SupportApp"},controltower:{name:"ControlTower"},iotfleetwise:{name:"IoTFleetWise"},migrationhuborchestrator:{name:"MigrationHubOrchestrator"},connectcases:{name:"ConnectCases"},resourceexplorer2:{prefix:"resource-explorer-2",name:"ResourceExplorer2"},scheduler:{name:"Scheduler"},chimesdkvoice:{prefix:"chime-sdk-voice",name:"ChimeSDKVoice"},iotroborunner:{prefix:"iot-roborunner",name:"IoTRoboRunner"},ssmsap:{prefix:"ssm-sap",name:"SsmSap"},oam:{name:"OAM"},arczonalshift:{prefix:"arc-zonal-shift",name:"ARCZonalShift"},omics:{name:"Omics"},opensearchserverless:{name:"OpenSearchServerless"},securitylake:{name:"SecurityLake"},simspaceweaver:{name:"SimSpaceWeaver"},docdbelastic:{prefix:"docdb-elastic",name:"DocDBElastic"},sagemakergeospatial:{prefix:"sagemaker-geospatial",name:"SageMakerGeospatial"},codecatalyst:{name:"CodeCatalyst"},pipes:{name:"Pipes"},sagemakermetrics:{prefix:"sagemaker-metrics",name:"SageMakerMetrics"},kinesisvideowebrtcstorage:{prefix:"kinesis-video-webrtc-storage",name:"KinesisVideoWebRTCStorage"},licensemanagerlinuxsubscriptions:{prefix:"license-manager-linux-subscriptions",name:"LicenseManagerLinuxSubscriptions"},kendraranking:{prefix:"kendra-ranking",name:"KendraRanking"},cleanrooms:{name:"CleanRooms"},cloudtraildata:{prefix:"cloudtrail-data",name:"CloudTrailData"},tnb:{name:"Tnb"}}});var ma=P((mk,Xc)=>{var Ho=ia(),sy=fa(),ay=_n(),uy=da(),cy=ha(),Kc=pa(),Bn=Oe(),ge=Bn.property,ly=Bn.memoizedProperty;function fy(t,e){var r=this;t=t||{},e=e||{},e.api=this,t.metadata=t.metadata||{};var i=e.serviceIdentifier;delete e.serviceIdentifier,ge(this,"isApi",!0,!1),ge(this,"apiVersion",t.metadata.apiVersion),ge(this,"endpointPrefix",t.metadata.endpointPrefix),ge(this,"signingName",t.metadata.signingName),ge(this,"globalEndpoint",t.metadata.globalEndpoint),ge(this,"signatureVersion",t.metadata.signatureVersion),ge(this,"jsonVersion",t.metadata.jsonVersion),ge(this,"targetPrefix",t.metadata.targetPrefix),ge(this,"protocol",t.metadata.protocol),ge(this,"timestampFormat",t.metadata.timestampFormat),ge(this,"xmlNamespaceUri",t.metadata.xmlNamespace),ge(this,"abbreviation",t.metadata.serviceAbbreviation),ge(this,"fullName",t.metadata.serviceFullName),ge(this,"serviceId",t.metadata.serviceId),i&&Kc[i]&&ge(this,"xmlNoDefaultLists",Kc[i].xmlNoDefaultLists,!1),ly(this,"className",function(){var s=t.metadata.serviceAbbreviation||t.metadata.serviceFullName;return s?(s=s.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g,""),s==="ElasticLoadBalancing"&&(s="ELB"),s):null});function n(s,a){a.endpointoperation===!0&&ge(r,"endpointOperation",Bn.string.lowerFirst(s)),a.endpointdiscovery&&!r.hasRequiredEndpointDiscovery&&ge(r,"hasRequiredEndpointDiscovery",a.endpointdiscovery.required===!0)}o(n,"addEndpointOperation"),ge(this,"operations",new Ho(t.operations,e,function(s,a){return new sy(s,a,e)},Bn.string.lowerFirst,n)),ge(this,"shapes",new Ho(t.shapes,e,function(s,a){return ay.create(a,e)})),ge(this,"paginators",new Ho(t.paginators,e,function(s,a){return new uy(s,a,e)})),ge(this,"waiters",new Ho(t.waiters,e,function(s,a){return new cy(s,a,e)},Bn.string.lowerFirst)),e.documentation&&(ge(this,"documentation",t.documentation),ge(this,"documentationUrl",t.documentationUrl)),ge(this,"awsQueryCompatible",t.metadata.awsQueryCompatible)}o(fy,"Api");Xc.exports=fy});var Jc=P((vk,Gc)=>{function jo(t,e){if(!jo.services.hasOwnProperty(t))throw new Error("InvalidService: Failed to load api for "+t);return jo.services[t][e]}o(jo,"apiLoader");jo.services={};Gc.exports=jo});var Yc=P(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var dy=function(){function t(e,r){this.key=e,this.value=r}return o(t,"LinkedListNode"),t}(),hy=function(){function t(e){if(this.nodeMap={},this.size=0,typeof e!="number"||e<1)throw new Error("Cache size can only be positive number");this.sizeLimit=e}return o(t,"LRUCache"),Object.defineProperty(t.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),t.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},t.prototype.removeFromTail=function(){if(this.tailNode){var e=this.tailNode,r=e.prev;return r&&(r.next=void 0),e.prev=void 0,this.tailNode=r,this.size--,e}},t.prototype.detachFromList=function(e){this.headerNode===e&&(this.headerNode=e.next),this.tailNode===e&&(this.tailNode=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.next=void 0,e.prev=void 0,this.size--},t.prototype.get=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];return this.detachFromList(r),this.prependToList(r),r.value}},t.prototype.remove=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];this.detachFromList(r),delete this.nodeMap[e]}},t.prototype.put=function(e,r){if(this.nodeMap[e])this.remove(e);else if(this.size===this.sizeLimit){var i=this.removeFromTail(),n=i.key;delete this.nodeMap[n]}var s=new dy(e,r);this.nodeMap[e]=s,this.prependToList(s)},t.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),r=0;r<e.length;r++){var i=e[r],n=this.nodeMap[i];this.detachFromList(n),delete this.nodeMap[i]}},t}();ya.LRUCache=hy});var Qc=P(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var py=Yc(),my=1e3,yy=function(){function t(e){e===void 0&&(e=my),this.maxSize=e,this.cache=new py.LRUCache(e)}return o(t,"EndpointCache"),Object.defineProperty(t.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),t.prototype.put=function(e,r){var i=typeof e!="string"?t.getKeyString(e):e,n=this.populateValue(r);this.cache.put(i,n)},t.prototype.get=function(e){var r=typeof e!="string"?t.getKeyString(e):e,i=Date.now(),n=this.cache.get(r);if(n){for(var s=n.length-1;s>=0;s--){var a=n[s];a.Expire<i&&n.splice(s,1)}if(n.length===0){this.cache.remove(r);return}}return n},t.getKeyString=function(e){for(var r=[],i=Object.keys(e).sort(),n=0;n<i.length;n++){var s=i[n];e[s]!==void 0&&r.push(e[s])}return r.join(" ")},t.prototype.populateValue=function(e){var r=Date.now();return e.map(function(i){return{Address:i.Address||"",Expire:r+(i.CachePeriodInMinutes||1)*60*1e3}})},t.prototype.empty=function(){this.cache.empty()},t.prototype.remove=function(e){var r=typeof e!="string"?t.getKeyString(e):e;this.cache.remove(r)},t}();va.EndpointCache=yy});var ga=P((Ck,$c)=>{var mr=V();mr.SequentialExecutor=mr.util.inherit({constructor:o(function(){this._events={}},"SequentialExecutor"),listeners:o(function(e){return this._events[e]?this._events[e].slice(0):[]},"listeners"),on:o(function(e,r,i){return this._events[e]?i?this._events[e].unshift(r):this._events[e].push(r):this._events[e]=[r],this},"on"),onAsync:o(function(e,r,i){return r._isAsync=!0,this.on(e,r,i)},"onAsync"),removeListener:o(function(e,r){var i=this._events[e];if(i){for(var n=i.length,s=-1,a=0;a<n;++a)i[a]===r&&(s=a);s>-1&&i.splice(s,1)}return this},"removeListener"),removeAllListeners:o(function(e){return e?delete this._events[e]:this._events={},this},"removeAllListeners"),emit:o(function(e,r,i){i||(i=o(function(){},"doneCallback"));var n=this.listeners(e),s=n.length;return this.callListeners(n,r,i),s>0},"emit"),callListeners:o(function(e,r,i,n){var s=this,a=n||null;function u(h){if(h&&(a=mr.util.error(a||new Error,h),s._haltHandlersOnError))return i.call(s,a);s.callListeners(e,r,i,a)}for(o(u,"callNextListener");e.length>0;){var l=e.shift();if(l._isAsync){l.apply(s,r.concat([u]));return}else{try{l.apply(s,r)}catch(h){a=mr.util.error(a||new Error,h)}if(a&&s._haltHandlersOnError){i.call(s,a);return}}}i.call(s,a)},"callListeners"),addListeners:o(function(e){var r=this;return e._events&&(e=e._events),mr.util.each(e,function(i,n){typeof n=="function"&&(n=[n]),mr.util.arrayEach(n,function(s){r.on(i,s)})}),r},"addListeners"),addNamedListener:o(function(e,r,i,n){return this[e]=i,this.addListener(r,i,n),this},"addNamedListener"),addNamedAsyncListener:o(function(e,r,i,n){return i._isAsync=!0,this.addNamedListener(e,r,i,n)},"addNamedAsyncListener"),addNamedListeners:o(function(e){var r=this;return e(function(){r.addNamedListener.apply(r,arguments)},function(){r.addNamedAsyncListener.apply(r,arguments)}),this},"addNamedListeners")});mr.SequentialExecutor.prototype.addListener=mr.SequentialExecutor.prototype.on;$c.exports=mr.SequentialExecutor});var Zc=P((Tk,vy)=>{vy.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":"usIso","us-isob-*/*":"usIsob","*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:!0},"*/route53":"globalSSL","cn-*/route53":{endpoint:"{service}.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","us-iso-*/route53":{endpoint:"{service}.c2s.ic.gov",globalEndpoint:!0,signingRegion:"us-iso-east-1"},"us-isob-*/route53":{endpoint:"{service}.sc2s.sgov.gov",globalEndpoint:!0,signingRegion:"us-isob-east-1"},"*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{endpoint:"{service}.cn-north-1.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-north-1"},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"},"*/resource-explorer-2":"dualstackByDefault","*/kendra-ranking":"dualstackByDefault","*/codecatalyst":"globalDualstackByDefault"},fipsRules:{"*/*":"fipsStandard","us-gov-*/*":"fipsStandard","us-iso-*/*":{endpoint:"{service}-fips.{region}.c2s.ic.gov"},"us-iso-*/dms":"usIso","us-isob-*/*":{endpoint:"{service}-fips.{region}.sc2s.sgov.gov"},"us-isob-*/dms":"usIsob","cn-*/*":{endpoint:"{service}-fips.{region}.amazonaws.com.cn"},"*/api.ecr":"fips.api.ecr","*/api.sagemaker":"fips.api.sagemaker","*/batch":"fipsDotPrefix","*/eks":"fipsDotPrefix","*/models.lex":"fips.models.lex","*/runtime.lex":"fips.runtime.lex","*/runtime.sagemaker":{endpoint:"runtime-fips.sagemaker.{region}.amazonaws.com"},"*/iam":"fipsWithoutRegion","*/route53":"fipsWithoutRegion","*/transcribe":"fipsDotPrefix","*/waf":"fipsWithoutRegion","us-gov-*/transcribe":"fipsDotPrefix","us-gov-*/api.ecr":"fips.api.ecr","us-gov-*/api.sagemaker":"fips.api.sagemaker","us-gov-*/models.lex":"fips.models.lex","us-gov-*/runtime.lex":"fips.runtime.lex","us-gov-*/acm-pca":"fipsWithServiceOnly","us-gov-*/batch":"fipsWithServiceOnly","us-gov-*/cloudformation":"fipsWithServiceOnly","us-gov-*/config":"fipsWithServiceOnly","us-gov-*/eks":"fipsWithServiceOnly","us-gov-*/elasticmapreduce":"fipsWithServiceOnly","us-gov-*/identitystore":"fipsWithServiceOnly","us-gov-*/dynamodb":"fipsWithServiceOnly","us-gov-*/elasticloadbalancing":"fipsWithServiceOnly","us-gov-*/guardduty":"fipsWithServiceOnly","us-gov-*/monitoring":"fipsWithServiceOnly","us-gov-*/resource-groups":"fipsWithServiceOnly","us-gov-*/runtime.sagemaker":"fipsWithServiceOnly","us-gov-*/servicecatalog-appregistry":"fipsWithServiceOnly","us-gov-*/servicequotas":"fipsWithServiceOnly","us-gov-*/ssm":"fipsWithServiceOnly","us-gov-*/sts":"fipsWithServiceOnly","us-gov-*/support":"fipsWithServiceOnly","us-gov-west-1/states":"fipsWithServiceOnly","us-iso-east-1/elasticfilesystem":{endpoint:"elasticfilesystem-fips.{region}.c2s.ic.gov"},"us-gov-west-1/organizations":"fipsWithServiceOnly","us-gov-west-1/route53":{endpoint:"route53.us-gov.amazonaws.com"},"*/resource-explorer-2":"fipsDualstackByDefault","*/kendra-ranking":"dualstackByDefault","*/codecatalyst":"fipsGlobalDualstackByDefault"},dualstackRules:{"*/*":{endpoint:"{service}.{region}.api.aws"},"cn-*/*":{endpoint:"{service}.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackLegacy","cn-*/s3":"dualstackLegacyCn","*/s3-control":"dualstackLegacy","cn-*/s3-control":"dualstackLegacyCn","ap-south-1/ec2":"dualstackLegacyEc2","eu-west-1/ec2":"dualstackLegacyEc2","sa-east-1/ec2":"dualstackLegacyEc2","us-east-1/ec2":"dualstackLegacyEc2","us-east-2/ec2":"dualstackLegacyEc2","us-west-2/ec2":"dualstackLegacyEc2"},dualstackFipsRules:{"*/*":{endpoint:"{service}-fips.{region}.api.aws"},"cn-*/*":{endpoint:"{service}-fips.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackFipsLegacy","cn-*/s3":"dualstackFipsLegacyCn","*/s3-control":"dualstackFipsLegacy","cn-*/s3-control":"dualstackFipsLegacyCn"},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:!0,signingRegion:"us-east-1"},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com",globalEndpoint:!0,signingRegion:"us-gov-west-1"},s3signature:{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"s3"},usIso:{endpoint:"{service}.{region}.c2s.ic.gov"},usIsob:{endpoint:"{service}.{region}.sc2s.sgov.gov"},fipsStandard:{endpoint:"{service}-fips.{region}.amazonaws.com"},fipsDotPrefix:{endpoint:"fips.{service}.{region}.amazonaws.com"},fipsWithoutRegion:{endpoint:"{service}-fips.amazonaws.com"},"fips.api.ecr":{endpoint:"ecr-fips.{region}.amazonaws.com"},"fips.api.sagemaker":{endpoint:"api-fips.sagemaker.{region}.amazonaws.com"},"fips.models.lex":{endpoint:"models-fips.lex.{region}.amazonaws.com"},"fips.runtime.lex":{endpoint:"runtime-fips.lex.{region}.amazonaws.com"},fipsWithServiceOnly:{endpoint:"{service}.{region}.amazonaws.com"},dualstackLegacy:{endpoint:"{service}.dualstack.{region}.amazonaws.com"},dualstackLegacyCn:{endpoint:"{service}.dualstack.{region}.amazonaws.com.cn"},dualstackFipsLegacy:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com"},dualstackFipsLegacyCn:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com.cn"},dualstackLegacyEc2:{endpoint:"api.ec2.{region}.aws"},dualstackByDefault:{endpoint:"{service}.{region}.api.aws"},fipsDualstackByDefault:{endpoint:"{service}-fips.{region}.api.aws"},globalDualstackByDefault:{endpoint:"{service}.global.api.aws"},fipsGlobalDualstackByDefault:{endpoint:"{service}-fips.global.api.aws"}}}});var tl=P((bk,el)=>{var gy=Oe(),Un=Zc();function Ny(t){if(!t)return null;var e=t.split("-");return e.length<3?null:e.slice(0,e.length-2).join("-")+"-*"}o(Ny,"generateRegionPrefix");function wy(t){var e=t.config.region,r=Ny(e),i=t.api.endpointPrefix;return[[e,i],[r,i],[e,"*"],[r,"*"],["*",i],["*","*"]].map(function(n){return n[0]&&n[1]?n.join("/"):null})}o(wy,"derivedKeys");function xy(t,e){gy.each(e,function(r,i){r!=="globalEndpoint"&&(t.config[r]===void 0||t.config[r]===null)&&(t.config[r]=i)})}o(xy,"applyConfig");function Ey(t){for(var e=wy(t),r=t.config.useFipsEndpoint,i=t.config.useDualstackEndpoint,n=0;n<e.length;n++){var s=e[n];if(s){var a=r?i?Un.dualstackFipsRules:Un.fipsRules:i?Un.dualstackRules:Un.rules;if(Object.prototype.hasOwnProperty.call(a,s)){var u=a[s];typeof u=="string"&&(u=Un.patterns[u]),t.isGlobalEndpoint=!!u.globalEndpoint,u.signingRegion&&(t.signingRegion=u.signingRegion),u.signatureVersion||(u.signatureVersion="v4");var l=(t.api&&t.api.signatureVersion)==="bearer";xy(t,Object.assign({},u,{signatureVersion:l?"bearer":u.signatureVersion}));return}}}}o(Ey,"configureEndpoint");function Cy(t){for(var e={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},r="amazonaws.com",i=Object.keys(e),n=0;n<i.length;n++){var s=RegExp(i[n]),a=e[i[n]];if(s.test(t))return a}return r}o(Cy,"getEndpointSuffix");el.exports={configureEndpoint:Ey,getEndpointSuffix:Cy}});var Na=P((Ik,rl)=>{function Sy(t){return typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))}o(Sy,"isFipsRegion");function Ty(t){return typeof t=="string"&&["aws-global","aws-us-gov-global"].includes(t)}o(Ty,"isGlobalRegion");function by(t){return["fips-aws-global","aws-fips","aws-global"].includes(t)?"us-east-1":["fips-aws-us-gov-global","aws-us-gov-global"].includes(t)?"us-gov-west-1":t.replace(/fips-(dkr-|prod-)?|-fips/,"")}o(by,"getRealRegion");rl.exports={isFipsRegion:Sy,isGlobalRegion:Ty,getRealRegion:by}});var nl=P((Rk,il)=>{var U=V(),Ay=ma(),Iy=tl(),wa=U.util.inherit,Oy=0,Ko=Na();U.Service=wa({constructor:o(function(e){if(!this.loadServiceClass)throw U.util.error(new Error,"Service must be constructed with `new' operator");if(e){if(e.region){var r=e.region;Ko.isFipsRegion(r)&&(e.region=Ko.getRealRegion(r),e.useFipsEndpoint=!0),Ko.isGlobalRegion(r)&&(e.region=Ko.getRealRegion(r))}typeof e.useDualstack=="boolean"&&typeof e.useDualstackEndpoint!="boolean"&&(e.useDualstackEndpoint=e.useDualstack)}var i=this.loadServiceClass(e||{});if(i){var n=U.util.copy(e),s=new i(e);return Object.defineProperty(s,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),s._clientId=++Oy,s}this.initialize(e)},"Service"),initialize:o(function(e){var r=U.config[this.serviceIdentifier];if(this.config=new U.Config(U.config),r&&this.config.update(r,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||Iy.configureEndpoint(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),U.SequentialExecutor.call(this),U.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||U.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",o(function(s){process.nextTick(function(){i.eventHandler(s)})},"PUBLISH_API_CALL")),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",o(function(s){process.nextTick(function(){i.eventHandler(s)})},"PUBLISH_API_ATTEMPT"))}},"initialize"),validateService:o(function(){},"validateService"),loadServiceClass:o(function(e){var r=e;if(U.util.isEmpty(this.api)){if(r.apiConfig)return U.Service.defineServiceApi(this.constructor,r.apiConfig);if(this.constructor.services){r=new U.Config(U.config),r.update(e,!0);var i=r.apiVersions[this.constructor.serviceIdentifier];return i=i||r.apiVersion,this.getLatestServiceClass(i)}else return null}else return null},"loadServiceClass"),getLatestServiceClass:o(function(e){return e=this.getLatestServiceVersion(e),this.constructor.services[e]===null&&U.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},"getLatestServiceClass"),getLatestServiceVersion:o(function(e){if(!this.constructor.services||this.constructor.services.length===0)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?U.util.isType(e,Date)&&(e=U.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var r=Object.keys(this.constructor.services).sort(),i=null,n=r.length-1;n>=0;n--)if(r[n][r[n].length-1]!=="*"&&(i=r[n]),r[n].substr(0,10)<=e)return i;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},"getLatestServiceVersion"),api:{},defaultRetryCount:3,customizeRequests:o(function(e){if(!e)this.customRequestHandler=null;else if(typeof e=="function")this.customRequestHandler=e;else throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests")},"customizeRequests"),makeRequest:o(function(e,r,i){if(typeof r=="function"&&(i=r,r=null),r=r||{},this.config.params){var n=this.api.operations[e];n&&(r=U.util.copy(r),U.util.each(this.config.params,function(a,u){n.input.members[a]&&(r[a]===void 0||r[a]===null)&&(r[a]=u)}))}var s=new U.Request(this,e,r);return this.addAllRequestListeners(s),this.attachMonitoringEmitter(s),i&&s.send(i),s},"makeRequest"),makeUnauthenticatedRequest:o(function(e,r,i){typeof r=="function"&&(i=r,r={});var n=this.makeRequest(e,r).toUnauthenticated();return i?n.send(i):n},"makeUnauthenticatedRequest"),waitFor:o(function(e,r,i){var n=new U.ResourceWaiter(this,e);return n.wait(r,i)},"waitFor"),addAllRequestListeners:o(function(e){for(var r=[U.events,U.EventListeners.Core,this.serviceInterface(),U.EventListeners.CorePost],i=0;i<r.length;i++)r[i]&&e.addListeners(r[i]);this.config.paramValidation||e.removeListener("validate",U.EventListeners.Core.VALIDATE_PARAMETERS),this.config.logger&&e.addListeners(U.EventListeners.Logger),this.setupRequestListeners(e),typeof this.constructor.prototype.customRequestHandler=="function"&&this.constructor.prototype.customRequestHandler(e),Object.prototype.hasOwnProperty.call(this,"customRequestHandler")&&typeof this.customRequestHandler=="function"&&this.customRequestHandler(e)},"addAllRequestListeners"),apiCallEvent:o(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCall",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Region:e.httpRequest.region,MaxRetriesExceeded:0,UserAgent:e.httpRequest.getUserAgent()},n=e.response;if(n.httpResponse.statusCode&&(i.FinalHttpStatusCode=n.httpResponse.statusCode),n.error){var s=n.error,a=n.httpResponse.statusCode;a>299?(s.code&&(i.FinalAwsException=s.code),s.message&&(i.FinalAwsExceptionMessage=s.message)):((s.code||s.name)&&(i.FinalSdkException=s.code||s.name),s.message&&(i.FinalSdkExceptionMessage=s.message))}return i},"apiCallEvent"),apiAttemptEvent:o(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCallAttempt",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},n=e.response;return n.httpResponse.statusCode&&(i.HttpStatusCode=n.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(i.AccessKey=e.service.config.credentials.accessKeyId),n.httpResponse.headers&&(e.httpRequest.headers["x-amz-security-token"]&&(i.SessionToken=e.httpRequest.headers["x-amz-security-token"]),n.httpResponse.headers["x-amzn-requestid"]&&(i.XAmznRequestId=n.httpResponse.headers["x-amzn-requestid"]),n.httpResponse.headers["x-amz-request-id"]&&(i.XAmzRequestId=n.httpResponse.headers["x-amz-request-id"]),n.httpResponse.headers["x-amz-id-2"]&&(i.XAmzId2=n.httpResponse.headers["x-amz-id-2"])),i},"apiAttemptEvent"),attemptFailEvent:o(function(e){var r=this.apiAttemptEvent(e),i=e.response,n=i.error;return i.httpResponse.statusCode>299?(n.code&&(r.AwsException=n.code),n.message&&(r.AwsExceptionMessage=n.message)):((n.code||n.name)&&(r.SdkException=n.code||n.name),n.message&&(r.SdkExceptionMessage=n.message)),r},"attemptFailEvent"),attachMonitoringEmitter:o(function(e){var r,i,n,s,a=0,u,l,h=this,y=!0;e.on("validate",function(){s=U.util.realClock.now(),l=Date.now()},y),e.on("sign",function(){i=U.util.realClock.now(),r=Date.now(),u=e.httpRequest.region,a++},y),e.on("validateResponse",function(){n=Math.round(U.util.realClock.now()-i)}),e.addNamedListener("API_CALL_ATTEMPT","success",o(function(){var S=h.apiAttemptEvent(e);S.Timestamp=r,S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT")),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",o(function(){var S=h.attemptFailEvent(e);S.Timestamp=r,n=n||Math.round(U.util.realClock.now()-i),S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT_RETRY")),e.addNamedListener("API_CALL","complete",o(function(){var S=h.apiCallEvent(e);if(S.AttemptCount=a,!(S.AttemptCount<=0)){S.Timestamp=l;var O=Math.round(U.util.realClock.now()-s);S.Latency=O>=0?O:0;var g=e.response;g.error&&g.error.retryable&&typeof g.retryCount=="number"&&typeof g.maxRetries=="number"&&g.retryCount>=g.maxRetries&&(S.MaxRetriesExceeded=1),h.emit("apiCall",[S])}},"API_CALL"))},"attachMonitoringEmitter"),setupRequestListeners:o(function(e){},"setupRequestListeners"),getSigningName:o(function(){return this.api.signingName||this.api.endpointPrefix},"getSigningName"),getSignerClass:o(function(e){var r,i=null,n="";if(e){var s=e.service.api.operations||{};i=s[e.operation]||null,n=i?i.authtype:""}return this.config.signatureVersion?r=this.config.signatureVersion:n==="v4"||n==="v4-unsigned-body"?r="v4":n==="bearer"?r="bearer":r=this.api.signatureVersion,U.Signers.RequestSigner.getVersion(r)},"getSignerClass"),serviceInterface:o(function(){switch(this.api.protocol){case"ec2":return U.EventListeners.Query;case"query":return U.EventListeners.Query;case"json":return U.EventListeners.Json;case"rest-json":return U.EventListeners.RestJson;case"rest-xml":return U.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},"serviceInterface"),successfulResponse:o(function(e){return e.httpResponse.statusCode<300},"successfulResponse"),numRetries:o(function(){return this.config.maxRetries!==void 0?this.config.maxRetries:this.defaultRetryCount},"numRetries"),retryDelays:o(function(e,r){return U.util.calculateRetryDelay(e,this.config.retryDelayOptions,r)},"retryDelays"),retryableError:o(function(e){return!!(this.timeoutError(e)||this.networkingError(e)||this.expiredCredentialsError(e)||this.throttledError(e)||e.statusCode>=500)},"retryableError"),networkingError:o(function(e){return e.code==="NetworkingError"},"networkingError"),timeoutError:o(function(e){return e.code==="TimeoutError"},"timeoutError"),expiredCredentialsError:o(function(e){return e.code==="ExpiredTokenException"},"expiredCredentialsError"),clockSkewError:o(function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},"clockSkewError"),getSkewCorrectedDate:o(function(){return new Date(Date.now()+this.config.systemClockOffset)},"getSkewCorrectedDate"),applyClockOffset:o(function(e){e&&(this.config.systemClockOffset=e-Date.now())},"applyClockOffset"),isClockSkewed:o(function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e5},"isClockSkewed"),throttledError:o(function(e){if(e.statusCode===429)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":case"EC2ThrottledException":return!0;default:return!1}},"throttledError"),endpointFromTemplate:o(function(e){if(typeof e!="string")return e;var r=e;return r=r.replace(/\{service\}/g,this.api.endpointPrefix),r=r.replace(/\{region\}/g,this.config.region),r=r.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http"),r},"endpointFromTemplate"),setEndpoint:o(function(e){this.endpoint=new U.Endpoint(e,this.config)},"setEndpoint"),paginationConfig:o(function(e,r){var i=this.api.operations[e].paginator;if(!i){if(r){var n=new Error;throw U.util.error(n,"No pagination configuration for "+e)}return null}return i},"paginationConfig")});U.util.update(U.Service,{defineMethods:o(function(e){U.util.each(e.prototype.api.operations,o(function(i){if(!e.prototype[i]){var n=e.prototype.api.operations[i];n.authtype==="none"?e.prototype[i]=function(s,a){return this.makeUnauthenticatedRequest(i,s,a)}:e.prototype[i]=function(s,a){return this.makeRequest(i,s,a)}}},"iterator"))},"defineMethods"),defineService:o(function(e,r,i){U.Service._serviceMap[e]=!0,Array.isArray(r)||(i=r,r=[]);var n=wa(U.Service,i||{});if(typeof e=="string"){U.Service.addVersions(n,r);var s=n.serviceIdentifier||e;n.serviceIdentifier=s}else n.prototype.api=e,U.Service.defineMethods(n);if(U.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&U.util.clientSideMonitoring){var a=U.util.clientSideMonitoring.Publisher,u=U.util.clientSideMonitoring.configProvider,l=u();this.prototype.publisher=new a(l),l.enabled&&(U.Service._clientSideMonitoring=!0)}return U.SequentialExecutor.call(n.prototype),U.Service.addDefaultMonitoringListeners(n.prototype),n},"defineService"),addVersions:o(function(e,r){Array.isArray(r)||(r=[r]),e.services=e.services||{};for(var i=0;i<r.length;i++)e.services[r[i]]===void 0&&(e.services[r[i]]=null);e.apiVersions=Object.keys(e.services).sort()},"addVersions"),defineServiceApi:o(function(e,r,i){var n=wa(e,{serviceIdentifier:e.serviceIdentifier});function s(a){a.isApi?n.prototype.api=a:n.prototype.api=new Ay(a,{serviceIdentifier:e.serviceIdentifier})}if(o(s,"setApi"),typeof r=="string"){if(i)s(i);else try{s(U.apiLoader(e.serviceIdentifier,r))}catch(a){throw U.util.error(a,{message:"Could not find API configuration "+e.serviceIdentifier+"-"+r})}Object.prototype.hasOwnProperty.call(e.services,r)||(e.apiVersions=e.apiVersions.concat(r).sort()),e.services[r]=n}else s(r);return U.Service.defineMethods(n),n},"defineServiceApi"),hasService:function(t){return Object.prototype.hasOwnProperty.call(U.Service._serviceMap,t)},addDefaultMonitoringListeners:o(function(e){e.addNamedListener("MONITOR_EVENTS_BUBBLE","apiCallAttempt",o(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCallAttempt",[i])},"EVENTS_BUBBLE")),e.addNamedListener("CALL_EVENTS_BUBBLE","apiCall",o(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCall",[i])},"CALL_EVENTS_BUBBLE"))},"addDefaultMonitoringListeners"),_serviceMap:{}});U.util.mixin(U.Service,U.SequentialExecutor);il.exports=U.Service});var xa=P(()=>{var Et=V();Et.Credentials=Et.util.inherit({constructor:o(function(){if(Et.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1&&typeof arguments[0]=="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},"Credentials"),expiryWindow:15,needsRefresh:o(function(){var e=Et.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},"needsRefresh"),get:o(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:o(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:o(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(o(function(s){Et.util.arrayEach(i.refreshCallbacks,function(a){r?a(s):Et.util.defer(function(){a(s)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:o(function(e){e()},"load")});Et.Credentials.addPromisesToClass=o(function(e){this.prototype.getPromise=Et.util.promisifyMethod("get",e),this.prototype.refreshPromise=Et.util.promisifyMethod("refresh",e)},"addPromisesToClass");Et.Credentials.deletePromisesFromClass=o(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Et.util.addPromises(Et.Credentials)});var Ea=P(()=>{var Lt=V();Lt.CredentialProviderChain=Lt.util.inherit(Lt.Credentials,{constructor:o(function(e){e?this.providers=e:this.providers=Lt.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"CredentialProviderChain"),resolve:o(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Lt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var s=a;o(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Lt.CredentialProviderChain.defaultProviders=[];Lt.CredentialProviderChain.addPromisesToClass=o(function(e){this.prototype.resolvePromise=Lt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Lt.CredentialProviderChain.deletePromisesFromClass=o(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Lt.util.addPromises(Lt.CredentialProviderChain)});var ol=P(()=>{var Ne=V();xa();Ea();var Xo;Ne.Config=Ne.util.inherit({constructor:o(function(e){e===void 0&&(e={}),e=this.extractCredentials(e),Ne.util.each.call(this,this.keys,function(r,i){this.set(r,e[r],i)})},"Config"),getCredentials:o(function(e){var r=this;function i(u){e(u,u?null:r.credentials)}o(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"CredentialsError",message:u,name:"CredentialsError"})}o(n,"credError");function s(){r.credentials.get(function(u){if(u){var l="Could not load credentials from "+r.credentials.constructor.name;u=n(l,u)}i(u)})}o(s,"getAsyncCredentials");function a(){var u=null;(!r.credentials.accessKeyId||!r.credentials.secretAccessKey)&&(u=n("Missing credentials")),i(u)}o(a,"getStaticCredentials"),r.credentials?typeof r.credentials.get=="function"?s():a():r.credentialProvider?r.credentialProvider.resolve(function(u,l){u&&(u=n("Could not load credentials from any providers",u)),r.credentials=l,i(u)}):i(n("No credentials to load"))},"getCredentials"),getToken:o(function(e){var r=this;function i(u){e(u,u?null:r.token)}o(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"TokenError",message:u,name:"TokenError"})}o(n,"tokenError");function s(){r.token.get(function(u){if(u){var l="Could not load token from "+r.token.constructor.name;u=n(l,u)}i(u)})}o(s,"getAsyncToken");function a(){var u=null;r.token.token||(u=n("Missing token")),i(u)}o(a,"getStaticToken"),r.token?typeof r.token.get=="function"?s():a():r.tokenProvider?r.tokenProvider.resolve(function(u,l){u&&(u=n("Could not load token from any providers",u)),r.token=l,i(u)}):i(n("No token to load"))},"getToken"),update:o(function(e,r){r=r||!1,e=this.extractCredentials(e),Ne.util.each.call(this,e,function(i,n){(r||Object.prototype.hasOwnProperty.call(this.keys,i)||Ne.Service.hasService(i))&&this.set(i,n)})},"update"),loadFromPath:o(function(e){this.clear();var r=JSON.parse(Ne.util.readFileSync(e)),i=new Ne.FileSystemCredentials(e),n=new Ne.CredentialProviderChain;return n.providers.unshift(i),n.resolve(function(s,a){if(s)throw s;r.credentials=a}),this.constructor(r),this},"loadFromPath"),clear:o(function(){Ne.util.each.call(this,this.keys,function(e){delete this[e]}),this.set("credentials",void 0),this.set("credentialProvider",void 0)},"clear"),set:o(function(e,r,i){r===void 0?(i===void 0&&(i=this.keys[e]),typeof i=="function"?this[e]=i.call(this):this[e]=i):e==="httpOptions"&&this[e]?this[e]=Ne.util.merge(this[e],r):this[e]=r},"set"),keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,s3UsEast1RegionalEndpoint:"legacy",s3UseArnRegion:void 0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:void 0,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:"legacy",useFipsEndpoint:!1,useDualstackEndpoint:!1,token:null},extractCredentials:o(function(e){return e.accessKeyId&&e.secretAccessKey&&(e=Ne.util.copy(e),e.credentials=new Ne.Credentials(e)),e},"extractCredentials"),setPromisesDependency:o(function(e){Xo=e,e===null&&typeof Promise=="function"&&(Xo=Promise);var r=[Ne.Request,Ne.Credentials,Ne.CredentialProviderChain];Ne.S3&&(r.push(Ne.S3),Ne.S3.ManagedUpload&&r.push(Ne.S3.ManagedUpload)),Ne.util.addPromises(r,Xo)},"setPromisesDependency"),getPromisesDependency:o(function(){return Xo},"getPromisesDependency")});Ne.config=new Ne.Config});var Jo=P(()=>{var je=V(),Go=je.util.inherit;je.Endpoint=Go({constructor:o(function(e,r){if(je.util.hideProperties(this,["slashes","auth","hash","search","query"]),typeof e>"u"||e===null)throw new Error("Invalid endpoint: "+e);if(typeof e!="string")return je.util.copy(e);if(!e.match(/^http/)){var i=r&&r.sslEnabled!==void 0?r.sslEnabled:je.config.sslEnabled;e=(i?"https":"http")+"://"+e}je.util.update(this,je.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port=this.protocol==="https:"?443:80},"Endpoint")});je.HttpRequest=Go({constructor:o(function(e,r){e=new je.Endpoint(e),this.method="POST",this.path=e.path||"/",this.headers={},this.body="",this.endpoint=e,this.region=r,this._userAgent="",this.setUserAgent()},"HttpRequest"),setUserAgent:o(function(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=je.util.userAgent()},"setUserAgent"),getUserAgentHeaderName:o(function(){var e=je.util.isBrowser()?"X-Amz-":"";return e+"User-Agent"},"getUserAgentHeaderName"),appendToUserAgent:o(function(e){typeof e=="string"&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},"appendToUserAgent"),getUserAgent:o(function(){return this._userAgent},"getUserAgent"),pathname:o(function(){return this.path.split("?",1)[0]},"pathname"),search:o(function(){var e=this.path.split("?",2)[1];return e?(e=je.util.queryStringParse(e),je.util.queryParamsToString(e)):""},"search"),updateEndpoint:o(function(e){var r=new je.Endpoint(e);this.endpoint=r,this.path=r.path||"/",this.headers.Host&&(this.headers.Host=r.host)},"updateEndpoint")});je.HttpResponse=Go({constructor:o(function(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},"HttpResponse"),createUnbufferedStream:o(function(){return this.streaming=!0,this.stream},"createUnbufferedStream")});je.HttpClient=Go({});je.HttpClient.getInstance=o(function(){return this.singleton===void 0&&(this.singleton=new this),this.singleton},"getInstance")});var hl=P((Hk,dl)=>{var Le=V(),vt=Oe(),sl=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function Yo(t){var e=t.service,r=e.api||{},i=r.operations,n={};return e.config.region&&(n.region=e.config.region),r.serviceId&&(n.serviceId=r.serviceId),e.config.credentials.accessKeyId&&(n.accessKeyId=e.config.credentials.accessKeyId),n}o(Yo,"getCacheKey");function ul(t,e,r){!r||e===void 0||e===null||r.type==="structure"&&r.required&&r.required.length>0&&vt.arrayEach(r.required,function(i){var n=r.members[i];if(n.endpointDiscoveryId===!0){var s=n.isLocationName?n.name:i;t[s]=String(e[i])}else ul(t,e[i],n)})}o(ul,"marshallCustomIdentifiersHelper");function Qo(t,e){var r={};return ul(r,t.params,e),r}o(Qo,"marshallCustomIdentifiers");function cl(t){var e=t.service,r=e.api,i=r.operations?r.operations[t.operation]:void 0,n=i?i.input:void 0,s=Qo(t,n),a=Yo(t);Object.keys(s).length>0&&(a=vt.update(a,s),i&&(a.operation=i.name));var u=Le.endpointCache.get(a);if(!(u&&u.length===1&&u[0].Address===""))if(u&&u.length>0)t.httpRequest.updateEndpoint(u[0].Address);else{var l=e.makeRequest(r.endpointOperation,{Operation:i.name,Identifiers:s});fl(l),l.removeListener("validate",Le.EventListeners.Core.VALIDATE_PARAMETERS),l.removeListener("retry",Le.EventListeners.Core.RETRY_CHECK),Le.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}]),l.send(function(h,y){y&&y.Endpoints?Le.endpointCache.put(a,y.Endpoints):h&&Le.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}])})}}o(cl,"optionalDiscoverEndpoint");var yr={};function ll(t,e){var r=t.service,i=r.api,n=i.operations?i.operations[t.operation]:void 0,s=n?n.input:void 0,a=Qo(t,s),u=Yo(t);Object.keys(a).length>0&&(u=vt.update(u,a),n&&(u.operation=n.name));var l=Le.EndpointCache.getKeyString(u),h=Le.endpointCache.get(l);if(h&&h.length===1&&h[0].Address===""){yr[l]||(yr[l]=[]),yr[l].push({request:t,callback:e});return}else if(h&&h.length>0)t.httpRequest.updateEndpoint(h[0].Address),e();else{var y=r.makeRequest(i.endpointOperation,{Operation:n.name,Identifiers:a});y.removeListener("validate",Le.EventListeners.Core.VALIDATE_PARAMETERS),fl(y),Le.endpointCache.put(l,[{Address:"",CachePeriodInMinutes:60}]),y.send(function(v,S){if(v){if(t.response.error=vt.error(v,{retryable:!1}),Le.endpointCache.remove(u),yr[l]){var O=yr[l];vt.arrayEach(O,function(g){g.request.response.error=vt.error(v,{retryable:!1}),g.callback()}),delete yr[l]}}else if(S&&(Le.endpointCache.put(l,S.Endpoints),t.httpRequest.updateEndpoint(S.Endpoints[0].Address),yr[l])){var O=yr[l];vt.arrayEach(O,function(N){N.request.httpRequest.updateEndpoint(S.Endpoints[0].Address),N.callback()}),delete yr[l]}e()})}}o(ll,"requiredDiscoverEndpoint");function fl(t){var e=t.service.api,r=e.apiVersion;r&&!t.httpRequest.headers["x-amz-api-version"]&&(t.httpRequest.headers["x-amz-api-version"]=r)}o(fl,"addApiVersionHeader");function Ca(t){var e=t.error,r=t.httpResponse;if(e&&(e.code==="InvalidEndpointException"||r.statusCode===421)){var i=t.request,n=i.service.api.operations||{},s=n[i.operation]?n[i.operation].input:void 0,a=Qo(i,s),u=Yo(i);Object.keys(a).length>0&&(u=vt.update(u,a),n[i.operation]&&(u.operation=n[i.operation].name)),Le.endpointCache.remove(u)}}o(Ca,"invalidateCachedEndpoints");function Ry(t){if(t._originalConfig&&t._originalConfig.endpoint&&t._originalConfig.endpointDiscoveryEnabled===!0)throw vt.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var e=Le.config[t.serviceIdentifier]||{};return Boolean(Le.config.endpoint||e.endpoint||t._originalConfig&&t._originalConfig.endpoint)}o(Ry,"hasCustomEndpoint");function al(t){return["false","0"].indexOf(t)>=0}o(al,"isFalsy");function Dy(t){var e=t.service||{};if(e.config.endpointDiscoveryEnabled!==void 0)return e.config.endpointDiscoveryEnabled;if(!vt.isBrowser()){for(var r=0;r<sl.length;r++){var i=sl[r];if(Object.prototype.hasOwnProperty.call(process.env,i)){if(process.env[i]===""||process.env[i]===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"environmental variable "+i+" cannot be set to nothing"});return!al(process.env[i])}}var n={};try{n=Le.util.iniLoader?Le.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[Le.util.sharedConfigFileEnv]}):{}}catch{}var s=n[process.env.AWS_PROFILE||Le.util.defaultProfile]||{};if(Object.prototype.hasOwnProperty.call(s,"endpoint_discovery_enabled")){if(s.endpoint_discovery_enabled===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"config file entry 'endpoint_discovery_enabled' cannot be set to nothing"});return!al(s.endpoint_discovery_enabled)}}}o(Dy,"resolveEndpointDiscoveryConfig");function Py(t,e){var r=t.service||{};if(Ry(r)||t.isPresigned())return e();var i=r.api.operations||{},n=i[t.operation],s=n?n.endpointDiscoveryRequired:"NULL",a=Dy(t),u=r.api.hasRequiredEndpointDiscovery;switch((a||u)&&t.httpRequest.appendToUserAgent("endpoint-discovery"),s){case"OPTIONAL":(a||u)&&(cl(t),t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ca)),e();break;case"REQUIRED":if(a===!1){t.response.error=vt.error(new Error,{code:"ConfigurationException",message:"Endpoint Discovery is disabled but "+r.api.className+"."+t.operation+"() requires it. Please check your configurations."}),e();break}t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ca),ll(t,e);break;case"NULL":default:e();break}}o(Py,"discoverEndpoint");dl.exports={discoverEndpoint:Py,requiredDiscoverEndpoint:ll,optionalDiscoverEndpoint:cl,marshallCustomIdentifiers:Qo,getCacheKey:Yo,invalidateCachedEndpoint:Ca}});var yl=P(()=>{var ee=V(),Ur=ga(),_y=hl().discoverEndpoint;ee.EventListeners={Core:{}};function ml(t){if(!t.service.api.operations)return"";var e=t.service.api.operations[t.operation];return e?e.authtype:""}o(ml,"getOperationAuthtype");function pl(t){var e=t.service;return e.config.signatureVersion?e.config.signatureVersion:e.api.signatureVersion?e.api.signatureVersion:ml(t)}o(pl,"getIdentityType");ee.EventListeners={Core:new Ur().addNamedListeners(function(t,e){e("VALIDATE_CREDENTIALS","validate",o(function(n,s){if(!n.service.api.signatureVersion&&!n.service.config.signatureVersion)return s();var a=pl(n);if(a==="bearer"){n.service.config.getToken(function(u){u&&(n.response.error=ee.util.error(u,{code:"TokenError"})),s()});return}n.service.config.getCredentials(function(u){u&&(n.response.error=ee.util.error(u,{code:"CredentialsError",message:"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1"})),s()})},"VALIDATE_CREDENTIALS")),t("VALIDATE_REGION","validate",o(function(n){if(!n.service.isGlobalEndpoint){var s=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);n.service.config.region?s.test(n.service.config.region)||(n.response.error=ee.util.error(new Error,{code:"ConfigError",message:"Invalid region in config"})):n.response.error=ee.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}},"VALIDATE_REGION")),t("BUILD_IDEMPOTENCY_TOKENS","validate",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation];if(s){var a=s.idempotentMembers;if(a.length){for(var u=ee.util.copy(n.params),l=0,h=a.length;l<h;l++)u[a[l]]||(u[a[l]]=ee.util.uuid.v4());n.params=u}}}},"BUILD_IDEMPOTENCY_TOKENS")),t("VALIDATE_PARAMETERS","validate",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation].input,a=n.service.config.paramValidation;new ee.ParamValidator(a).validate(s,n.params)}},"VALIDATE_PARAMETERS")),t("COMPUTE_CHECKSUM","afterBuild",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation];if(s){var a=n.httpRequest.body,u=a&&(ee.util.Buffer.isBuffer(a)||typeof a=="string"),l=n.httpRequest.headers;if(s.httpChecksumRequired&&n.service.config.computeChecksums&&u&&!l["Content-MD5"]){var h=ee.util.crypto.md5(a,"base64");l["Content-MD5"]=h}}}},"COMPUTE_CHECKSUM")),e("COMPUTE_SHA256","afterBuild",o(function(n,s){if(n.haltHandlersOnError(),!!n.service.api.operations){var a=n.service.api.operations[n.operation],u=a?a.authtype:"";if(!n.service.api.signatureVersion&&!u&&!n.service.config.signatureVersion)return s();if(n.service.getSignerClass(n)===ee.Signers.V4){var l=n.httpRequest.body||"";if(u.indexOf("unsigned-body")>=0)return n.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",s();ee.util.computeSha256(l,function(h,y){h?s(h):(n.httpRequest.headers["X-Amz-Content-Sha256"]=y,s())})}else s()}},"COMPUTE_SHA256")),t("SET_CONTENT_LENGTH","afterBuild",o(function(n){var s=ml(n),a=ee.util.getRequestPayloadShape(n);if(n.httpRequest.headers["Content-Length"]===void 0)try{var u=ee.util.string.byteLength(n.httpRequest.body);n.httpRequest.headers["Content-Length"]=u}catch(l){if(a&&a.isStreaming){if(a.requiresLength)throw l;if(s.indexOf("unsigned-body")>=0){n.httpRequest.headers["Transfer-Encoding"]="chunked";return}else throw l}throw l}},"SET_CONTENT_LENGTH")),t("SET_HTTP_HOST","afterBuild",o(function(n){n.httpRequest.headers.Host=n.httpRequest.endpoint.host},"SET_HTTP_HOST")),t("SET_TRACE_ID","afterBuild",o(function(n){var s="X-Amzn-Trace-Id";if(ee.util.isNode()&&!Object.hasOwnProperty.call(n.httpRequest.headers,s)){var a="AWS_LAMBDA_FUNCTION_NAME",u="_X_AMZN_TRACE_ID",l=process.env[a],h=process.env[u];typeof l=="string"&&l.length>0&&typeof h=="string"&&h.length>0&&(n.httpRequest.headers[s]=h)}},"SET_TRACE_ID")),t("RESTART","restart",o(function(){var n=this.response.error;!n||!n.retryable||(this.httpRequest=new ee.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount<this.service.config.maxRetries?this.response.retryCount++:this.response.error=null)},"RESTART"));var r=!0;e("DISCOVER_ENDPOINT","sign",_y,r),e("SIGN","sign",o(function(n,s){var a=n.service,u=pl(n);if(!u||u.length===0)return s();u==="bearer"?a.config.getToken(function(l,h){if(l)return n.response.error=l,s();try{var y=a.getSignerClass(n),v=new y(n.httpRequest);v.addAuthorization(h)}catch(S){n.response.error=S}s()}):a.config.getCredentials(function(l,h){if(l)return n.response.error=l,s();try{var y=a.getSkewCorrectedDate(),v=a.getSignerClass(n),S=n.service.api.operations||{},O=S[n.operation],g=new v(n.httpRequest,a.getSigningName(n),{signatureCache:a.config.signatureCache,operation:O,signatureVersion:a.api.signatureVersion});g.setServiceClientId(a._clientId),delete n.httpRequest.headers.Authorization,delete n.httpRequest.headers.Date,delete n.httpRequest.headers["X-Amz-Date"],g.addAuthorization(h,y),n.signedAt=y}catch(N){n.response.error=N}s()})},"SIGN")),t("VALIDATE_RESPONSE","validateResponse",o(function(n){this.service.successfulResponse(n,this)?(n.data={},n.error=null):(n.data=null,n.error=ee.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))},"VALIDATE_RESPONSE")),t("ERROR","error",o(function(n,s){var a=s.request.service.api.awsQueryCompatible;if(a){var u=s.httpResponse.headers,l=u?u["x-amzn-query-error"]:void 0;l&&l.includes(";")&&(s.error.code=l.split(";")[0])}},"ERROR"),!0),e("SEND","send",o(function(n,s){n.httpResponse._abortCallback=s,n.error=null,n.data=null;function a(v){n.httpResponse.stream=v;var S=n.request.httpRequest.stream,O=n.request.service,g=O.api,N=n.request.operation,D=g.operations[N]||{};v.on("headers",o(function(p,C,R){if(n.request.emit("httpHeaders",[p,C,n,R]),!n.httpResponse.streaming)if(ee.HttpClient.streamsApiVersion===2){if(D.hasEventOutput&&O.successfulResponse(n)){n.request.emit("httpDone"),s();return}v.on("readable",o(function(){var T=v.read();T!==null&&n.request.emit("httpData",[T,n])},"onReadable"))}else v.on("data",o(function(T){n.request.emit("httpData",[T,n])},"onData"))},"onHeaders")),v.on("end",o(function(){if(!S||!S.didCallback){if(ee.HttpClient.streamsApiVersion===2&&D.hasEventOutput&&O.successfulResponse(n))return;n.request.emit("httpDone"),s()}},"onEnd"))}o(a,"callback");function u(v){v.on("sendProgress",o(function(O){n.request.emit("httpUploadProgress",[O,n])},"onSendProgress")),v.on("receiveProgress",o(function(O){n.request.emit("httpDownloadProgress",[O,n])},"onReceiveProgress"))}o(u,"progress");function l(v){if(v.code!=="RequestAbortedError"){var S=v.code==="TimeoutError"?v.code:"NetworkingError";v=ee.util.error(v,{code:S,region:n.request.httpRequest.region,hostname:n.request.httpRequest.endpoint.hostname,retryable:!0})}n.error=v,n.request.emit("httpError",[n.error,n],function(){s()})}o(l,"error");function h(){var v=ee.HttpClient.getInstance(),S=n.request.service.config.httpOptions||{};try{var O=v.handleRequest(n.request.httpRequest,S,a,l);u(O)}catch(g){l(g)}}o(h,"executeSend");var y=(n.request.service.getSkewCorrectedDate()-this.signedAt)/1e3;y>=60*10?this.emit("sign",[this],function(v){v?s(v):h()}):h()},"SEND")),t("HTTP_HEADERS","httpHeaders",o(function(n,s,a,u){a.httpResponse.statusCode=n,a.httpResponse.statusMessage=u,a.httpResponse.headers=s,a.httpResponse.body=ee.util.buffer.toBuffer(""),a.httpResponse.buffers=[],a.httpResponse.numBytes=0;var l=s.date||s.Date,h=a.request.service;if(l){var y=Date.parse(l);h.config.correctClockSkew&&h.isClockSkewed(y)&&h.applyClockOffset(y)}},"HTTP_HEADERS")),t("HTTP_DATA","httpData",o(function(n,s){if(n){if(ee.util.isNode()){s.httpResponse.numBytes+=n.length;var a=s.httpResponse.headers["content-length"],u={loaded:s.httpResponse.numBytes,total:a};s.request.emit("httpDownloadProgress",[u,s])}s.httpResponse.buffers.push(ee.util.buffer.toBuffer(n))}},"HTTP_DATA")),t("HTTP_DONE","httpDone",o(function(n){if(n.httpResponse.buffers&&n.httpResponse.buffers.length>0){var s=ee.util.buffer.concat(n.httpResponse.buffers);n.httpResponse.body=s}delete n.httpResponse.numBytes,delete n.httpResponse.buffers},"HTTP_DONE")),t("FINALIZE_ERROR","retry",o(function(n){n.httpResponse.statusCode&&(n.error.statusCode=n.httpResponse.statusCode,n.error.retryable===void 0&&(n.error.retryable=this.service.retryableError(n.error,this)))},"FINALIZE_ERROR")),t("INVALIDATE_CREDENTIALS","retry",o(function(n){if(n.error)switch(n.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":n.error.retryable=!0,n.request.service.config.credentials.expired=!0}},"INVALIDATE_CREDENTIALS")),t("EXPIRED_SIGNATURE","retry",o(function(n){var s=n.error;s&&typeof s.code=="string"&&typeof s.message=="string"&&s.code.match(/Signature/)&&s.message.match(/expired/)&&(n.error.retryable=!0)},"EXPIRED_SIGNATURE")),t("CLOCK_SKEWED","retry",o(function(n){n.error&&this.service.clockSkewError(n.error)&&this.service.config.correctClockSkew&&(n.error.retryable=!0)},"CLOCK_SKEWED")),t("REDIRECT","retry",o(function(n){n.error&&n.error.statusCode>=300&&n.error.statusCode<400&&n.httpResponse.headers.location&&(this.httpRequest.endpoint=new ee.Endpoint(n.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,n.error.redirect=!0,n.error.retryable=!0)},"REDIRECT")),t("RETRY_CHECK","retry",o(function(n){n.error&&(n.error.redirect&&n.redirectCount<n.maxRedirects?n.error.retryDelay=0:n.retryCount<n.maxRetries&&(n.error.retryDelay=this.service.retryDelays(n.retryCount,n.error)||0))},"RETRY_CHECK")),e("RESET_RETRY_STATE","afterRetry",o(function(n,s){var a,u=!1;n.error&&(a=n.error.retryDelay||0,n.error.retryable&&n.retryCount<n.maxRetries?(n.retryCount++,u=!0):n.error.redirect&&n.redirectCount<n.maxRedirects&&(n.redirectCount++,u=!0)),u&&a>=0?(n.error=null,setTimeout(s,a)):s()},"RESET_RETRY_STATE"))}),CorePost:new Ur().addNamedListeners(function(t){t("EXTRACT_REQUEST_ID","extractData",ee.util.extractRequestId),t("EXTRACT_REQUEST_ID","extractError",ee.util.extractRequestId),t("ENOTFOUND_ERROR","httpError",o(function(r){function i(s){return s.errno==="ENOTFOUND"||typeof s.errno=="number"&&typeof ee.util.getSystemErrorName=="function"&&["EAI_NONAME","EAI_NODATA"].indexOf(ee.util.getSystemErrorName(s.errno)>=0)}if(o(i,"isDNSError"),r.code==="NetworkingError"&&i(r)){var n="Inaccessible host: `"+r.hostname+"' at port `"+r.port+"'. This service may not be available in the `"+r.region+"' region.";this.response.error=ee.util.error(new Error(n),{code:"UnknownEndpoint",region:r.region,hostname:r.hostname,retryable:!0,originalError:r})}},"ENOTFOUND_ERROR"))}),Logger:new Ur().addNamedListeners(function(t){t("LOG_REQUEST","complete",o(function(r){var i=r.request,n=i.service.config.logger;if(!n)return;function s(l,h){if(!h)return h;if(l.isSensitive)return"***SensitiveInformation***";switch(l.type){case"structure":var y={};return ee.util.each(h,function(O,g){Object.prototype.hasOwnProperty.call(l.members,O)?y[O]=s(l.members[O],g):y[O]=g}),y;case"list":var v=[];return ee.util.arrayEach(h,function(O,g){v.push(s(l.member,O))}),v;case"map":var S={};return ee.util.each(h,function(O,g){S[O]=s(l.value,g)}),S;default:return h}}o(s,"filterSensitiveLog");function a(){var l=r.request.service.getSkewCorrectedDate().getTime(),h=(l-i.startTime.getTime())/1e3,y=!!n.isTTY,v=r.httpResponse.statusCode,S=i.params;if(i.service.api.operations&&i.service.api.operations[i.operation]&&i.service.api.operations[i.operation].input){var O=i.service.api.operations[i.operation].input;S=s(O,i.params)}var g=re("util").inspect(S,!0,null),N="";return y&&(N+="\x1B[33m"),N+="[AWS "+i.service.serviceIdentifier+" "+v,N+=" "+h.toString()+"s "+r.retryCount+" retries]",y&&(N+="\x1B[0;1m"),N+=" "+ee.util.string.lowerFirst(i.operation),N+="("+g+")",y&&(N+="\x1B[0m"),N}o(a,"buildMessage");var u=a();typeof n.log=="function"?n.log(u):typeof n.write=="function"&&n.write(u+`
|
|
2
|
-
`)},"LOG_REQUEST"))}),Json:new Ur().addNamedListeners(function(t){var e=Bo();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Rest:new Ur().addNamedListeners(function(t){var e=qn();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),RestJson:new Ur().addNamedListeners(function(t){var e=ua();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError),t("UNSET_CONTENT_LENGTH","afterBuild",e.unsetContentLength)}),RestXml:new Ur().addNamedListeners(function(t){var e=la();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Query:new Ur().addNamedListeners(function(t){var e=oa();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)})}});var gl=P((Jk,vl)=>{function Sa(t,e){this.currentState=e||null,this.states=t||{}}o(Sa,"AcceptorStateMachine");Sa.prototype.runTo=o(function(e,r,i,n){typeof e=="function"&&(n=i,i=r,r=e,e=null);var s=this,a=s.states[s.currentState];a.fn.call(i||s,n,function(u){if(u)if(a.fail)s.currentState=a.fail;else return r?r.call(i,u):null;else if(a.accept)s.currentState=a.accept;else return r?r.call(i):null;if(s.currentState===e)return r?r.call(i,u):null;s.runTo(e,r,i,u)})},"runTo");Sa.prototype.addState=o(function(e,r,i,n){return typeof r=="function"?(n=r,r=null,i=null):typeof i=="function"&&(n=i,i=null),this.currentState||(this.currentState=e),this.states[e]={accept:r,fail:i,fn:n},this},"addState");vl.exports=Sa});var Zo=P($o=>{(function(t){"use strict";function e(d){return d!==null?Object.prototype.toString.call(d)==="[object Array]":!1}o(e,"isArray");function r(d){return d!==null?Object.prototype.toString.call(d)==="[object Object]":!1}o(r,"isObject");function i(d,x){if(d===x)return!0;var b=Object.prototype.toString.call(d);if(b!==Object.prototype.toString.call(x))return!1;if(e(d)===!0){if(d.length!==x.length)return!1;for(var k=0;k<d.length;k++)if(i(d[k],x[k])===!1)return!1;return!0}if(r(d)===!0){var L={};for(var W in d)if(hasOwnProperty.call(d,W)){if(i(d[W],x[W])===!1)return!1;L[W]=!0}for(var Q in x)if(hasOwnProperty.call(x,Q)&&L[Q]!==!0)return!1;return!0}return!1}o(i,"strictDeepEqual");function n(d){if(d===""||d===!1||d===null)return!0;if(e(d)&&d.length===0)return!0;if(r(d)){for(var x in d)if(d.hasOwnProperty(x))return!1;return!0}else return!1}o(n,"isFalse");function s(d){for(var x=Object.keys(d),b=[],k=0;k<x.length;k++)b.push(d[x[k]]);return b}o(s,"objValues");function a(d,x){var b={};for(var k in d)b[k]=d[k];for(var L in x)b[L]=x[L];return b}o(a,"merge");var u;typeof String.prototype.trimLeft=="function"?u=o(function(d){return d.trimLeft()},"trimLeft"):u=o(function(d){return d.match(/^\s*(.*)/)[1]},"trimLeft");var l=0,h=1,y=2,v=3,S=4,O=5,g=6,N=7,D=8,E=9,p={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},C="EOF",R="UnquotedIdentifier",_="QuotedIdentifier",T="Rbracket",A="Rparen",w="Comma",K="Colon",X="Rbrace",F="Number",oe="Current",We="Expref",Fe="Pipe",bt="Or",Z="And",xr="EQ",Er="GT",Cr="LT",Nt="GTE",Sr="LTE",wi="NE",At="Flatten",Ut="Star",Kr="Filter",m="Dot",f="Not",q="Lbrace",I="Lbracket",te="Lparen",we="Literal",Te={".":m,"*":Ut,",":w,":":K,"{":q,"}":X,"]":T,"(":te,")":A,"@":oe},Je={"<":!0,">":!0,"=":!0,"!":!0},wt={" ":!0," ":!0,"\n":!0};function Tr(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d==="_"}o(Tr,"isAlpha");function De(d){return d>="0"&&d<="9"||d==="-"}o(De,"isNum");function It(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d>="0"&&d<="9"||d==="_"}o(It,"isAlphaNum");function Xi(){}o(Xi,"Lexer"),Xi.prototype={tokenize:function(d){var x=[];this._current=0;for(var b,k,L;this._current<d.length;)if(Tr(d[this._current]))b=this._current,k=this._consumeUnquotedIdentifier(d),x.push({type:R,value:k,start:b});else if(Te[d[this._current]]!==void 0)x.push({type:Te[d[this._current]],value:d[this._current],start:this._current}),this._current++;else if(De(d[this._current]))L=this._consumeNumber(d),x.push(L);else if(d[this._current]==="[")L=this._consumeLBracket(d),x.push(L);else if(d[this._current]==='"')b=this._current,k=this._consumeQuotedIdentifier(d),x.push({type:_,value:k,start:b});else if(d[this._current]==="'")b=this._current,k=this._consumeRawStringLiteral(d),x.push({type:we,value:k,start:b});else if(d[this._current]==="`"){b=this._current;var W=this._consumeLiteral(d);x.push({type:we,value:W,start:b})}else if(Je[d[this._current]]!==void 0)x.push(this._consumeOperator(d));else if(wt[d[this._current]]!==void 0)this._current++;else if(d[this._current]==="&")b=this._current,this._current++,d[this._current]==="&"?(this._current++,x.push({type:Z,value:"&&",start:b})):x.push({type:We,value:"&",start:b});else if(d[this._current]==="|")b=this._current,this._current++,d[this._current]==="|"?(this._current++,x.push({type:bt,value:"||",start:b})):x.push({type:Fe,value:"|",start:b});else{var Q=new Error("Unknown character:"+d[this._current]);throw Q.name="LexerError",Q}return x},_consumeUnquotedIdentifier:function(d){var x=this._current;for(this._current++;this._current<d.length&&It(d[this._current]);)this._current++;return d.slice(x,this._current)},_consumeQuotedIdentifier:function(d){var x=this._current;this._current++;for(var b=d.length;d[this._current]!=='"'&&this._current<b;){var k=this._current;d[k]==="\\"&&(d[k+1]==="\\"||d[k+1]==='"')?k+=2:k++,this._current=k}return this._current++,JSON.parse(d.slice(x,this._current))},_consumeRawStringLiteral:function(d){var x=this._current;this._current++;for(var b=d.length;d[this._current]!=="'"&&this._current<b;){var k=this._current;d[k]==="\\"&&(d[k+1]==="\\"||d[k+1]==="'")?k+=2:k++,this._current=k}this._current++;var L=d.slice(x+1,this._current-1);return L.replace("\\'","'")},_consumeNumber:function(d){var x=this._current;this._current++;for(var b=d.length;De(d[this._current])&&this._current<b;)this._current++;var k=parseInt(d.slice(x,this._current));return{type:F,value:k,start:x}},_consumeLBracket:function(d){var x=this._current;return this._current++,d[this._current]==="?"?(this._current++,{type:Kr,value:"[?",start:x}):d[this._current]==="]"?(this._current++,{type:At,value:"[]",start:x}):{type:I,value:"[",start:x}},_consumeOperator:function(d){var x=this._current,b=d[x];if(this._current++,b==="!")return d[this._current]==="="?(this._current++,{type:wi,value:"!=",start:x}):{type:f,value:"!",start:x};if(b==="<")return d[this._current]==="="?(this._current++,{type:Sr,value:"<=",start:x}):{type:Cr,value:"<",start:x};if(b===">")return d[this._current]==="="?(this._current++,{type:Nt,value:">=",start:x}):{type:Er,value:">",start:x};if(b==="="&&d[this._current]==="=")return this._current++,{type:xr,value:"==",start:x}},_consumeLiteral:function(d){this._current++;for(var x=this._current,b=d.length,k;d[this._current]!=="`"&&this._current<b;){var L=this._current;d[L]==="\\"&&(d[L+1]==="\\"||d[L+1]==="`")?L+=2:L++,this._current=L}var W=u(d.slice(x,this._current));return W=W.replace("\\`","`"),this._looksLikeJSON(W)?k=JSON.parse(W):k=JSON.parse('"'+W+'"'),this._current++,k},_looksLikeJSON:function(d){var x='[{"',b=["true","false","null"],k="-0123456789";if(d==="")return!1;if(x.indexOf(d[0])>=0)return!0;if(b.indexOf(d)>=0)return!0;if(k.indexOf(d[0])>=0)try{return JSON.parse(d),!0}catch{return!1}else return!1}};var J={};J[C]=0,J[R]=0,J[_]=0,J[T]=0,J[A]=0,J[w]=0,J[X]=0,J[F]=0,J[oe]=0,J[We]=0,J[Fe]=1,J[bt]=2,J[Z]=3,J[xr]=5,J[Er]=5,J[Cr]=5,J[Nt]=5,J[Sr]=5,J[wi]=5,J[At]=9,J[Ut]=20,J[Kr]=21,J[m]=40,J[f]=45,J[q]=50,J[I]=55,J[te]=60;function Xr(){}o(Xr,"Parser"),Xr.prototype={parse:function(d){this._loadTokens(d),this.index=0;var x=this.expression(0);if(this._lookahead(0)!==C){var b=this._lookaheadToken(0),k=new Error("Unexpected token type: "+b.type+", value: "+b.value);throw k.name="ParserError",k}return x},_loadTokens:function(d){var x=new Xi,b=x.tokenize(d);b.push({type:C,value:"",start:d.length}),this.tokens=b},expression:function(d){var x=this._lookaheadToken(0);this._advance();for(var b=this.nud(x),k=this._lookahead(0);d<J[k];)this._advance(),b=this.led(k,b),k=this._lookahead(0);return b},_lookahead:function(d){return this.tokens[this.index+d].type},_lookaheadToken:function(d){return this.tokens[this.index+d]},_advance:function(){this.index++},nud:function(d){var x,b,k;switch(d.type){case we:return{type:"Literal",value:d.value};case R:return{type:"Field",name:d.value};case _:var L={type:"Field",name:d.value};if(this._lookahead(0)===te)throw new Error("Quoted identifier not allowed for function names.");return L;case f:return b=this.expression(J.Not),{type:"NotExpression",children:[b]};case Ut:return x={type:"Identity"},b=null,this._lookahead(0)===T?b={type:"Identity"}:b=this._parseProjectionRHS(J.Star),{type:"ValueProjection",children:[x,b]};case Kr:return this.led(d.type,{type:"Identity"});case q:return this._parseMultiselectHash();case At:return x={type:At,children:[{type:"Identity"}]},b=this._parseProjectionRHS(J.Flatten),{type:"Projection",children:[x,b]};case I:return this._lookahead(0)===F||this._lookahead(0)===K?(b=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},b)):this._lookahead(0)===Ut&&this._lookahead(1)===T?(this._advance(),this._advance(),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[{type:"Identity"},b]}):this._parseMultiselectList();case oe:return{type:oe};case We:return k=this.expression(J.Expref),{type:"ExpressionReference",children:[k]};case te:for(var W=[];this._lookahead(0)!==A;)this._lookahead(0)===oe?(k={type:oe},this._advance()):k=this.expression(0),W.push(k);return this._match(A),W[0];default:this._errorToken(d)}},led:function(d,x){var b;switch(d){case m:var k=J.Dot;return this._lookahead(0)!==Ut?(b=this._parseDotRHS(k),{type:"Subexpression",children:[x,b]}):(this._advance(),b=this._parseProjectionRHS(k),{type:"ValueProjection",children:[x,b]});case Fe:return b=this.expression(J.Pipe),{type:Fe,children:[x,b]};case bt:return b=this.expression(J.Or),{type:"OrExpression",children:[x,b]};case Z:return b=this.expression(J.And),{type:"AndExpression",children:[x,b]};case te:for(var L=x.name,W=[],Q,se;this._lookahead(0)!==A;)this._lookahead(0)===oe?(Q={type:oe},this._advance()):Q=this.expression(0),this._lookahead(0)===w&&this._match(w),W.push(Q);return this._match(A),se={type:"Function",name:L,children:W},se;case Kr:var $e=this.expression(0);return this._match(T),this._lookahead(0)===At?b={type:"Identity"}:b=this._parseProjectionRHS(J.Filter),{type:"FilterProjection",children:[x,b,$e]};case At:var $t={type:At,children:[x]},ke=this._parseProjectionRHS(J.Flatten);return{type:"Projection",children:[$t,ke]};case xr:case wi:case Er:case Nt:case Cr:case Sr:return this._parseComparator(x,d);case I:var G=this._lookaheadToken(0);return G.type===F||G.type===K?(b=this._parseIndexExpression(),this._projectIfSlice(x,b)):(this._match(Ut),this._match(T),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[x,b]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(d){if(this._lookahead(0)===d)this._advance();else{var x=this._lookaheadToken(0),b=new Error("Expected "+d+", got: "+x.type);throw b.name="ParserError",b}},_errorToken:function(d){var x=new Error("Invalid token ("+d.type+'): "'+d.value+'"');throw x.name="ParserError",x},_parseIndexExpression:function(){if(this._lookahead(0)===K||this._lookahead(1)===K)return this._parseSliceExpression();var d={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(T),d},_projectIfSlice:function(d,x){var b={type:"IndexExpression",children:[d,x]};return x.type==="Slice"?{type:"Projection",children:[b,this._parseProjectionRHS(J.Star)]}:b},_parseSliceExpression:function(){for(var d=[null,null,null],x=0,b=this._lookahead(0);b!==T&&x<3;){if(b===K)x++,this._advance();else if(b===F)d[x]=this._lookaheadToken(0).value,this._advance();else{var k=this._lookahead(0),L=new Error("Syntax error, unexpected token: "+k.value+"("+k.type+")");throw L.name="Parsererror",L}b=this._lookahead(0)}return this._match(T),{type:"Slice",children:d}},_parseComparator:function(d,x){var b=this.expression(J[x]);return{type:"Comparator",name:x,children:[d,b]}},_parseDotRHS:function(d){var x=this._lookahead(0),b=[R,_,Ut];if(b.indexOf(x)>=0)return this.expression(d);if(x===I)return this._match(I),this._parseMultiselectList();if(x===q)return this._match(q),this._parseMultiselectHash()},_parseProjectionRHS:function(d){var x;if(J[this._lookahead(0)]<10)x={type:"Identity"};else if(this._lookahead(0)===I)x=this.expression(d);else if(this._lookahead(0)===Kr)x=this.expression(d);else if(this._lookahead(0)===m)this._match(m),x=this._parseDotRHS(d);else{var b=this._lookaheadToken(0),k=new Error("Sytanx error, unexpected token: "+b.value+"("+b.type+")");throw k.name="ParserError",k}return x},_parseMultiselectList:function(){for(var d=[];this._lookahead(0)!==T;){var x=this.expression(0);if(d.push(x),this._lookahead(0)===w&&(this._match(w),this._lookahead(0)===T))throw new Error("Unexpected token Rbracket")}return this._match(T),{type:"MultiSelectList",children:d}},_parseMultiselectHash:function(){for(var d=[],x=[R,_],b,k,L,W;;){if(b=this._lookaheadToken(0),x.indexOf(b.type)<0)throw new Error("Expecting an identifier token, got: "+b.type);if(k=b.value,this._advance(),this._match(K),L=this.expression(0),W={type:"KeyValuePair",name:k,value:L},d.push(W),this._lookahead(0)===w)this._match(w);else if(this._lookahead(0)===X){this._match(X);break}}return{type:"MultiSelectHash",children:d}}};function Gi(d){this.runtime=d}o(Gi,"TreeInterpreter"),Gi.prototype={search:function(d,x){return this.visit(d,x)},visit:function(d,x){var b,k,L,W,Q,se,$e,$t,ke,G;switch(d.type){case"Field":return x!==null&&r(x)?(se=x[d.name],se===void 0?null:se):null;case"Subexpression":for(L=this.visit(d.children[0],x),G=1;G<d.children.length;G++)if(L=this.visit(d.children[1],L),L===null)return null;return L;case"IndexExpression":return $e=this.visit(d.children[0],x),$t=this.visit(d.children[1],$e),$t;case"Index":if(!e(x))return null;var Zt=d.value;return Zt<0&&(Zt=x.length+Zt),L=x[Zt],L===void 0&&(L=null),L;case"Slice":if(!e(x))return null;var op=d.children.slice(0),Is=this.computeSliceParams(x.length,op),Za=Is[0],eu=Is[1],Os=Is[2];if(L=[],Os>0)for(G=Za;G<eu;G+=Os)L.push(x[G]);else for(G=Za;G>eu;G+=Os)L.push(x[G]);return L;case"Projection":var Ot=this.visit(d.children[0],x);if(!e(Ot))return null;for(ke=[],G=0;G<Ot.length;G++)k=this.visit(d.children[1],Ot[G]),k!==null&&ke.push(k);return ke;case"ValueProjection":if(Ot=this.visit(d.children[0],x),!r(Ot))return null;ke=[];var tu=s(Ot);for(G=0;G<tu.length;G++)k=this.visit(d.children[1],tu[G]),k!==null&&ke.push(k);return ke;case"FilterProjection":if(Ot=this.visit(d.children[0],x),!e(Ot))return null;var Rs=[],ru=[];for(G=0;G<Ot.length;G++)b=this.visit(d.children[2],Ot[G]),n(b)||Rs.push(Ot[G]);for(var Ds=0;Ds<Rs.length;Ds++)k=this.visit(d.children[1],Rs[Ds]),k!==null&&ru.push(k);return ru;case"Comparator":switch(W=this.visit(d.children[0],x),Q=this.visit(d.children[1],x),d.name){case xr:L=i(W,Q);break;case wi:L=!i(W,Q);break;case Er:L=W>Q;break;case Nt:L=W>=Q;break;case Cr:L=W<Q;break;case Sr:L=W<=Q;break;default:throw new Error("Unknown comparator: "+d.name)}return L;case At:var Ps=this.visit(d.children[0],x);if(!e(Ps))return null;var fo=[];for(G=0;G<Ps.length;G++)k=Ps[G],e(k)?fo.push.apply(fo,k):fo.push(k);return fo;case"Identity":return x;case"MultiSelectList":if(x===null)return null;for(ke=[],G=0;G<d.children.length;G++)ke.push(this.visit(d.children[G],x));return ke;case"MultiSelectHash":if(x===null)return null;ke={};var _s;for(G=0;G<d.children.length;G++)_s=d.children[G],ke[_s.name]=this.visit(_s.value,x);return ke;case"OrExpression":return b=this.visit(d.children[0],x),n(b)&&(b=this.visit(d.children[1],x)),b;case"AndExpression":return W=this.visit(d.children[0],x),n(W)===!0?W:this.visit(d.children[1],x);case"NotExpression":return W=this.visit(d.children[0],x),n(W);case"Literal":return d.value;case Fe:return $e=this.visit(d.children[0],x),this.visit(d.children[1],$e);case oe:return x;case"Function":var iu=[];for(G=0;G<d.children.length;G++)iu.push(this.visit(d.children[G],x));return this.runtime.callFunction(d.name,iu);case"ExpressionReference":var nu=d.children[0];return nu.jmespathType=We,nu;default:throw new Error("Unknown node type: "+d.type)}},computeSliceParams:function(d,x){var b=x[0],k=x[1],L=x[2],W=[null,null,null];if(L===null)L=1;else if(L===0){var Q=new Error("Invalid slice, step cannot be 0");throw Q.name="RuntimeError",Q}var se=L<0;return b===null?b=se?d-1:0:b=this.capSliceRange(d,b,L),k===null?k=se?-1:d:k=this.capSliceRange(d,k,L),W[0]=b,W[1]=k,W[2]=L,W},capSliceRange:function(d,x,b){return x<0?(x+=d,x<0&&(x=b<0?-1:0)):x>=d&&(x=b<0?d-1:d),x}};function $a(d){this._interpreter=d,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[D]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[y,v]},{types:[h]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[y]},{types:[y]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[y,v,S]}]},map:{_func:this._functionMap,_signature:[{types:[g]},{types:[v]}]},max:{_func:this._functionMax,_signature:[{types:[D,E]}]},merge:{_func:this._functionMerge,_signature:[{types:[S],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[v]},{types:[g]}]},sum:{_func:this._functionSum,_signature:[{types:[D]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[y]},{types:[y]}]},min:{_func:this._functionMin,_signature:[{types:[D,E]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[v]},{types:[g]}]},type:{_func:this._functionType,_signature:[{types:[h]}]},keys:{_func:this._functionKeys,_signature:[{types:[S]}]},values:{_func:this._functionValues,_signature:[{types:[S]}]},sort:{_func:this._functionSort,_signature:[{types:[E,D]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[v]},{types:[g]}]},join:{_func:this._functionJoin,_signature:[{types:[y]},{types:[E]}]},reverse:{_func:this._functionReverse,_signature:[{types:[y,v]}]},to_array:{_func:this._functionToArray,_signature:[{types:[h]}]},to_string:{_func:this._functionToString,_signature:[{types:[h]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[h]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[h],variadic:!0}]}}}o($a,"Runtime"),$a.prototype={callFunction:function(d,x){var b=this.functionTable[d];if(b===void 0)throw new Error("Unknown function: "+d+"()");return this._validateArgs(d,x,b._signature),b._func.call(this,x)},_validateArgs:function(d,x,b){var k;if(b[b.length-1].variadic){if(x.length<b.length)throw k=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes at least"+b.length+k+" but received "+x.length)}else if(x.length!==b.length)throw k=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes "+b.length+k+" but received "+x.length);for(var L,W,Q,se=0;se<b.length;se++){Q=!1,L=b[se].types,W=this._getTypeName(x[se]);for(var $e=0;$e<L.length;$e++)if(this._typeMatches(W,L[$e],x[se])){Q=!0;break}if(!Q){var $t=L.map(function(ke){return p[ke]}).join(",");throw new Error("TypeError: "+d+"() expected argument "+(se+1)+" to be type "+$t+" but received type "+p[W]+" instead.")}}},_typeMatches:function(d,x,b){if(x===h)return!0;if(x===E||x===D||x===v){if(x===v)return d===v;if(d===v){var k;x===D?k=l:x===E&&(k=y);for(var L=0;L<b.length;L++)if(!this._typeMatches(this._getTypeName(b[L]),k,b[L]))return!1;return!0}}else return d===x},_getTypeName:function(d){switch(Object.prototype.toString.call(d)){case"[object String]":return y;case"[object Number]":return l;case"[object Array]":return v;case"[object Boolean]":return O;case"[object Null]":return N;case"[object Object]":return d.jmespathType===We?g:S}},_functionStartsWith:function(d){return d[0].lastIndexOf(d[1])===0},_functionEndsWith:function(d){var x=d[0],b=d[1];return x.indexOf(b,x.length-b.length)!==-1},_functionReverse:function(d){var x=this._getTypeName(d[0]);if(x===y){for(var b=d[0],k="",L=b.length-1;L>=0;L--)k+=b[L];return k}else{var W=d[0].slice(0);return W.reverse(),W}},_functionAbs:function(d){return Math.abs(d[0])},_functionCeil:function(d){return Math.ceil(d[0])},_functionAvg:function(d){for(var x=0,b=d[0],k=0;k<b.length;k++)x+=b[k];return x/b.length},_functionContains:function(d){return d[0].indexOf(d[1])>=0},_functionFloor:function(d){return Math.floor(d[0])},_functionLength:function(d){return r(d[0])?Object.keys(d[0]).length:d[0].length},_functionMap:function(d){for(var x=[],b=this._interpreter,k=d[0],L=d[1],W=0;W<L.length;W++)x.push(b.visit(k,L[W]));return x},_functionMerge:function(d){for(var x={},b=0;b<d.length;b++){var k=d[b];for(var L in k)x[L]=k[L]}return x},_functionMax:function(d){if(d[0].length>0){var x=this._getTypeName(d[0][0]);if(x===l)return Math.max.apply(Math,d[0]);for(var b=d[0],k=b[0],L=1;L<b.length;L++)k.localeCompare(b[L])<0&&(k=b[L]);return k}else return null},_functionMin:function(d){if(d[0].length>0){var x=this._getTypeName(d[0][0]);if(x===l)return Math.min.apply(Math,d[0]);for(var b=d[0],k=b[0],L=1;L<b.length;L++)b[L].localeCompare(k)<0&&(k=b[L]);return k}else return null},_functionSum:function(d){for(var x=0,b=d[0],k=0;k<b.length;k++)x+=b[k];return x},_functionType:function(d){switch(this._getTypeName(d[0])){case l:return"number";case y:return"string";case v:return"array";case S:return"object";case O:return"boolean";case g:return"expref";case N:return"null"}},_functionKeys:function(d){return Object.keys(d[0])},_functionValues:function(d){for(var x=d[0],b=Object.keys(x),k=[],L=0;L<b.length;L++)k.push(x[b[L]]);return k},_functionJoin:function(d){var x=d[0],b=d[1];return b.join(x)},_functionToArray:function(d){return this._getTypeName(d[0])===v?d[0]:[d[0]]},_functionToString:function(d){return this._getTypeName(d[0])===y?d[0]:JSON.stringify(d[0])},_functionToNumber:function(d){var x=this._getTypeName(d[0]),b;return x===l?d[0]:x===y&&(b=+d[0],!isNaN(b))?b:null},_functionNotNull:function(d){for(var x=0;x<d.length;x++)if(this._getTypeName(d[x])!==N)return d[x];return null},_functionSort:function(d){var x=d[0].slice(0);return x.sort(),x},_functionSortBy:function(d){var x=d[0].slice(0);if(x.length===0)return x;var b=this._interpreter,k=d[1],L=this._getTypeName(b.visit(k,x[0]));if([l,y].indexOf(L)<0)throw new Error("TypeError");for(var W=this,Q=[],se=0;se<x.length;se++)Q.push([se,x[se]]);Q.sort(function($t,ke){var G=b.visit(k,$t[1]),Zt=b.visit(k,ke[1]);if(W._getTypeName(G)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(G));if(W._getTypeName(Zt)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(Zt));return G>Zt?1:G<Zt?-1:$t[0]-ke[0]});for(var $e=0;$e<Q.length;$e++)x[$e]=Q[$e][1];return x},_functionMaxBy:function(d){for(var x=d[1],b=d[0],k=this.createKeyFunction(x,[l,y]),L=-1/0,W,Q,se=0;se<b.length;se++)Q=k(b[se]),Q>L&&(L=Q,W=b[se]);return W},_functionMinBy:function(d){for(var x=d[1],b=d[0],k=this.createKeyFunction(x,[l,y]),L=1/0,W,Q,se=0;se<b.length;se++)Q=k(b[se]),Q<L&&(L=Q,W=b[se]);return W},createKeyFunction:function(d,x){var b=this,k=this._interpreter,L=o(function(W){var Q=k.visit(d,W);if(x.indexOf(b._getTypeName(Q))<0){var se="TypeError: expected one of "+x+", received "+b._getTypeName(Q);throw new Error(se)}return Q},"keyFunc");return L}};function rp(d){var x=new Xr,b=x.parse(d);return b}o(rp,"compile");function ip(d){var x=new Xi;return x.tokenize(d)}o(ip,"tokenize");function np(d,x){var b=new Xr,k=new $a,L=new Gi(k);k._interpreter=L;var W=b.parse(x);return L.search(W,d)}o(np,"search"),t.tokenize=ip,t.compile=rp,t.search=np,t.strictDeepEqual=i})(typeof $o>"u"?$o.jmespath={}:$o)});var wl=P(()=>{var ce=V(),Nl=gl(),ky=ce.util.inherit,es=ce.util.domain,qy=Zo(),Ly={success:1,error:1,complete:1};function My(t){return Object.prototype.hasOwnProperty.call(Ly,t._asm.currentState)}o(My,"isTerminalState");var Ta=new Nl;Ta.setupStates=function(){var t=o(function(e,r){var i=this;i._haltHandlersOnError=!1,i.emit(i._asm.currentState,function(n){if(n)if(My(i))if(es&&i.domain instanceof es.Domain)n.domainEmitter=i,n.domain=i.domain,n.domainThrown=!1,i.domain.emit("error",n);else throw n;else i.response.error=n,r(n);else r(i.response.error)})},"transition");this.addState("validate","build","error",t),this.addState("build","afterBuild","restart",t),this.addState("afterBuild","sign","restart",t),this.addState("sign","send","retry",t),this.addState("retry","afterRetry","afterRetry",t),this.addState("afterRetry","sign","error",t),this.addState("send","validateResponse","retry",t),this.addState("validateResponse","extractData","extractError",t),this.addState("extractError","extractData","retry",t),this.addState("extractData","success","retry",t),this.addState("restart","build","error",t),this.addState("success","complete","complete",t),this.addState("error","complete","complete",t),this.addState("complete",null,null,t)};Ta.setupStates();ce.Request=ky({constructor:o(function(e,r,i){var n=e.endpoint,s=e.config.region,a=e.config.customUserAgent;e.signingRegion?s=e.signingRegion:e.isGlobalEndpoint&&(s="us-east-1"),this.domain=es&&es.active,this.service=e,this.operation=r,this.params=i||{},this.httpRequest=new ce.HttpRequest(n,s),this.httpRequest.appendToUserAgent(a),this.startTime=e.getSkewCorrectedDate(),this.response=new ce.Response(this),this._asm=new Nl(Ta.states,"validate"),this._haltHandlersOnError=!1,ce.SequentialExecutor.call(this),this.emit=this.emitEvent},"Request"),send:o(function(e){return e&&(this.httpRequest.appendToUserAgent("callback"),this.on("complete",function(r){e.call(r,r.error,r.data)})),this.runTo(),this.response},"send"),build:o(function(e){return this.runTo("send",e)},"build"),runTo:o(function(e,r){return this._asm.runTo(e,r,this),this},"runTo"),abort:o(function(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",o(function(r){r.error=ce.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1})},"addAbortedError")),this.httpRequest.stream&&!this.httpRequest.stream.didCallback&&(this.httpRequest.stream.abort(),this.httpRequest._abortCallback?this.httpRequest._abortCallback():this.removeAllListeners("send")),this},"abort"),eachPage:o(function(e){e=ce.util.fn.makeAsync(e,3);function r(i){e.call(i,i.error,i.data,function(n){n!==!1&&(i.hasNextPage()?i.nextPage().on("complete",r).send():e.call(i,null,null,ce.util.fn.noop))})}o(r,"wrappedCallback"),this.on("complete",r).send()},"eachPage"),eachItem:o(function(e){var r=this;function i(n,s){if(n)return e(n,null);if(s===null)return e(null,null);var a=r.service.paginationConfig(r.operation),u=a.resultKey;Array.isArray(u)&&(u=u[0]);var l=qy.search(s,u),h=!0;return ce.util.arrayEach(l,function(y){if(h=e(null,y),h===!1)return ce.util.abort}),h}o(i,"wrappedCallback"),this.eachPage(i)},"eachItem"),isPageable:o(function(){return!!this.service.paginationConfig(this.operation)},"isPageable"),createReadStream:o(function(){var e=ce.util.stream,r=this,i=null;return ce.HttpClient.streamsApiVersion===2?(i=new e.PassThrough,process.nextTick(function(){r.send()})):(i=new e.Stream,i.readable=!0,i.sent=!1,i.on("newListener",function(n){!i.sent&&n==="data"&&(i.sent=!0,process.nextTick(function(){r.send()}))})),this.on("error",function(n){i.emit("error",n)}),this.on("httpHeaders",o(function(s,a,u){if(s<300){r.removeListener("httpData",ce.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",ce.EventListeners.Core.HTTP_ERROR),r.on("httpError",o(function(N){u.error=N,u.error.retryable=!1},"streamHttpError"));var l=!1,h;if(r.httpRequest.method!=="HEAD"&&(h=parseInt(a["content-length"],10)),h!==void 0&&!isNaN(h)&&h>=0){l=!0;var y=0}var v=o(function(){l&&y!==h?i.emit("error",ce.util.error(new Error("Stream content length mismatch. Received "+y+" of "+h+" bytes."),{code:"StreamContentLengthMismatch"})):ce.HttpClient.streamsApiVersion===2?i.end():i.emit("end")},"checkContentLengthAndEmit"),S=u.httpResponse.createUnbufferedStream();if(ce.HttpClient.streamsApiVersion===2)if(l){var O=new e.PassThrough;O._write=function(g){return g&&g.length&&(y+=g.length),e.PassThrough.prototype._write.apply(this,arguments)},O.on("end",v),i.on("error",function(g){l=!1,S.unpipe(O),O.emit("end"),O.end()}),S.pipe(O).pipe(i,{end:!1})}else S.pipe(i);else l&&S.on("data",function(g){g&&g.length&&(y+=g.length)}),S.on("data",function(g){i.emit("data",g)}),S.on("end",v);S.on("error",function(g){l=!1,i.emit("error",g)})}},"streamHeaders")),i},"createReadStream"),emitEvent:o(function(e,r,i){typeof r=="function"&&(i=r,r=null),i||(i=o(function(){},"done")),r||(r=this.eventParameters(e,this.response));var n=ce.SequentialExecutor.prototype.emit;n.call(this,e,r,function(s){s&&(this.response.error=s),i.call(this,s)})},"emit"),eventParameters:o(function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},"eventParameters"),presign:o(function(e,r){return!r&&typeof e=="function"&&(r=e,e=null),new ce.Signers.Presign().sign(this.toGet(),e,r)},"presign"),isPresigned:o(function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},"isPresigned"),toUnauthenticated:o(function(){return this._unAuthenticated=!0,this.removeListener("validate",ce.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",ce.EventListeners.Core.SIGN),this},"toUnauthenticated"),toGet:o(function(){return(this.service.api.protocol==="query"||this.service.api.protocol==="ec2")&&(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},"toGet"),buildAsGet:o(function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},"buildAsGet"),haltHandlersOnError:o(function(){this._haltHandlersOnError=!0},"haltHandlersOnError")});ce.Request.addPromisesToClass=o(function(e){this.prototype.promise=o(function(){var i=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(n,s){i.on("complete",function(a){a.error?s(a.error):n(Object.defineProperty(a.data||{},"$response",{value:a}))}),i.runTo()})},"promise")},"addPromisesToClass");ce.Request.deletePromisesFromClass=o(function(){delete this.prototype.promise},"deletePromisesFromClass");ce.util.addPromises(ce.Request);ce.util.mixin(ce.Request,ce.SequentialExecutor)});var El=P(()=>{var Vn=V(),Fy=Vn.util.inherit,xl=Zo();Vn.Response=Fy({constructor:o(function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new Vn.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},"Response"),nextPage:o(function(e){var r,i=this.request.service,n=this.request.operation;try{r=i.paginationConfig(n,!0)}catch(l){this.error=l}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var s=Vn.util.copy(this.request.params);if(this.nextPageTokens){var a=r.inputToken;typeof a=="string"&&(a=[a]);for(var u=0;u<a.length;u++)s[a[u]]=this.nextPageTokens[u];return i.makeRequest(this.request.operation,s,e)}else return e?e(null,null):null},"nextPage"),hasNextPage:o(function(){if(this.cacheNextPageTokens(),this.nextPageTokens)return!0;if(this.nextPageTokens!==void 0)return!1},"hasNextPage"),cacheNextPageTokens:o(function(){if(Object.prototype.hasOwnProperty.call(this,"nextPageTokens"))return this.nextPageTokens;this.nextPageTokens=void 0;var e=this.request.service.paginationConfig(this.request.operation);if(!e)return this.nextPageTokens;if(this.nextPageTokens=null,e.moreResults&&!xl.search(this.data,e.moreResults))return this.nextPageTokens;var r=e.outputToken;return typeof r=="string"&&(r=[r]),Vn.util.arrayEach.call(this,r,function(i){var n=xl.search(this.data,i);n&&(this.nextPageTokens=this.nextPageTokens||[],this.nextPageTokens.push(n))}),this.nextPageTokens},"cacheNextPageTokens")})});var Sl=P(()=>{var fi=V(),Wy=fi.util.inherit,zi=Zo();function Cl(t){var e=t.request._waiter,r=e.config.acceptors,i=!1,n="retry";r.forEach(function(s){if(!i){var a=e.matchers[s.matcher];a&&a(t,s.expected,s.argument)&&(i=!0,n=s.state)}}),!i&&t.error&&(n="failure"),n==="success"?e.setSuccess(t):e.setError(t,n==="retry")}o(Cl,"CHECK_ACCEPTORS");fi.ResourceWaiter=Wy({constructor:o(function(e,r){this.service=e,this.state=r,this.loadWaiterConfig(this.state)},"constructor"),service:null,state:null,config:null,matchers:{path:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}return zi.strictDeepEqual(i,e)},pathAll:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);var n=i.length;if(!n)return!1;for(var s=0;s<n;s++)if(!zi.strictDeepEqual(i[s],e))return!1;return!0},pathAny:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);for(var n=i.length,s=0;s<n;s++)if(zi.strictDeepEqual(i[s],e))return!0;return!1},status:function(t,e){var r=t.httpResponse.statusCode;return typeof r=="number"&&r===e},error:function(t,e){return typeof e=="string"&&t.error?e===t.error.code:e===!!t.error}},listeners:new fi.SequentialExecutor().addNamedListeners(function(t){t("RETRY_CHECK","retry",function(e){var r=e.request._waiter;e.error&&e.error.code==="ResourceNotReady"&&(e.error.retryDelay=(r.config.delay||0)*1e3)}),t("CHECK_OUTPUT","extractData",Cl),t("CHECK_ERROR","extractError",Cl)}),wait:o(function(e,r){typeof e=="function"&&(r=e,e=void 0),e&&e.$waiter&&(e=fi.util.copy(e),typeof e.$waiter.delay=="number"&&(this.config.delay=e.$waiter.delay),typeof e.$waiter.maxAttempts=="number"&&(this.config.maxAttempts=e.$waiter.maxAttempts),delete e.$waiter);var i=this.service.makeRequest(this.config.operation,e);return i._waiter=this,i.response.maxRetries=this.config.maxAttempts,i.addListeners(this.listeners),r&&i.send(r),i},"wait"),setSuccess:o(function(e){e.error=null,e.data=e.data||{},e.request.removeAllListeners("extractData")},"setSuccess"),setError:o(function(e,r){e.data=null,e.error=fi.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:r})},"setError"),loadWaiterConfig:o(function(e){if(!this.service.api.waiters[e])throw new fi.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."});this.config=fi.util.copy(this.service.api.waiters[e])},"loadWaiterConfig")})});var bl=P((uq,Tl)=>{var vr=V(),By=vr.util.inherit;vr.Signers.V2=By(vr.Signers.RequestSigner,{addAuthorization:o(function(e,r){r||(r=vr.util.date.getDate());var i=this.request;i.params.Timestamp=vr.util.date.iso8601(r),i.params.SignatureVersion="2",i.params.SignatureMethod="HmacSHA256",i.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(i.params.SecurityToken=e.sessionToken),delete i.params.Signature,i.params.Signature=this.signature(e),i.body=vr.util.queryParamsToString(i.params),i.headers["Content-Length"]=i.body.length},"addAuthorization"),signature:o(function(e){return vr.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:o(function(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(vr.util.queryParamsToString(this.request.params)),e.join(`
|
|
3
|
-
`)},"stringToSign")});
|
|
1
|
+
var ap=Object.create;var ko=Object.defineProperty;var up=Object.getOwnPropertyDescriptor;var cp=Object.getOwnPropertyNames;var lp=Object.getPrototypeOf,fp=Object.prototype.hasOwnProperty;var s=(t,e)=>ko(t,"name",{value:e,configurable:!0}),re=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var dp=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of cp(e))!fp.call(t,n)&&n!==r&&ko(t,n,{get:()=>e[n],enumerable:!(i=up(e,n))||i.enumerable});return t};var hp=(t,e,r)=>(r=t!=null?ap(lp(t)):{},dp(e||!t||!t.__esModule?ko(r,"default",{value:t,enumerable:!0}):r,t));var qs=P((q_,Zu)=>{var ra=Oe();function Qu(){}s(Qu,"JsonBuilder");Qu.prototype.build=function(t,e){return JSON.stringify(ks(t,e))};function ks(t,e){if(!(!e||t===void 0||t===null))switch(e.type){case"structure":return Jp(t,e);case"map":return Yp(t,e);case"list":return $p(t,e);default:return Qp(t,e)}}s(ks,"translate");function Jp(t,e){if(e.isDocument)return t;var r={};return ra.each(t,function(i,n){var o=e.members[i];if(o){if(o.location!=="body")return;var a=o.isLocationName?o.name:i,u=ks(n,o);u!==void 0&&(r[a]=u)}}),r}s(Jp,"translateStructure");function $p(t,e){var r=[];return ra.arrayEach(t,function(i){var n=ks(i,e.member);n!==void 0&&r.push(n)}),r}s($p,"translateList");function Yp(t,e){var r={};return ra.each(t,function(i,n){var o=ks(n,e.value);o!==void 0&&(r[i]=o)}),r}s(Yp,"translateMap");function Qp(t,e){return e.toWireFormat(t)}s(Qp,"translateScalar");Zu.exports=Qu});var Ms=P((M_,tc)=>{var ia=Oe();function ec(){}s(ec,"JsonParser");ec.prototype.parse=function(t,e){return Ls(JSON.parse(t),e)};function Ls(t,e){if(!(!e||t===void 0))switch(e.type){case"structure":return Zp(t,e);case"map":return tm(t,e);case"list":return em(t,e);default:return rm(t,e)}}s(Ls,"translate");function Zp(t,e){if(t!=null){if(e.isDocument)return t;var r={},i=e.members;return ia.each(i,function(n,o){var a=o.isLocationName?o.name:n;if(Object.prototype.hasOwnProperty.call(t,a)){var u=t[a],l=Ls(u,o);l!==void 0&&(r[n]=l)}}),r}}s(Zp,"translateStructure");function em(t,e){if(t!=null){var r=[];return ia.arrayEach(t,function(i){var n=Ls(i,e.member);n===void 0?r.push(null):r.push(n)}),r}}s(em,"translateList");function tm(t,e){if(t!=null){var r={};return ia.each(t,function(i,n){var o=Ls(n,e.value);o===void 0?r[i]=null:r[i]=o}),r}}s(tm,"translateMap");function rm(t,e){return e.toType(t)}s(rm,"translateScalar");tc.exports=ec});var Fs=P((W_,rc)=>{var Pn=Oe(),im=V();function nm(t){var e=t.service.config.hostPrefixEnabled;if(!e)return t;var r=t.service.api.operations[t.operation];if(sm(t))return t;if(r.endpoint&&r.endpoint.hostPrefix){var i=r.endpoint.hostPrefix,n=om(i,t.params,r.input);am(t.httpRequest.endpoint,n),um(t.httpRequest.endpoint.hostname)}return t}s(nm,"populateHostPrefix");function sm(t){var e=t.service.api,r=e.operations[t.operation],i=e.endpointOperation&&e.endpointOperation===Pn.string.lowerFirst(r.name);return r.endpointDiscoveryRequired!=="NULL"||i===!0}s(sm,"hasEndpointDiscover");function om(t,e,r){return Pn.each(r.members,function(i,n){if(n.hostLabel===!0){if(typeof e[i]!="string"||e[i]==="")throw Pn.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+i+"\\}","g");t=t.replace(o,e[i])}}),t}s(om,"expandHostPrefix");function am(t,e){t.host&&(t.host=e+t.host),t.hostname&&(t.hostname=e+t.hostname)}s(am,"prependEndpointPrefix");function um(t){var e=t.split("."),r=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;Pn.arrayEach(e,function(i){if(!i.length||i.length<1||i.length>63)throw Pn.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!r.test(i))throw im.util.error(new Error,{code:"ValidationError",message:i+" is not hostname compatible."})})}s(um,"validateHostname");rc.exports={populateHostPrefix:nm}});var Ws=P((U_,ic)=>{var cm=Oe(),lm=qs(),fm=Ms(),dm=Fs().populateHostPrefix;function hm(t){var e=t.httpRequest,r=t.service.api,i=r.targetPrefix+"."+r.operations[t.operation].name,n=r.jsonVersion||"1.0",o=r.operations[t.operation].input,a=new lm;n===1&&(n="1.0"),e.body=a.build(t.params||{},o),e.headers["Content-Type"]="application/x-amz-json-"+n,e.headers["X-Amz-Target"]=i,dm(t)}s(hm,"buildRequest");function pm(t){var e={},r=t.httpResponse;if(e.code=r.headers["x-amzn-errortype"]||"UnknownError",typeof e.code=="string"&&(e.code=e.code.split(":")[0]),r.body.length>0)try{var i=JSON.parse(r.body.toString()),n=i.__type||i.code||i.Code;n&&(e.code=n.split("#").pop()),e.code==="RequestEntityTooLarge"?e.message="Request body must be less than 1 MB":e.message=i.message||i.Message||null}catch{e.statusCode=r.statusCode,e.message=r.statusMessage}else e.statusCode=r.statusCode,e.message=r.statusCode.toString();t.error=cm.error(new Error,e)}s(pm,"extractError");function mm(t){var e=t.httpResponse.body.toString()||"{}";if(t.request.service.config.convertResponseTypes===!1)t.data=JSON.parse(e);else{var r=t.request.service.api.operations[t.request.operation],i=r.output||{},n=new fm;t.data=n.parse(e,i)}}s(mm,"extractData");ic.exports={buildRequest:hm,extractError:pm,extractData:mm}});var uc=P((z_,ac)=>{var na=Oe();function nc(){}s(nc,"QueryParamSerializer");nc.prototype.serialize=function(t,e,r){oc("",t,e,r)};function sc(t){return t.isQueryName||t.api.protocol!=="ec2"?t.name:t.name[0].toUpperCase()+t.name.substr(1)}s(sc,"ucfirst");function oc(t,e,r,i){na.each(r.members,function(n,o){var a=e[n];if(a!=null){var u=sc(o);u=t?t+"."+u:u,Bs(u,a,o,i)}})}s(oc,"serializeStructure");function ym(t,e,r,i){var n=1;na.each(e,function(o,a){var u=r.flattened?".":".entry.",l=u+n+++".",h=l+(r.key.name||"key"),y=l+(r.value.name||"value");Bs(t+h,o,r.key,i),Bs(t+y,a,r.value,i)})}s(ym,"serializeMap");function vm(t,e,r,i){var n=r.member||{};if(e.length===0){i.call(this,t,null);return}na.arrayEach(e,function(o,a){var u="."+(a+1);if(r.api.protocol==="ec2")u=u+"";else if(r.flattened){if(n.name){var l=t.split(".");l.pop(),l.push(sc(n)),t=l.join(".")}}else u="."+(n.name?n.name:"member")+u;Bs(t+u,o,n,i)})}s(vm,"serializeList");function Bs(t,e,r,i){e!=null&&(r.type==="structure"?oc(t,e,r,i):r.type==="list"?vm(t,e,r,i):r.type==="map"?ym(t,e,r,i):i(t,r.toWireFormat(e).toString()))}s(Bs,"serializeMember");ac.exports=nc});var sa=P((j_,cc)=>{var gm=Oe().memoizedProperty;function Nm(t,e,r,i){gm(this,i(t),function(){return r(t,e)})}s(Nm,"memoize");function wm(t,e,r,i,n){i=i||String;var o=this;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Nm.call(o,a,t[a],r,i),n&&n(a,t[a]))}s(wm,"Collection");cc.exports=wm});var _n=P((X_,vc)=>{var xm=sa(),yr=Oe();function j(t,e,r){r!=null&&yr.property.apply(this,arguments)}s(j,"property");function ui(t,e){t.constructor.prototype[e]||yr.memoizedProperty.apply(this,arguments)}s(ui,"memoizedProperty");function ve(t,e,r){e=e||{},j(this,"shape",t.shape),j(this,"api",e.api,!1),j(this,"type",t.type),j(this,"enum",t.enum),j(this,"min",t.min),j(this,"max",t.max),j(this,"pattern",t.pattern),j(this,"location",t.location||this.location||"body"),j(this,"name",this.name||t.xmlName||t.queryName||t.locationName||r),j(this,"isStreaming",t.streaming||this.isStreaming||!1),j(this,"requiresLength",t.requiresLength,!1),j(this,"isComposite",t.isComposite||!1),j(this,"isShape",!0,!1),j(this,"isQueryName",Boolean(t.queryName),!1),j(this,"isLocationName",Boolean(t.locationName),!1),j(this,"isIdempotent",t.idempotencyToken===!0),j(this,"isJsonValue",t.jsonvalue===!0),j(this,"isSensitive",t.sensitive===!0||t.prototype&&t.prototype.sensitive===!0),j(this,"isEventStream",Boolean(t.eventstream),!1),j(this,"isEvent",Boolean(t.event),!1),j(this,"isEventPayload",Boolean(t.eventpayload),!1),j(this,"isEventHeader",Boolean(t.eventheader),!1),j(this,"isTimestampFormatSet",Boolean(t.timestampFormat)||t.prototype&&t.prototype.isTimestampFormatSet===!0,!1),j(this,"endpointDiscoveryId",Boolean(t.endpointdiscoveryid),!1),j(this,"hostLabel",Boolean(t.hostLabel),!1),e.documentation&&(j(this,"documentation",t.documentation),j(this,"documentationUrl",t.documentationUrl)),t.xmlAttribute&&j(this,"isXmlAttribute",t.xmlAttribute||!1),j(this,"defaultValue",null),this.toWireFormat=function(i){return i??""},this.toType=function(i){return i}}s(ve,"Shape");ve.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"};ve.types={structure:lc,list:fc,map:dc,boolean:yc,timestamp:Em,float:Cm,integer:Sm,string:hc,base64:mc,binary:pc};ve.resolve=s(function(e,r){if(e.shape){var i=r.api.shapes[e.shape];if(!i)throw new Error("Cannot find shape reference: "+e.shape);return i}else return null},"resolve");ve.create=s(function(e,r,i){if(e.isShape)return e;var n=ve.resolve(e,r);if(n){var o=Object.keys(e);r.documentation||(o=o.filter(function(l){return!l.match(/documentation/)}));var a=s(function(){n.constructor.call(this,e,r,i)},"InlineShape");return a.prototype=n,new a}else{e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var u=e.type;if(ve.normalizedTypes[e.type]&&(e.type=ve.normalizedTypes[e.type]),ve.types[e.type])return new ve.types[e.type](e,r,i);throw new Error("Unrecognized shape type: "+u)}},"create");function oa(t){ve.apply(this,arguments),j(this,"isComposite",!0),t.flattened&&j(this,"flattened",t.flattened||!1)}s(oa,"CompositeShape");function lc(t,e){var r=this,i=null,n=!this.isShape;oa.apply(this,arguments),n&&(j(this,"defaultValue",function(){return{}}),j(this,"members",{}),j(this,"memberNames",[]),j(this,"required",[]),j(this,"isRequired",function(){return!1}),j(this,"isDocument",Boolean(t.document))),t.members&&(j(this,"members",new xm(t.members,e,function(o,a){return ve.create(a,e,o)})),ui(this,"memberNames",function(){return t.xmlOrder||Object.keys(t.members)}),t.event&&(ui(this,"eventPayloadMemberName",function(){for(var o=r.members,a=r.memberNames,u=0,l=a.length;u<l;u++)if(o[a[u]].isEventPayload)return a[u]}),ui(this,"eventHeaderMemberNames",function(){for(var o=r.members,a=r.memberNames,u=[],l=0,h=a.length;l<h;l++)o[a[l]].isEventHeader&&u.push(a[l]);return u}))),t.required&&(j(this,"required",t.required),j(this,"isRequired",function(o){if(!i){i={};for(var a=0;a<t.required.length;a++)i[t.required[a]]=!0}return i[o]},!1,!0)),j(this,"resultWrapper",t.resultWrapper||null),t.payload&&j(this,"payload",t.payload),typeof t.xmlNamespace=="string"?j(this,"xmlNamespaceUri",t.xmlNamespace):typeof t.xmlNamespace=="object"&&(j(this,"xmlNamespacePrefix",t.xmlNamespace.prefix),j(this,"xmlNamespaceUri",t.xmlNamespace.uri))}s(lc,"StructureShape");function fc(t,e){var r=this,i=!this.isShape;if(oa.apply(this,arguments),i&&j(this,"defaultValue",function(){return[]}),t.member&&ui(this,"member",function(){return ve.create(t.member,e)}),this.flattened){var n=this.name;ui(this,"name",function(){return r.member.name||n})}}s(fc,"ListShape");function dc(t,e){var r=!this.isShape;oa.apply(this,arguments),r&&(j(this,"defaultValue",function(){return{}}),j(this,"key",ve.create({type:"string"},e)),j(this,"value",ve.create({type:"string"},e))),t.key&&ui(this,"key",function(){return ve.create(t.key,e)}),t.value&&ui(this,"value",function(){return ve.create(t.value,e)})}s(dc,"MapShape");function Em(t){var e=this;if(ve.apply(this,arguments),t.timestampFormat)j(this,"timestampFormat",t.timestampFormat);else if(e.isTimestampFormatSet&&this.timestampFormat)j(this,"timestampFormat",this.timestampFormat);else if(this.location==="header")j(this,"timestampFormat","rfc822");else if(this.location==="querystring")j(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":j(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":j(this,"timestampFormat","iso8601");break}this.toType=function(r){return r==null?null:typeof r.toUTCString=="function"?r:typeof r=="string"||typeof r=="number"?yr.date.parseTimestamp(r):null},this.toWireFormat=function(r){return yr.date.format(r,e.timestampFormat)}}s(Em,"TimestampShape");function hc(){ve.apply(this,arguments);var t=["rest-xml","query","ec2"];this.toType=function(e){return e=this.api&&t.indexOf(this.api.protocol)>-1?e||"":e,this.isJsonValue?JSON.parse(e):e&&typeof e.toString=="function"?e.toString():e},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}s(hc,"StringShape");function Cm(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseFloat(t)},this.toWireFormat=this.toType}s(Cm,"FloatShape");function Sm(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseInt(t,10)},this.toWireFormat=this.toType}s(Sm,"IntegerShape");function pc(){ve.apply(this,arguments),this.toType=function(t){var e=yr.base64.decode(t);if(this.isSensitive&&yr.isNode()&&typeof yr.Buffer.alloc=="function"){var r=yr.Buffer.alloc(e.length,e);e.fill(0),e=r}return e},this.toWireFormat=yr.base64.encode}s(pc,"BinaryShape");function mc(){pc.apply(this,arguments)}s(mc,"Base64Shape");function yc(){ve.apply(this,arguments),this.toType=function(t){return typeof t=="boolean"?t:t==null?null:t==="true"}}s(yc,"BooleanShape");ve.shapes={StructureShape:lc,ListShape:fc,MapShape:dc,StringShape:hc,BooleanShape:yc,Base64Shape:mc};vc.exports=ve});var aa=P((J_,wc)=>{var Nc=V(),kn=Oe(),Tm=uc(),gc=_n(),bm=Fs().populateHostPrefix;function Am(t){var e=t.service.api.operations[t.operation],r=t.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:t.service.api.apiVersion,Action:e.name};var i=new Tm;i.serialize(t.params,e.input,function(n,o){r.params[n]=o}),r.body=kn.queryParamsToString(r.params),bm(t)}s(Am,"buildRequest");function Im(t){var e,r=t.httpResponse.body.toString();if(r.match("<UnknownOperationException"))e={Code:"UnknownOperation",Message:"Unknown operation "+t.request.operation};else try{e=new Nc.XML.Parser().parse(r)}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.requestId&&!t.requestId&&(t.requestId=e.requestId),e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=kn.error(new Error,{code:e.Code,message:e.Message}):t.error=kn.error(new Error,{code:t.httpResponse.statusCode,message:null})}s(Im,"extractError");function Om(t){var e=t.request,r=e.service.api.operations[e.operation],i=r.output||{},n=i;if(n.resultWrapper){var o=gc.create({type:"structure"});o.members[n.resultWrapper]=i,o.memberNames=[n.resultWrapper],kn.property(i,"name",i.resultWrapper),i=o}var a=new Nc.XML.Parser;if(i&&i.members&&!i.members._XAMZRequestId){var u=gc.create({type:"string"},{api:{protocol:"query"}},"requestId");i.members._XAMZRequestId=u}var l=a.parse(t.httpResponse.body.toString(),i);t.requestId=l._XAMZRequestId||l.requestId,l._XAMZRequestId&&delete l._XAMZRequestId,n.resultWrapper&&l[n.resultWrapper]&&(kn.update(l,l[n.resultWrapper]),delete l[n.resultWrapper]),t.data=l}s(Om,"extractData");wc.exports={buildRequest:Am,extractError:Im,extractData:Om}});var qn=P((Y_,Ec)=>{var He=Oe(),Rm=Fs().populateHostPrefix;function Dm(t){t.httpRequest.method=t.service.api.operations[t.operation].httpMethod}s(Dm,"populateMethod");function xc(t,e,r,i){var n=[t,e].join("/");n=n.replace(/\/+/g,"/");var o={},a=!1;if(He.each(r.members,function(l,h){var y=i[l];if(y!=null)if(h.location==="uri"){var v=new RegExp("\\{"+h.name+"(\\+)?\\}");n=n.replace(v,function(S,O){var g=O?He.uriEscapePath:He.uriEscape;return g(String(y))})}else h.location==="querystring"&&(a=!0,h.type==="list"?o[h.name]=y.map(function(S){return He.uriEscape(h.member.toWireFormat(S).toString())}):h.type==="map"?He.each(y,function(S,O){Array.isArray(O)?o[S]=O.map(function(g){return He.uriEscape(String(g))}):o[S]=He.uriEscape(String(O))}):o[h.name]=He.uriEscape(h.toWireFormat(y).toString()))}),a){n+=n.indexOf("?")>=0?"&":"?";var u=[];He.arrayEach(Object.keys(o).sort(),function(l){Array.isArray(o[l])||(o[l]=[o[l]]);for(var h=0;h<o[l].length;h++)u.push(He.uriEscape(String(l))+"="+o[l][h])}),n+=u.join("&")}return n}s(xc,"generateURI");function Pm(t){var e=t.service.api.operations[t.operation],r=e.input,i=xc(t.httpRequest.endpoint.path,e.httpPath,r,t.params);t.httpRequest.path=i}s(Pm,"populateURI");function _m(t){var e=t.service.api.operations[t.operation];He.each(e.input.members,function(r,i){var n=t.params[r];n!=null&&(i.location==="headers"&&i.type==="map"?He.each(n,function(o,a){t.httpRequest.headers[i.name+o]=a}):i.location==="header"&&(n=i.toWireFormat(n).toString(),i.isJsonValue&&(n=He.base64.encode(n)),t.httpRequest.headers[i.name]=n))})}s(_m,"populateHeaders");function km(t){Dm(t),Pm(t),_m(t),Rm(t)}s(km,"buildRequest");function qm(){}s(qm,"extractError");function Lm(t){var e=t.request,r={},i=t.httpResponse,n=e.service.api.operations[e.operation],o=n.output,a={};He.each(i.headers,function(u,l){a[u.toLowerCase()]=l}),He.each(o.members,function(u,l){var h=(l.name||u).toLowerCase();if(l.location==="headers"&&l.type==="map"){r[u]={};var y=l.isLocationName?l.name:"",v=new RegExp("^"+y+"(.+)","i");He.each(i.headers,function(O,g){var N=O.match(v);N!==null&&(r[u][N[1]]=g)})}else if(l.location==="header"){if(a[h]!==void 0){var S=l.isJsonValue?He.base64.decode(a[h]):a[h];r[u]=l.toType(S)}}else l.location==="statusCode"&&(r[u]=parseInt(i.statusCode,10))}),t.data=r}s(Lm,"extractData");Ec.exports={buildRequest:km,extractError:qm,extractData:Lm,generateURI:xc}});var la=P((Z_,Ac)=>{var ca=Oe(),Sc=qn(),Tc=Ws(),Mm=qs(),Cc=Ms(),bc=["GET","HEAD","DELETE"];function Fm(t){var e=ca.getRequestPayloadShape(t);e===void 0&&bc.indexOf(t.httpRequest.method)>=0&&delete t.httpRequest.headers["Content-Length"]}s(Fm,"unsetContentLength");function Wm(t){var e=new Mm,r=t.service.api.operations[t.operation].input;if(r.payload){var i={},n=r.members[r.payload];i=t.params[r.payload],n.type==="structure"?(t.httpRequest.body=e.build(i||{},n),ua(t)):i!==void 0&&(t.httpRequest.body=i,(n.type==="binary"||n.isStreaming)&&ua(t,!0))}else t.httpRequest.body=e.build(t.params,r),ua(t)}s(Wm,"populateBody");function ua(t,e){if(!t.httpRequest.headers["Content-Type"]){var r=e?"binary/octet-stream":"application/json";t.httpRequest.headers["Content-Type"]=r}}s(ua,"applyContentTypeHeader");function Bm(t){Sc.buildRequest(t),bc.indexOf(t.httpRequest.method)<0&&Wm(t)}s(Bm,"buildRequest");function Um(t){Tc.extractError(t)}s(Um,"extractError");function Vm(t){Sc.extractData(t);var e=t.request,r=e.service.api.operations[e.operation],i=e.service.api.operations[e.operation].output||{},n,o=r.hasEventOutput;if(i.payload){var a=i.members[i.payload],u=t.httpResponse.body;if(a.isEventStream)n=new Cc,t.data[payload]=ca.createEventStream(AWS.HttpClient.streamsApiVersion===2?t.httpResponse.stream:u,n,a);else if(a.type==="structure"||a.type==="list"){var n=new Cc;t.data[i.payload]=n.parse(u,a)}else a.type==="binary"||a.isStreaming?t.data[i.payload]=u:t.data[i.payload]=a.toType(u)}else{var l=t.data;Tc.extractData(t),t.data=ca.merge(l,t.data)}}s(Vm,"extractData");Ac.exports={buildRequest:Bm,extractError:Um,extractData:Vm,unsetContentLength:Fm}});var da=P((tk,Ic)=>{var Vi=V(),Ln=Oe(),fa=qn();function zm(t){var e=t.service.api.operations[t.operation].input,r=new Vi.XML.Builder,i=t.params,n=e.payload;if(n){var o=e.members[n];if(i=i[n],i===void 0)return;if(o.type==="structure"){var a=o.name;t.httpRequest.body=r.toXML(i,o,a,!0)}else t.httpRequest.body=i}else t.httpRequest.body=r.toXML(i,e,e.name||e.shape||Ln.string.upperFirst(t.operation)+"Request")}s(zm,"populateBody");function Hm(t){fa.buildRequest(t),["GET","HEAD"].indexOf(t.httpRequest.method)<0&&zm(t)}s(Hm,"buildRequest");function jm(t){fa.extractError(t);var e;try{e=new Vi.XML.Parser().parse(t.httpResponse.body.toString())}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=Ln.error(new Error,{code:e.Code,message:e.Message}):t.error=Ln.error(new Error,{code:t.httpResponse.statusCode,message:null})}s(jm,"extractError");function Km(t){fa.extractData(t);var e,r=t.request,i=t.httpResponse.body,n=r.service.api.operations[r.operation],o=n.output,a=n.hasEventOutput,u=o.payload;if(u){var l=o.members[u];l.isEventStream?(e=new Vi.XML.Parser,t.data[u]=Ln.createEventStream(Vi.HttpClient.streamsApiVersion===2?t.httpResponse.stream:t.httpResponse.body,e,l)):l.type==="structure"?(e=new Vi.XML.Parser,t.data[u]=e.parse(i.toString(),l)):l.type==="binary"||l.isStreaming?t.data[u]=i:t.data[u]=l.toType(i)}else if(i.length>0){e=new Vi.XML.Parser;var h=e.parse(i.toString(),o);Ln.update(t.data,h)}}s(Km,"extractData");Ic.exports={buildRequest:Hm,extractError:jm,extractData:Km}});var Rc=P((ik,Oc)=>{function Xm(t){return t.replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}s(Xm,"escapeAttribute");Oc.exports={escapeAttribute:Xm}});var Pc=P((sk,Dc)=>{var Gm=Rc().escapeAttribute;function Mn(t,e){e===void 0&&(e=[]),this.name=t,this.children=e,this.attributes={}}s(Mn,"XmlNode");Mn.prototype.addAttribute=function(t,e){return this.attributes[t]=e,this};Mn.prototype.addChildNode=function(t){return this.children.push(t),this};Mn.prototype.removeAttribute=function(t){return delete this.attributes[t],this};Mn.prototype.toString=function(){for(var t=Boolean(this.children.length),e="<"+this.name,r=this.attributes,i=0,n=Object.keys(r);i<n.length;i++){var o=n[i],a=r[o];typeof a<"u"&&a!==null&&(e+=" "+o+'="'+Gm(""+a)+'"')}return e+=t?">"+this.children.map(function(u){return u.toString()}).join("")+"</"+this.name+">":"/>"};Dc.exports={XmlNode:Mn}});var kc=P((ak,_c)=>{function Jm(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
").replace(/\n/g,"
").replace(/\u0085/g,"…").replace(/\u2028/,"
")}s(Jm,"escapeElement");_c.exports={escapeElement:Jm}});var Mc=P((ck,Lc)=>{var $m=kc().escapeElement;function qc(t){this.value=t}s(qc,"XmlText");qc.prototype.toString=function(){return $m(""+this.value)};Lc.exports={XmlText:qc}});var Uc=P((fk,Bc)=>{var Us=Oe(),ci=Pc().XmlNode,Ym=Mc().XmlText;function Fc(){}s(Fc,"XmlBuilder");Fc.prototype.toXML=function(t,e,r,i){var n=new ci(r);return Wc(n,e,!0),li(n,t,e),n.children.length>0||i?n.toString():""};function li(t,e,r){switch(r.type){case"structure":return Qm(t,e,r);case"map":return Zm(t,e,r);case"list":return ey(t,e,r);default:return ty(t,e,r)}}s(li,"serialize");function Qm(t,e,r){Us.arrayEach(r.memberNames,function(i){var n=r.members[i];if(n.location==="body"){var o=e[i],a=n.name;if(o!=null)if(n.isXmlAttribute)t.addAttribute(a,o);else if(n.flattened)li(t,o,n);else{var u=new ci(a);t.addChildNode(u),Wc(u,n),li(u,o,n)}}})}s(Qm,"serializeStructure");function Zm(t,e,r){var i=r.key.name||"key",n=r.value.name||"value";Us.each(e,function(o,a){var u=new ci(r.flattened?r.name:"entry");t.addChildNode(u);var l=new ci(i),h=new ci(n);u.addChildNode(l),u.addChildNode(h),li(l,o,r.key),li(h,a,r.value)})}s(Zm,"serializeMap");function ey(t,e,r){r.flattened?Us.arrayEach(e,function(i){var n=r.member.name||r.name,o=new ci(n);t.addChildNode(o),li(o,i,r.member)}):Us.arrayEach(e,function(i){var n=r.member.name||"member",o=new ci(n);t.addChildNode(o),li(o,i,r.member)})}s(ey,"serializeList");function ty(t,e,r){t.addChildNode(new Ym(r.toWireFormat(e)))}s(ty,"serializeScalar");function Wc(t,e,r){var i,n="xmlns";e.xmlNamespaceUri?(i=e.xmlNamespaceUri,e.xmlNamespacePrefix&&(n+=":"+e.xmlNamespacePrefix)):r&&e.api.xmlNamespaceUri&&(i=e.api.xmlNamespaceUri),i&&t.addAttribute(n,i)}s(Wc,"applyNamespaces");Bc.exports=Fc});var ha=P((hk,zc)=>{var Fn=_n(),Vc=Oe(),Jt=Vc.property,zi=Vc.memoizedProperty;function ry(t,e,r){var i=this;r=r||{},Jt(this,"name",e.name||t),Jt(this,"api",r.api,!1),e.http=e.http||{},Jt(this,"endpoint",e.endpoint),Jt(this,"httpMethod",e.http.method||"POST"),Jt(this,"httpPath",e.http.requestUri||"/"),Jt(this,"authtype",e.authtype||""),Jt(this,"endpointDiscoveryRequired",e.endpointdiscovery?e.endpointdiscovery.required?"REQUIRED":"OPTIONAL":"NULL");var n=e.httpChecksumRequired||e.httpChecksum&&e.httpChecksum.requestChecksumRequired;Jt(this,"httpChecksumRequired",n,!1),zi(this,"input",function(){return e.input?Fn.create(e.input,r):new Fn.create({type:"structure"},r)}),zi(this,"output",function(){return e.output?Fn.create(e.output,r):new Fn.create({type:"structure"},r)}),zi(this,"errors",function(){var o=[];if(!e.errors)return null;for(var a=0;a<e.errors.length;a++)o.push(Fn.create(e.errors[a],r));return o}),zi(this,"paginator",function(){return r.api.paginators[t]}),r.documentation&&(Jt(this,"documentation",e.documentation),Jt(this,"documentationUrl",e.documentationUrl)),zi(this,"idempotentMembers",function(){var o=[],a=i.input,u=a.members;if(!a.members)return o;for(var l in u)u.hasOwnProperty(l)&&u[l].isIdempotent===!0&&o.push(l);return o}),zi(this,"hasEventOutput",function(){var o=i.output;return iy(o)})}s(ry,"Operation");function iy(t){var e=t.members,r=t.payload;if(!t.members)return!1;if(r){var i=e[r];return i.isEventStream}for(var n in e)if(!e.hasOwnProperty(n)&&e[n].isEventStream===!0)return!0;return!1}s(iy,"hasEventStream");zc.exports=ry});var pa=P((mk,Hc)=>{var Wn=Oe().property;function ny(t,e){Wn(this,"inputToken",e.input_token),Wn(this,"limitKey",e.limit_key),Wn(this,"moreResults",e.more_results),Wn(this,"outputToken",e.output_token),Wn(this,"resultKey",e.result_key)}s(ny,"Paginator");Hc.exports=ny});var ma=P((vk,Kc)=>{var jc=Oe(),Vs=jc.property;function sy(t,e,r){r=r||{},Vs(this,"name",t),Vs(this,"api",r.api,!1),e.operation&&Vs(this,"operation",jc.string.lowerFirst(e.operation));var i=this,n=["type","description","delay","maxAttempts","acceptors"];n.forEach(function(o){var a=e[o];a&&Vs(i,o,a)})}s(sy,"ResourceWaiter");Kc.exports=sy});var ya=P((Nk,oy)=>{oy.exports={acm:{name:"ACM",cors:!0},apigateway:{name:"APIGateway",cors:!0},applicationautoscaling:{prefix:"application-autoscaling",name:"ApplicationAutoScaling",cors:!0},appstream:{name:"AppStream"},autoscaling:{name:"AutoScaling",cors:!0},batch:{name:"Batch"},budgets:{name:"Budgets"},clouddirectory:{name:"CloudDirectory",versions:["2016-05-10*"]},cloudformation:{name:"CloudFormation",cors:!0},cloudfront:{name:"CloudFront",versions:["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*","2019-03-26*"],cors:!0},cloudhsm:{name:"CloudHSM",cors:!0},cloudsearch:{name:"CloudSearch"},cloudsearchdomain:{name:"CloudSearchDomain"},cloudtrail:{name:"CloudTrail",cors:!0},cloudwatch:{prefix:"monitoring",name:"CloudWatch",cors:!0},cloudwatchevents:{prefix:"events",name:"CloudWatchEvents",versions:["2014-02-03*"],cors:!0},cloudwatchlogs:{prefix:"logs",name:"CloudWatchLogs",cors:!0},codebuild:{name:"CodeBuild",cors:!0},codecommit:{name:"CodeCommit",cors:!0},codedeploy:{name:"CodeDeploy",cors:!0},codepipeline:{name:"CodePipeline",cors:!0},cognitoidentity:{prefix:"cognito-identity",name:"CognitoIdentity",cors:!0},cognitoidentityserviceprovider:{prefix:"cognito-idp",name:"CognitoIdentityServiceProvider",cors:!0},cognitosync:{prefix:"cognito-sync",name:"CognitoSync",cors:!0},configservice:{prefix:"config",name:"ConfigService",cors:!0},cur:{name:"CUR",cors:!0},datapipeline:{name:"DataPipeline"},devicefarm:{name:"DeviceFarm",cors:!0},directconnect:{name:"DirectConnect",cors:!0},directoryservice:{prefix:"ds",name:"DirectoryService"},discovery:{name:"Discovery"},dms:{name:"DMS"},dynamodb:{name:"DynamoDB",cors:!0},dynamodbstreams:{prefix:"streams.dynamodb",name:"DynamoDBStreams",cors:!0},ec2:{name:"EC2",versions:["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],cors:!0},ecr:{name:"ECR",cors:!0},ecs:{name:"ECS",cors:!0},efs:{prefix:"elasticfilesystem",name:"EFS",cors:!0},elasticache:{name:"ElastiCache",versions:["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],cors:!0},elasticbeanstalk:{name:"ElasticBeanstalk",cors:!0},elb:{prefix:"elasticloadbalancing",name:"ELB",cors:!0},elbv2:{prefix:"elasticloadbalancingv2",name:"ELBv2",cors:!0},emr:{prefix:"elasticmapreduce",name:"EMR",cors:!0},es:{name:"ES"},elastictranscoder:{name:"ElasticTranscoder",cors:!0},firehose:{name:"Firehose",cors:!0},gamelift:{name:"GameLift",cors:!0},glacier:{name:"Glacier"},health:{name:"Health"},iam:{name:"IAM",cors:!0},importexport:{name:"ImportExport"},inspector:{name:"Inspector",versions:["2015-08-18*"],cors:!0},iot:{name:"Iot",cors:!0},iotdata:{prefix:"iot-data",name:"IotData",cors:!0},kinesis:{name:"Kinesis",cors:!0},kinesisanalytics:{name:"KinesisAnalytics"},kms:{name:"KMS",cors:!0},lambda:{name:"Lambda",cors:!0},lexruntime:{prefix:"runtime.lex",name:"LexRuntime",cors:!0},lightsail:{name:"Lightsail"},machinelearning:{name:"MachineLearning",cors:!0},marketplacecommerceanalytics:{name:"MarketplaceCommerceAnalytics",cors:!0},marketplacemetering:{prefix:"meteringmarketplace",name:"MarketplaceMetering"},mturk:{prefix:"mturk-requester",name:"MTurk",cors:!0},mobileanalytics:{name:"MobileAnalytics",cors:!0},opsworks:{name:"OpsWorks",cors:!0},opsworkscm:{name:"OpsWorksCM"},organizations:{name:"Organizations"},pinpoint:{name:"Pinpoint"},polly:{name:"Polly",cors:!0},rds:{name:"RDS",versions:["2014-09-01*"],cors:!0},redshift:{name:"Redshift",cors:!0},rekognition:{name:"Rekognition",cors:!0},resourcegroupstaggingapi:{name:"ResourceGroupsTaggingAPI"},route53:{name:"Route53",cors:!0},route53domains:{name:"Route53Domains",cors:!0},s3:{name:"S3",dualstackAvailable:!0,cors:!0},s3control:{name:"S3Control",dualstackAvailable:!0,xmlNoDefaultLists:!0},servicecatalog:{name:"ServiceCatalog",cors:!0},ses:{prefix:"email",name:"SES",cors:!0},shield:{name:"Shield"},simpledb:{prefix:"sdb",name:"SimpleDB"},sms:{name:"SMS"},snowball:{name:"Snowball"},sns:{name:"SNS",cors:!0},sqs:{name:"SQS",cors:!0},ssm:{name:"SSM",cors:!0},storagegateway:{name:"StorageGateway",cors:!0},stepfunctions:{prefix:"states",name:"StepFunctions"},sts:{name:"STS",cors:!0},support:{name:"Support"},swf:{name:"SWF"},xray:{name:"XRay",cors:!0},waf:{name:"WAF",cors:!0},wafregional:{prefix:"waf-regional",name:"WAFRegional"},workdocs:{name:"WorkDocs",cors:!0},workspaces:{name:"WorkSpaces"},codestar:{name:"CodeStar"},lexmodelbuildingservice:{prefix:"lex-models",name:"LexModelBuildingService",cors:!0},marketplaceentitlementservice:{prefix:"entitlement.marketplace",name:"MarketplaceEntitlementService"},athena:{name:"Athena",cors:!0},greengrass:{name:"Greengrass"},dax:{name:"DAX"},migrationhub:{prefix:"AWSMigrationHub",name:"MigrationHub"},cloudhsmv2:{name:"CloudHSMV2",cors:!0},glue:{name:"Glue"},mobile:{name:"Mobile"},pricing:{name:"Pricing",cors:!0},costexplorer:{prefix:"ce",name:"CostExplorer",cors:!0},mediaconvert:{name:"MediaConvert"},medialive:{name:"MediaLive"},mediapackage:{name:"MediaPackage"},mediastore:{name:"MediaStore"},mediastoredata:{prefix:"mediastore-data",name:"MediaStoreData",cors:!0},appsync:{name:"AppSync"},guardduty:{name:"GuardDuty"},mq:{name:"MQ"},comprehend:{name:"Comprehend",cors:!0},iotjobsdataplane:{prefix:"iot-jobs-data",name:"IoTJobsDataPlane"},kinesisvideoarchivedmedia:{prefix:"kinesis-video-archived-media",name:"KinesisVideoArchivedMedia",cors:!0},kinesisvideomedia:{prefix:"kinesis-video-media",name:"KinesisVideoMedia",cors:!0},kinesisvideo:{name:"KinesisVideo",cors:!0},sagemakerruntime:{prefix:"runtime.sagemaker",name:"SageMakerRuntime"},sagemaker:{name:"SageMaker"},translate:{name:"Translate",cors:!0},resourcegroups:{prefix:"resource-groups",name:"ResourceGroups",cors:!0},alexaforbusiness:{name:"AlexaForBusiness"},cloud9:{name:"Cloud9"},serverlessapplicationrepository:{prefix:"serverlessrepo",name:"ServerlessApplicationRepository"},servicediscovery:{name:"ServiceDiscovery"},workmail:{name:"WorkMail"},autoscalingplans:{prefix:"autoscaling-plans",name:"AutoScalingPlans"},transcribeservice:{prefix:"transcribe",name:"TranscribeService"},connect:{name:"Connect",cors:!0},acmpca:{prefix:"acm-pca",name:"ACMPCA"},fms:{name:"FMS"},secretsmanager:{name:"SecretsManager",cors:!0},iotanalytics:{name:"IoTAnalytics",cors:!0},iot1clickdevicesservice:{prefix:"iot1click-devices",name:"IoT1ClickDevicesService"},iot1clickprojects:{prefix:"iot1click-projects",name:"IoT1ClickProjects"},pi:{name:"PI"},neptune:{name:"Neptune"},mediatailor:{name:"MediaTailor"},eks:{name:"EKS"},macie:{name:"Macie"},dlm:{name:"DLM"},signer:{name:"Signer"},chime:{name:"Chime"},pinpointemail:{prefix:"pinpoint-email",name:"PinpointEmail"},ram:{name:"RAM"},route53resolver:{name:"Route53Resolver"},pinpointsmsvoice:{prefix:"sms-voice",name:"PinpointSMSVoice"},quicksight:{name:"QuickSight"},rdsdataservice:{prefix:"rds-data",name:"RDSDataService"},amplify:{name:"Amplify"},datasync:{name:"DataSync"},robomaker:{name:"RoboMaker"},transfer:{name:"Transfer"},globalaccelerator:{name:"GlobalAccelerator"},comprehendmedical:{name:"ComprehendMedical",cors:!0},kinesisanalyticsv2:{name:"KinesisAnalyticsV2"},mediaconnect:{name:"MediaConnect"},fsx:{name:"FSx"},securityhub:{name:"SecurityHub"},appmesh:{name:"AppMesh",versions:["2018-10-01*"]},licensemanager:{prefix:"license-manager",name:"LicenseManager"},kafka:{name:"Kafka"},apigatewaymanagementapi:{name:"ApiGatewayManagementApi"},apigatewayv2:{name:"ApiGatewayV2"},docdb:{name:"DocDB"},backup:{name:"Backup"},worklink:{name:"WorkLink"},textract:{name:"Textract"},managedblockchain:{name:"ManagedBlockchain"},mediapackagevod:{prefix:"mediapackage-vod",name:"MediaPackageVod"},groundstation:{name:"GroundStation"},iotthingsgraph:{name:"IoTThingsGraph"},iotevents:{name:"IoTEvents"},ioteventsdata:{prefix:"iotevents-data",name:"IoTEventsData"},personalize:{name:"Personalize",cors:!0},personalizeevents:{prefix:"personalize-events",name:"PersonalizeEvents",cors:!0},personalizeruntime:{prefix:"personalize-runtime",name:"PersonalizeRuntime",cors:!0},applicationinsights:{prefix:"application-insights",name:"ApplicationInsights"},servicequotas:{prefix:"service-quotas",name:"ServiceQuotas"},ec2instanceconnect:{prefix:"ec2-instance-connect",name:"EC2InstanceConnect"},eventbridge:{name:"EventBridge"},lakeformation:{name:"LakeFormation"},forecastservice:{prefix:"forecast",name:"ForecastService",cors:!0},forecastqueryservice:{prefix:"forecastquery",name:"ForecastQueryService",cors:!0},qldb:{name:"QLDB"},qldbsession:{prefix:"qldb-session",name:"QLDBSession"},workmailmessageflow:{name:"WorkMailMessageFlow"},codestarnotifications:{prefix:"codestar-notifications",name:"CodeStarNotifications"},savingsplans:{name:"SavingsPlans"},sso:{name:"SSO"},ssooidc:{prefix:"sso-oidc",name:"SSOOIDC"},marketplacecatalog:{prefix:"marketplace-catalog",name:"MarketplaceCatalog",cors:!0},dataexchange:{name:"DataExchange"},sesv2:{name:"SESV2"},migrationhubconfig:{prefix:"migrationhub-config",name:"MigrationHubConfig"},connectparticipant:{name:"ConnectParticipant"},appconfig:{name:"AppConfig"},iotsecuretunneling:{name:"IoTSecureTunneling"},wafv2:{name:"WAFV2"},elasticinference:{prefix:"elastic-inference",name:"ElasticInference"},imagebuilder:{name:"Imagebuilder"},schemas:{name:"Schemas"},accessanalyzer:{name:"AccessAnalyzer"},codegurureviewer:{prefix:"codeguru-reviewer",name:"CodeGuruReviewer"},codeguruprofiler:{name:"CodeGuruProfiler"},computeoptimizer:{prefix:"compute-optimizer",name:"ComputeOptimizer"},frauddetector:{name:"FraudDetector"},kendra:{name:"Kendra"},networkmanager:{name:"NetworkManager"},outposts:{name:"Outposts"},augmentedairuntime:{prefix:"sagemaker-a2i-runtime",name:"AugmentedAIRuntime"},ebs:{name:"EBS"},kinesisvideosignalingchannels:{prefix:"kinesis-video-signaling",name:"KinesisVideoSignalingChannels",cors:!0},detective:{name:"Detective"},codestarconnections:{prefix:"codestar-connections",name:"CodeStarconnections"},synthetics:{name:"Synthetics"},iotsitewise:{name:"IoTSiteWise"},macie2:{name:"Macie2"},codeartifact:{name:"CodeArtifact"},honeycode:{name:"Honeycode"},ivs:{name:"IVS"},braket:{name:"Braket"},identitystore:{name:"IdentityStore"},appflow:{name:"Appflow"},redshiftdata:{prefix:"redshift-data",name:"RedshiftData"},ssoadmin:{prefix:"sso-admin",name:"SSOAdmin"},timestreamquery:{prefix:"timestream-query",name:"TimestreamQuery"},timestreamwrite:{prefix:"timestream-write",name:"TimestreamWrite"},s3outposts:{name:"S3Outposts"},databrew:{name:"DataBrew"},servicecatalogappregistry:{prefix:"servicecatalog-appregistry",name:"ServiceCatalogAppRegistry"},networkfirewall:{prefix:"network-firewall",name:"NetworkFirewall"},mwaa:{name:"MWAA"},amplifybackend:{name:"AmplifyBackend"},appintegrations:{name:"AppIntegrations"},connectcontactlens:{prefix:"connect-contact-lens",name:"ConnectContactLens"},devopsguru:{prefix:"devops-guru",name:"DevOpsGuru"},ecrpublic:{prefix:"ecr-public",name:"ECRPUBLIC"},lookoutvision:{name:"LookoutVision"},sagemakerfeaturestoreruntime:{prefix:"sagemaker-featurestore-runtime",name:"SageMakerFeatureStoreRuntime"},customerprofiles:{prefix:"customer-profiles",name:"CustomerProfiles"},auditmanager:{name:"AuditManager"},emrcontainers:{prefix:"emr-containers",name:"EMRcontainers"},healthlake:{name:"HealthLake"},sagemakeredge:{prefix:"sagemaker-edge",name:"SagemakerEdge"},amp:{name:"Amp"},greengrassv2:{name:"GreengrassV2"},iotdeviceadvisor:{name:"IotDeviceAdvisor"},iotfleethub:{name:"IoTFleetHub"},iotwireless:{name:"IoTWireless"},location:{name:"Location",cors:!0},wellarchitected:{name:"WellArchitected"},lexmodelsv2:{prefix:"models.lex.v2",name:"LexModelsV2"},lexruntimev2:{prefix:"runtime.lex.v2",name:"LexRuntimeV2",cors:!0},fis:{name:"Fis"},lookoutmetrics:{name:"LookoutMetrics"},mgn:{name:"Mgn"},lookoutequipment:{name:"LookoutEquipment"},nimble:{name:"Nimble"},finspace:{name:"Finspace"},finspacedata:{prefix:"finspace-data",name:"Finspacedata"},ssmcontacts:{prefix:"ssm-contacts",name:"SSMContacts"},ssmincidents:{prefix:"ssm-incidents",name:"SSMIncidents"},applicationcostprofiler:{name:"ApplicationCostProfiler"},apprunner:{name:"AppRunner"},proton:{name:"Proton"},route53recoverycluster:{prefix:"route53-recovery-cluster",name:"Route53RecoveryCluster"},route53recoverycontrolconfig:{prefix:"route53-recovery-control-config",name:"Route53RecoveryControlConfig"},route53recoveryreadiness:{prefix:"route53-recovery-readiness",name:"Route53RecoveryReadiness"},chimesdkidentity:{prefix:"chime-sdk-identity",name:"ChimeSDKIdentity"},chimesdkmessaging:{prefix:"chime-sdk-messaging",name:"ChimeSDKMessaging"},snowdevicemanagement:{prefix:"snow-device-management",name:"SnowDeviceManagement"},memorydb:{name:"MemoryDB"},opensearch:{name:"OpenSearch"},kafkaconnect:{name:"KafkaConnect"},voiceid:{prefix:"voice-id",name:"VoiceID"},wisdom:{name:"Wisdom"},account:{name:"Account"},cloudcontrol:{name:"CloudControl"},grafana:{name:"Grafana"},panorama:{name:"Panorama"},chimesdkmeetings:{prefix:"chime-sdk-meetings",name:"ChimeSDKMeetings"},resiliencehub:{name:"Resiliencehub"},migrationhubstrategy:{name:"MigrationHubStrategy"},appconfigdata:{name:"AppConfigData"},drs:{name:"Drs"},migrationhubrefactorspaces:{prefix:"migration-hub-refactor-spaces",name:"MigrationHubRefactorSpaces"},evidently:{name:"Evidently"},inspector2:{name:"Inspector2"},rbin:{name:"Rbin"},rum:{name:"RUM"},backupgateway:{prefix:"backup-gateway",name:"BackupGateway"},iottwinmaker:{name:"IoTTwinMaker"},workspacesweb:{prefix:"workspaces-web",name:"WorkSpacesWeb"},amplifyuibuilder:{name:"AmplifyUIBuilder"},keyspaces:{name:"Keyspaces"},billingconductor:{name:"Billingconductor"},gamesparks:{name:"GameSparks"},pinpointsmsvoicev2:{prefix:"pinpoint-sms-voice-v2",name:"PinpointSMSVoiceV2"},ivschat:{name:"Ivschat"},chimesdkmediapipelines:{prefix:"chime-sdk-media-pipelines",name:"ChimeSDKMediaPipelines"},emrserverless:{prefix:"emr-serverless",name:"EMRServerless"},m2:{name:"M2"},connectcampaigns:{name:"ConnectCampaigns"},redshiftserverless:{prefix:"redshift-serverless",name:"RedshiftServerless"},rolesanywhere:{name:"RolesAnywhere"},licensemanagerusersubscriptions:{prefix:"license-manager-user-subscriptions",name:"LicenseManagerUserSubscriptions"},backupstorage:{name:"BackupStorage"},privatenetworks:{name:"PrivateNetworks"},supportapp:{prefix:"support-app",name:"SupportApp"},controltower:{name:"ControlTower"},iotfleetwise:{name:"IoTFleetWise"},migrationhuborchestrator:{name:"MigrationHubOrchestrator"},connectcases:{name:"ConnectCases"},resourceexplorer2:{prefix:"resource-explorer-2",name:"ResourceExplorer2"},scheduler:{name:"Scheduler"},chimesdkvoice:{prefix:"chime-sdk-voice",name:"ChimeSDKVoice"},iotroborunner:{prefix:"iot-roborunner",name:"IoTRoboRunner"},ssmsap:{prefix:"ssm-sap",name:"SsmSap"},oam:{name:"OAM"},arczonalshift:{prefix:"arc-zonal-shift",name:"ARCZonalShift"},omics:{name:"Omics"},opensearchserverless:{name:"OpenSearchServerless"},securitylake:{name:"SecurityLake"},simspaceweaver:{name:"SimSpaceWeaver"},docdbelastic:{prefix:"docdb-elastic",name:"DocDBElastic"},sagemakergeospatial:{prefix:"sagemaker-geospatial",name:"SageMakerGeospatial"},codecatalyst:{name:"CodeCatalyst"},pipes:{name:"Pipes"},sagemakermetrics:{prefix:"sagemaker-metrics",name:"SageMakerMetrics"},kinesisvideowebrtcstorage:{prefix:"kinesis-video-webrtc-storage",name:"KinesisVideoWebRTCStorage"},licensemanagerlinuxsubscriptions:{prefix:"license-manager-linux-subscriptions",name:"LicenseManagerLinuxSubscriptions"},kendraranking:{prefix:"kendra-ranking",name:"KendraRanking"},cleanrooms:{name:"CleanRooms"},cloudtraildata:{prefix:"cloudtrail-data",name:"CloudTrailData"},tnb:{name:"Tnb"},internetmonitor:{name:"InternetMonitor"}}});var va=P((wk,Gc)=>{var zs=sa(),ay=ha(),uy=_n(),cy=pa(),ly=ma(),Xc=ya(),Bn=Oe(),ge=Bn.property,fy=Bn.memoizedProperty;function dy(t,e){var r=this;t=t||{},e=e||{},e.api=this,t.metadata=t.metadata||{};var i=e.serviceIdentifier;delete e.serviceIdentifier,ge(this,"isApi",!0,!1),ge(this,"apiVersion",t.metadata.apiVersion),ge(this,"endpointPrefix",t.metadata.endpointPrefix),ge(this,"signingName",t.metadata.signingName),ge(this,"globalEndpoint",t.metadata.globalEndpoint),ge(this,"signatureVersion",t.metadata.signatureVersion),ge(this,"jsonVersion",t.metadata.jsonVersion),ge(this,"targetPrefix",t.metadata.targetPrefix),ge(this,"protocol",t.metadata.protocol),ge(this,"timestampFormat",t.metadata.timestampFormat),ge(this,"xmlNamespaceUri",t.metadata.xmlNamespace),ge(this,"abbreviation",t.metadata.serviceAbbreviation),ge(this,"fullName",t.metadata.serviceFullName),ge(this,"serviceId",t.metadata.serviceId),i&&Xc[i]&&ge(this,"xmlNoDefaultLists",Xc[i].xmlNoDefaultLists,!1),fy(this,"className",function(){var o=t.metadata.serviceAbbreviation||t.metadata.serviceFullName;return o?(o=o.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g,""),o==="ElasticLoadBalancing"&&(o="ELB"),o):null});function n(o,a){a.endpointoperation===!0&&ge(r,"endpointOperation",Bn.string.lowerFirst(o)),a.endpointdiscovery&&!r.hasRequiredEndpointDiscovery&&ge(r,"hasRequiredEndpointDiscovery",a.endpointdiscovery.required===!0)}s(n,"addEndpointOperation"),ge(this,"operations",new zs(t.operations,e,function(o,a){return new ay(o,a,e)},Bn.string.lowerFirst,n)),ge(this,"shapes",new zs(t.shapes,e,function(o,a){return uy.create(a,e)})),ge(this,"paginators",new zs(t.paginators,e,function(o,a){return new cy(o,a,e)})),ge(this,"waiters",new zs(t.waiters,e,function(o,a){return new ly(o,a,e)},Bn.string.lowerFirst)),e.documentation&&(ge(this,"documentation",t.documentation),ge(this,"documentationUrl",t.documentationUrl)),ge(this,"awsQueryCompatible",t.metadata.awsQueryCompatible)}s(dy,"Api");Gc.exports=dy});var $c=P((Ek,Jc)=>{function Hs(t,e){if(!Hs.services.hasOwnProperty(t))throw new Error("InvalidService: Failed to load api for "+t);return Hs.services[t][e]}s(Hs,"apiLoader");Hs.services={};Jc.exports=Hs});var Yc=P(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var hy=function(){function t(e,r){this.key=e,this.value=r}return s(t,"LinkedListNode"),t}(),py=function(){function t(e){if(this.nodeMap={},this.size=0,typeof e!="number"||e<1)throw new Error("Cache size can only be positive number");this.sizeLimit=e}return s(t,"LRUCache"),Object.defineProperty(t.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),t.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},t.prototype.removeFromTail=function(){if(this.tailNode){var e=this.tailNode,r=e.prev;return r&&(r.next=void 0),e.prev=void 0,this.tailNode=r,this.size--,e}},t.prototype.detachFromList=function(e){this.headerNode===e&&(this.headerNode=e.next),this.tailNode===e&&(this.tailNode=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.next=void 0,e.prev=void 0,this.size--},t.prototype.get=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];return this.detachFromList(r),this.prependToList(r),r.value}},t.prototype.remove=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];this.detachFromList(r),delete this.nodeMap[e]}},t.prototype.put=function(e,r){if(this.nodeMap[e])this.remove(e);else if(this.size===this.sizeLimit){var i=this.removeFromTail(),n=i.key;delete this.nodeMap[n]}var o=new hy(e,r);this.nodeMap[e]=o,this.prependToList(o)},t.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),r=0;r<e.length;r++){var i=e[r],n=this.nodeMap[i];this.detachFromList(n),delete this.nodeMap[i]}},t}();ga.LRUCache=py});var Qc=P(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var my=Yc(),yy=1e3,vy=function(){function t(e){e===void 0&&(e=yy),this.maxSize=e,this.cache=new my.LRUCache(e)}return s(t,"EndpointCache"),Object.defineProperty(t.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),t.prototype.put=function(e,r){var i=typeof e!="string"?t.getKeyString(e):e,n=this.populateValue(r);this.cache.put(i,n)},t.prototype.get=function(e){var r=typeof e!="string"?t.getKeyString(e):e,i=Date.now(),n=this.cache.get(r);if(n){for(var o=n.length-1;o>=0;o--){var a=n[o];a.Expire<i&&n.splice(o,1)}if(n.length===0){this.cache.remove(r);return}}return n},t.getKeyString=function(e){for(var r=[],i=Object.keys(e).sort(),n=0;n<i.length;n++){var o=i[n];e[o]!==void 0&&r.push(e[o])}return r.join(" ")},t.prototype.populateValue=function(e){var r=Date.now();return e.map(function(i){return{Address:i.Address||"",Expire:r+(i.CachePeriodInMinutes||1)*60*1e3}})},t.prototype.empty=function(){this.cache.empty()},t.prototype.remove=function(e){var r=typeof e!="string"?t.getKeyString(e):e;this.cache.remove(r)},t}();Na.EndpointCache=vy});var wa=P((Ik,Zc)=>{var vr=V();vr.SequentialExecutor=vr.util.inherit({constructor:s(function(){this._events={}},"SequentialExecutor"),listeners:s(function(e){return this._events[e]?this._events[e].slice(0):[]},"listeners"),on:s(function(e,r,i){return this._events[e]?i?this._events[e].unshift(r):this._events[e].push(r):this._events[e]=[r],this},"on"),onAsync:s(function(e,r,i){return r._isAsync=!0,this.on(e,r,i)},"onAsync"),removeListener:s(function(e,r){var i=this._events[e];if(i){for(var n=i.length,o=-1,a=0;a<n;++a)i[a]===r&&(o=a);o>-1&&i.splice(o,1)}return this},"removeListener"),removeAllListeners:s(function(e){return e?delete this._events[e]:this._events={},this},"removeAllListeners"),emit:s(function(e,r,i){i||(i=s(function(){},"doneCallback"));var n=this.listeners(e),o=n.length;return this.callListeners(n,r,i),o>0},"emit"),callListeners:s(function(e,r,i,n){var o=this,a=n||null;function u(h){if(h&&(a=vr.util.error(a||new Error,h),o._haltHandlersOnError))return i.call(o,a);o.callListeners(e,r,i,a)}for(s(u,"callNextListener");e.length>0;){var l=e.shift();if(l._isAsync){l.apply(o,r.concat([u]));return}else{try{l.apply(o,r)}catch(h){a=vr.util.error(a||new Error,h)}if(a&&o._haltHandlersOnError){i.call(o,a);return}}}i.call(o,a)},"callListeners"),addListeners:s(function(e){var r=this;return e._events&&(e=e._events),vr.util.each(e,function(i,n){typeof n=="function"&&(n=[n]),vr.util.arrayEach(n,function(o){r.on(i,o)})}),r},"addListeners"),addNamedListener:s(function(e,r,i,n){return this[e]=i,this.addListener(r,i,n),this},"addNamedListener"),addNamedAsyncListener:s(function(e,r,i,n){return i._isAsync=!0,this.addNamedListener(e,r,i,n)},"addNamedAsyncListener"),addNamedListeners:s(function(e){var r=this;return e(function(){r.addNamedListener.apply(r,arguments)},function(){r.addNamedAsyncListener.apply(r,arguments)}),this},"addNamedListeners")});vr.SequentialExecutor.prototype.addListener=vr.SequentialExecutor.prototype.on;Zc.exports=vr.SequentialExecutor});var el=P((Rk,gy)=>{gy.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":"usIso","us-isob-*/*":"usIsob","*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:!0},"*/route53":"globalSSL","cn-*/route53":{endpoint:"{service}.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","us-iso-*/route53":{endpoint:"{service}.c2s.ic.gov",globalEndpoint:!0,signingRegion:"us-iso-east-1"},"us-isob-*/route53":{endpoint:"{service}.sc2s.sgov.gov",globalEndpoint:!0,signingRegion:"us-isob-east-1"},"*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{endpoint:"{service}.cn-north-1.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-north-1"},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"},"*/resource-explorer-2":"dualstackByDefault","*/kendra-ranking":"dualstackByDefault","*/internetmonitor":"dualstackByDefault","*/codecatalyst":"globalDualstackByDefault"},fipsRules:{"*/*":"fipsStandard","us-gov-*/*":"fipsStandard","us-iso-*/*":{endpoint:"{service}-fips.{region}.c2s.ic.gov"},"us-iso-*/dms":"usIso","us-isob-*/*":{endpoint:"{service}-fips.{region}.sc2s.sgov.gov"},"us-isob-*/dms":"usIsob","cn-*/*":{endpoint:"{service}-fips.{region}.amazonaws.com.cn"},"*/api.ecr":"fips.api.ecr","*/api.sagemaker":"fips.api.sagemaker","*/batch":"fipsDotPrefix","*/eks":"fipsDotPrefix","*/models.lex":"fips.models.lex","*/runtime.lex":"fips.runtime.lex","*/runtime.sagemaker":{endpoint:"runtime-fips.sagemaker.{region}.amazonaws.com"},"*/iam":"fipsWithoutRegion","*/route53":"fipsWithoutRegion","*/transcribe":"fipsDotPrefix","*/waf":"fipsWithoutRegion","us-gov-*/transcribe":"fipsDotPrefix","us-gov-*/api.ecr":"fips.api.ecr","us-gov-*/api.sagemaker":"fips.api.sagemaker","us-gov-*/models.lex":"fips.models.lex","us-gov-*/runtime.lex":"fips.runtime.lex","us-gov-*/acm-pca":"fipsWithServiceOnly","us-gov-*/batch":"fipsWithServiceOnly","us-gov-*/cloudformation":"fipsWithServiceOnly","us-gov-*/config":"fipsWithServiceOnly","us-gov-*/eks":"fipsWithServiceOnly","us-gov-*/elasticmapreduce":"fipsWithServiceOnly","us-gov-*/identitystore":"fipsWithServiceOnly","us-gov-*/dynamodb":"fipsWithServiceOnly","us-gov-*/elasticloadbalancing":"fipsWithServiceOnly","us-gov-*/guardduty":"fipsWithServiceOnly","us-gov-*/monitoring":"fipsWithServiceOnly","us-gov-*/resource-groups":"fipsWithServiceOnly","us-gov-*/runtime.sagemaker":"fipsWithServiceOnly","us-gov-*/servicecatalog-appregistry":"fipsWithServiceOnly","us-gov-*/servicequotas":"fipsWithServiceOnly","us-gov-*/ssm":"fipsWithServiceOnly","us-gov-*/sts":"fipsWithServiceOnly","us-gov-*/support":"fipsWithServiceOnly","us-gov-west-1/states":"fipsWithServiceOnly","us-iso-east-1/elasticfilesystem":{endpoint:"elasticfilesystem-fips.{region}.c2s.ic.gov"},"us-gov-west-1/organizations":"fipsWithServiceOnly","us-gov-west-1/route53":{endpoint:"route53.us-gov.amazonaws.com"},"*/resource-explorer-2":"fipsDualstackByDefault","*/kendra-ranking":"dualstackByDefault","*/internetmonitor":"dualstackByDefault","*/codecatalyst":"fipsGlobalDualstackByDefault"},dualstackRules:{"*/*":{endpoint:"{service}.{region}.api.aws"},"cn-*/*":{endpoint:"{service}.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackLegacy","cn-*/s3":"dualstackLegacyCn","*/s3-control":"dualstackLegacy","cn-*/s3-control":"dualstackLegacyCn","ap-south-1/ec2":"dualstackLegacyEc2","eu-west-1/ec2":"dualstackLegacyEc2","sa-east-1/ec2":"dualstackLegacyEc2","us-east-1/ec2":"dualstackLegacyEc2","us-east-2/ec2":"dualstackLegacyEc2","us-west-2/ec2":"dualstackLegacyEc2"},dualstackFipsRules:{"*/*":{endpoint:"{service}-fips.{region}.api.aws"},"cn-*/*":{endpoint:"{service}-fips.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackFipsLegacy","cn-*/s3":"dualstackFipsLegacyCn","*/s3-control":"dualstackFipsLegacy","cn-*/s3-control":"dualstackFipsLegacyCn"},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:!0,signingRegion:"us-east-1"},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com",globalEndpoint:!0,signingRegion:"us-gov-west-1"},s3signature:{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"s3"},usIso:{endpoint:"{service}.{region}.c2s.ic.gov"},usIsob:{endpoint:"{service}.{region}.sc2s.sgov.gov"},fipsStandard:{endpoint:"{service}-fips.{region}.amazonaws.com"},fipsDotPrefix:{endpoint:"fips.{service}.{region}.amazonaws.com"},fipsWithoutRegion:{endpoint:"{service}-fips.amazonaws.com"},"fips.api.ecr":{endpoint:"ecr-fips.{region}.amazonaws.com"},"fips.api.sagemaker":{endpoint:"api-fips.sagemaker.{region}.amazonaws.com"},"fips.models.lex":{endpoint:"models-fips.lex.{region}.amazonaws.com"},"fips.runtime.lex":{endpoint:"runtime-fips.lex.{region}.amazonaws.com"},fipsWithServiceOnly:{endpoint:"{service}.{region}.amazonaws.com"},dualstackLegacy:{endpoint:"{service}.dualstack.{region}.amazonaws.com"},dualstackLegacyCn:{endpoint:"{service}.dualstack.{region}.amazonaws.com.cn"},dualstackFipsLegacy:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com"},dualstackFipsLegacyCn:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com.cn"},dualstackLegacyEc2:{endpoint:"api.ec2.{region}.aws"},dualstackByDefault:{endpoint:"{service}.{region}.api.aws"},fipsDualstackByDefault:{endpoint:"{service}-fips.{region}.api.aws"},globalDualstackByDefault:{endpoint:"{service}.global.api.aws"},fipsGlobalDualstackByDefault:{endpoint:"{service}-fips.global.api.aws"}}}});var rl=P((Dk,tl)=>{var Ny=Oe(),Un=el();function wy(t){if(!t)return null;var e=t.split("-");return e.length<3?null:e.slice(0,e.length-2).join("-")+"-*"}s(wy,"generateRegionPrefix");function xy(t){var e=t.config.region,r=wy(e),i=t.api.endpointPrefix;return[[e,i],[r,i],[e,"*"],[r,"*"],["*",i],["*","*"]].map(function(n){return n[0]&&n[1]?n.join("/"):null})}s(xy,"derivedKeys");function Ey(t,e){Ny.each(e,function(r,i){r!=="globalEndpoint"&&(t.config[r]===void 0||t.config[r]===null)&&(t.config[r]=i)})}s(Ey,"applyConfig");function Cy(t){for(var e=xy(t),r=t.config.useFipsEndpoint,i=t.config.useDualstackEndpoint,n=0;n<e.length;n++){var o=e[n];if(o){var a=r?i?Un.dualstackFipsRules:Un.fipsRules:i?Un.dualstackRules:Un.rules;if(Object.prototype.hasOwnProperty.call(a,o)){var u=a[o];typeof u=="string"&&(u=Un.patterns[u]),t.isGlobalEndpoint=!!u.globalEndpoint,u.signingRegion&&(t.signingRegion=u.signingRegion),u.signatureVersion||(u.signatureVersion="v4");var l=(t.api&&t.api.signatureVersion)==="bearer";Ey(t,Object.assign({},u,{signatureVersion:l?"bearer":u.signatureVersion}));return}}}}s(Cy,"configureEndpoint");function Sy(t){for(var e={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},r="amazonaws.com",i=Object.keys(e),n=0;n<i.length;n++){var o=RegExp(i[n]),a=e[i[n]];if(o.test(t))return a}return r}s(Sy,"getEndpointSuffix");tl.exports={configureEndpoint:Cy,getEndpointSuffix:Sy}});var xa=P((_k,il)=>{function Ty(t){return typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))}s(Ty,"isFipsRegion");function by(t){return typeof t=="string"&&["aws-global","aws-us-gov-global"].includes(t)}s(by,"isGlobalRegion");function Ay(t){return["fips-aws-global","aws-fips","aws-global"].includes(t)?"us-east-1":["fips-aws-us-gov-global","aws-us-gov-global"].includes(t)?"us-gov-west-1":t.replace(/fips-(dkr-|prod-)?|-fips/,"")}s(Ay,"getRealRegion");il.exports={isFipsRegion:Ty,isGlobalRegion:by,getRealRegion:Ay}});var sl=P((qk,nl)=>{var U=V(),Iy=va(),Oy=rl(),Ea=U.util.inherit,Ry=0,js=xa();U.Service=Ea({constructor:s(function(e){if(!this.loadServiceClass)throw U.util.error(new Error,"Service must be constructed with `new' operator");if(e){if(e.region){var r=e.region;js.isFipsRegion(r)&&(e.region=js.getRealRegion(r),e.useFipsEndpoint=!0),js.isGlobalRegion(r)&&(e.region=js.getRealRegion(r))}typeof e.useDualstack=="boolean"&&typeof e.useDualstackEndpoint!="boolean"&&(e.useDualstackEndpoint=e.useDualstack)}var i=this.loadServiceClass(e||{});if(i){var n=U.util.copy(e),o=new i(e);return Object.defineProperty(o,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),o._clientId=++Ry,o}this.initialize(e)},"Service"),initialize:s(function(e){var r=U.config[this.serviceIdentifier];if(this.config=new U.Config(U.config),r&&this.config.update(r,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||Oy.configureEndpoint(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),U.SequentialExecutor.call(this),U.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||U.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",s(function(o){process.nextTick(function(){i.eventHandler(o)})},"PUBLISH_API_CALL")),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",s(function(o){process.nextTick(function(){i.eventHandler(o)})},"PUBLISH_API_ATTEMPT"))}},"initialize"),validateService:s(function(){},"validateService"),loadServiceClass:s(function(e){var r=e;if(U.util.isEmpty(this.api)){if(r.apiConfig)return U.Service.defineServiceApi(this.constructor,r.apiConfig);if(this.constructor.services){r=new U.Config(U.config),r.update(e,!0);var i=r.apiVersions[this.constructor.serviceIdentifier];return i=i||r.apiVersion,this.getLatestServiceClass(i)}else return null}else return null},"loadServiceClass"),getLatestServiceClass:s(function(e){return e=this.getLatestServiceVersion(e),this.constructor.services[e]===null&&U.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},"getLatestServiceClass"),getLatestServiceVersion:s(function(e){if(!this.constructor.services||this.constructor.services.length===0)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?U.util.isType(e,Date)&&(e=U.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var r=Object.keys(this.constructor.services).sort(),i=null,n=r.length-1;n>=0;n--)if(r[n][r[n].length-1]!=="*"&&(i=r[n]),r[n].substr(0,10)<=e)return i;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},"getLatestServiceVersion"),api:{},defaultRetryCount:3,customizeRequests:s(function(e){if(!e)this.customRequestHandler=null;else if(typeof e=="function")this.customRequestHandler=e;else throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests")},"customizeRequests"),makeRequest:s(function(e,r,i){if(typeof r=="function"&&(i=r,r=null),r=r||{},this.config.params){var n=this.api.operations[e];n&&(r=U.util.copy(r),U.util.each(this.config.params,function(a,u){n.input.members[a]&&(r[a]===void 0||r[a]===null)&&(r[a]=u)}))}var o=new U.Request(this,e,r);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),i&&o.send(i),o},"makeRequest"),makeUnauthenticatedRequest:s(function(e,r,i){typeof r=="function"&&(i=r,r={});var n=this.makeRequest(e,r).toUnauthenticated();return i?n.send(i):n},"makeUnauthenticatedRequest"),waitFor:s(function(e,r,i){var n=new U.ResourceWaiter(this,e);return n.wait(r,i)},"waitFor"),addAllRequestListeners:s(function(e){for(var r=[U.events,U.EventListeners.Core,this.serviceInterface(),U.EventListeners.CorePost],i=0;i<r.length;i++)r[i]&&e.addListeners(r[i]);this.config.paramValidation||e.removeListener("validate",U.EventListeners.Core.VALIDATE_PARAMETERS),this.config.logger&&e.addListeners(U.EventListeners.Logger),this.setupRequestListeners(e),typeof this.constructor.prototype.customRequestHandler=="function"&&this.constructor.prototype.customRequestHandler(e),Object.prototype.hasOwnProperty.call(this,"customRequestHandler")&&typeof this.customRequestHandler=="function"&&this.customRequestHandler(e)},"addAllRequestListeners"),apiCallEvent:s(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCall",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Region:e.httpRequest.region,MaxRetriesExceeded:0,UserAgent:e.httpRequest.getUserAgent()},n=e.response;if(n.httpResponse.statusCode&&(i.FinalHttpStatusCode=n.httpResponse.statusCode),n.error){var o=n.error,a=n.httpResponse.statusCode;a>299?(o.code&&(i.FinalAwsException=o.code),o.message&&(i.FinalAwsExceptionMessage=o.message)):((o.code||o.name)&&(i.FinalSdkException=o.code||o.name),o.message&&(i.FinalSdkExceptionMessage=o.message))}return i},"apiCallEvent"),apiAttemptEvent:s(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCallAttempt",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},n=e.response;return n.httpResponse.statusCode&&(i.HttpStatusCode=n.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(i.AccessKey=e.service.config.credentials.accessKeyId),n.httpResponse.headers&&(e.httpRequest.headers["x-amz-security-token"]&&(i.SessionToken=e.httpRequest.headers["x-amz-security-token"]),n.httpResponse.headers["x-amzn-requestid"]&&(i.XAmznRequestId=n.httpResponse.headers["x-amzn-requestid"]),n.httpResponse.headers["x-amz-request-id"]&&(i.XAmzRequestId=n.httpResponse.headers["x-amz-request-id"]),n.httpResponse.headers["x-amz-id-2"]&&(i.XAmzId2=n.httpResponse.headers["x-amz-id-2"])),i},"apiAttemptEvent"),attemptFailEvent:s(function(e){var r=this.apiAttemptEvent(e),i=e.response,n=i.error;return i.httpResponse.statusCode>299?(n.code&&(r.AwsException=n.code),n.message&&(r.AwsExceptionMessage=n.message)):((n.code||n.name)&&(r.SdkException=n.code||n.name),n.message&&(r.SdkExceptionMessage=n.message)),r},"attemptFailEvent"),attachMonitoringEmitter:s(function(e){var r,i,n,o,a=0,u,l,h=this,y=!0;e.on("validate",function(){o=U.util.realClock.now(),l=Date.now()},y),e.on("sign",function(){i=U.util.realClock.now(),r=Date.now(),u=e.httpRequest.region,a++},y),e.on("validateResponse",function(){n=Math.round(U.util.realClock.now()-i)}),e.addNamedListener("API_CALL_ATTEMPT","success",s(function(){var S=h.apiAttemptEvent(e);S.Timestamp=r,S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT")),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",s(function(){var S=h.attemptFailEvent(e);S.Timestamp=r,n=n||Math.round(U.util.realClock.now()-i),S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT_RETRY")),e.addNamedListener("API_CALL","complete",s(function(){var S=h.apiCallEvent(e);if(S.AttemptCount=a,!(S.AttemptCount<=0)){S.Timestamp=l;var O=Math.round(U.util.realClock.now()-o);S.Latency=O>=0?O:0;var g=e.response;g.error&&g.error.retryable&&typeof g.retryCount=="number"&&typeof g.maxRetries=="number"&&g.retryCount>=g.maxRetries&&(S.MaxRetriesExceeded=1),h.emit("apiCall",[S])}},"API_CALL"))},"attachMonitoringEmitter"),setupRequestListeners:s(function(e){},"setupRequestListeners"),getSigningName:s(function(){return this.api.signingName||this.api.endpointPrefix},"getSigningName"),getSignerClass:s(function(e){var r,i=null,n="";if(e){var o=e.service.api.operations||{};i=o[e.operation]||null,n=i?i.authtype:""}return this.config.signatureVersion?r=this.config.signatureVersion:n==="v4"||n==="v4-unsigned-body"?r="v4":n==="bearer"?r="bearer":r=this.api.signatureVersion,U.Signers.RequestSigner.getVersion(r)},"getSignerClass"),serviceInterface:s(function(){switch(this.api.protocol){case"ec2":return U.EventListeners.Query;case"query":return U.EventListeners.Query;case"json":return U.EventListeners.Json;case"rest-json":return U.EventListeners.RestJson;case"rest-xml":return U.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},"serviceInterface"),successfulResponse:s(function(e){return e.httpResponse.statusCode<300},"successfulResponse"),numRetries:s(function(){return this.config.maxRetries!==void 0?this.config.maxRetries:this.defaultRetryCount},"numRetries"),retryDelays:s(function(e,r){return U.util.calculateRetryDelay(e,this.config.retryDelayOptions,r)},"retryDelays"),retryableError:s(function(e){return!!(this.timeoutError(e)||this.networkingError(e)||this.expiredCredentialsError(e)||this.throttledError(e)||e.statusCode>=500)},"retryableError"),networkingError:s(function(e){return e.code==="NetworkingError"},"networkingError"),timeoutError:s(function(e){return e.code==="TimeoutError"},"timeoutError"),expiredCredentialsError:s(function(e){return e.code==="ExpiredTokenException"},"expiredCredentialsError"),clockSkewError:s(function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},"clockSkewError"),getSkewCorrectedDate:s(function(){return new Date(Date.now()+this.config.systemClockOffset)},"getSkewCorrectedDate"),applyClockOffset:s(function(e){e&&(this.config.systemClockOffset=e-Date.now())},"applyClockOffset"),isClockSkewed:s(function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e5},"isClockSkewed"),throttledError:s(function(e){if(e.statusCode===429)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":case"EC2ThrottledException":return!0;default:return!1}},"throttledError"),endpointFromTemplate:s(function(e){if(typeof e!="string")return e;var r=e;return r=r.replace(/\{service\}/g,this.api.endpointPrefix),r=r.replace(/\{region\}/g,this.config.region),r=r.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http"),r},"endpointFromTemplate"),setEndpoint:s(function(e){this.endpoint=new U.Endpoint(e,this.config)},"setEndpoint"),paginationConfig:s(function(e,r){var i=this.api.operations[e].paginator;if(!i){if(r){var n=new Error;throw U.util.error(n,"No pagination configuration for "+e)}return null}return i},"paginationConfig")});U.util.update(U.Service,{defineMethods:s(function(e){U.util.each(e.prototype.api.operations,s(function(i){if(!e.prototype[i]){var n=e.prototype.api.operations[i];n.authtype==="none"?e.prototype[i]=function(o,a){return this.makeUnauthenticatedRequest(i,o,a)}:e.prototype[i]=function(o,a){return this.makeRequest(i,o,a)}}},"iterator"))},"defineMethods"),defineService:s(function(e,r,i){U.Service._serviceMap[e]=!0,Array.isArray(r)||(i=r,r=[]);var n=Ea(U.Service,i||{});if(typeof e=="string"){U.Service.addVersions(n,r);var o=n.serviceIdentifier||e;n.serviceIdentifier=o}else n.prototype.api=e,U.Service.defineMethods(n);if(U.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&U.util.clientSideMonitoring){var a=U.util.clientSideMonitoring.Publisher,u=U.util.clientSideMonitoring.configProvider,l=u();this.prototype.publisher=new a(l),l.enabled&&(U.Service._clientSideMonitoring=!0)}return U.SequentialExecutor.call(n.prototype),U.Service.addDefaultMonitoringListeners(n.prototype),n},"defineService"),addVersions:s(function(e,r){Array.isArray(r)||(r=[r]),e.services=e.services||{};for(var i=0;i<r.length;i++)e.services[r[i]]===void 0&&(e.services[r[i]]=null);e.apiVersions=Object.keys(e.services).sort()},"addVersions"),defineServiceApi:s(function(e,r,i){var n=Ea(e,{serviceIdentifier:e.serviceIdentifier});function o(a){a.isApi?n.prototype.api=a:n.prototype.api=new Iy(a,{serviceIdentifier:e.serviceIdentifier})}if(s(o,"setApi"),typeof r=="string"){if(i)o(i);else try{o(U.apiLoader(e.serviceIdentifier,r))}catch(a){throw U.util.error(a,{message:"Could not find API configuration "+e.serviceIdentifier+"-"+r})}Object.prototype.hasOwnProperty.call(e.services,r)||(e.apiVersions=e.apiVersions.concat(r).sort()),e.services[r]=n}else o(r);return U.Service.defineMethods(n),n},"defineServiceApi"),hasService:function(t){return Object.prototype.hasOwnProperty.call(U.Service._serviceMap,t)},addDefaultMonitoringListeners:s(function(e){e.addNamedListener("MONITOR_EVENTS_BUBBLE","apiCallAttempt",s(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCallAttempt",[i])},"EVENTS_BUBBLE")),e.addNamedListener("CALL_EVENTS_BUBBLE","apiCall",s(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCall",[i])},"CALL_EVENTS_BUBBLE"))},"addDefaultMonitoringListeners"),_serviceMap:{}});U.util.mixin(U.Service,U.SequentialExecutor);nl.exports=U.Service});var Ca=P(()=>{var Et=V();Et.Credentials=Et.util.inherit({constructor:s(function(){if(Et.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1&&typeof arguments[0]=="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},"Credentials"),expiryWindow:15,needsRefresh:s(function(){var e=Et.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},"needsRefresh"),get:s(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:s(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:s(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(s(function(o){Et.util.arrayEach(i.refreshCallbacks,function(a){r?a(o):Et.util.defer(function(){a(o)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:s(function(e){e()},"load")});Et.Credentials.addPromisesToClass=s(function(e){this.prototype.getPromise=Et.util.promisifyMethod("get",e),this.prototype.refreshPromise=Et.util.promisifyMethod("refresh",e)},"addPromisesToClass");Et.Credentials.deletePromisesFromClass=s(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Et.util.addPromises(Et.Credentials)});var Sa=P(()=>{var Lt=V();Lt.CredentialProviderChain=Lt.util.inherit(Lt.Credentials,{constructor:s(function(e){e?this.providers=e:this.providers=Lt.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"CredentialProviderChain"),resolve:s(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Lt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var o=a;s(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Lt.CredentialProviderChain.defaultProviders=[];Lt.CredentialProviderChain.addPromisesToClass=s(function(e){this.prototype.resolvePromise=Lt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Lt.CredentialProviderChain.deletePromisesFromClass=s(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Lt.util.addPromises(Lt.CredentialProviderChain)});var ol=P(()=>{var Ne=V();Ca();Sa();var Ks;Ne.Config=Ne.util.inherit({constructor:s(function(e){e===void 0&&(e={}),e=this.extractCredentials(e),Ne.util.each.call(this,this.keys,function(r,i){this.set(r,e[r],i)})},"Config"),getCredentials:s(function(e){var r=this;function i(u){e(u,u?null:r.credentials)}s(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"CredentialsError",message:u,name:"CredentialsError"})}s(n,"credError");function o(){r.credentials.get(function(u){if(u){var l="Could not load credentials from "+r.credentials.constructor.name;u=n(l,u)}i(u)})}s(o,"getAsyncCredentials");function a(){var u=null;(!r.credentials.accessKeyId||!r.credentials.secretAccessKey)&&(u=n("Missing credentials")),i(u)}s(a,"getStaticCredentials"),r.credentials?typeof r.credentials.get=="function"?o():a():r.credentialProvider?r.credentialProvider.resolve(function(u,l){u&&(u=n("Could not load credentials from any providers",u)),r.credentials=l,i(u)}):i(n("No credentials to load"))},"getCredentials"),getToken:s(function(e){var r=this;function i(u){e(u,u?null:r.token)}s(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"TokenError",message:u,name:"TokenError"})}s(n,"tokenError");function o(){r.token.get(function(u){if(u){var l="Could not load token from "+r.token.constructor.name;u=n(l,u)}i(u)})}s(o,"getAsyncToken");function a(){var u=null;r.token.token||(u=n("Missing token")),i(u)}s(a,"getStaticToken"),r.token?typeof r.token.get=="function"?o():a():r.tokenProvider?r.tokenProvider.resolve(function(u,l){u&&(u=n("Could not load token from any providers",u)),r.token=l,i(u)}):i(n("No token to load"))},"getToken"),update:s(function(e,r){r=r||!1,e=this.extractCredentials(e),Ne.util.each.call(this,e,function(i,n){(r||Object.prototype.hasOwnProperty.call(this.keys,i)||Ne.Service.hasService(i))&&this.set(i,n)})},"update"),loadFromPath:s(function(e){this.clear();var r=JSON.parse(Ne.util.readFileSync(e)),i=new Ne.FileSystemCredentials(e),n=new Ne.CredentialProviderChain;return n.providers.unshift(i),n.resolve(function(o,a){if(o)throw o;r.credentials=a}),this.constructor(r),this},"loadFromPath"),clear:s(function(){Ne.util.each.call(this,this.keys,function(e){delete this[e]}),this.set("credentials",void 0),this.set("credentialProvider",void 0)},"clear"),set:s(function(e,r,i){r===void 0?(i===void 0&&(i=this.keys[e]),typeof i=="function"?this[e]=i.call(this):this[e]=i):e==="httpOptions"&&this[e]?this[e]=Ne.util.merge(this[e],r):this[e]=r},"set"),keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,s3UsEast1RegionalEndpoint:"legacy",s3UseArnRegion:void 0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:void 0,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:"legacy",useFipsEndpoint:!1,useDualstackEndpoint:!1,token:null},extractCredentials:s(function(e){return e.accessKeyId&&e.secretAccessKey&&(e=Ne.util.copy(e),e.credentials=new Ne.Credentials(e)),e},"extractCredentials"),setPromisesDependency:s(function(e){Ks=e,e===null&&typeof Promise=="function"&&(Ks=Promise);var r=[Ne.Request,Ne.Credentials,Ne.CredentialProviderChain];Ne.S3&&(r.push(Ne.S3),Ne.S3.ManagedUpload&&r.push(Ne.S3.ManagedUpload)),Ne.util.addPromises(r,Ks)},"setPromisesDependency"),getPromisesDependency:s(function(){return Ks},"getPromisesDependency")});Ne.config=new Ne.Config});var Gs=P(()=>{var je=V(),Xs=je.util.inherit;je.Endpoint=Xs({constructor:s(function(e,r){if(je.util.hideProperties(this,["slashes","auth","hash","search","query"]),typeof e>"u"||e===null)throw new Error("Invalid endpoint: "+e);if(typeof e!="string")return je.util.copy(e);if(!e.match(/^http/)){var i=r&&r.sslEnabled!==void 0?r.sslEnabled:je.config.sslEnabled;e=(i?"https":"http")+"://"+e}je.util.update(this,je.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port=this.protocol==="https:"?443:80},"Endpoint")});je.HttpRequest=Xs({constructor:s(function(e,r){e=new je.Endpoint(e),this.method="POST",this.path=e.path||"/",this.headers={},this.body="",this.endpoint=e,this.region=r,this._userAgent="",this.setUserAgent()},"HttpRequest"),setUserAgent:s(function(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=je.util.userAgent()},"setUserAgent"),getUserAgentHeaderName:s(function(){var e=je.util.isBrowser()?"X-Amz-":"";return e+"User-Agent"},"getUserAgentHeaderName"),appendToUserAgent:s(function(e){typeof e=="string"&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},"appendToUserAgent"),getUserAgent:s(function(){return this._userAgent},"getUserAgent"),pathname:s(function(){return this.path.split("?",1)[0]},"pathname"),search:s(function(){var e=this.path.split("?",2)[1];return e?(e=je.util.queryStringParse(e),je.util.queryParamsToString(e)):""},"search"),updateEndpoint:s(function(e){var r=new je.Endpoint(e);this.endpoint=r,this.path=r.path||"/",this.headers.Host&&(this.headers.Host=r.host)},"updateEndpoint")});je.HttpResponse=Xs({constructor:s(function(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},"HttpResponse"),createUnbufferedStream:s(function(){return this.streaming=!0,this.stream},"createUnbufferedStream")});je.HttpClient=Xs({});je.HttpClient.getInstance=s(function(){return this.singleton===void 0&&(this.singleton=new this),this.singleton},"getInstance")});var pl=P((Jk,hl)=>{var Le=V(),vt=Oe(),al=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function Js(t){var e=t.service,r=e.api||{},i=r.operations,n={};return e.config.region&&(n.region=e.config.region),r.serviceId&&(n.serviceId=r.serviceId),e.config.credentials.accessKeyId&&(n.accessKeyId=e.config.credentials.accessKeyId),n}s(Js,"getCacheKey");function cl(t,e,r){!r||e===void 0||e===null||r.type==="structure"&&r.required&&r.required.length>0&&vt.arrayEach(r.required,function(i){var n=r.members[i];if(n.endpointDiscoveryId===!0){var o=n.isLocationName?n.name:i;t[o]=String(e[i])}else cl(t,e[i],n)})}s(cl,"marshallCustomIdentifiersHelper");function $s(t,e){var r={};return cl(r,t.params,e),r}s($s,"marshallCustomIdentifiers");function ll(t){var e=t.service,r=e.api,i=r.operations?r.operations[t.operation]:void 0,n=i?i.input:void 0,o=$s(t,n),a=Js(t);Object.keys(o).length>0&&(a=vt.update(a,o),i&&(a.operation=i.name));var u=Le.endpointCache.get(a);if(!(u&&u.length===1&&u[0].Address===""))if(u&&u.length>0)t.httpRequest.updateEndpoint(u[0].Address);else{var l=e.makeRequest(r.endpointOperation,{Operation:i.name,Identifiers:o});dl(l),l.removeListener("validate",Le.EventListeners.Core.VALIDATE_PARAMETERS),l.removeListener("retry",Le.EventListeners.Core.RETRY_CHECK),Le.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}]),l.send(function(h,y){y&&y.Endpoints?Le.endpointCache.put(a,y.Endpoints):h&&Le.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}])})}}s(ll,"optionalDiscoverEndpoint");var gr={};function fl(t,e){var r=t.service,i=r.api,n=i.operations?i.operations[t.operation]:void 0,o=n?n.input:void 0,a=$s(t,o),u=Js(t);Object.keys(a).length>0&&(u=vt.update(u,a),n&&(u.operation=n.name));var l=Le.EndpointCache.getKeyString(u),h=Le.endpointCache.get(l);if(h&&h.length===1&&h[0].Address===""){gr[l]||(gr[l]=[]),gr[l].push({request:t,callback:e});return}else if(h&&h.length>0)t.httpRequest.updateEndpoint(h[0].Address),e();else{var y=r.makeRequest(i.endpointOperation,{Operation:n.name,Identifiers:a});y.removeListener("validate",Le.EventListeners.Core.VALIDATE_PARAMETERS),dl(y),Le.endpointCache.put(l,[{Address:"",CachePeriodInMinutes:60}]),y.send(function(v,S){if(v){if(t.response.error=vt.error(v,{retryable:!1}),Le.endpointCache.remove(u),gr[l]){var O=gr[l];vt.arrayEach(O,function(g){g.request.response.error=vt.error(v,{retryable:!1}),g.callback()}),delete gr[l]}}else if(S&&(Le.endpointCache.put(l,S.Endpoints),t.httpRequest.updateEndpoint(S.Endpoints[0].Address),gr[l])){var O=gr[l];vt.arrayEach(O,function(N){N.request.httpRequest.updateEndpoint(S.Endpoints[0].Address),N.callback()}),delete gr[l]}e()})}}s(fl,"requiredDiscoverEndpoint");function dl(t){var e=t.service.api,r=e.apiVersion;r&&!t.httpRequest.headers["x-amz-api-version"]&&(t.httpRequest.headers["x-amz-api-version"]=r)}s(dl,"addApiVersionHeader");function Ta(t){var e=t.error,r=t.httpResponse;if(e&&(e.code==="InvalidEndpointException"||r.statusCode===421)){var i=t.request,n=i.service.api.operations||{},o=n[i.operation]?n[i.operation].input:void 0,a=$s(i,o),u=Js(i);Object.keys(a).length>0&&(u=vt.update(u,a),n[i.operation]&&(u.operation=n[i.operation].name)),Le.endpointCache.remove(u)}}s(Ta,"invalidateCachedEndpoints");function Dy(t){if(t._originalConfig&&t._originalConfig.endpoint&&t._originalConfig.endpointDiscoveryEnabled===!0)throw vt.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var e=Le.config[t.serviceIdentifier]||{};return Boolean(Le.config.endpoint||e.endpoint||t._originalConfig&&t._originalConfig.endpoint)}s(Dy,"hasCustomEndpoint");function ul(t){return["false","0"].indexOf(t)>=0}s(ul,"isFalsy");function Py(t){var e=t.service||{};if(e.config.endpointDiscoveryEnabled!==void 0)return e.config.endpointDiscoveryEnabled;if(!vt.isBrowser()){for(var r=0;r<al.length;r++){var i=al[r];if(Object.prototype.hasOwnProperty.call(process.env,i)){if(process.env[i]===""||process.env[i]===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"environmental variable "+i+" cannot be set to nothing"});return!ul(process.env[i])}}var n={};try{n=Le.util.iniLoader?Le.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[Le.util.sharedConfigFileEnv]}):{}}catch{}var o=n[process.env.AWS_PROFILE||Le.util.defaultProfile]||{};if(Object.prototype.hasOwnProperty.call(o,"endpoint_discovery_enabled")){if(o.endpoint_discovery_enabled===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"config file entry 'endpoint_discovery_enabled' cannot be set to nothing"});return!ul(o.endpoint_discovery_enabled)}}}s(Py,"resolveEndpointDiscoveryConfig");function _y(t,e){var r=t.service||{};if(Dy(r)||t.isPresigned())return e();var i=r.api.operations||{},n=i[t.operation],o=n?n.endpointDiscoveryRequired:"NULL",a=Py(t),u=r.api.hasRequiredEndpointDiscovery;switch((a||u)&&t.httpRequest.appendToUserAgent("endpoint-discovery"),o){case"OPTIONAL":(a||u)&&(ll(t),t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ta)),e();break;case"REQUIRED":if(a===!1){t.response.error=vt.error(new Error,{code:"ConfigurationException",message:"Endpoint Discovery is disabled but "+r.api.className+"."+t.operation+"() requires it. Please check your configurations."}),e();break}t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ta),fl(t,e);break;case"NULL":default:e();break}}s(_y,"discoverEndpoint");hl.exports={discoverEndpoint:_y,requiredDiscoverEndpoint:fl,optionalDiscoverEndpoint:ll,marshallCustomIdentifiers:$s,getCacheKey:Js,invalidateCachedEndpoint:Ta}});var vl=P(()=>{var ee=V(),Ur=wa(),ky=pl().discoverEndpoint;ee.EventListeners={Core:{}};function yl(t){if(!t.service.api.operations)return"";var e=t.service.api.operations[t.operation];return e?e.authtype:""}s(yl,"getOperationAuthtype");function ml(t){var e=t.service;return e.config.signatureVersion?e.config.signatureVersion:e.api.signatureVersion?e.api.signatureVersion:yl(t)}s(ml,"getIdentityType");ee.EventListeners={Core:new Ur().addNamedListeners(function(t,e){e("VALIDATE_CREDENTIALS","validate",s(function(n,o){if(!n.service.api.signatureVersion&&!n.service.config.signatureVersion)return o();var a=ml(n);if(a==="bearer"){n.service.config.getToken(function(u){u&&(n.response.error=ee.util.error(u,{code:"TokenError"})),o()});return}n.service.config.getCredentials(function(u){u&&(n.response.error=ee.util.error(u,{code:"CredentialsError",message:"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1"})),o()})},"VALIDATE_CREDENTIALS")),t("VALIDATE_REGION","validate",s(function(n){if(!n.service.isGlobalEndpoint){var o=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);n.service.config.region?o.test(n.service.config.region)||(n.response.error=ee.util.error(new Error,{code:"ConfigError",message:"Invalid region in config"})):n.response.error=ee.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}},"VALIDATE_REGION")),t("BUILD_IDEMPOTENCY_TOKENS","validate",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation];if(o){var a=o.idempotentMembers;if(a.length){for(var u=ee.util.copy(n.params),l=0,h=a.length;l<h;l++)u[a[l]]||(u[a[l]]=ee.util.uuid.v4());n.params=u}}}},"BUILD_IDEMPOTENCY_TOKENS")),t("VALIDATE_PARAMETERS","validate",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation].input,a=n.service.config.paramValidation;new ee.ParamValidator(a).validate(o,n.params)}},"VALIDATE_PARAMETERS")),t("COMPUTE_CHECKSUM","afterBuild",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation];if(o){var a=n.httpRequest.body,u=a&&(ee.util.Buffer.isBuffer(a)||typeof a=="string"),l=n.httpRequest.headers;if(o.httpChecksumRequired&&n.service.config.computeChecksums&&u&&!l["Content-MD5"]){var h=ee.util.crypto.md5(a,"base64");l["Content-MD5"]=h}}}},"COMPUTE_CHECKSUM")),e("COMPUTE_SHA256","afterBuild",s(function(n,o){if(n.haltHandlersOnError(),!!n.service.api.operations){var a=n.service.api.operations[n.operation],u=a?a.authtype:"";if(!n.service.api.signatureVersion&&!u&&!n.service.config.signatureVersion)return o();if(n.service.getSignerClass(n)===ee.Signers.V4){var l=n.httpRequest.body||"";if(u.indexOf("unsigned-body")>=0)return n.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",o();ee.util.computeSha256(l,function(h,y){h?o(h):(n.httpRequest.headers["X-Amz-Content-Sha256"]=y,o())})}else o()}},"COMPUTE_SHA256")),t("SET_CONTENT_LENGTH","afterBuild",s(function(n){var o=yl(n),a=ee.util.getRequestPayloadShape(n);if(n.httpRequest.headers["Content-Length"]===void 0)try{var u=ee.util.string.byteLength(n.httpRequest.body);n.httpRequest.headers["Content-Length"]=u}catch(l){if(a&&a.isStreaming){if(a.requiresLength)throw l;if(o.indexOf("unsigned-body")>=0){n.httpRequest.headers["Transfer-Encoding"]="chunked";return}else throw l}throw l}},"SET_CONTENT_LENGTH")),t("SET_HTTP_HOST","afterBuild",s(function(n){n.httpRequest.headers.Host=n.httpRequest.endpoint.host},"SET_HTTP_HOST")),t("SET_TRACE_ID","afterBuild",s(function(n){var o="X-Amzn-Trace-Id";if(ee.util.isNode()&&!Object.hasOwnProperty.call(n.httpRequest.headers,o)){var a="AWS_LAMBDA_FUNCTION_NAME",u="_X_AMZN_TRACE_ID",l=process.env[a],h=process.env[u];typeof l=="string"&&l.length>0&&typeof h=="string"&&h.length>0&&(n.httpRequest.headers[o]=h)}},"SET_TRACE_ID")),t("RESTART","restart",s(function(){var n=this.response.error;!n||!n.retryable||(this.httpRequest=new ee.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount<this.service.config.maxRetries?this.response.retryCount++:this.response.error=null)},"RESTART"));var r=!0;e("DISCOVER_ENDPOINT","sign",ky,r),e("SIGN","sign",s(function(n,o){var a=n.service,u=ml(n);if(!u||u.length===0)return o();u==="bearer"?a.config.getToken(function(l,h){if(l)return n.response.error=l,o();try{var y=a.getSignerClass(n),v=new y(n.httpRequest);v.addAuthorization(h)}catch(S){n.response.error=S}o()}):a.config.getCredentials(function(l,h){if(l)return n.response.error=l,o();try{var y=a.getSkewCorrectedDate(),v=a.getSignerClass(n),S=n.service.api.operations||{},O=S[n.operation],g=new v(n.httpRequest,a.getSigningName(n),{signatureCache:a.config.signatureCache,operation:O,signatureVersion:a.api.signatureVersion});g.setServiceClientId(a._clientId),delete n.httpRequest.headers.Authorization,delete n.httpRequest.headers.Date,delete n.httpRequest.headers["X-Amz-Date"],g.addAuthorization(h,y),n.signedAt=y}catch(N){n.response.error=N}o()})},"SIGN")),t("VALIDATE_RESPONSE","validateResponse",s(function(n){this.service.successfulResponse(n,this)?(n.data={},n.error=null):(n.data=null,n.error=ee.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))},"VALIDATE_RESPONSE")),t("ERROR","error",s(function(n,o){var a=o.request.service.api.awsQueryCompatible;if(a){var u=o.httpResponse.headers,l=u?u["x-amzn-query-error"]:void 0;l&&l.includes(";")&&(o.error.code=l.split(";")[0])}},"ERROR"),!0),e("SEND","send",s(function(n,o){n.httpResponse._abortCallback=o,n.error=null,n.data=null;function a(v){n.httpResponse.stream=v;var S=n.request.httpRequest.stream,O=n.request.service,g=O.api,N=n.request.operation,D=g.operations[N]||{};v.on("headers",s(function(p,C,R){if(n.request.emit("httpHeaders",[p,C,n,R]),!n.httpResponse.streaming)if(ee.HttpClient.streamsApiVersion===2){if(D.hasEventOutput&&O.successfulResponse(n)){n.request.emit("httpDone"),o();return}v.on("readable",s(function(){var T=v.read();T!==null&&n.request.emit("httpData",[T,n])},"onReadable"))}else v.on("data",s(function(T){n.request.emit("httpData",[T,n])},"onData"))},"onHeaders")),v.on("end",s(function(){if(!S||!S.didCallback){if(ee.HttpClient.streamsApiVersion===2&&D.hasEventOutput&&O.successfulResponse(n))return;n.request.emit("httpDone"),o()}},"onEnd"))}s(a,"callback");function u(v){v.on("sendProgress",s(function(O){n.request.emit("httpUploadProgress",[O,n])},"onSendProgress")),v.on("receiveProgress",s(function(O){n.request.emit("httpDownloadProgress",[O,n])},"onReceiveProgress"))}s(u,"progress");function l(v){if(v.code!=="RequestAbortedError"){var S=v.code==="TimeoutError"?v.code:"NetworkingError";v=ee.util.error(v,{code:S,region:n.request.httpRequest.region,hostname:n.request.httpRequest.endpoint.hostname,retryable:!0})}n.error=v,n.request.emit("httpError",[n.error,n],function(){o()})}s(l,"error");function h(){var v=ee.HttpClient.getInstance(),S=n.request.service.config.httpOptions||{};try{var O=v.handleRequest(n.request.httpRequest,S,a,l);u(O)}catch(g){l(g)}}s(h,"executeSend");var y=(n.request.service.getSkewCorrectedDate()-this.signedAt)/1e3;y>=60*10?this.emit("sign",[this],function(v){v?o(v):h()}):h()},"SEND")),t("HTTP_HEADERS","httpHeaders",s(function(n,o,a,u){a.httpResponse.statusCode=n,a.httpResponse.statusMessage=u,a.httpResponse.headers=o,a.httpResponse.body=ee.util.buffer.toBuffer(""),a.httpResponse.buffers=[],a.httpResponse.numBytes=0;var l=o.date||o.Date,h=a.request.service;if(l){var y=Date.parse(l);h.config.correctClockSkew&&h.isClockSkewed(y)&&h.applyClockOffset(y)}},"HTTP_HEADERS")),t("HTTP_DATA","httpData",s(function(n,o){if(n){if(ee.util.isNode()){o.httpResponse.numBytes+=n.length;var a=o.httpResponse.headers["content-length"],u={loaded:o.httpResponse.numBytes,total:a};o.request.emit("httpDownloadProgress",[u,o])}o.httpResponse.buffers.push(ee.util.buffer.toBuffer(n))}},"HTTP_DATA")),t("HTTP_DONE","httpDone",s(function(n){if(n.httpResponse.buffers&&n.httpResponse.buffers.length>0){var o=ee.util.buffer.concat(n.httpResponse.buffers);n.httpResponse.body=o}delete n.httpResponse.numBytes,delete n.httpResponse.buffers},"HTTP_DONE")),t("FINALIZE_ERROR","retry",s(function(n){n.httpResponse.statusCode&&(n.error.statusCode=n.httpResponse.statusCode,n.error.retryable===void 0&&(n.error.retryable=this.service.retryableError(n.error,this)))},"FINALIZE_ERROR")),t("INVALIDATE_CREDENTIALS","retry",s(function(n){if(n.error)switch(n.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":n.error.retryable=!0,n.request.service.config.credentials.expired=!0}},"INVALIDATE_CREDENTIALS")),t("EXPIRED_SIGNATURE","retry",s(function(n){var o=n.error;o&&typeof o.code=="string"&&typeof o.message=="string"&&o.code.match(/Signature/)&&o.message.match(/expired/)&&(n.error.retryable=!0)},"EXPIRED_SIGNATURE")),t("CLOCK_SKEWED","retry",s(function(n){n.error&&this.service.clockSkewError(n.error)&&this.service.config.correctClockSkew&&(n.error.retryable=!0)},"CLOCK_SKEWED")),t("REDIRECT","retry",s(function(n){n.error&&n.error.statusCode>=300&&n.error.statusCode<400&&n.httpResponse.headers.location&&(this.httpRequest.endpoint=new ee.Endpoint(n.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,n.error.redirect=!0,n.error.retryable=!0)},"REDIRECT")),t("RETRY_CHECK","retry",s(function(n){n.error&&(n.error.redirect&&n.redirectCount<n.maxRedirects?n.error.retryDelay=0:n.retryCount<n.maxRetries&&(n.error.retryDelay=this.service.retryDelays(n.retryCount,n.error)||0))},"RETRY_CHECK")),e("RESET_RETRY_STATE","afterRetry",s(function(n,o){var a,u=!1;n.error&&(a=n.error.retryDelay||0,n.error.retryable&&n.retryCount<n.maxRetries?(n.retryCount++,u=!0):n.error.redirect&&n.redirectCount<n.maxRedirects&&(n.redirectCount++,u=!0)),u&&a>=0?(n.error=null,setTimeout(o,a)):o()},"RESET_RETRY_STATE"))}),CorePost:new Ur().addNamedListeners(function(t){t("EXTRACT_REQUEST_ID","extractData",ee.util.extractRequestId),t("EXTRACT_REQUEST_ID","extractError",ee.util.extractRequestId),t("ENOTFOUND_ERROR","httpError",s(function(r){function i(o){return o.errno==="ENOTFOUND"||typeof o.errno=="number"&&typeof ee.util.getSystemErrorName=="function"&&["EAI_NONAME","EAI_NODATA"].indexOf(ee.util.getSystemErrorName(o.errno)>=0)}if(s(i,"isDNSError"),r.code==="NetworkingError"&&i(r)){var n="Inaccessible host: `"+r.hostname+"' at port `"+r.port+"'. This service may not be available in the `"+r.region+"' region.";this.response.error=ee.util.error(new Error(n),{code:"UnknownEndpoint",region:r.region,hostname:r.hostname,retryable:!0,originalError:r})}},"ENOTFOUND_ERROR"))}),Logger:new Ur().addNamedListeners(function(t){t("LOG_REQUEST","complete",s(function(r){var i=r.request,n=i.service.config.logger;if(!n)return;function o(l,h){if(!h)return h;if(l.isSensitive)return"***SensitiveInformation***";switch(l.type){case"structure":var y={};return ee.util.each(h,function(O,g){Object.prototype.hasOwnProperty.call(l.members,O)?y[O]=o(l.members[O],g):y[O]=g}),y;case"list":var v=[];return ee.util.arrayEach(h,function(O,g){v.push(o(l.member,O))}),v;case"map":var S={};return ee.util.each(h,function(O,g){S[O]=o(l.value,g)}),S;default:return h}}s(o,"filterSensitiveLog");function a(){var l=r.request.service.getSkewCorrectedDate().getTime(),h=(l-i.startTime.getTime())/1e3,y=!!n.isTTY,v=r.httpResponse.statusCode,S=i.params;if(i.service.api.operations&&i.service.api.operations[i.operation]&&i.service.api.operations[i.operation].input){var O=i.service.api.operations[i.operation].input;S=o(O,i.params)}var g=re("util").inspect(S,!0,null),N="";return y&&(N+="\x1B[33m"),N+="[AWS "+i.service.serviceIdentifier+" "+v,N+=" "+h.toString()+"s "+r.retryCount+" retries]",y&&(N+="\x1B[0;1m"),N+=" "+ee.util.string.lowerFirst(i.operation),N+="("+g+")",y&&(N+="\x1B[0m"),N}s(a,"buildMessage");var u=a();typeof n.log=="function"?n.log(u):typeof n.write=="function"&&n.write(u+`
|
|
2
|
+
`)},"LOG_REQUEST"))}),Json:new Ur().addNamedListeners(function(t){var e=Ws();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Rest:new Ur().addNamedListeners(function(t){var e=qn();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),RestJson:new Ur().addNamedListeners(function(t){var e=la();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError),t("UNSET_CONTENT_LENGTH","afterBuild",e.unsetContentLength)}),RestXml:new Ur().addNamedListeners(function(t){var e=da();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Query:new Ur().addNamedListeners(function(t){var e=aa();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)})}});var Nl=P((eq,gl)=>{function ba(t,e){this.currentState=e||null,this.states=t||{}}s(ba,"AcceptorStateMachine");ba.prototype.runTo=s(function(e,r,i,n){typeof e=="function"&&(n=i,i=r,r=e,e=null);var o=this,a=o.states[o.currentState];a.fn.call(i||o,n,function(u){if(u)if(a.fail)o.currentState=a.fail;else return r?r.call(i,u):null;else if(a.accept)o.currentState=a.accept;else return r?r.call(i):null;if(o.currentState===e)return r?r.call(i,u):null;o.runTo(e,r,i,u)})},"runTo");ba.prototype.addState=s(function(e,r,i,n){return typeof r=="function"?(n=r,r=null,i=null):typeof i=="function"&&(n=i,i=null),this.currentState||(this.currentState=e),this.states[e]={accept:r,fail:i,fn:n},this},"addState");gl.exports=ba});var Qs=P(Ys=>{(function(t){"use strict";function e(d){return d!==null?Object.prototype.toString.call(d)==="[object Array]":!1}s(e,"isArray");function r(d){return d!==null?Object.prototype.toString.call(d)==="[object Object]":!1}s(r,"isObject");function i(d,x){if(d===x)return!0;var b=Object.prototype.toString.call(d);if(b!==Object.prototype.toString.call(x))return!1;if(e(d)===!0){if(d.length!==x.length)return!1;for(var k=0;k<d.length;k++)if(i(d[k],x[k])===!1)return!1;return!0}if(r(d)===!0){var L={};for(var B in d)if(hasOwnProperty.call(d,B)){if(i(d[B],x[B])===!1)return!1;L[B]=!0}for(var Y in x)if(hasOwnProperty.call(x,Y)&&L[Y]!==!0)return!1;return!0}return!1}s(i,"strictDeepEqual");function n(d){if(d===""||d===!1||d===null)return!0;if(e(d)&&d.length===0)return!0;if(r(d)){for(var x in d)if(d.hasOwnProperty(x))return!1;return!0}else return!1}s(n,"isFalse");function o(d){for(var x=Object.keys(d),b=[],k=0;k<x.length;k++)b.push(d[x[k]]);return b}s(o,"objValues");function a(d,x){var b={};for(var k in d)b[k]=d[k];for(var L in x)b[L]=x[L];return b}s(a,"merge");var u;typeof String.prototype.trimLeft=="function"?u=s(function(d){return d.trimLeft()},"trimLeft"):u=s(function(d){return d.match(/^\s*(.*)/)[1]},"trimLeft");var l=0,h=1,y=2,v=3,S=4,O=5,g=6,N=7,D=8,E=9,p={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},C="EOF",R="UnquotedIdentifier",_="QuotedIdentifier",T="Rbracket",A="Rparen",w="Comma",K="Colon",X="Rbrace",F="Number",se="Current",We="Expref",Fe="Pipe",bt="Or",Z="And",Cr="EQ",Sr="GT",Tr="LT",Nt="GTE",br="LTE",wi="NE",At="Flatten",Ut="Star",Kr="Filter",m="Dot",f="Not",q="Lbrace",I="Lbracket",te="Lparen",we="Literal",be={".":m,"*":Ut,",":w,":":K,"{":q,"}":X,"]":T,"(":te,")":A,"@":se},Je={"<":!0,">":!0,"=":!0,"!":!0},wt={" ":!0," ":!0,"\n":!0};function Ar(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d==="_"}s(Ar,"isAlpha");function De(d){return d>="0"&&d<="9"||d==="-"}s(De,"isNum");function It(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d>="0"&&d<="9"||d==="_"}s(It,"isAlphaNum");function Gi(){}s(Gi,"Lexer"),Gi.prototype={tokenize:function(d){var x=[];this._current=0;for(var b,k,L;this._current<d.length;)if(Ar(d[this._current]))b=this._current,k=this._consumeUnquotedIdentifier(d),x.push({type:R,value:k,start:b});else if(be[d[this._current]]!==void 0)x.push({type:be[d[this._current]],value:d[this._current],start:this._current}),this._current++;else if(De(d[this._current]))L=this._consumeNumber(d),x.push(L);else if(d[this._current]==="[")L=this._consumeLBracket(d),x.push(L);else if(d[this._current]==='"')b=this._current,k=this._consumeQuotedIdentifier(d),x.push({type:_,value:k,start:b});else if(d[this._current]==="'")b=this._current,k=this._consumeRawStringLiteral(d),x.push({type:we,value:k,start:b});else if(d[this._current]==="`"){b=this._current;var B=this._consumeLiteral(d);x.push({type:we,value:B,start:b})}else if(Je[d[this._current]]!==void 0)x.push(this._consumeOperator(d));else if(wt[d[this._current]]!==void 0)this._current++;else if(d[this._current]==="&")b=this._current,this._current++,d[this._current]==="&"?(this._current++,x.push({type:Z,value:"&&",start:b})):x.push({type:We,value:"&",start:b});else if(d[this._current]==="|")b=this._current,this._current++,d[this._current]==="|"?(this._current++,x.push({type:bt,value:"||",start:b})):x.push({type:Fe,value:"|",start:b});else{var Y=new Error("Unknown character:"+d[this._current]);throw Y.name="LexerError",Y}return x},_consumeUnquotedIdentifier:function(d){var x=this._current;for(this._current++;this._current<d.length&&It(d[this._current]);)this._current++;return d.slice(x,this._current)},_consumeQuotedIdentifier:function(d){var x=this._current;this._current++;for(var b=d.length;d[this._current]!=='"'&&this._current<b;){var k=this._current;d[k]==="\\"&&(d[k+1]==="\\"||d[k+1]==='"')?k+=2:k++,this._current=k}return this._current++,JSON.parse(d.slice(x,this._current))},_consumeRawStringLiteral:function(d){var x=this._current;this._current++;for(var b=d.length;d[this._current]!=="'"&&this._current<b;){var k=this._current;d[k]==="\\"&&(d[k+1]==="\\"||d[k+1]==="'")?k+=2:k++,this._current=k}this._current++;var L=d.slice(x+1,this._current-1);return L.replace("\\'","'")},_consumeNumber:function(d){var x=this._current;this._current++;for(var b=d.length;De(d[this._current])&&this._current<b;)this._current++;var k=parseInt(d.slice(x,this._current));return{type:F,value:k,start:x}},_consumeLBracket:function(d){var x=this._current;return this._current++,d[this._current]==="?"?(this._current++,{type:Kr,value:"[?",start:x}):d[this._current]==="]"?(this._current++,{type:At,value:"[]",start:x}):{type:I,value:"[",start:x}},_consumeOperator:function(d){var x=this._current,b=d[x];if(this._current++,b==="!")return d[this._current]==="="?(this._current++,{type:wi,value:"!=",start:x}):{type:f,value:"!",start:x};if(b==="<")return d[this._current]==="="?(this._current++,{type:br,value:"<=",start:x}):{type:Tr,value:"<",start:x};if(b===">")return d[this._current]==="="?(this._current++,{type:Nt,value:">=",start:x}):{type:Sr,value:">",start:x};if(b==="="&&d[this._current]==="=")return this._current++,{type:Cr,value:"==",start:x}},_consumeLiteral:function(d){this._current++;for(var x=this._current,b=d.length,k;d[this._current]!=="`"&&this._current<b;){var L=this._current;d[L]==="\\"&&(d[L+1]==="\\"||d[L+1]==="`")?L+=2:L++,this._current=L}var B=u(d.slice(x,this._current));return B=B.replace("\\`","`"),this._looksLikeJSON(B)?k=JSON.parse(B):k=JSON.parse('"'+B+'"'),this._current++,k},_looksLikeJSON:function(d){var x='[{"',b=["true","false","null"],k="-0123456789";if(d==="")return!1;if(x.indexOf(d[0])>=0)return!0;if(b.indexOf(d)>=0)return!0;if(k.indexOf(d[0])>=0)try{return JSON.parse(d),!0}catch{return!1}else return!1}};var J={};J[C]=0,J[R]=0,J[_]=0,J[T]=0,J[A]=0,J[w]=0,J[X]=0,J[F]=0,J[se]=0,J[We]=0,J[Fe]=1,J[bt]=2,J[Z]=3,J[Cr]=5,J[Sr]=5,J[Tr]=5,J[Nt]=5,J[br]=5,J[wi]=5,J[At]=9,J[Ut]=20,J[Kr]=21,J[m]=40,J[f]=45,J[q]=50,J[I]=55,J[te]=60;function Xr(){}s(Xr,"Parser"),Xr.prototype={parse:function(d){this._loadTokens(d),this.index=0;var x=this.expression(0);if(this._lookahead(0)!==C){var b=this._lookaheadToken(0),k=new Error("Unexpected token type: "+b.type+", value: "+b.value);throw k.name="ParserError",k}return x},_loadTokens:function(d){var x=new Gi,b=x.tokenize(d);b.push({type:C,value:"",start:d.length}),this.tokens=b},expression:function(d){var x=this._lookaheadToken(0);this._advance();for(var b=this.nud(x),k=this._lookahead(0);d<J[k];)this._advance(),b=this.led(k,b),k=this._lookahead(0);return b},_lookahead:function(d){return this.tokens[this.index+d].type},_lookaheadToken:function(d){return this.tokens[this.index+d]},_advance:function(){this.index++},nud:function(d){var x,b,k;switch(d.type){case we:return{type:"Literal",value:d.value};case R:return{type:"Field",name:d.value};case _:var L={type:"Field",name:d.value};if(this._lookahead(0)===te)throw new Error("Quoted identifier not allowed for function names.");return L;case f:return b=this.expression(J.Not),{type:"NotExpression",children:[b]};case Ut:return x={type:"Identity"},b=null,this._lookahead(0)===T?b={type:"Identity"}:b=this._parseProjectionRHS(J.Star),{type:"ValueProjection",children:[x,b]};case Kr:return this.led(d.type,{type:"Identity"});case q:return this._parseMultiselectHash();case At:return x={type:At,children:[{type:"Identity"}]},b=this._parseProjectionRHS(J.Flatten),{type:"Projection",children:[x,b]};case I:return this._lookahead(0)===F||this._lookahead(0)===K?(b=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},b)):this._lookahead(0)===Ut&&this._lookahead(1)===T?(this._advance(),this._advance(),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[{type:"Identity"},b]}):this._parseMultiselectList();case se:return{type:se};case We:return k=this.expression(J.Expref),{type:"ExpressionReference",children:[k]};case te:for(var B=[];this._lookahead(0)!==A;)this._lookahead(0)===se?(k={type:se},this._advance()):k=this.expression(0),B.push(k);return this._match(A),B[0];default:this._errorToken(d)}},led:function(d,x){var b;switch(d){case m:var k=J.Dot;return this._lookahead(0)!==Ut?(b=this._parseDotRHS(k),{type:"Subexpression",children:[x,b]}):(this._advance(),b=this._parseProjectionRHS(k),{type:"ValueProjection",children:[x,b]});case Fe:return b=this.expression(J.Pipe),{type:Fe,children:[x,b]};case bt:return b=this.expression(J.Or),{type:"OrExpression",children:[x,b]};case Z:return b=this.expression(J.And),{type:"AndExpression",children:[x,b]};case te:for(var L=x.name,B=[],Y,oe;this._lookahead(0)!==A;)this._lookahead(0)===se?(Y={type:se},this._advance()):Y=this.expression(0),this._lookahead(0)===w&&this._match(w),B.push(Y);return this._match(A),oe={type:"Function",name:L,children:B},oe;case Kr:var Qe=this.expression(0);return this._match(T),this._lookahead(0)===At?b={type:"Identity"}:b=this._parseProjectionRHS(J.Filter),{type:"FilterProjection",children:[x,b,Qe]};case At:var er={type:At,children:[x]},ke=this._parseProjectionRHS(J.Flatten);return{type:"Projection",children:[er,ke]};case Cr:case wi:case Sr:case Nt:case Tr:case br:return this._parseComparator(x,d);case I:var G=this._lookaheadToken(0);return G.type===F||G.type===K?(b=this._parseIndexExpression(),this._projectIfSlice(x,b)):(this._match(Ut),this._match(T),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[x,b]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(d){if(this._lookahead(0)===d)this._advance();else{var x=this._lookaheadToken(0),b=new Error("Expected "+d+", got: "+x.type);throw b.name="ParserError",b}},_errorToken:function(d){var x=new Error("Invalid token ("+d.type+'): "'+d.value+'"');throw x.name="ParserError",x},_parseIndexExpression:function(){if(this._lookahead(0)===K||this._lookahead(1)===K)return this._parseSliceExpression();var d={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(T),d},_projectIfSlice:function(d,x){var b={type:"IndexExpression",children:[d,x]};return x.type==="Slice"?{type:"Projection",children:[b,this._parseProjectionRHS(J.Star)]}:b},_parseSliceExpression:function(){for(var d=[null,null,null],x=0,b=this._lookahead(0);b!==T&&x<3;){if(b===K)x++,this._advance();else if(b===F)d[x]=this._lookaheadToken(0).value,this._advance();else{var k=this._lookahead(0),L=new Error("Syntax error, unexpected token: "+k.value+"("+k.type+")");throw L.name="Parsererror",L}b=this._lookahead(0)}return this._match(T),{type:"Slice",children:d}},_parseComparator:function(d,x){var b=this.expression(J[x]);return{type:"Comparator",name:x,children:[d,b]}},_parseDotRHS:function(d){var x=this._lookahead(0),b=[R,_,Ut];if(b.indexOf(x)>=0)return this.expression(d);if(x===I)return this._match(I),this._parseMultiselectList();if(x===q)return this._match(q),this._parseMultiselectHash()},_parseProjectionRHS:function(d){var x;if(J[this._lookahead(0)]<10)x={type:"Identity"};else if(this._lookahead(0)===I)x=this.expression(d);else if(this._lookahead(0)===Kr)x=this.expression(d);else if(this._lookahead(0)===m)this._match(m),x=this._parseDotRHS(d);else{var b=this._lookaheadToken(0),k=new Error("Sytanx error, unexpected token: "+b.value+"("+b.type+")");throw k.name="ParserError",k}return x},_parseMultiselectList:function(){for(var d=[];this._lookahead(0)!==T;){var x=this.expression(0);if(d.push(x),this._lookahead(0)===w&&(this._match(w),this._lookahead(0)===T))throw new Error("Unexpected token Rbracket")}return this._match(T),{type:"MultiSelectList",children:d}},_parseMultiselectHash:function(){for(var d=[],x=[R,_],b,k,L,B;;){if(b=this._lookaheadToken(0),x.indexOf(b.type)<0)throw new Error("Expecting an identifier token, got: "+b.type);if(k=b.value,this._advance(),this._match(K),L=this.expression(0),B={type:"KeyValuePair",name:k,value:L},d.push(B),this._lookahead(0)===w)this._match(w);else if(this._lookahead(0)===X){this._match(X);break}}return{type:"MultiSelectHash",children:d}}};function Ji(d){this.runtime=d}s(Ji,"TreeInterpreter"),Ji.prototype={search:function(d,x){return this.visit(d,x)},visit:function(d,x){var b,k,L,B,Y,oe,Qe,er,ke,G;switch(d.type){case"Field":return x!==null&&r(x)?(oe=x[d.name],oe===void 0?null:oe):null;case"Subexpression":for(L=this.visit(d.children[0],x),G=1;G<d.children.length;G++)if(L=this.visit(d.children[1],L),L===null)return null;return L;case"IndexExpression":return Qe=this.visit(d.children[0],x),er=this.visit(d.children[1],Qe),er;case"Index":if(!e(x))return null;var tr=d.value;return tr<0&&(tr=x.length+tr),L=x[tr],L===void 0&&(L=null),L;case"Slice":if(!e(x))return null;var op=d.children.slice(0),Io=this.computeSliceParams(x.length,op),tu=Io[0],ru=Io[1],Oo=Io[2];if(L=[],Oo>0)for(G=tu;G<ru;G+=Oo)L.push(x[G]);else for(G=tu;G>ru;G+=Oo)L.push(x[G]);return L;case"Projection":var Ot=this.visit(d.children[0],x);if(!e(Ot))return null;for(ke=[],G=0;G<Ot.length;G++)k=this.visit(d.children[1],Ot[G]),k!==null&&ke.push(k);return ke;case"ValueProjection":if(Ot=this.visit(d.children[0],x),!r(Ot))return null;ke=[];var iu=o(Ot);for(G=0;G<iu.length;G++)k=this.visit(d.children[1],iu[G]),k!==null&&ke.push(k);return ke;case"FilterProjection":if(Ot=this.visit(d.children[0],x),!e(Ot))return null;var Ro=[],nu=[];for(G=0;G<Ot.length;G++)b=this.visit(d.children[2],Ot[G]),n(b)||Ro.push(Ot[G]);for(var Do=0;Do<Ro.length;Do++)k=this.visit(d.children[1],Ro[Do]),k!==null&&nu.push(k);return nu;case"Comparator":switch(B=this.visit(d.children[0],x),Y=this.visit(d.children[1],x),d.name){case Cr:L=i(B,Y);break;case wi:L=!i(B,Y);break;case Sr:L=B>Y;break;case Nt:L=B>=Y;break;case Tr:L=B<Y;break;case br:L=B<=Y;break;default:throw new Error("Unknown comparator: "+d.name)}return L;case At:var Po=this.visit(d.children[0],x);if(!e(Po))return null;var fs=[];for(G=0;G<Po.length;G++)k=Po[G],e(k)?fs.push.apply(fs,k):fs.push(k);return fs;case"Identity":return x;case"MultiSelectList":if(x===null)return null;for(ke=[],G=0;G<d.children.length;G++)ke.push(this.visit(d.children[G],x));return ke;case"MultiSelectHash":if(x===null)return null;ke={};var _o;for(G=0;G<d.children.length;G++)_o=d.children[G],ke[_o.name]=this.visit(_o.value,x);return ke;case"OrExpression":return b=this.visit(d.children[0],x),n(b)&&(b=this.visit(d.children[1],x)),b;case"AndExpression":return B=this.visit(d.children[0],x),n(B)===!0?B:this.visit(d.children[1],x);case"NotExpression":return B=this.visit(d.children[0],x),n(B);case"Literal":return d.value;case Fe:return Qe=this.visit(d.children[0],x),this.visit(d.children[1],Qe);case se:return x;case"Function":var su=[];for(G=0;G<d.children.length;G++)su.push(this.visit(d.children[G],x));return this.runtime.callFunction(d.name,su);case"ExpressionReference":var ou=d.children[0];return ou.jmespathType=We,ou;default:throw new Error("Unknown node type: "+d.type)}},computeSliceParams:function(d,x){var b=x[0],k=x[1],L=x[2],B=[null,null,null];if(L===null)L=1;else if(L===0){var Y=new Error("Invalid slice, step cannot be 0");throw Y.name="RuntimeError",Y}var oe=L<0;return b===null?b=oe?d-1:0:b=this.capSliceRange(d,b,L),k===null?k=oe?-1:d:k=this.capSliceRange(d,k,L),B[0]=b,B[1]=k,B[2]=L,B},capSliceRange:function(d,x,b){return x<0?(x+=d,x<0&&(x=b<0?-1:0)):x>=d&&(x=b<0?d-1:d),x}};function eu(d){this._interpreter=d,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[D]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[y,v]},{types:[h]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[y]},{types:[y]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[y,v,S]}]},map:{_func:this._functionMap,_signature:[{types:[g]},{types:[v]}]},max:{_func:this._functionMax,_signature:[{types:[D,E]}]},merge:{_func:this._functionMerge,_signature:[{types:[S],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[v]},{types:[g]}]},sum:{_func:this._functionSum,_signature:[{types:[D]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[y]},{types:[y]}]},min:{_func:this._functionMin,_signature:[{types:[D,E]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[v]},{types:[g]}]},type:{_func:this._functionType,_signature:[{types:[h]}]},keys:{_func:this._functionKeys,_signature:[{types:[S]}]},values:{_func:this._functionValues,_signature:[{types:[S]}]},sort:{_func:this._functionSort,_signature:[{types:[E,D]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[v]},{types:[g]}]},join:{_func:this._functionJoin,_signature:[{types:[y]},{types:[E]}]},reverse:{_func:this._functionReverse,_signature:[{types:[y,v]}]},to_array:{_func:this._functionToArray,_signature:[{types:[h]}]},to_string:{_func:this._functionToString,_signature:[{types:[h]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[h]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[h],variadic:!0}]}}}s(eu,"Runtime"),eu.prototype={callFunction:function(d,x){var b=this.functionTable[d];if(b===void 0)throw new Error("Unknown function: "+d+"()");return this._validateArgs(d,x,b._signature),b._func.call(this,x)},_validateArgs:function(d,x,b){var k;if(b[b.length-1].variadic){if(x.length<b.length)throw k=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes at least"+b.length+k+" but received "+x.length)}else if(x.length!==b.length)throw k=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes "+b.length+k+" but received "+x.length);for(var L,B,Y,oe=0;oe<b.length;oe++){Y=!1,L=b[oe].types,B=this._getTypeName(x[oe]);for(var Qe=0;Qe<L.length;Qe++)if(this._typeMatches(B,L[Qe],x[oe])){Y=!0;break}if(!Y){var er=L.map(function(ke){return p[ke]}).join(",");throw new Error("TypeError: "+d+"() expected argument "+(oe+1)+" to be type "+er+" but received type "+p[B]+" instead.")}}},_typeMatches:function(d,x,b){if(x===h)return!0;if(x===E||x===D||x===v){if(x===v)return d===v;if(d===v){var k;x===D?k=l:x===E&&(k=y);for(var L=0;L<b.length;L++)if(!this._typeMatches(this._getTypeName(b[L]),k,b[L]))return!1;return!0}}else return d===x},_getTypeName:function(d){switch(Object.prototype.toString.call(d)){case"[object String]":return y;case"[object Number]":return l;case"[object Array]":return v;case"[object Boolean]":return O;case"[object Null]":return N;case"[object Object]":return d.jmespathType===We?g:S}},_functionStartsWith:function(d){return d[0].lastIndexOf(d[1])===0},_functionEndsWith:function(d){var x=d[0],b=d[1];return x.indexOf(b,x.length-b.length)!==-1},_functionReverse:function(d){var x=this._getTypeName(d[0]);if(x===y){for(var b=d[0],k="",L=b.length-1;L>=0;L--)k+=b[L];return k}else{var B=d[0].slice(0);return B.reverse(),B}},_functionAbs:function(d){return Math.abs(d[0])},_functionCeil:function(d){return Math.ceil(d[0])},_functionAvg:function(d){for(var x=0,b=d[0],k=0;k<b.length;k++)x+=b[k];return x/b.length},_functionContains:function(d){return d[0].indexOf(d[1])>=0},_functionFloor:function(d){return Math.floor(d[0])},_functionLength:function(d){return r(d[0])?Object.keys(d[0]).length:d[0].length},_functionMap:function(d){for(var x=[],b=this._interpreter,k=d[0],L=d[1],B=0;B<L.length;B++)x.push(b.visit(k,L[B]));return x},_functionMerge:function(d){for(var x={},b=0;b<d.length;b++){var k=d[b];for(var L in k)x[L]=k[L]}return x},_functionMax:function(d){if(d[0].length>0){var x=this._getTypeName(d[0][0]);if(x===l)return Math.max.apply(Math,d[0]);for(var b=d[0],k=b[0],L=1;L<b.length;L++)k.localeCompare(b[L])<0&&(k=b[L]);return k}else return null},_functionMin:function(d){if(d[0].length>0){var x=this._getTypeName(d[0][0]);if(x===l)return Math.min.apply(Math,d[0]);for(var b=d[0],k=b[0],L=1;L<b.length;L++)b[L].localeCompare(k)<0&&(k=b[L]);return k}else return null},_functionSum:function(d){for(var x=0,b=d[0],k=0;k<b.length;k++)x+=b[k];return x},_functionType:function(d){switch(this._getTypeName(d[0])){case l:return"number";case y:return"string";case v:return"array";case S:return"object";case O:return"boolean";case g:return"expref";case N:return"null"}},_functionKeys:function(d){return Object.keys(d[0])},_functionValues:function(d){for(var x=d[0],b=Object.keys(x),k=[],L=0;L<b.length;L++)k.push(x[b[L]]);return k},_functionJoin:function(d){var x=d[0],b=d[1];return b.join(x)},_functionToArray:function(d){return this._getTypeName(d[0])===v?d[0]:[d[0]]},_functionToString:function(d){return this._getTypeName(d[0])===y?d[0]:JSON.stringify(d[0])},_functionToNumber:function(d){var x=this._getTypeName(d[0]),b;return x===l?d[0]:x===y&&(b=+d[0],!isNaN(b))?b:null},_functionNotNull:function(d){for(var x=0;x<d.length;x++)if(this._getTypeName(d[x])!==N)return d[x];return null},_functionSort:function(d){var x=d[0].slice(0);return x.sort(),x},_functionSortBy:function(d){var x=d[0].slice(0);if(x.length===0)return x;var b=this._interpreter,k=d[1],L=this._getTypeName(b.visit(k,x[0]));if([l,y].indexOf(L)<0)throw new Error("TypeError");for(var B=this,Y=[],oe=0;oe<x.length;oe++)Y.push([oe,x[oe]]);Y.sort(function(er,ke){var G=b.visit(k,er[1]),tr=b.visit(k,ke[1]);if(B._getTypeName(G)!==L)throw new Error("TypeError: expected "+L+", received "+B._getTypeName(G));if(B._getTypeName(tr)!==L)throw new Error("TypeError: expected "+L+", received "+B._getTypeName(tr));return G>tr?1:G<tr?-1:er[0]-ke[0]});for(var Qe=0;Qe<Y.length;Qe++)x[Qe]=Y[Qe][1];return x},_functionMaxBy:function(d){for(var x=d[1],b=d[0],k=this.createKeyFunction(x,[l,y]),L=-1/0,B,Y,oe=0;oe<b.length;oe++)Y=k(b[oe]),Y>L&&(L=Y,B=b[oe]);return B},_functionMinBy:function(d){for(var x=d[1],b=d[0],k=this.createKeyFunction(x,[l,y]),L=1/0,B,Y,oe=0;oe<b.length;oe++)Y=k(b[oe]),Y<L&&(L=Y,B=b[oe]);return B},createKeyFunction:function(d,x){var b=this,k=this._interpreter,L=s(function(B){var Y=k.visit(d,B);if(x.indexOf(b._getTypeName(Y))<0){var oe="TypeError: expected one of "+x+", received "+b._getTypeName(Y);throw new Error(oe)}return Y},"keyFunc");return L}};function ip(d){var x=new Xr,b=x.parse(d);return b}s(ip,"compile");function np(d){var x=new Gi;return x.tokenize(d)}s(np,"tokenize");function sp(d,x){var b=new Xr,k=new eu,L=new Ji(k);k._interpreter=L;var B=b.parse(x);return L.search(B,d)}s(sp,"search"),t.tokenize=np,t.compile=ip,t.search=sp,t.strictDeepEqual=i})(typeof Ys>"u"?Ys.jmespath={}:Ys)});var xl=P(()=>{var ce=V(),wl=Nl(),qy=ce.util.inherit,Zs=ce.util.domain,Ly=Qs(),My={success:1,error:1,complete:1};function Fy(t){return Object.prototype.hasOwnProperty.call(My,t._asm.currentState)}s(Fy,"isTerminalState");var Aa=new wl;Aa.setupStates=function(){var t=s(function(e,r){var i=this;i._haltHandlersOnError=!1,i.emit(i._asm.currentState,function(n){if(n)if(Fy(i))if(Zs&&i.domain instanceof Zs.Domain)n.domainEmitter=i,n.domain=i.domain,n.domainThrown=!1,i.domain.emit("error",n);else throw n;else i.response.error=n,r(n);else r(i.response.error)})},"transition");this.addState("validate","build","error",t),this.addState("build","afterBuild","restart",t),this.addState("afterBuild","sign","restart",t),this.addState("sign","send","retry",t),this.addState("retry","afterRetry","afterRetry",t),this.addState("afterRetry","sign","error",t),this.addState("send","validateResponse","retry",t),this.addState("validateResponse","extractData","extractError",t),this.addState("extractError","extractData","retry",t),this.addState("extractData","success","retry",t),this.addState("restart","build","error",t),this.addState("success","complete","complete",t),this.addState("error","complete","complete",t),this.addState("complete",null,null,t)};Aa.setupStates();ce.Request=qy({constructor:s(function(e,r,i){var n=e.endpoint,o=e.config.region,a=e.config.customUserAgent;e.signingRegion?o=e.signingRegion:e.isGlobalEndpoint&&(o="us-east-1"),this.domain=Zs&&Zs.active,this.service=e,this.operation=r,this.params=i||{},this.httpRequest=new ce.HttpRequest(n,o),this.httpRequest.appendToUserAgent(a),this.startTime=e.getSkewCorrectedDate(),this.response=new ce.Response(this),this._asm=new wl(Aa.states,"validate"),this._haltHandlersOnError=!1,ce.SequentialExecutor.call(this),this.emit=this.emitEvent},"Request"),send:s(function(e){return e&&(this.httpRequest.appendToUserAgent("callback"),this.on("complete",function(r){e.call(r,r.error,r.data)})),this.runTo(),this.response},"send"),build:s(function(e){return this.runTo("send",e)},"build"),runTo:s(function(e,r){return this._asm.runTo(e,r,this),this},"runTo"),abort:s(function(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",s(function(r){r.error=ce.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1})},"addAbortedError")),this.httpRequest.stream&&!this.httpRequest.stream.didCallback&&(this.httpRequest.stream.abort(),this.httpRequest._abortCallback?this.httpRequest._abortCallback():this.removeAllListeners("send")),this},"abort"),eachPage:s(function(e){e=ce.util.fn.makeAsync(e,3);function r(i){e.call(i,i.error,i.data,function(n){n!==!1&&(i.hasNextPage()?i.nextPage().on("complete",r).send():e.call(i,null,null,ce.util.fn.noop))})}s(r,"wrappedCallback"),this.on("complete",r).send()},"eachPage"),eachItem:s(function(e){var r=this;function i(n,o){if(n)return e(n,null);if(o===null)return e(null,null);var a=r.service.paginationConfig(r.operation),u=a.resultKey;Array.isArray(u)&&(u=u[0]);var l=Ly.search(o,u),h=!0;return ce.util.arrayEach(l,function(y){if(h=e(null,y),h===!1)return ce.util.abort}),h}s(i,"wrappedCallback"),this.eachPage(i)},"eachItem"),isPageable:s(function(){return!!this.service.paginationConfig(this.operation)},"isPageable"),createReadStream:s(function(){var e=ce.util.stream,r=this,i=null;return ce.HttpClient.streamsApiVersion===2?(i=new e.PassThrough,process.nextTick(function(){r.send()})):(i=new e.Stream,i.readable=!0,i.sent=!1,i.on("newListener",function(n){!i.sent&&n==="data"&&(i.sent=!0,process.nextTick(function(){r.send()}))})),this.on("error",function(n){i.emit("error",n)}),this.on("httpHeaders",s(function(o,a,u){if(o<300){r.removeListener("httpData",ce.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",ce.EventListeners.Core.HTTP_ERROR),r.on("httpError",s(function(N){u.error=N,u.error.retryable=!1},"streamHttpError"));var l=!1,h;if(r.httpRequest.method!=="HEAD"&&(h=parseInt(a["content-length"],10)),h!==void 0&&!isNaN(h)&&h>=0){l=!0;var y=0}var v=s(function(){l&&y!==h?i.emit("error",ce.util.error(new Error("Stream content length mismatch. Received "+y+" of "+h+" bytes."),{code:"StreamContentLengthMismatch"})):ce.HttpClient.streamsApiVersion===2?i.end():i.emit("end")},"checkContentLengthAndEmit"),S=u.httpResponse.createUnbufferedStream();if(ce.HttpClient.streamsApiVersion===2)if(l){var O=new e.PassThrough;O._write=function(g){return g&&g.length&&(y+=g.length),e.PassThrough.prototype._write.apply(this,arguments)},O.on("end",v),i.on("error",function(g){l=!1,S.unpipe(O),O.emit("end"),O.end()}),S.pipe(O).pipe(i,{end:!1})}else S.pipe(i);else l&&S.on("data",function(g){g&&g.length&&(y+=g.length)}),S.on("data",function(g){i.emit("data",g)}),S.on("end",v);S.on("error",function(g){l=!1,i.emit("error",g)})}},"streamHeaders")),i},"createReadStream"),emitEvent:s(function(e,r,i){typeof r=="function"&&(i=r,r=null),i||(i=s(function(){},"done")),r||(r=this.eventParameters(e,this.response));var n=ce.SequentialExecutor.prototype.emit;n.call(this,e,r,function(o){o&&(this.response.error=o),i.call(this,o)})},"emit"),eventParameters:s(function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},"eventParameters"),presign:s(function(e,r){return!r&&typeof e=="function"&&(r=e,e=null),new ce.Signers.Presign().sign(this.toGet(),e,r)},"presign"),isPresigned:s(function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},"isPresigned"),toUnauthenticated:s(function(){return this._unAuthenticated=!0,this.removeListener("validate",ce.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",ce.EventListeners.Core.SIGN),this},"toUnauthenticated"),toGet:s(function(){return(this.service.api.protocol==="query"||this.service.api.protocol==="ec2")&&(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},"toGet"),buildAsGet:s(function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},"buildAsGet"),haltHandlersOnError:s(function(){this._haltHandlersOnError=!0},"haltHandlersOnError")});ce.Request.addPromisesToClass=s(function(e){this.prototype.promise=s(function(){var i=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(n,o){i.on("complete",function(a){a.error?o(a.error):n(Object.defineProperty(a.data||{},"$response",{value:a}))}),i.runTo()})},"promise")},"addPromisesToClass");ce.Request.deletePromisesFromClass=s(function(){delete this.prototype.promise},"deletePromisesFromClass");ce.util.addPromises(ce.Request);ce.util.mixin(ce.Request,ce.SequentialExecutor)});var Cl=P(()=>{var Vn=V(),Wy=Vn.util.inherit,El=Qs();Vn.Response=Wy({constructor:s(function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new Vn.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},"Response"),nextPage:s(function(e){var r,i=this.request.service,n=this.request.operation;try{r=i.paginationConfig(n,!0)}catch(l){this.error=l}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var o=Vn.util.copy(this.request.params);if(this.nextPageTokens){var a=r.inputToken;typeof a=="string"&&(a=[a]);for(var u=0;u<a.length;u++)o[a[u]]=this.nextPageTokens[u];return i.makeRequest(this.request.operation,o,e)}else return e?e(null,null):null},"nextPage"),hasNextPage:s(function(){if(this.cacheNextPageTokens(),this.nextPageTokens)return!0;if(this.nextPageTokens!==void 0)return!1},"hasNextPage"),cacheNextPageTokens:s(function(){if(Object.prototype.hasOwnProperty.call(this,"nextPageTokens"))return this.nextPageTokens;this.nextPageTokens=void 0;var e=this.request.service.paginationConfig(this.request.operation);if(!e)return this.nextPageTokens;if(this.nextPageTokens=null,e.moreResults&&!El.search(this.data,e.moreResults))return this.nextPageTokens;var r=e.outputToken;return typeof r=="string"&&(r=[r]),Vn.util.arrayEach.call(this,r,function(i){var n=El.search(this.data,i);n&&(this.nextPageTokens=this.nextPageTokens||[],this.nextPageTokens.push(n))}),this.nextPageTokens},"cacheNextPageTokens")})});var Tl=P(()=>{var fi=V(),By=fi.util.inherit,Hi=Qs();function Sl(t){var e=t.request._waiter,r=e.config.acceptors,i=!1,n="retry";r.forEach(function(o){if(!i){var a=e.matchers[o.matcher];a&&a(t,o.expected,o.argument)&&(i=!0,n=o.state)}}),!i&&t.error&&(n="failure"),n==="success"?e.setSuccess(t):e.setError(t,n==="retry")}s(Sl,"CHECK_ACCEPTORS");fi.ResourceWaiter=By({constructor:s(function(e,r){this.service=e,this.state=r,this.loadWaiterConfig(this.state)},"constructor"),service:null,state:null,config:null,matchers:{path:function(t,e,r){try{var i=Hi.search(t.data,r)}catch{return!1}return Hi.strictDeepEqual(i,e)},pathAll:function(t,e,r){try{var i=Hi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);var n=i.length;if(!n)return!1;for(var o=0;o<n;o++)if(!Hi.strictDeepEqual(i[o],e))return!1;return!0},pathAny:function(t,e,r){try{var i=Hi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);for(var n=i.length,o=0;o<n;o++)if(Hi.strictDeepEqual(i[o],e))return!0;return!1},status:function(t,e){var r=t.httpResponse.statusCode;return typeof r=="number"&&r===e},error:function(t,e){return typeof e=="string"&&t.error?e===t.error.code:e===!!t.error}},listeners:new fi.SequentialExecutor().addNamedListeners(function(t){t("RETRY_CHECK","retry",function(e){var r=e.request._waiter;e.error&&e.error.code==="ResourceNotReady"&&(e.error.retryDelay=(r.config.delay||0)*1e3)}),t("CHECK_OUTPUT","extractData",Sl),t("CHECK_ERROR","extractError",Sl)}),wait:s(function(e,r){typeof e=="function"&&(r=e,e=void 0),e&&e.$waiter&&(e=fi.util.copy(e),typeof e.$waiter.delay=="number"&&(this.config.delay=e.$waiter.delay),typeof e.$waiter.maxAttempts=="number"&&(this.config.maxAttempts=e.$waiter.maxAttempts),delete e.$waiter);var i=this.service.makeRequest(this.config.operation,e);return i._waiter=this,i.response.maxRetries=this.config.maxAttempts,i.addListeners(this.listeners),r&&i.send(r),i},"wait"),setSuccess:s(function(e){e.error=null,e.data=e.data||{},e.request.removeAllListeners("extractData")},"setSuccess"),setError:s(function(e,r){e.data=null,e.error=fi.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:r})},"setError"),loadWaiterConfig:s(function(e){if(!this.service.api.waiters[e])throw new fi.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."});this.config=fi.util.copy(this.service.api.waiters[e])},"loadWaiterConfig")})});var Al=P((hq,bl)=>{var Nr=V(),Uy=Nr.util.inherit;Nr.Signers.V2=Uy(Nr.Signers.RequestSigner,{addAuthorization:s(function(e,r){r||(r=Nr.util.date.getDate());var i=this.request;i.params.Timestamp=Nr.util.date.iso8601(r),i.params.SignatureVersion="2",i.params.SignatureMethod="HmacSHA256",i.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(i.params.SecurityToken=e.sessionToken),delete i.params.Signature,i.params.Signature=this.signature(e),i.body=Nr.util.queryParamsToString(i.params),i.headers["Content-Length"]=i.body.length},"addAuthorization"),signature:s(function(e){return Nr.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:s(function(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(Nr.util.queryParamsToString(this.request.params)),e.join(`
|
|
3
|
+
`)},"stringToSign")});bl.exports=Nr.Signers.V2});var Ia=P((mq,Il)=>{var $t=V(),Vy=$t.util.inherit;$t.Signers.V3=Vy($t.Signers.RequestSigner,{addAuthorization:s(function(e,r){var i=$t.util.date.rfc822(r);this.request.headers["X-Amz-Date"]=i,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken),this.request.headers["X-Amzn-Authorization"]=this.authorization(e,i)},"addAuthorization"),authorization:s(function(e){return"AWS3 AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,SignedHeaders="+this.signedHeaders()+",Signature="+this.signature(e)},"authorization"),signedHeaders:s(function(){var e=[];return $t.util.arrayEach(this.headersToSign(),s(function(i){e.push(i.toLowerCase())},"iterator")),e.sort().join(";")},"signedHeaders"),canonicalHeaders:s(function(){var e=this.request.headers,r=[];return $t.util.arrayEach(this.headersToSign(),s(function(n){r.push(n.toLowerCase().trim()+":"+String(e[n]).trim())},"iterator")),r.sort().join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`},"canonicalHeaders"),headersToSign:
|
|
6
|
-
`))},"stringToSign")});
|
|
7
|
-
`)},"stringToSign"),canonicalString:
|
|
5
|
+
`},"canonicalHeaders"),headersToSign:s(function(){var e=[];return $t.util.each(this.request.headers,s(function(i){(i==="Host"||i==="Content-Encoding"||i.match(/^X-Amz/i))&&e.push(i)},"iterator")),e},"headersToSign"),signature:s(function(e){return $t.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:s(function(){var e=[];return e.push(this.request.method),e.push("/"),e.push(""),e.push(this.canonicalHeaders()),e.push(this.request.body),$t.util.crypto.sha256(e.join(`
|
|
6
|
+
`))},"stringToSign")});Il.exports=$t.Signers.V3});var Rl=P((vq,Ol)=>{var eo=V(),zy=eo.util.inherit;Ia();eo.Signers.V3Https=zy(eo.Signers.V3,{authorization:s(function(e){return"AWS3-HTTPS AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,Signature="+this.signature(e)},"authorization"),stringToSign:s(function(){return this.request.headers["X-Amz-Date"]},"stringToSign")});Ol.exports=eo.Signers.V3Https});var _l=P((Nq,Pl)=>{var zn=V(),Hn={},to=[],Hy=50,Dl="aws4_request";Pl.exports={createScope:s(function(e,r,i){return[e.substr(0,8),r,i,Dl].join("/")},"createScope"),getSigningKey:s(function(e,r,i,n,o){var a=zn.util.crypto.hmac(e.secretAccessKey,e.accessKeyId,"base64"),u=[a,r,i,n].join("_");if(o=o!==!1,o&&u in Hn)return Hn[u];var l=zn.util.crypto.hmac("AWS4"+e.secretAccessKey,r,"buffer"),h=zn.util.crypto.hmac(l,i,"buffer"),y=zn.util.crypto.hmac(h,n,"buffer"),v=zn.util.crypto.hmac(y,Dl,"buffer");return o&&(Hn[u]=v,to.push(u),to.length>Hy&&delete Hn[to.shift()]),v},"getSigningKey"),emptyCache:s(function(){Hn={},to=[]},"emptyCache")}});var Ll=P((xq,ql)=>{var nt=V(),kl=_l(),jy=nt.util.inherit,ro="presigned-expires";nt.Signers.V4=jy(nt.Signers.RequestSigner,{constructor:s(function(e,r,i){nt.Signers.RequestSigner.call(this,e),this.serviceName=r,i=i||{},this.signatureCache=typeof i.signatureCache=="boolean"?i.signatureCache:!0,this.operation=i.operation,this.signatureVersion=i.signatureVersion},"V4"),algorithm:"AWS4-HMAC-SHA256",addAuthorization:s(function(e,r){var i=nt.util.date.iso8601(r).replace(/[:\-]|\.\d{3}/g,"");this.isPresigned()?this.updateForPresigned(e,i):this.addHeaders(e,i),this.request.headers.Authorization=this.authorization(e,i)},"addAuthorization"),addHeaders:s(function(e,r){this.request.headers["X-Amz-Date"]=r,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken)},"addHeaders"),updateForPresigned:s(function(e,r){var i=this.credentialString(r),n={"X-Amz-Date":r,"X-Amz-Algorithm":this.algorithm,"X-Amz-Credential":e.accessKeyId+"/"+i,"X-Amz-Expires":this.request.headers[ro],"X-Amz-SignedHeaders":this.signedHeaders()};e.sessionToken&&(n["X-Amz-Security-Token"]=e.sessionToken),this.request.headers["Content-Type"]&&(n["Content-Type"]=this.request.headers["Content-Type"]),this.request.headers["Content-MD5"]&&(n["Content-MD5"]=this.request.headers["Content-MD5"]),this.request.headers["Cache-Control"]&&(n["Cache-Control"]=this.request.headers["Cache-Control"]),nt.util.each.call(this,this.request.headers,function(a,u){if(a!==ro&&this.isSignableHeader(a)){var l=a.toLowerCase();l.indexOf("x-amz-meta-")===0?n[l]=u:l.indexOf("x-amz-")===0&&(n[a]=u)}});var o=this.request.path.indexOf("?")>=0?"&":"?";this.request.path+=o+nt.util.queryParamsToString(n)},"updateForPresigned"),authorization:s(function(e,r){var i=[],n=this.credentialString(r);return i.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n),i.push("SignedHeaders="+this.signedHeaders()),i.push("Signature="+this.signature(e,r)),i.join(", ")},"authorization"),signature:s(function(e,r){var i=kl.getSigningKey(e,r.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return nt.util.crypto.hmac(i,this.stringToSign(r),"hex")},"signature"),stringToSign:s(function(e){var r=[];return r.push("AWS4-HMAC-SHA256"),r.push(e),r.push(this.credentialString(e)),r.push(this.hexEncodedHash(this.canonicalString())),r.join(`
|
|
7
|
+
`)},"stringToSign"),canonicalString:s(function(){var e=[],r=this.request.pathname();return this.serviceName!=="s3"&&this.signatureVersion!=="s3v4"&&(r=nt.util.uriEscapePath(r)),e.push(this.request.method),e.push(r),e.push(this.request.search()),e.push(this.canonicalHeaders()+`
|
|
8
8
|
`),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join(`
|
|
9
|
-
`)},"canonicalString"),canonicalHeaders:
|
|
10
|
-
`)},"canonicalHeaders"),canonicalHeaderValues:
|
|
11
|
-
`)},"stringToSign"),canonicalizedAmzHeaders:
|
|
12
|
-
`)},"canonicalizedAmzHeaders"),canonicalizedResource:
|
|
9
|
+
`)},"canonicalString"),canonicalHeaders:s(function(){var e=[];nt.util.each.call(this,this.request.headers,function(i,n){e.push([i,n])}),e.sort(function(i,n){return i[0].toLowerCase()<n[0].toLowerCase()?-1:1});var r=[];return nt.util.arrayEach.call(this,e,function(i){var n=i[0].toLowerCase();if(this.isSignableHeader(n)){var o=i[1];if(typeof o>"u"||o===null||typeof o.toString!="function")throw nt.util.error(new Error("Header "+n+" contains invalid value"),{code:"InvalidHeader"});r.push(n+":"+this.canonicalHeaderValues(o.toString()))}}),r.join(`
|
|
10
|
+
`)},"canonicalHeaders"),canonicalHeaderValues:s(function(e){return e.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")},"canonicalHeaderValues"),signedHeaders:s(function(){var e=[];return nt.util.each.call(this,this.request.headers,function(r){r=r.toLowerCase(),this.isSignableHeader(r)&&e.push(r)}),e.sort().join(";")},"signedHeaders"),credentialString:s(function(e){return kl.createScope(e.substr(0,8),this.request.region,this.serviceName)},"credentialString"),hexEncodedHash:s(function(e){return nt.util.crypto.sha256(e,"hex")},"hash"),hexEncodedBodyHash:s(function(){var e=this.request;return this.isPresigned()&&["s3","s3-object-lambda"].indexOf(this.serviceName)>-1&&!e.body?"UNSIGNED-PAYLOAD":e.headers["X-Amz-Content-Sha256"]?e.headers["X-Amz-Content-Sha256"]:this.hexEncodedHash(this.request.body||"")},"hexEncodedBodyHash"),unsignableHeaders:["authorization","content-type","content-length","user-agent",ro,"expect","x-amzn-trace-id"],isSignableHeader:s(function(e){return e.toLowerCase().indexOf("x-amz-")===0?!0:this.unsignableHeaders.indexOf(e)<0},"isSignableHeader"),isPresigned:s(function(){return!!this.request.headers[ro]},"isPresigned")});ql.exports=nt.Signers.V4});var Fl=P((Cq,Ml)=>{var Yt=V(),Ky=Yt.util.inherit;Yt.Signers.S3=Ky(Yt.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,analytics:1,cors:1,lifecycle:1,delete:1,inventory:1,location:1,logging:1,metrics:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:s(function(e,r){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=Yt.util.date.rfc822(r)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var i=this.sign(e.secretAccessKey,this.stringToSign()),n="AWS "+e.accessKeyId+":"+i;this.request.headers.Authorization=n},"addAuthorization"),stringToSign:s(function(){var e=this.request,r=[];r.push(e.method),r.push(e.headers["Content-MD5"]||""),r.push(e.headers["Content-Type"]||""),r.push(e.headers["presigned-expires"]||"");var i=this.canonicalizedAmzHeaders();return i&&r.push(i),r.push(this.canonicalizedResource()),r.join(`
|
|
11
|
+
`)},"stringToSign"),canonicalizedAmzHeaders:s(function(){var e=[];Yt.util.each(this.request.headers,function(i){i.match(/^x-amz-/i)&&e.push(i)}),e.sort(function(i,n){return i.toLowerCase()<n.toLowerCase()?-1:1});var r=[];return Yt.util.arrayEach.call(this,e,function(i){r.push(i.toLowerCase()+":"+String(this.request.headers[i]))}),r.join(`
|
|
12
|
+
`)},"canonicalizedAmzHeaders"),canonicalizedResource:s(function(){var e=this.request,r=e.path.split("?"),i=r[0],n=r[1],o="";if(e.virtualHostedBucket&&(o+="/"+e.virtualHostedBucket),o+=i,n){var a=[];Yt.util.arrayEach.call(this,n.split("&"),function(u){var l=u.split("=")[0],h=u.split("=")[1];if(this.subResources[l]||this.responseHeaders[l]){var y={name:l};h!==void 0&&(this.subResources[l]?y.value=h:y.value=decodeURIComponent(h)),a.push(y)}}),a.sort(function(u,l){return u.name<l.name?-1:1}),a.length&&(n=[],Yt.util.arrayEach(a,function(u){u.value===void 0?n.push(u.name):n.push(u.name+"="+u.value)}),o+="?"+n.join("&"))}return o},"canonicalizedResource"),sign:s(function(e,r){return Yt.util.crypto.hmac(e,r,"base64","sha1")},"sign")});Ml.exports=Yt.Signers.S3});var Bl=P((Tq,Wl)=>{var Ke=V(),Xy=Ke.util.inherit,ji="presigned-expires";function Gy(t){var e=t.httpRequest.headers[ji],r=t.service.getSignerClass(t);if(delete t.httpRequest.headers["User-Agent"],delete t.httpRequest.headers["X-Amz-User-Agent"],r===Ke.Signers.V4){if(e>604800){var i="Presigning does not support expiry time greater than a week with SigV4 signing.";throw Ke.util.error(new Error,{code:"InvalidExpiryTime",message:i,retryable:!1})}t.httpRequest.headers[ji]=e}else if(r===Ke.Signers.S3){var n=t.service?t.service.getSkewCorrectedDate():Ke.util.date.getDate();t.httpRequest.headers[ji]=parseInt(Ke.util.date.unixTimestamp(n)+e,10).toString()}else throw Ke.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1})}s(Gy,"signedUrlBuilder");function Jy(t){var e=t.httpRequest.endpoint,r=Ke.util.urlParse(t.httpRequest.path),i={};r.search&&(i=Ke.util.queryStringParse(r.search.substr(1)));var n=t.httpRequest.headers.Authorization.split(" ");if(n[0]==="AWS")n=n[1].split(":"),i.Signature=n.pop(),i.AWSAccessKeyId=n.join(":"),Ke.util.each(t.httpRequest.headers,function(u,l){u===ji&&(u="Expires"),u.indexOf("x-amz-meta-")===0&&(delete i[u],u=u.toLowerCase()),i[u]=l}),delete t.httpRequest.headers[ji],delete i.Authorization,delete i.Host;else if(n[0]==="AWS4-HMAC-SHA256"){n.shift();var o=n.join(" "),a=o.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}e.pathname=r.pathname,e.search=Ke.util.queryParamsToString(i)}s(Jy,"signedUrlSigner");Ke.Signers.Presign=Xy({sign:s(function(e,r,i){if(e.httpRequest.headers[ji]=r||3600,e.on("build",Gy),e.on("sign",Jy),e.removeListener("afterBuild",Ke.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",Ke.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),i)e.build(function(){this.response.error?i(this.response.error):i(null,Ke.util.urlFormat(e.httpRequest.endpoint))});else{if(e.build(),e.response.error)throw e.response.error;return Ke.util.urlFormat(e.httpRequest.endpoint)}},"sign")});Wl.exports=Ke.Signers.Presign});var Ul=P(()=>{var io=V();io.Signers.Bearer=io.util.inherit(io.Signers.RequestSigner,{constructor:s(function(e){io.Signers.RequestSigner.call(this,e)},"Bearer"),addAuthorization:s(function(e){this.request.headers.Authorization="Bearer "+e.token},"addAuthorization")})});var Vl=P(()=>{var Qt=V(),$y=Qt.util.inherit;Qt.Signers.RequestSigner=$y({constructor:s(function(e){this.request=e},"RequestSigner"),setServiceClientId:s(function(e){this.serviceClientId=e},"setServiceClientId"),getServiceClientId:s(function(){return this.serviceClientId},"getServiceClientId")});Qt.Signers.RequestSigner.getVersion=s(function(e){switch(e){case"v2":return Qt.Signers.V2;case"v3":return Qt.Signers.V3;case"s3v4":return Qt.Signers.V4;case"v4":return Qt.Signers.V4;case"s3":return Qt.Signers.S3;case"v3https":return Qt.Signers.V3Https;case"bearer":return Qt.Signers.Bearer}throw new Error("Unknown signing version "+e)},"getVersion");Al();Ia();Rl();Ll();Fl();Bl();Ul()});var zl=P(()=>{var Mt=V();Mt.ParamValidator=Mt.util.inherit({constructor:s(function(e){(e===!0||e===void 0)&&(e={min:!0}),this.validation=e},"ParamValidator"),validate:s(function(e,r,i){if(this.errors=[],this.validateMember(e,r||{},i||"params"),this.errors.length>1){var n=this.errors.join(`
|
|
13
13
|
* `);throw n="There were "+this.errors.length+` validation errors:
|
|
14
|
-
* `+n,Mt.util.error(new Error(n),{code:"MultipleValidationErrors",errors:this.errors})}else{if(this.errors.length===1)throw this.errors[0];return!0}},"validate"),fail:
|
|
14
|
+
* `+n,Mt.util.error(new Error(n),{code:"MultipleValidationErrors",errors:this.errors})}else{if(this.errors.length===1)throw this.errors[0];return!0}},"validate"),fail:s(function(e,r){this.errors.push(Mt.util.error(new Error(r),{code:e}))},"fail"),validateStructure:s(function(e,r,i){if(e.isDocument)return!0;this.validateType(r,i,["object"],"structure");for(var n,o=0;e.required&&o<e.required.length;o++){n=e.required[o];var a=r[n];a==null&&this.fail("MissingRequiredParameter","Missing required key '"+n+"' in "+i)}for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var u=r[n],l=e.members[n];if(l!==void 0){var h=[i,n].join(".");this.validateMember(l,u,h)}else u!=null&&this.fail("UnexpectedParameter","Unexpected key '"+n+"' found in "+i)}return!0},"validateStructure"),validateMember:s(function(e,r,i){switch(e.type){case"structure":return this.validateStructure(e,r,i);case"list":return this.validateList(e,r,i);case"map":return this.validateMap(e,r,i);default:return this.validateScalar(e,r,i)}},"validateMember"),validateList:s(function(e,r,i){if(this.validateType(r,i,[Array])){this.validateRange(e,r.length,i,"list member count");for(var n=0;n<r.length;n++)this.validateMember(e.member,r[n],i+"["+n+"]")}},"validateList"),validateMap:s(function(e,r,i){if(this.validateType(r,i,["object"],"map")){var n=0;for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this.validateMember(e.key,o,i+"[key='"+o+"']"),this.validateMember(e.value,r[o],i+"['"+o+"']"),n++);this.validateRange(e,n,i,"map member count")}},"validateMap"),validateScalar:s(function(e,r,i){switch(e.type){case null:case void 0:case"string":return this.validateString(e,r,i);case"base64":case"binary":return this.validatePayload(r,i);case"integer":case"float":return this.validateNumber(e,r,i);case"boolean":return this.validateType(r,i,["boolean"]);case"timestamp":return this.validateType(r,i,[Date,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,"number"],"Date object, ISO-8601 string, or a UNIX timestamp");default:return this.fail("UnkownType","Unhandled type "+e.type+" for "+i)}},"validateScalar"),validateString:s(function(e,r,i){var n=["string"];e.isJsonValue&&(n=n.concat(["number","object","boolean"])),r!==null&&this.validateType(r,i,n)&&(this.validateEnum(e,r,i),this.validateRange(e,r.length,i,"string length"),this.validatePattern(e,r,i),this.validateUri(e,r,i))},"validateString"),validateUri:s(function(e,r,i){e.location==="uri"&&r.length===0&&this.fail("UriParameterError",'Expected uri parameter to have length >= 1, but found "'+r+'" for '+i)},"validateUri"),validatePattern:s(function(e,r,i){this.validation.pattern&&e.pattern!==void 0&&(new RegExp(e.pattern).test(r)||this.fail("PatternMatchError",'Provided value "'+r+'" does not match regex pattern /'+e.pattern+"/ for "+i))},"validatePattern"),validateRange:s(function(e,r,i,n){this.validation.min&&e.min!==void 0&&r<e.min&&this.fail("MinRangeError","Expected "+n+" >= "+e.min+", but found "+r+" for "+i),this.validation.max&&e.max!==void 0&&r>e.max&&this.fail("MaxRangeError","Expected "+n+" <= "+e.max+", but found "+r+" for "+i)},"validateRange"),validateEnum:s(function(e,r,i){this.validation.enum&&e.enum!==void 0&&e.enum.indexOf(r)===-1&&this.fail("EnumError","Found string value of "+r+", but expected "+e.enum.join("|")+" for "+i)},"validateRange"),validateType:s(function(e,r,i,n){if(e==null)return!1;for(var o=!1,a=0;a<i.length;a++){if(typeof i[a]=="string"){if(typeof e===i[a])return!0}else if(i[a]instanceof RegExp){if((e||"").toString().match(i[a]))return!0}else{if(e instanceof i[a]||Mt.util.isType(e,i[a]))return!0;!n&&!o&&(i=i.slice()),i[a]=Mt.util.typeName(i[a])}o=!0}var u=n;u||(u=i.join(", ").replace(/,([^,]+)$/,", or$1"));var l=u.match(/^[aeiou]/i)?"n":"";return this.fail("InvalidParameterType","Expected "+r+" to be a"+l+" "+u),!1},"validateType"),validateNumber:s(function(e,r,i){if(r!=null){if(typeof r=="string"){var n=parseFloat(r);n.toString()===r&&(r=n)}this.validateType(r,i,["number"])&&this.validateRange(e,r,i,"numeric value")}},"validateNumber"),validatePayload:s(function(e,r){if(e!=null&&typeof e!="string"&&!(e&&typeof e.byteLength=="number")){if(Mt.util.isNode()){var i=Mt.util.stream.Stream;if(Mt.util.Buffer.isBuffer(e)||e instanceof i)return}else if(typeof Blob!==void 0&&e instanceof Blob)return;var n=["Buffer","Stream","File","Blob","ArrayBuffer","DataView"];if(e){for(var o=0;o<n.length;o++)if(Mt.util.isType(e,n[o])||Mt.util.typeName(e.constructor)===n[o])return}this.fail("InvalidParameterType","Expected "+r+" to be a string, Buffer, Stream, Blob, or typed array object")}},"validatePayload")})});var Hl=P((Lq,Oa)=>{var Yy=[`We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
|
|
15
15
|
`,"Please migrate your code to use AWS SDK for JavaScript (v3).","For more information, check the migration guide at https://a.co/7PzMCcy"].join(`
|
|
16
|
-
`);Aa.exports={suppress:!1};function Qy(){typeof process<"u"&&typeof process.emitWarning=="function"&&process.emitWarning(Yy,{type:"NOTE"})}o(Qy,"emitWarning");setTimeout(function(){Aa.exports.suppress||Qy()},0)});var V=P((_q,Hl)=>{var gr={util:Oe()},$y={};$y.toString();Hl.exports=gr;gr.util.update(gr,{VERSION:"2.1323.0",Signers:{},Protocol:{Json:Bo(),Query:oa(),Rest:qn(),RestJson:ua(),RestXml:la()},XML:{Builder:Bc(),Parser:null},JSON:{Builder:Lo(),Parser:Fo()},Model:{Api:ma(),Operation:fa(),Shape:_n(),Paginator:da(),ResourceWaiter:ha()},apiLoader:Jc(),EndpointCache:Qc().EndpointCache});ga();nl();ol();Jo();yl();wl();El();Sl();Ul();Vl();zl();gr.events=new gr.SequentialExecutor;gr.util.memoizedProperty(gr,"endpointCache",function(){return new gr.EndpointCache(gr.config.endpointCacheSize)},!0)});var Oa=P(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.default=tv;var Zy=ev(re("crypto"));function ev(t){return t&&t.__esModule?t:{default:t}}o(ev,"_interopRequireDefault");function tv(){return Zy.default.randomBytes(16)}o(tv,"rng")});var ss=P(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.default=void 0;var jl=[];for(jn=0;jn<256;++jn)jl[jn]=(jn+256).toString(16).substr(1);var jn;function rv(t,e){var r=e||0,i=jl;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}o(rv,"bytesToUuid");var iv=rv;os.default=iv});var Gl=P(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.default=void 0;var nv=Xl(Oa()),ov=Xl(ss());function Xl(t){return t&&t.__esModule?t:{default:t}}o(Xl,"_interopRequireDefault");var Kl,Ra,Da=0,Pa=0;function sv(t,e,r){var i=e&&r||0,n=e||[];t=t||{};var s=t.node||Kl,a=t.clockseq!==void 0?t.clockseq:Ra;if(s==null||a==null){var u=t.random||(t.rng||nv.default)();s==null&&(s=Kl=[u[0]|1,u[1],u[2],u[3],u[4],u[5]]),a==null&&(a=Ra=(u[6]<<8|u[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),h=t.nsecs!==void 0?t.nsecs:Pa+1,y=l-Da+(h-Pa)/1e4;if(y<0&&t.clockseq===void 0&&(a=a+1&16383),(y<0||l>Da)&&t.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Da=l,Pa=h,Ra=a,l+=122192928e5;var v=((l&268435455)*1e4+h)%4294967296;n[i++]=v>>>24&255,n[i++]=v>>>16&255,n[i++]=v>>>8&255,n[i++]=v&255;var S=l/4294967296*1e4&268435455;n[i++]=S>>>8&255,n[i++]=S&255,n[i++]=S>>>24&15|16,n[i++]=S>>>16&255,n[i++]=a>>>8|128,n[i++]=a&255;for(var O=0;O<6;++O)n[i+O]=s[O];return e||(0,ov.default)(n)}o(sv,"v1");var av=sv;as.default=av});var _a=P(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.default=dv;di.URL=di.DNS=void 0;var uv=cv(ss());function cv(t){return t&&t.__esModule?t:{default:t}}o(cv,"_interopRequireDefault");function lv(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(r){e.push(parseInt(r,16))}),e}o(lv,"uuidToBytes");function fv(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}o(fv,"stringToBytes");var Jl="6ba7b810-9dad-11d1-80b4-00c04fd430c8";di.DNS=Jl;var Yl="6ba7b811-9dad-11d1-80b4-00c04fd430c8";di.URL=Yl;function dv(t,e,r){var i=o(function(n,s,a,u){var l=a&&u||0;if(typeof n=="string"&&(n=fv(n)),typeof s=="string"&&(s=lv(s)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(s)||s.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var h=r(s.concat(n));if(h[6]=h[6]&15|e,h[8]=h[8]&63|128,a)for(var y=0;y<16;++y)a[l+y]=h[y];return a||(0,uv.default)(h)},"generateUUID");try{i.name=t}catch{}return i.DNS=Jl,i.URL=Yl,i}o(dv,"_default")});var Ql=P(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.default=void 0;var hv=pv(re("crypto"));function pv(t){return t&&t.__esModule?t:{default:t}}o(pv,"_interopRequireDefault");function mv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),hv.default.createHash("md5").update(t).digest()}o(mv,"md5");var yv=mv;us.default=yv});var Zl=P(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.default=void 0;var vv=$l(_a()),gv=$l(Ql());function $l(t){return t&&t.__esModule?t:{default:t}}o($l,"_interopRequireDefault");var Nv=(0,vv.default)("v3",48,gv.default),wv=Nv;cs.default=wv});var tf=P(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.default=void 0;var xv=ef(Oa()),Ev=ef(ss());function ef(t){return t&&t.__esModule?t:{default:t}}o(ef,"_interopRequireDefault");function Cv(t,e,r){var i=e&&r||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var n=t.random||(t.rng||xv.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var s=0;s<16;++s)e[i+s]=n[s];return e||(0,Ev.default)(n)}o(Cv,"v4");var Sv=Cv;ls.default=Sv});var rf=P(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.default=void 0;var Tv=bv(re("crypto"));function bv(t){return t&&t.__esModule?t:{default:t}}o(bv,"_interopRequireDefault");function Av(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),Tv.default.createHash("sha1").update(t).digest()}o(Av,"sha1");var Iv=Av;fs.default=Iv});var of=P(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.default=void 0;var Ov=nf(_a()),Rv=nf(rf());function nf(t){return t&&t.__esModule?t:{default:t}}o(nf,"_interopRequireDefault");var Dv=(0,Ov.default)("v5",80,Rv.default),Pv=Dv;ds.default=Pv});var sf=P(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});Object.defineProperty(ji,"v1",{enumerable:!0,get:function(){return _v.default}});Object.defineProperty(ji,"v3",{enumerable:!0,get:function(){return kv.default}});Object.defineProperty(ji,"v4",{enumerable:!0,get:function(){return qv.default}});Object.defineProperty(ji,"v5",{enumerable:!0,get:function(){return Lv.default}});var _v=hs(Gl()),kv=hs(Zl()),qv=hs(tf()),Lv=hs(of());function hs(t){return t&&t.__esModule?t:{default:t}}o(hs,"_interopRequireDefault")});var Oe=P((eL,af)=>{var Ct,M={environment:"nodejs",engine:o(function(){if(M.isBrowser()&&typeof navigator<"u")return navigator.userAgent;var e=process.platform+"/"+process.version;return process.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+process.env.AWS_EXECUTION_ENV),e},"engine"),userAgent:o(function(){var e=M.environment,r="aws-sdk-"+e+"/"+V().VERSION;return e==="nodejs"&&(r+=" "+M.engine()),r},"userAgent"),uriEscape:o(function(e){var r=encodeURIComponent(e);return r=r.replace(/[^A-Za-z0-9_.~\-%]+/g,escape),r=r.replace(/[*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()}),r},"uriEscape"),uriEscapePath:o(function(e){var r=[];return M.arrayEach(e.split("/"),function(i){r.push(M.uriEscape(i))}),r.join("/")},"uriEscapePath"),urlParse:o(function(e){return M.url.parse(e)},"urlParse"),urlFormat:o(function(e){return M.url.format(e)},"urlFormat"),queryStringParse:o(function(e){return M.querystring.parse(e)},"queryStringParse"),queryParamsToString:o(function(e){var r=[],i=M.uriEscape,n=Object.keys(e).sort();return M.arrayEach(n,function(s){var a=e[s],u=i(s),l=u+"=";if(Array.isArray(a)){var h=[];M.arrayEach(a,function(y){h.push(i(y))}),l=u+"="+h.sort().join("&"+u+"=")}else a!=null&&(l=u+"="+i(a));r.push(l)}),r.join("&")},"queryParamsToString"),readFileSync:o(function(e){return M.isBrowser()?null:re("fs").readFileSync(e,"utf-8")},"readFileSync"),base64:{encode:o(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 encode number "+e));if(e===null||typeof e>"u")return e;var r=M.buffer.toBuffer(e);return r.toString("base64")},"encode64"),decode:o(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 decode number "+e));return e===null||typeof e>"u"?e:M.buffer.toBuffer(e,"base64")},"decode64")},buffer:{toBuffer:function(t,e){return typeof M.Buffer.from=="function"&&M.Buffer.from!==Uint8Array.from?M.Buffer.from(t,e):new M.Buffer(t,e)},alloc:function(t,e,r){if(typeof t!="number")throw new Error("size passed to alloc must be a number.");if(typeof M.Buffer.alloc=="function")return M.Buffer.alloc(t,e,r);var i=new M.Buffer(t);return e!==void 0&&typeof i.fill=="function"&&i.fill(e,void 0,void 0,r),i},toStream:o(function(e){M.Buffer.isBuffer(e)||(e=M.buffer.toBuffer(e));var r=new M.stream.Readable,i=0;return r._read=function(n){if(i>=e.length)return r.push(null);var s=i+n;s>e.length&&(s=e.length),r.push(e.slice(i,s)),i=s},r},"toStream"),concat:function(t){var e=0,r=0,i=null,n;for(n=0;n<t.length;n++)e+=t[n].length;for(i=M.buffer.alloc(e),n=0;n<t.length;n++)t[n].copy(i,r),r+=t[n].length;return i}},string:{byteLength:o(function(e){if(e==null)return 0;if(typeof e=="string"&&(e=M.buffer.toBuffer(e)),typeof e.byteLength=="number")return e.byteLength;if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.path=="string")return re("fs").lstatSync(e.path).size;throw M.error(new Error("Cannot determine length of "+e),{object:e})},"byteLength"),upperFirst:o(function(e){return e[0].toUpperCase()+e.substr(1)},"upperFirst"),lowerFirst:o(function(e){return e[0].toLowerCase()+e.substr(1)},"lowerFirst")},ini:{parse:o(function(e){var r,i={};return M.arrayEach(e.split(/\r?\n/),function(n){n=n.split(/(^|\s)[;#]/)[0].trim();var s=n[0]==="["&&n[n.length-1]==="]";if(s){if(r=n.substring(1,n.length-1),r==="__proto__"||r.split(/\s/)[1]==="__proto__")throw M.error(new Error("Cannot load profile name '"+r+"' from shared ini file."))}else if(r){var a=n.indexOf("="),u=0,l=n.length-1,h=a!==-1&&a!==u&&a!==l;if(h){var y=n.substring(0,a).trim(),v=n.substring(a+1).trim();i[r]=i[r]||{},i[r][y]=v}}}),i},"string")},fn:{noop:function(){},callback:function(t){if(t)throw t},makeAsync:o(function(e,r){return r&&r<=e.length?e:function(){var i=Array.prototype.slice.call(arguments,0),n=i.pop(),s=e.apply(null,i);n(s)}},"makeAsync")},date:{getDate:o(function(){return Ct||(Ct=V()),Ct.config.systemClockOffset?new Date(new Date().getTime()+Ct.config.systemClockOffset):new Date},"getDate"),iso8601:o(function(e){return e===void 0&&(e=M.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},"iso8601"),rfc822:o(function(e){return e===void 0&&(e=M.date.getDate()),e.toUTCString()},"rfc822"),unixTimestamp:o(function(e){return e===void 0&&(e=M.date.getDate()),e.getTime()/1e3},"unixTimestamp"),from:o(function(e){return typeof e=="number"?new Date(e*1e3):new Date(e)},"format"),format:o(function(e,r){return r||(r="iso8601"),M.date[r](M.date.from(e))},"format"),parseTimestamp:o(function(e){if(typeof e=="number")return new Date(e*1e3);if(e.match(/^\d+$/))return new Date(e*1e3);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw M.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})},"parseTimestamp")},crypto:{crc32Table:[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],crc32:o(function(e){var r=M.crypto.crc32Table,i=-1;typeof e=="string"&&(e=M.buffer.toBuffer(e));for(var n=0;n<e.length;n++){var s=e.readUInt8(n);i=i>>>8^r[(i^s)&255]}return(i^-1)>>>0},"crc32"),hmac:o(function(e,r,i,n){return i||(i="binary"),i==="buffer"&&(i=void 0),n||(n="sha256"),typeof r=="string"&&(r=M.buffer.toBuffer(r)),M.crypto.lib.createHmac(n,e).update(r).digest(i)},"hmac"),md5:o(function(e,r,i){return M.crypto.hash("md5",e,r,i)},"md5"),sha256:o(function(e,r,i){return M.crypto.hash("sha256",e,r,i)},"sha256"),hash:function(t,e,r,i){var n=M.crypto.createHash(t);r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=M.buffer.toBuffer(e));var s=M.arraySliceFn(e),a=M.Buffer.isBuffer(e);if(M.isBrowser()&&typeof ArrayBuffer<"u"&&e&&e.buffer instanceof ArrayBuffer&&(a=!0),i&&typeof e=="object"&&typeof e.on=="function"&&!a)e.on("data",function(v){n.update(v)}),e.on("error",function(v){i(v)}),e.on("end",function(){i(null,n.digest(r))});else if(i&&s&&!a&&typeof FileReader<"u"){var u=0,l=1024*512,h=new FileReader;h.onerror=function(){i(new Error("Failed to read data."))},h.onload=function(){var v=new M.Buffer(new Uint8Array(h.result));n.update(v),u+=v.length,h._continueReading()},h._continueReading=function(){if(u>=e.size){i(null,n.digest(r));return}var v=u+l;v>e.size&&(v=e.size),h.readAsArrayBuffer(s.call(e,u,v))},h._continueReading()}else{M.isBrowser()&&typeof e=="object"&&!a&&(e=new M.Buffer(new Uint8Array(e)));var y=n.update(e).digest(r);return i&&i(null,y),y}},toHex:o(function(e){for(var r=[],i=0;i<e.length;i++)r.push(("0"+e.charCodeAt(i).toString(16)).substr(-2,2));return r.join("")},"toHex"),createHash:o(function(e){return M.crypto.lib.createHash(e)},"createHash")},abort:{},each:o(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,i,e[i]);if(n===M.abort)break}},"each"),arrayEach:o(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,e[i],parseInt(i,10));if(n===M.abort)break}},"arrayEach"),update:o(function(e,r){return M.each(r,o(function(n,s){e[n]=s},"iterator")),e},"update"),merge:o(function(e,r){return M.update(M.copy(e),r)},"merge"),copy:o(function(e){if(e==null)return e;var r={};for(var i in e)r[i]=e[i];return r},"copy"),isEmpty:o(function(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!1;return!0},"isEmpty"),arraySliceFn:o(function(e){var r=e.slice||e.webkitSlice||e.mozSlice;return typeof r=="function"?r:null},"arraySliceFn"),isType:o(function(e,r){return typeof r=="function"&&(r=M.typeName(r)),Object.prototype.toString.call(e)==="[object "+r+"]"},"isType"),typeName:o(function(e){if(Object.prototype.hasOwnProperty.call(e,"name"))return e.name;var r=e.toString(),i=r.match(/^\s*function (.+)\(/);return i?i[1]:r},"typeName"),error:o(function(e,r){var i=null;return typeof e.message=="string"&&e.message!==""&&(typeof r=="string"||r&&r.message)&&(i=M.copy(e),i.message=e.message),e.message=e.message||null,typeof r=="string"?e.message=r:typeof r=="object"&&r!==null&&(M.update(e,r),r.message&&(e.message=r.message),(r.code||r.name)&&(e.code=r.code||r.name),r.stack&&(e.stack=r.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=String(r&&r.name||e.name||e.code||"Error"),e.time=new Date,i&&(e.originalError=i),e},"error"),inherit:o(function(e,r){var i=null;if(r===void 0)r=e,e=Object,i={};else{var n=o(function(){},"ConstructorWrapper");n.prototype=e.prototype,i=new n}return r.constructor===Object&&(r.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),r.constructor.prototype=i,M.update(r.constructor.prototype,r),r.constructor.__super__=e,r.constructor},"inherit"),mixin:o(function(){for(var e=arguments[0],r=1;r<arguments.length;r++)for(var i in arguments[r].prototype){var n=arguments[r].prototype[i];i!=="constructor"&&(e.prototype[i]=n)}return e},"mixin"),hideProperties:o(function(e,r){typeof Object.defineProperty=="function"&&M.arrayEach(r,function(i){Object.defineProperty(e,i,{enumerable:!1,writable:!0,configurable:!0})})},"hideProperties"),property:o(function(e,r,i,n,s){var a={configurable:!0,enumerable:n!==void 0?n:!0};typeof i=="function"&&!s?a.get=i:(a.value=i,a.writable=!0),Object.defineProperty(e,r,a)},"property"),memoizedProperty:o(function(e,r,i,n){var s=null;M.property(e,r,function(){return s===null&&(s=i()),s},n)},"memoizedProperty"),hoistPayloadMember:o(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i],s=n.output;if(s.payload&&!n.hasEventOutput){var a=s.members[s.payload],u=e.data[s.payload];a.type==="structure"&&M.each(u,function(l,h){M.property(e.data,l,h,!1)})}},"hoistPayloadMember"),computeSha256:o(function(e,r){if(M.isNode()){var i=M.stream.Stream,n=re("fs");if(typeof i=="function"&&e instanceof i)if(typeof e.path=="string"){var s={};typeof e.start=="number"&&(s.start=e.start),typeof e.end=="number"&&(s.end=e.end),e=n.createReadStream(e.path,s)}else return r(new Error("Non-file stream objects are not supported with SigV4"))}M.crypto.sha256(e,"hex",function(a,u){a?r(a):r(null,u)})},"computeSha256"),isClockSkewed:o(function(e){if(e)return M.property(Ct.config,"isClockSkewed",Math.abs(new Date().getTime()-e)>=3e5,!1),Ct.config.isClockSkewed},"isClockSkewed"),applyClockOffset:o(function(e){e&&(Ct.config.systemClockOffset=e-new Date().getTime())},"applyClockOffset"),extractRequestId:o(function(e){var r=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!r&&e.data&&e.data.ResponseMetadata&&(r=e.data.ResponseMetadata.RequestId),r&&(e.requestId=r),e.error&&(e.error.requestId=r)},"extractRequestId"),addPromises:o(function(e,r){var i=!1;r===void 0&&Ct&&Ct.config&&(r=Ct.config.getPromisesDependency()),r===void 0&&typeof Promise<"u"&&(r=Promise),typeof r!="function"&&(i=!0),Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var s=e[n];i?s.deletePromisesFromClass&&s.deletePromisesFromClass():s.addPromisesToClass&&s.addPromisesToClass(r)}},"addPromises"),promisifyMethod:o(function(e,r){return o(function(){var n=this,s=Array.prototype.slice.call(arguments);return new r(function(a,u){s.push(function(l,h){l?u(l):a(h)}),n[e].apply(n,s)})},"promise")},"promisifyMethod"),isDualstackAvailable:o(function(e){if(!e)return!1;var r=pa();return typeof e!="string"&&(e=e.serviceIdentifier),typeof e!="string"||!r.hasOwnProperty(e)?!1:!!r[e].dualstackAvailable},"isDualstackAvailable"),calculateRetryDelay:o(function(e,r,i){r||(r={});var n=r.customBackoff||null;if(typeof n=="function")return n(e,i);var s=typeof r.base=="number"?r.base:100,a=Math.random()*(Math.pow(2,e)*s);return a},"calculateRetryDelay"),handleRequestWithRetries:o(function(e,r,i){r||(r={});var n=Ct.HttpClient.getInstance(),s=r.httpOptions||{},a=0,u=o(function(h){var y=r.maxRetries||0;if(h&&h.code==="TimeoutError"&&(h.retryable=!0),h&&h.retryable&&a<y){var v=M.calculateRetryDelay(a,r.retryDelayOptions,h);if(v>=0){a++,setTimeout(l,v+(h.retryAfter||0));return}}i(h)},"errCallback"),l=o(function(){var h="";n.handleRequest(e,s,function(y){y.on("data",function(v){h+=v.toString()}),y.on("end",function(){var v=y.statusCode;if(v<300)i(null,h);else{var S=parseInt(y.headers["retry-after"],10)*1e3||0,O=M.error(new Error,{statusCode:v,retryable:v>=500||v===429});S&&O.retryable&&(O.retryAfter=S),u(O)}})},u)},"sendRequest");Ct.util.defer(l)},"handleRequestWithRetries"),uuid:{v4:o(function(){return sf().v4()},"uuidV4")},convertPayloadToString:o(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i].output||{};n.payload&&e.data[n.payload]&&(e.data[n.payload]=e.data[n.payload].toString())},"convertPayloadToString"),defer:o(function(e){typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0)},"defer"),getRequestPayloadShape:o(function(e){var r=e.service.api.operations;if(r){var i=(r||{})[e.operation];if(!(!i||!i.input||!i.input.payload))return i.input.members[i.input.payload]}},"getRequestPayloadShape"),getProfilesFromSharedConfig:o(function(e,r){var i={},n={};if(process.env[M.configOptInEnv])var n=e.loadFrom({isConfig:!0,filename:process.env[M.sharedConfigFileEnv]});var s={};try{var s=e.loadFrom({filename:r||process.env[M.configOptInEnv]&&process.env[M.sharedCredentialsFileEnv]})}catch(h){if(!process.env[M.configOptInEnv])throw h}for(var a=0,u=Object.keys(n);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},n[u[a]]);for(var a=0,u=Object.keys(s);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},s[u[a]]);return i;function l(h,y){for(var v=0,S=Object.keys(y);v<S.length;v++)h[S[v]]=y[S[v]];return h}},"getProfilesFromSharedConfig"),ARN:{validate:o(function(e){return e&&e.indexOf("arn:")===0&&e.split(":").length>=6},"validateARN"),parse:o(function(e){var r=e.split(":");return{partition:r[1],service:r[2],region:r[3],accountId:r[4],resource:r.slice(5).join(":")}},"parseARN"),build:o(function(e){if(e.service===void 0||e.region===void 0||e.accountId===void 0||e.resource===void 0)throw M.error(new Error("Input ARN object is invalid"));return"arn:"+(e.partition||"aws")+":"+e.service+":"+e.region+":"+e.accountId+":"+e.resource},"buildARN")},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};af.exports=M});var ff=P((rL,lf)=>{var Mv=V().util,uf=re("stream").Transform,cf=Mv.buffer.alloc;function Kn(t){uf.call(this,t),this.currentMessageTotalLength=0,this.currentMessagePendingLength=0,this.currentMessage=null,this.messageLengthBuffer=null}o(Kn,"EventMessageChunkerStream");Kn.prototype=Object.create(uf.prototype);Kn.prototype._transform=function(t,e,r){for(var i=t.length,n=0;n<i;){if(!this.currentMessage){var s=i-n;this.messageLengthBuffer||(this.messageLengthBuffer=cf(4));var a=Math.min(4-this.currentMessagePendingLength,s);if(t.copy(this.messageLengthBuffer,this.currentMessagePendingLength,n,n+a),this.currentMessagePendingLength+=a,n+=a,this.currentMessagePendingLength<4)break;this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)),this.messageLengthBuffer=null}var u=Math.min(this.currentMessageTotalLength-this.currentMessagePendingLength,i-n);t.copy(this.currentMessage,this.currentMessagePendingLength,n,n+u),this.currentMessagePendingLength+=u,n+=u,this.currentMessageTotalLength&&this.currentMessageTotalLength===this.currentMessagePendingLength&&(this.push(this.currentMessage),this.currentMessage=null,this.currentMessageTotalLength=0,this.currentMessagePendingLength=0)}r()};Kn.prototype._flush=function(t){this.currentMessageTotalLength?this.currentMessageTotalLength===this.currentMessagePendingLength?t(null,this.currentMessage):t(new Error("Truncated event message received.")):t()};Kn.prototype.allocateMessage=function(t){if(typeof t!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+t);this.currentMessageTotalLength=t,this.currentMessagePendingLength=4,this.currentMessage=cf(t),this.currentMessage.writeUInt32BE(t,0)};lf.exports={EventMessageChunkerStream:Kn}});var mf=P((nL,pf)=>{var df=V().util,Fv=df.buffer.toBuffer;function Xn(t){if(t.length!==8)throw new Error("Int64 buffers must be exactly 8 bytes");df.Buffer.isBuffer(t)||(t=Fv(t)),this.bytes=t}o(Xn,"Int64");Xn.fromNumber=function(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var e=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)e[r]=i;return t<0&&hf(e),new Xn(e)};Xn.prototype.valueOf=function(){var t=this.bytes.slice(0),e=t[0]&128;return e&&hf(t),parseInt(t.toString("hex"),16)*(e?-1:1)};Xn.prototype.toString=function(){return String(this.valueOf())};function hf(t){for(var e=0;e<8;e++)t[e]^=255;for(var e=7;e>-1&&(t[e]++,t[e]===0);e--);}o(hf,"negate");pf.exports={Int64:Xn}});var gf=P((sL,vf)=>{var ps=V().util,Wv=ps.buffer.toBuffer,yf=4,ms=yf*2,Gn=4,Bv=ms+Gn*2;function Uv(t){if(ps.Buffer.isBuffer(t)||(t=Wv(t)),t.length<Bv)throw new Error("Provided message too short to accommodate event stream message overhead");if(t.length!==t.readUInt32BE(0))throw new Error("Reported message length does not match received message length");var e=t.readUInt32BE(ms);if(e!==ps.crypto.crc32(t.slice(0,ms)))throw new Error("The prelude checksum specified in the message ("+e+") does not match the calculated CRC32 checksum.");var r=t.readUInt32BE(t.length-Gn);if(r!==ps.crypto.crc32(t.slice(0,t.length-Gn)))throw new Error("The message checksum did not match the expected value of "+r);var i=ms+Gn,n=i+t.readUInt32BE(yf);return{headers:t.slice(i,n),body:t.slice(n,t.length-Gn)}}o(Uv,"splitMessage");vf.exports={splitMessage:Uv}});var Ef=P((uL,xf)=>{var Nf=mf().Int64,Vv=gf().splitMessage,wf="boolean",zv="byte",Hv="short",jv="integer",Kv="long",Xv="binary",Gv="string",Jv="timestamp",Yv="uuid";function Qv(t){for(var e={},r=0;r<t.length;){var i=t.readUInt8(r++),n=t.slice(r,r+i).toString();switch(r+=i,t.readUInt8(r++)){case 0:e[n]={type:wf,value:!0};break;case 1:e[n]={type:wf,value:!1};break;case 2:e[n]={type:zv,value:t.readInt8(r++)};break;case 3:e[n]={type:Hv,value:t.readInt16BE(r)},r+=2;break;case 4:e[n]={type:jv,value:t.readInt32BE(r)},r+=4;break;case 5:e[n]={type:Kv,value:new Nf(t.slice(r,r+8))},r+=8;break;case 6:var s=t.readUInt16BE(r);r+=2,e[n]={type:Xv,value:t.slice(r,r+s)},r+=s;break;case 7:var a=t.readUInt16BE(r);r+=2,e[n]={type:Gv,value:t.slice(r,r+a).toString()},r+=a;break;case 8:e[n]={type:Jv,value:new Date(new Nf(t.slice(r,r+8)).valueOf())},r+=8;break;case 9:var u=t.slice(r,r+16).toString("hex");r+=16,e[n]={type:Yv,value:u.substr(0,8)+"-"+u.substr(8,4)+"-"+u.substr(12,4)+"-"+u.substr(16,4)+"-"+u.substr(20)};break;default:throw new Error("Unrecognized header type tag")}}return e}o(Qv,"parseHeaders");function $v(t){var e=Vv(t);return{headers:Qv(e.headers),body:e.body}}o($v,"parseMessage");xf.exports={parseMessage:$v}});var ka=P((lL,Cf)=>{var Zv=Ef().parseMessage;function eg(t,e,r){var i=Zv(e),n=i.headers[":message-type"];if(n){if(n.value==="error")throw tg(i);if(n.value!=="event")return}var s=i.headers[":event-type"],a=r.members[s.value];if(a){var u={},l=a.eventPayloadMemberName;if(l){var h=a.members[l];h.type==="binary"?u[l]=i.body:u[l]=t.parse(i.body.toString(),h)}for(var y=a.eventHeaderMemberNames,v=0;v<y.length;v++){var S=y[v];i.headers[S]&&(u[S]=a.members[S].toType(i.headers[S].value))}var O={};return O[s.value]=u,O}}o(eg,"parseEvent");function tg(t){var e=t.headers[":error-code"],r=t.headers[":error-message"],i=new Error(r.value||r);return i.code=i.name=e.value||e,i}o(tg,"parseError");Cf.exports={parseEvent:eg}});var bf=P((dL,Tf)=>{var Sf=re("stream").Transform,rg=ka().parseEvent;function qa(t){t=t||{},t.readableObjectMode=!0,Sf.call(this,t),this._readableState.objectMode=!0,this.parser=t.parser,this.eventStreamModel=t.eventStreamModel}o(qa,"EventUnmarshallerStream");qa.prototype=Object.create(Sf.prototype);qa.prototype._transform=function(t,e,r){try{var i=rg(this.parser,t,this.eventStreamModel);return this.push(i),r()}catch(n){r(n)}};Tf.exports={EventUnmarshallerStream:qa}});var If=P((pL,Af)=>{var ig=ff().EventMessageChunkerStream,ng=bf().EventUnmarshallerStream;function og(t,e,r){var i=new ng({parser:e,eventStreamModel:r}),n=new ig;return t.pipe(n).pipe(i),t.on("error",function(s){n.emit("error",s)}),n.on("error",function(s){i.emit("error",s)}),i}o(og,"createEventStream");Af.exports={createEventStream:og}});var Rf=P((yL,Of)=>{function sg(t){for(var e=[],r=0;r<t.length;){var i=t.readInt32BE(r),n=t.slice(r,i+r);r+=i,e.push(n)}return e}o(sg,"eventMessageChunker");Of.exports={eventMessageChunker:sg}});var Pf=P((gL,Df)=>{var ag=Rf().eventMessageChunker,ug=ka().parseEvent;function cg(t,e,r){for(var i=ag(t),n=[],s=0;s<i.length;s++)n.push(ug(e,i[s],r));return n}o(cg,"createEventStream");Df.exports={createEventStream:cg}});var kf=P((wL,_f)=>{_f.exports={now:o(function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6},"now")}});var Lf=P((EL,qf)=>{var lg=V().util,fg=re("dgram"),dg=lg.buffer.toBuffer,hg=1024*8;function hi(t){t=t||{},this.enabled=t.enabled||!1,this.port=t.port||31e3,this.clientId=t.clientId||"",this.address=t.host||"127.0.0.1",this.clientId.length>255&&(this.clientId=this.clientId.substr(0,255)),this.messagesInFlight=0}o(hi,"Publisher");hi.prototype.fieldsToTrim={UserAgent:256,SdkException:128,SdkExceptionMessage:512,AwsException:128,AwsExceptionMessage:512,FinalSdkException:128,FinalSdkExceptionMessage:512,FinalAwsException:128,FinalAwsExceptionMessage:512};hi.prototype.trimFields=function(t){for(var e=Object.keys(this.fieldsToTrim),r=0,i=e.length;r<i;r++){var n=e[r];if(t.hasOwnProperty(n)){var s=this.fieldsToTrim[n],a=t[n];a&&a.length>s&&(t[n]=a.substr(0,s))}}return t};hi.prototype.eventHandler=function(t){t.ClientId=this.clientId,this.trimFields(t);var e=dg(JSON.stringify(t));!this.enabled||e.length>hg||this.publishDatagram(e)};hi.prototype.publishDatagram=function(t){var e=this,r=this.getClient();this.messagesInFlight++,this.client.send(t,0,t.length,this.port,this.address,function(i,n){--e.messagesInFlight<=0&&e.destroyClient()})};hi.prototype.getClient=function(){return this.client||(this.client=fg.createSocket("udp4")),this.client};hi.prototype.destroyClient=function(){this.client&&(this.client.close(),this.client=void 0)};qf.exports={Publisher:hi}});var Wf=P((SL,Ff)=>{var La=V();function pg(){var t={port:void 0,clientId:void 0,enabled:void 0,host:void 0};return mg(t)||yg(t),Mf(t)}o(pg,"resolveMonitoringConfig");function mg(t){return t.port=t.port||process.env.AWS_CSM_PORT,t.enabled=t.enabled||process.env.AWS_CSM_ENABLED,t.clientId=t.clientId||process.env.AWS_CSM_CLIENT_ID,t.host=t.host||process.env.AWS_CSM_HOST,t.port&&t.enabled&&t.clientId&&t.host||["false","0"].indexOf(t.enabled)>=0}o(mg,"fromEnvironment");function yg(t){var e;try{var r=La.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[La.util.sharedConfigFileEnv]}),e=r[process.env.AWS_PROFILE||La.util.defaultProfile]}catch{return!1}return e?(t.port=t.port||e.csm_port,t.enabled=t.enabled||e.csm_enabled,t.clientId=t.clientId||e.csm_client_id,t.host=t.host||e.csm_host,t.port&&t.enabled&&t.clientId&&t.host):t}o(yg,"fromConfigFile");function Mf(t){var e=["false","0",void 0];return!t.enabled||e.indexOf(t.enabled.toLowerCase())>=0?t.enabled=!1:t.enabled=!0,t.port=t.port?parseInt(t.port,10):void 0,t}o(Mf,"toJSType");Ff.exports=pg});var Ma=P((bL,Vf)=>{var Ki=V(),Bf=re("os"),vg=re("path");function Uf(t){return Ki.util.ini.parse(Ki.util.readFileSync(t))}o(Uf,"parseFile");function gg(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)||Object.defineProperty(e,r.replace(/^profile\s/,""),{value:t[r],enumerable:!0})}),e}o(gg,"getProfiles");function Ng(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)&&Object.defineProperty(e,r.replace(/^sso-session\s/,""),{value:t[r],enumerable:!0})}),e}o(Ng,"getSsoSessions");Ki.IniLoader=Ki.util.inherit({constructor:o(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"IniLoader"),clearCachedFiles:o(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"clearCachedFiles"),loadFrom:o(function(e){e=e||{};var r=e.isConfig===!0,i=e.filename||this.getDefaultFilePath(r);if(!this.resolvedProfiles[i]){var n=Uf(i);r?Object.defineProperty(this.resolvedProfiles,i,{value:gg(n)}):Object.defineProperty(this.resolvedProfiles,i,{value:n})}return this.resolvedProfiles[i]},"loadFrom"),loadSsoSessionsFrom:o(function(e){e=e||{};var r=e.filename||this.getDefaultFilePath(!0);if(!this.resolvedSsoSessions[r]){var i=Uf(r);Object.defineProperty(this.resolvedSsoSessions,r,{value:Ng(i)})}return this.resolvedSsoSessions[r]},"loadSsoSessionsFrom"),getDefaultFilePath:o(function(e){return vg.join(this.getHomeDir(),".aws",e?"config":"credentials")},"getDefaultFilePath"),getHomeDir:o(function(){var e=process.env,r=e.HOME||e.USERPROFILE||(e.HOMEPATH?(e.HOMEDRIVE||"C:/")+e.HOMEPATH:null);if(r)return r;if(typeof Bf.homedir=="function")return Bf.homedir();throw Ki.util.error(new Error("Cannot load credentials, HOME path not set"))},"getHomeDir")});var wg=Ki.IniLoader;Vf.exports={IniLoader:wg}});var Hf=P((IL,zf)=>{var xg=Ma().IniLoader;zf.exports.iniLoader=new xg});var Kf=P((OL,jf)=>{var Jn=V();function Fa(t,e){if(typeof t=="string"){if(["legacy","regional"].indexOf(t.toLowerCase())>=0)return t.toLowerCase();throw Jn.util.error(new Error,e)}}o(Fa,"validateRegionalEndpointsFlagValue");function Eg(t,e){t=t||{};var r;if(t[e.clientConfig]&&(r=Fa(t[e.clientConfig],{code:"InvalidConfiguration",message:'invalid "'+e.clientConfig+'" configuration. Expect "legacy" or "regional". Got "'+t[e.clientConfig]+'".'}),r)||!Jn.util.isNode())return r;if(Object.prototype.hasOwnProperty.call(process.env,e.env)){var i=process.env[e.env];if(r=Fa(i,{code:"InvalidEnvironmentalVariable",message:"invalid "+e.env+' environmental variable. Expect "legacy" or "regional". Got "'+process.env[e.env]+'".'}),r)return r}var n={};try{var s=Jn.util.getProfilesFromSharedConfig(Jn.util.iniLoader);n=s[process.env.AWS_PROFILE||Jn.util.defaultProfile]}catch{}if(n&&Object.prototype.hasOwnProperty.call(n,e.sharedConfig)){var a=n[e.sharedConfig];if(r=Fa(a,{code:"InvalidConfiguration",message:"invalid "+e.sharedConfig+' profile config. Expect "legacy" or "regional". Got "'+n[e.sharedConfig]+'".'}),r)return r}return r}o(Eg,"resolveRegionalEndpointsFlag");jf.exports=Eg});var Xf=P(()=>{var ys=V(),Cg=Kf(),Sg="AWS_STS_REGIONAL_ENDPOINTS",Tg="sts_regional_endpoints";ys.util.update(ys.STS.prototype,{credentialsFrom:o(function(e,r){return e?(r||(r=new ys.TemporaryCredentials),r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretAccessKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration,r):null},"credentialsFrom"),assumeRoleWithWebIdentity:o(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,r)},"assumeRoleWithWebIdentity"),assumeRoleWithSAML:o(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,r)},"assumeRoleWithSAML"),setupRequestListeners:o(function(e){e.addListener("validate",this.optInRegionalEndpoint,!0)},"setupRequestListeners"),optInRegionalEndpoint:o(function(e){var r=e.service,i=r.config;if(i.stsRegionalEndpoints=Cg(r._originalConfig,{env:Sg,sharedConfig:Tg,clientConfig:"stsRegionalEndpoints"}),i.stsRegionalEndpoints==="regional"&&r.isGlobalEndpoint){if(!i.region)throw ys.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var n=i.endpoint.indexOf(".amazonaws.com"),s=i.endpoint.substring(0,n)+"."+i.region+i.endpoint.substring(n);e.httpRequest.updateEndpoint(s),e.httpRequest.region=i.region}},"optInRegionalEndpoint")})});var Gf=P((kL,bg)=>{bg.exports={version:"2.0",metadata:{apiVersion:"2011-06-15",endpointPrefix:"sts",globalEndpoint:"sts.amazonaws.com",protocol:"query",serviceAbbreviation:"AWS STS",serviceFullName:"AWS Security Token Service",serviceId:"STS",signatureVersion:"v4",uid:"sts-2011-06-15",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/"},operations:{AssumeRole:{input:{type:"structure",required:["RoleArn","RoleSessionName"],members:{RoleArn:{},RoleSessionName:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"},Tags:{shape:"S8"},TransitiveTagKeys:{type:"list",member:{}},ExternalId:{},SerialNumber:{},TokenCode:{},SourceIdentity:{}}},output:{resultWrapper:"AssumeRoleResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},SourceIdentity:{}}}},AssumeRoleWithSAML:{input:{type:"structure",required:["RoleArn","PrincipalArn","SAMLAssertion"],members:{RoleArn:{},PrincipalArn:{},SAMLAssertion:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithSAMLResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Subject:{},SubjectType:{},Issuer:{},Audience:{},NameQualifier:{},SourceIdentity:{}}}},AssumeRoleWithWebIdentity:{input:{type:"structure",required:["RoleArn","RoleSessionName","WebIdentityToken"],members:{RoleArn:{},RoleSessionName:{},WebIdentityToken:{},ProviderId:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithWebIdentityResult",type:"structure",members:{Credentials:{shape:"Si"},SubjectFromWebIdentityToken:{},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Provider:{},Audience:{},SourceIdentity:{}}}},DecodeAuthorizationMessage:{input:{type:"structure",required:["EncodedMessage"],members:{EncodedMessage:{}}},output:{resultWrapper:"DecodeAuthorizationMessageResult",type:"structure",members:{DecodedMessage:{}}}},GetAccessKeyInfo:{input:{type:"structure",required:["AccessKeyId"],members:{AccessKeyId:{}}},output:{resultWrapper:"GetAccessKeyInfoResult",type:"structure",members:{Account:{}}}},GetCallerIdentity:{input:{type:"structure",members:{}},output:{resultWrapper:"GetCallerIdentityResult",type:"structure",members:{UserId:{},Account:{},Arn:{}}}},GetFederationToken:{input:{type:"structure",required:["Name"],members:{Name:{},Policy:{},PolicyArns:{shape:"S4"},DurationSeconds:{type:"integer"},Tags:{shape:"S8"}}},output:{resultWrapper:"GetFederationTokenResult",type:"structure",members:{Credentials:{shape:"Si"},FederatedUser:{type:"structure",required:["FederatedUserId","Arn"],members:{FederatedUserId:{},Arn:{}}},PackedPolicySize:{type:"integer"}}}},GetSessionToken:{input:{type:"structure",members:{DurationSeconds:{type:"integer"},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"GetSessionTokenResult",type:"structure",members:{Credentials:{shape:"Si"}}}}},shapes:{S4:{type:"list",member:{type:"structure",members:{arn:{}}}},S8:{type:"list",member:{type:"structure",required:["Key","Value"],members:{Key:{},Value:{}}}},Si:{type:"structure",required:["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],members:{AccessKeyId:{},SecretAccessKey:{},SessionToken:{},Expiration:{type:"timestamp"}}},Sn:{type:"structure",required:["AssumedRoleId","Arn"],members:{AssumedRoleId:{},Arn:{}}}}}});var Jf=P((qL,Ag)=>{Ag.exports={pagination:{}}});var Vr=P((LL,Qf)=>{gs();var vs=V(),Ig=vs.Service,Yf=vs.apiLoader;Yf.services.sts={};vs.STS=Ig.defineService("sts",["2011-06-15"]);Xf();Object.defineProperty(Yf.services.sts,"2011-06-15",{get:o(function(){var e=Gf();return e.paginators=Jf().pagination,e},"get"),enumerable:!0,configurable:!0});Qf.exports=vs.STS});var $f=P(()=>{var pi=V(),Og=Vr();pi.TemporaryCredentials=pi.util.inherit(pi.Credentials,{constructor:o(function(e,r){pi.Credentials.call(this),this.loadMasterCredentials(r),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},"TemporaryCredentials"),refresh:o(function(e){this.coalesceRefresh(e||pi.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.masterCredentials.get(function(){r.service.config.credentials=r.masterCredentials;var i=r.params.RoleArn?r.service.assumeRole:r.service.getSessionToken;i.call(r.service,function(n,s){n||r.service.credentialsFrom(s,r),e(n)})})},"load"),loadMasterCredentials:o(function(e){for(this.masterCredentials=e||pi.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;typeof this.masterCredentials.get!="function"&&(this.masterCredentials=new pi.Credentials(this.masterCredentials))},"loadMasterCredentials"),createClients:function(){this.service=this.service||new Og({params:this.params})}})});var Zf=P(()=>{var Qt=V(),Rg=Vr();Qt.ChainableTemporaryCredentials=Qt.util.inherit(Qt.Credentials,{constructor:o(function(e){Qt.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var r=Qt.util.copy(e.params)||{};if(r.RoleArn&&(r.RoleSessionName=r.RoleSessionName||"temporary-credentials"),r.SerialNumber){if(!e.tokenCodeFn||typeof e.tokenCodeFn!="function")throw new Qt.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var i=Qt.util.merge({params:r,credentials:e.masterCredentials||Qt.config.credentials},e.stsConfig||{});this.service=new Rg(i)},"ChainableTemporaryCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Qt.util.fn.callback)},"refresh"),load:o(function(e){var r=this,i=r.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode(function(n,s){var a={};if(n){e(n);return}s&&(a.TokenCode=s),r.service[i](a,function(u,l){u||r.service.credentialsFrom(l,r),e(u)})})},"load"),getTokenCode:o(function(e){var r=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,function(i,n){if(i){var s=i;i instanceof Error&&(s=i.message),e(Qt.util.error(new Error("Error fetching MFA token: "+s),{code:r.errorCode}));return}e(null,n)}):e(null)},"getTokenCode")})});var ed=P(()=>{var mi=V(),Dg=Vr();mi.WebIdentityCredentials=mi.util.inherit(mi.Credentials,{constructor:o(function(e,r){mi.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=mi.util.copy(r||{})},"WebIdentityCredentials"),refresh:o(function(e){this.coalesceRefresh(e||mi.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.service.assumeRoleWithWebIdentity(function(i,n){r.data=null,i||(r.data=n,r.service.credentialsFrom(n,r)),e(i)})},"load"),createClients:function(){if(!this.service){var t=mi.util.merge({},this._clientConfig);t.params=this.params,this.service=new Dg(t)}}})});var td=P((XL,Pg)=>{Pg.exports={version:"2.0",metadata:{apiVersion:"2014-06-30",endpointPrefix:"cognito-identity",jsonVersion:"1.1",protocol:"json",serviceFullName:"Amazon Cognito Identity",serviceId:"Cognito Identity",signatureVersion:"v4",targetPrefix:"AWSCognitoIdentityService",uid:"cognito-identity-2014-06-30"},operations:{CreateIdentityPool:{input:{type:"structure",required:["IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},output:{shape:"Sk"}},DeleteIdentities:{input:{type:"structure",required:["IdentityIdsToDelete"],members:{IdentityIdsToDelete:{type:"list",member:{}}}},output:{type:"structure",members:{UnprocessedIdentityIds:{type:"list",member:{type:"structure",members:{IdentityId:{},ErrorCode:{}}}}}}},DeleteIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}}},DescribeIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{}}},output:{shape:"Sv"}},DescribeIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{shape:"Sk"}},GetCredentialsForIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"},CustomRoleArn:{}}},output:{type:"structure",members:{IdentityId:{},Credentials:{type:"structure",members:{AccessKeyId:{},SecretKey:{},SessionToken:{},Expiration:{type:"timestamp"}}}}},authtype:"none"},GetId:{input:{type:"structure",required:["IdentityPoolId"],members:{AccountId:{},IdentityPoolId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{}}},authtype:"none"},GetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{type:"structure",members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},GetOpenIdToken:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}},authtype:"none"},GetOpenIdTokenForDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId","Logins"],members:{IdentityPoolId:{},IdentityId:{},Logins:{shape:"S10"},PrincipalTags:{shape:"S1s"},TokenDuration:{type:"long"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},GetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},ListIdentities:{input:{type:"structure",required:["IdentityPoolId","MaxResults"],members:{IdentityPoolId:{},MaxResults:{type:"integer"},NextToken:{},HideDisabled:{type:"boolean"}}},output:{type:"structure",members:{IdentityPoolId:{},Identities:{type:"list",member:{shape:"Sv"}},NextToken:{}}}},ListIdentityPools:{input:{type:"structure",required:["MaxResults"],members:{MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityPools:{type:"list",member:{type:"structure",members:{IdentityPoolId:{},IdentityPoolName:{}}}},NextToken:{}}}},ListTagsForResource:{input:{type:"structure",required:["ResourceArn"],members:{ResourceArn:{}}},output:{type:"structure",members:{Tags:{shape:"Sh"}}}},LookupDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{},IdentityId:{},DeveloperUserIdentifier:{},MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityId:{},DeveloperUserIdentifierList:{type:"list",member:{}},NextToken:{}}}},MergeDeveloperIdentities:{input:{type:"structure",required:["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],members:{SourceUserIdentifier:{},DestinationUserIdentifier:{},DeveloperProviderName:{},IdentityPoolId:{}}},output:{type:"structure",members:{IdentityId:{}}}},SetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId","Roles"],members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},SetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},TagResource:{input:{type:"structure",required:["ResourceArn","Tags"],members:{ResourceArn:{},Tags:{shape:"Sh"}}},output:{type:"structure",members:{}}},UnlinkDeveloperIdentity:{input:{type:"structure",required:["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],members:{IdentityId:{},IdentityPoolId:{},DeveloperProviderName:{},DeveloperUserIdentifier:{}}}},UnlinkIdentity:{input:{type:"structure",required:["IdentityId","Logins","LoginsToRemove"],members:{IdentityId:{},Logins:{shape:"S10"},LoginsToRemove:{shape:"Sw"}}},authtype:"none"},UntagResource:{input:{type:"structure",required:["ResourceArn","TagKeys"],members:{ResourceArn:{},TagKeys:{type:"list",member:{}}}},output:{type:"structure",members:{}}},UpdateIdentityPool:{input:{shape:"Sk"},output:{shape:"Sk"}}},shapes:{S5:{type:"map",key:{},value:{}},S9:{type:"list",member:{}},Sb:{type:"list",member:{type:"structure",members:{ProviderName:{},ClientId:{},ServerSideTokenCheck:{type:"boolean"}}}},Sg:{type:"list",member:{}},Sh:{type:"map",key:{},value:{}},Sk:{type:"structure",required:["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolId:{},IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},Sv:{type:"structure",members:{IdentityId:{},Logins:{shape:"Sw"},CreationDate:{type:"timestamp"},LastModifiedDate:{type:"timestamp"}}},Sw:{type:"list",member:{}},S10:{type:"map",key:{},value:{}},S1c:{type:"map",key:{},value:{}},S1e:{type:"map",key:{},value:{type:"structure",required:["Type"],members:{Type:{},AmbiguousRoleResolution:{},RulesConfiguration:{type:"structure",required:["Rules"],members:{Rules:{type:"list",member:{type:"structure",required:["Claim","MatchType","Value","RoleARN"],members:{Claim:{},MatchType:{},Value:{},RoleARN:{}}}}}}}}},S1s:{type:"map",key:{},value:{}}}}});var rd=P((GL,_g)=>{_g.exports={pagination:{ListIdentityPools:{input_token:"NextToken",limit_key:"MaxResults",output_token:"NextToken",result_key:"IdentityPools"}}}});var od=P((JL,nd)=>{gs();var Ns=V(),kg=Ns.Service,id=Ns.apiLoader;id.services.cognitoidentity={};Ns.CognitoIdentity=kg.defineService("cognitoidentity",["2014-06-30"]);Object.defineProperty(id.services.cognitoidentity,"2014-06-30",{get:o(function(){var e=td();return e.paginators=rd().pagination,e},"get"),enumerable:!0,configurable:!0});nd.exports=Ns.CognitoIdentity});var sd=P(()=>{var Ft=V(),qg=od(),Lg=Vr();Ft.CognitoIdentityCredentials=Ft.util.inherit(Ft.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:o(function(e,r){Ft.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=Ft.util.copy(r||{}),this.loadCachedId();var i=this;Object.defineProperty(this,"identityId",{get:function(){return i.loadCachedId(),i._identityId||i.params.IdentityId},set:function(n){i._identityId=n}})},"CognitoIdentityCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Ft.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.data=null,r._identityId=null,r.getId(function(i){i?(r.clearIdOnNotAuthorized(i),e(i)):r.params.RoleArn?r.getCredentialsFromSTS(e):r.getCredentialsForIdentity(e)})},"load"),clearCachedId:o(function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,r=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+r],delete this.storage[this.localStorageKey.providers+e+r]},"clearCache"),clearIdOnNotAuthorized:o(function(e){var r=this;e.code=="NotAuthorizedException"&&r.clearCachedId()},"clearIdOnNotAuthorized"),getId:o(function(e){var r=this;if(typeof r.params.IdentityId=="string")return e(null,r.params.IdentityId);r.cognito.getId(function(i,n){!i&&n.IdentityId?(r.params.IdentityId=n.IdentityId,e(null,n.IdentityId)):e(i)})},"getId"),loadCredentials:o(function(e,r){!e||!r||(r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration)},"loadCredentials"),getCredentialsForIdentity:o(function(e){var r=this;r.cognito.getCredentialsForIdentity(function(i,n){i?r.clearIdOnNotAuthorized(i):(r.cacheId(n),r.data=n,r.loadCredentials(r.data,r)),e(i)})},"getCredentialsForIdentity"),getCredentialsFromSTS:o(function(e){var r=this;r.cognito.getOpenIdToken(function(i,n){i?(r.clearIdOnNotAuthorized(i),e(i)):(r.cacheId(n),r.params.WebIdentityToken=n.Token,r.webIdentityCredentials.refresh(function(s){s||(r.data=r.webIdentityCredentials.data,r.sts.credentialsFrom(r.data,r)),e(s)}))})},"getCredentialsFromSTS"),loadCachedId:o(function(){var e=this;if(Ft.util.isBrowser()&&!e.params.IdentityId){var r=e.getStorage("id");if(r&&e.params.Logins){var i=Object.keys(e.params.Logins),n=(e.getStorage("providers")||"").split(","),s=n.filter(function(a){return i.indexOf(a)!==-1});s.length!==0&&(e.params.IdentityId=r)}else r&&(e.params.IdentityId=r)}},"loadCachedId"),createClients:function(){var t=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new Ft.WebIdentityCredentials(this.params,t),!this.cognito){var e=Ft.util.merge({},t);e.params=this.params,this.cognito=new qg(e)}this.sts=this.sts||new Lg(t)},cacheId:o(function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,Ft.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},"cacheId"),getStorage:o(function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},"getStorage"),setStorage:o(function(e,r){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=r}catch{}},"setStorage"),storage:function(){try{var t=Ft.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage=="object"?window.localStorage:{};return t["aws.test-storage"]="foobar",delete t["aws.test-storage"],t}catch{return{}}}()})});var ad=P(()=>{var Yn=V(),Mg=Vr();Yn.SAMLCredentials=Yn.util.inherit(Yn.Credentials,{constructor:o(function(e){Yn.Credentials.call(this),this.expired=!0,this.params=e},"SAMLCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Yn.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.service.assumeRoleWithSAML(function(i,n){i||r.service.credentialsFrom(n,r),e(i)})},"load"),createClients:function(){this.service=this.service||new Mg({params:this.params})}})});var Wa=P(()=>{var ct=V(),Fg=re("child_process"),ud=ct.util.iniLoader;ct.ProcessCredentials=ct.util.inherit(ct.Credentials,{constructor:o(function(e){ct.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||ct.util.defaultProfile,this.get(e.callback||ct.util.fn.noop)},"ProcessCredentials"),load:o(function(e){var r=this;try{var i=ct.util.getProfilesFromSharedConfig(ud,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw ct.util.error(new Error("Profile "+this.profile+" not found"),{code:"ProcessCredentialsProviderFailure"});if(n.credential_process)this.loadViaCredentialProcess(n,function(s,a){s?e(s,null):(r.expired=!1,r.accessKeyId=a.AccessKeyId,r.secretAccessKey=a.SecretAccessKey,r.sessionToken=a.SessionToken,a.Expiration&&(r.expireTime=new Date(a.Expiration)),e(null))});else throw ct.util.error(new Error("Profile "+this.profile+" did not include credential process"),{code:"ProcessCredentialsProviderFailure"})}catch(s){e(s)}},"load"),loadViaCredentialProcess:o(function(e,r){Fg.exec(e.credential_process,{env:process.env},function(i,n,s){if(i)r(ct.util.error(new Error("credential_process returned error"),{code:"ProcessCredentialsProviderFailure"}),null);else try{var a=JSON.parse(n);if(a.Expiration){var u=ct.util.date.getDate(),l=new Date(a.Expiration);if(l<u)throw Error("credential_process returned expired credentials")}if(a.Version!==1)throw Error("credential_process does not return Version == 1");r(null,a)}catch(h){r(ct.util.error(new Error(h.message),{code:"ProcessCredentialsProviderFailure"}),null)}})},"loadViaCredentialProcess"),refresh:o(function(e){ud.clearCachedFiles(),this.coalesceRefresh(e||ct.util.fn.callback)},"refresh")})});var ws=P(Ba=>{(function(){Ba.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
17
|
-
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(Ba)});var Nr=P((cd,yi)=>{(function(){var t,e,r,i,n,s,a=[].slice,u={}.hasOwnProperty;t=o(function(){var l,h,y,v,S,O;if(O=arguments[0],S=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,y=S.length;l<y;l++)if(v=S[l],v!=null)for(h in v)u.call(v,h)&&(O[h]=v[h]);return O},"assign"),i=o(function(l){return!!l&&Object.prototype.toString.call(l)==="[object Function]"},"isFunction"),n=o(function(l){var h;return!!l&&((h=typeof l)=="function"||h==="object")},"isObject"),e=o(function(l){return i(Array.isArray)?Array.isArray(l):Object.prototype.toString.call(l)==="[object Array]"},"isArray"),r=o(function(l){var h;if(e(l))return!l.length;for(h in l)if(u.call(l,h))return!1;return!0},"isEmpty"),s=o(function(l){var h,y;return n(l)&&(y=Object.getPrototypeOf(l))&&(h=y.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),yi.exports.assign=t,yi.exports.isFunction=i,yi.exports.isObject=n,yi.exports.isArray=e,yi.exports.isEmpty=r,yi.exports.isPlainObject=s}).call(cd)});var Ua=P((ld,fd)=>{(function(){var t;fd.exports=t=function(){function e(r,i,n){if(this.options=r.options,this.stringify=r.stringify,i==null)throw new Error("Missing attribute name of element "+r.name);if(n==null)throw new Error("Missing attribute value for attribute "+i+" of element "+r.name);this.name=this.stringify.attName(i),this.value=this.stringify.attValue(n)}return o(e,"XMLAttribute"),e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(r){return this.options.writer.set(r).attribute(this)},e}()}).call(ld)});var Qn=P((dd,hd)=>{(function(){var t,e,r,i,n,s,a=o(function(l,h){for(var y in h)u.call(h,y)&&(l[y]=h[y]);function v(){this.constructor=l}return o(v,"ctor"),v.prototype=h.prototype,l.prototype=new v,l.__super__=h.prototype,l},"extend"),u={}.hasOwnProperty;s=Nr(),n=s.isObject,i=s.isFunction,r=lt(),t=Ua(),hd.exports=e=function(l){a(h,l);function h(y,v,S){if(h.__super__.constructor.call(this,y),v==null)throw new Error("Missing element name");this.name=this.stringify.eleName(v),this.attributes={},S!=null&&this.attribute(S),y.isDocument&&(this.isRoot=!0,this.documentObject=y,y.rootObject=this)}return o(h,"XMLElement"),h.prototype.clone=function(){var y,v,S,O;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attributes={},O=this.attributes;for(v in O)u.call(O,v)&&(y=O[v],S.attributes[v]=y.clone());return S.children=[],this.children.forEach(function(g){var N;return N=g.clone(),N.parent=S,S.children.push(N)}),S},h.prototype.attribute=function(y,v){var S,O;if(y!=null&&(y=y.valueOf()),n(y))for(S in y)u.call(y,S)&&(O=y[S],this.attribute(S,O));else i(v)&&(v=v.apply()),(!this.options.skipNullAttributes||v!=null)&&(this.attributes[y]=new t(this,y,v));return this},h.prototype.removeAttribute=function(y){var v,S,O;if(y==null)throw new Error("Missing attribute name");if(y=y.valueOf(),Array.isArray(y))for(S=0,O=y.length;S<O;S++)v=y[S],delete this.attributes[v];else delete this.attributes[y];return this},h.prototype.toString=function(y){return this.options.writer.set(y).element(this)},h.prototype.att=function(y,v){return this.attribute(y,v)},h.prototype.a=function(y,v){return this.attribute(y,v)},h}(r)}).call(dd)});var $n=P((pd,md)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),md.exports=t=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(u)}return o(s,"XMLCData"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).cdata(this)},s}(e)}).call(pd)});var Zn=P((yd,vd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),vd.exports=t=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing comment text");this.text=this.stringify.comment(u)}return o(s,"XMLComment"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).comment(this)},s}(e)}).call(yd)});var eo=P((gd,Nd)=>{(function(){var t,e,r,i=o(function(s,a){for(var u in a)n.call(a,u)&&(s[u]=a[u]);function l(){this.constructor=s}return o(l,"ctor"),l.prototype=a.prototype,s.prototype=new l,s.__super__=a.prototype,s},"extend"),n={}.hasOwnProperty;r=Nr().isObject,e=lt(),Nd.exports=t=function(s){i(a,s);function a(u,l,h,y){var v;a.__super__.constructor.call(this,u),r(l)&&(v=l,l=v.version,h=v.encoding,y=v.standalone),l||(l="1.0"),this.version=this.stringify.xmlVersion(l),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),y!=null&&(this.standalone=this.stringify.xmlStandalone(y))}return o(a,"XMLDeclaration"),a.prototype.toString=function(u){return this.options.writer.set(u).declaration(this)},a}(e)}).call(gd)});var to=P((wd,xd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),xd.exports=t=function(n){r(s,n);function s(a,u,l,h,y,v){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");if(l==null)throw new Error("Missing DTD attribute name");if(!h)throw new Error("Missing DTD attribute type");if(!y)throw new Error("Missing DTD attribute default");if(y.indexOf("#")!==0&&(y="#"+y),!y.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(v&&!y.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(u),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(h),this.defaultValue=this.stringify.dtdAttDefault(v),this.defaultValueType=y}return o(s,"XMLDTDAttList"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdAttList(this)},s}(e)}).call(wd)});var ro=P((Ed,Cd)=>{(function(){var t,e,r,i=o(function(s,a){for(var u in a)n.call(a,u)&&(s[u]=a[u]);function l(){this.constructor=s}return o(l,"ctor"),l.prototype=a.prototype,s.prototype=new l,s.__super__=a.prototype,s},"extend"),n={}.hasOwnProperty;r=Nr().isObject,e=lt(),Cd.exports=t=function(s){i(a,s);function a(u,l,h,y){if(a.__super__.constructor.call(this,u),h==null)throw new Error("Missing entity name");if(y==null)throw new Error("Missing entity value");if(this.pe=!!l,this.name=this.stringify.eleName(h),!r(y))this.value=this.stringify.dtdEntityValue(y);else{if(!y.pubID&&!y.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(y.pubID&&!y.sysID)throw new Error("System identifier is required for a public external entity");if(y.pubID!=null&&(this.pubID=this.stringify.dtdPubID(y.pubID)),y.sysID!=null&&(this.sysID=this.stringify.dtdSysID(y.sysID)),y.nData!=null&&(this.nData=this.stringify.dtdNData(y.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}}return o(a,"XMLDTDEntity"),a.prototype.toString=function(u){return this.options.writer.set(u).dtdEntity(this)},a}(e)}).call(Ed)});var io=P((Sd,Td)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),Td.exports=t=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.eleName(u),this.value=this.stringify.dtdElementValue(l)}return o(s,"XMLDTDElement"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdElement(this)},s}(e)}).call(Sd)});var no=P((bd,Ad)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),Ad.exports=t=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing notation name");if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(u),l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return o(s,"XMLDTDNotation"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdNotation(this)},s}(e)}).call(bd)});var oo=P((Id,Od)=>{(function(){var t,e,r,i,n,s,a,u=o(function(h,y){for(var v in y)l.call(y,v)&&(h[v]=y[v]);function S(){this.constructor=h}return o(S,"ctor"),S.prototype=y.prototype,h.prototype=new S,h.__super__=y.prototype,h},"extend"),l={}.hasOwnProperty;a=Nr().isObject,s=lt(),t=to(),r=ro(),e=io(),i=no(),Od.exports=n=function(h){u(y,h);function y(v,S,O){var g,N;y.__super__.constructor.call(this,v),this.documentObject=v,a(S)&&(g=S,S=g.pubID,O=g.sysID),O==null&&(N=[S,O],O=N[0],S=N[1]),S!=null&&(this.pubID=this.stringify.dtdPubID(S)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return o(y,"XMLDocType"),y.prototype.element=function(v,S){var O;return O=new e(this,v,S),this.children.push(O),this},y.prototype.attList=function(v,S,O,g,N){var D;return D=new t(this,v,S,O,g,N),this.children.push(D),this},y.prototype.entity=function(v,S){var O;return O=new r(this,!1,v,S),this.children.push(O),this},y.prototype.pEntity=function(v,S){var O;return O=new r(this,!0,v,S),this.children.push(O),this},y.prototype.notation=function(v,S){var O;return O=new i(this,v,S),this.children.push(O),this},y.prototype.toString=function(v){return this.options.writer.set(v).docType(this)},y.prototype.ele=function(v,S){return this.element(v,S)},y.prototype.att=function(v,S,O,g,N){return this.attList(v,S,O,g,N)},y.prototype.ent=function(v,S){return this.entity(v,S)},y.prototype.pent=function(v,S){return this.pEntity(v,S)},y.prototype.not=function(v,S){return this.notation(v,S)},y.prototype.up=function(){return this.root()||this.documentObject},y}(s)}).call(Id)});var so=P((Rd,Dd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Dd.exports=e=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing raw text");this.value=this.stringify.raw(u)}return o(s,"XMLRaw"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).raw(this)},s}(t)}).call(Rd)});var ao=P((Pd,_d)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),_d.exports=e=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing element text");this.value=this.stringify.eleText(u)}return o(s,"XMLText"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).text(this)},s}(t)}).call(Pd)});var uo=P((kd,qd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),qd.exports=e=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(u),l&&(this.value=this.stringify.insValue(l))}return o(s,"XMLProcessingInstruction"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).processingInstruction(this)},s}(t)}).call(kd)});var lt=P((Ld,Md)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,O={}.hasOwnProperty;S=Nr(),v=S.isObject,y=S.isFunction,h=S.isEmpty,n=null,t=null,e=null,r=null,i=null,u=null,l=null,a=null,Md.exports=s=function(){function g(N){this.parent=N,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],n||(n=Qn(),t=$n(),e=Zn(),r=eo(),i=oo(),u=so(),l=ao(),a=uo())}return o(g,"XMLNode"),g.prototype.element=function(N,D,E){var p,C,R,_,T,A,w,K,X,F;if(A=null,D==null&&(D={}),D=D.valueOf(),v(D)||(X=[D,E],E=X[0],D=X[1]),N!=null&&(N=N.valueOf()),Array.isArray(N))for(R=0,w=N.length;R<w;R++)C=N[R],A=this.element(C);else if(y(N))A=this.element(N.apply());else if(v(N)){for(T in N)if(O.call(N,T))if(F=N[T],y(F)&&(F=F.apply()),v(F)&&h(F)&&(F=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(T.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F))for(_=0,K=F.length;_<K;_++)C=F[_],p={},p[T]=C,A=this.element(p);else v(F)?(A=this.element(T),A.element(F)):A=this.element(T,F)}else!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?A=this.text(E):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&N.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(E):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&N.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(E):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&N.indexOf(this.stringify.convertRawKey)===0?A=this.raw(E):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&N.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(N.substr(this.stringify.convertPIKey.length),E):A=this.node(N,D,E);if(A==null)throw new Error("Could not create any elements with: "+N);return A},g.prototype.insertBefore=function(N,D,E){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C),p=this.parent.element(N,D,E),Array.prototype.push.apply(this.parent.children,R),p},g.prototype.insertAfter=function(N,D,E){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C+1),p=this.parent.element(N,D,E),Array.prototype.push.apply(this.parent.children,R),p},g.prototype.remove=function(){var N,D;if(this.isRoot)throw new Error("Cannot remove the root element");return N=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[N,N-N+1].concat(D=[])),this.parent},g.prototype.node=function(N,D,E){var p,C;return N!=null&&(N=N.valueOf()),D||(D={}),D=D.valueOf(),v(D)||(C=[D,E],E=C[0],D=C[1]),p=new n(this,N,D),E!=null&&p.text(E),this.children.push(p),p},g.prototype.text=function(N){var D;return D=new l(this,N),this.children.push(D),this},g.prototype.cdata=function(N){var D;return D=new t(this,N),this.children.push(D),this},g.prototype.comment=function(N){var D;return D=new e(this,N),this.children.push(D),this},g.prototype.commentBefore=function(N){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E),D=this.parent.comment(N),Array.prototype.push.apply(this.parent.children,p),this},g.prototype.commentAfter=function(N){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E+1),D=this.parent.comment(N),Array.prototype.push.apply(this.parent.children,p),this},g.prototype.raw=function(N){var D;return D=new u(this,N),this.children.push(D),this},g.prototype.instruction=function(N,D){var E,p,C,R,_;if(N!=null&&(N=N.valueOf()),D!=null&&(D=D.valueOf()),Array.isArray(N))for(R=0,_=N.length;R<_;R++)E=N[R],this.instruction(E);else if(v(N))for(E in N)O.call(N,E)&&(p=N[E],this.instruction(E,p));else y(D)&&(D=D.apply()),C=new a(this,N,D),this.children.push(C);return this},g.prototype.instructionBefore=function(N,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p),E=this.parent.instruction(N,D),Array.prototype.push.apply(this.parent.children,C),this},g.prototype.instructionAfter=function(N,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p+1),E=this.parent.instruction(N,D),Array.prototype.push.apply(this.parent.children,C),this},g.prototype.declaration=function(N,D,E){var p,C;return p=this.document(),C=new r(p,N,D,E),p.children[0]instanceof r?p.children[0]=C:p.children.unshift(C),p.root()||p},g.prototype.doctype=function(N,D){var E,p,C,R,_,T,A,w,K,X;for(p=this.document(),C=new i(p,N,D),K=p.children,R=_=0,A=K.length;_<A;R=++_)if(E=K[R],E instanceof i)return p.children[R]=C,C;for(X=p.children,R=T=0,w=X.length;T<w;R=++T)if(E=X[R],E.isRoot)return p.children.splice(R,0,C),C;return p.children.push(C),C},g.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},g.prototype.root=function(){var N;for(N=this;N;){if(N.isDocument)return N.rootObject;if(N.isRoot)return N;N=N.parent}},g.prototype.document=function(){var N;for(N=this;N;){if(N.isDocument)return N;N=N.parent}},g.prototype.end=function(N){return this.document().end(N)},g.prototype.prev=function(){var N;if(N=this.parent.children.indexOf(this),N<1)throw new Error("Already at the first node");return this.parent.children[N-1]},g.prototype.next=function(){var N;if(N=this.parent.children.indexOf(this),N===-1||N===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[N+1]},g.prototype.importDocument=function(N){var D;return D=N.root().clone(),D.parent=this,D.isRoot=!1,this.children.push(D),this},g.prototype.ele=function(N,D,E){return this.element(N,D,E)},g.prototype.nod=function(N,D,E){return this.node(N,D,E)},g.prototype.txt=function(N){return this.text(N)},g.prototype.dat=function(N){return this.cdata(N)},g.prototype.com=function(N){return this.comment(N)},g.prototype.ins=function(N,D){return this.instruction(N,D)},g.prototype.doc=function(){return this.document()},g.prototype.dec=function(N,D,E){return this.declaration(N,D,E)},g.prototype.dtd=function(N,D){return this.doctype(N,D)},g.prototype.e=function(N,D,E){return this.element(N,D,E)},g.prototype.n=function(N,D,E){return this.node(N,D,E)},g.prototype.t=function(N){return this.text(N)},g.prototype.d=function(N){return this.cdata(N)},g.prototype.c=function(N){return this.comment(N)},g.prototype.r=function(N){return this.raw(N)},g.prototype.i=function(N,D){return this.instruction(N,D)},g.prototype.u=function(){return this.up()},g.prototype.importXMLBuilder=function(N){return this.importDocument(N)},g}()}).call(Ld)});var Va=P((Fd,Wd)=>{(function(){var t,e=o(function(i,n){return function(){return i.apply(n,arguments)}},"bind"),r={}.hasOwnProperty;Wd.exports=t=function(){function i(n){this.assertLegalChar=e(this.assertLegalChar,this);var s,a,u;n||(n={}),this.noDoubleEncoding=n.noDoubleEncoding,a=n.stringify||{};for(s in a)r.call(a,s)&&(u=a[s],this[s]=u)}return o(i,"XMLStringifier"),i.prototype.eleName=function(n){return n=""+n||"",this.assertLegalChar(n)},i.prototype.eleText=function(n){return n=""+n||"",this.assertLegalChar(this.elEscape(n))},i.prototype.cdata=function(n){return n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n)},i.prototype.comment=function(n){if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},i.prototype.raw=function(n){return""+n||""},i.prototype.attName=function(n){return n=""+n||""},i.prototype.attValue=function(n){return n=""+n||"",this.attEscape(n)},i.prototype.insTarget=function(n){return""+n||""},i.prototype.insValue=function(n){if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return n},i.prototype.xmlVersion=function(n){if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},i.prototype.xmlEncoding=function(n){if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return n},i.prototype.xmlStandalone=function(n){return n?"yes":"no"},i.prototype.dtdPubID=function(n){return""+n||""},i.prototype.dtdSysID=function(n){return""+n||""},i.prototype.dtdElementValue=function(n){return""+n||""},i.prototype.dtdAttType=function(n){return""+n||""},i.prototype.dtdAttDefault=function(n){return n!=null?""+n||"":n},i.prototype.dtdEntityValue=function(n){return""+n||""},i.prototype.dtdNData=function(n){return""+n||""},i.prototype.convertAttKey="@",i.prototype.convertPIKey="?",i.prototype.convertTextKey="#text",i.prototype.convertCDataKey="#cdata",i.prototype.convertCommentKey="#comment",i.prototype.convertRawKey="#raw",i.prototype.assertLegalChar=function(n){var s;if(s=n.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),s)throw new Error("Invalid character in string: "+n+" at index "+s.index);return n},i.prototype.elEscape=function(n){var s;return s=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},i.prototype.attEscape=function(n){var s;return s=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},i}()}).call(Fd)});var za=P((Bd,Ud)=>{(function(){var t,e={}.hasOwnProperty;Ud.exports=t=function(){function r(i){var n,s,a,u,l,h,y,v,S;i||(i={}),this.pretty=i.pretty||!1,this.allowEmpty=(s=i.allowEmpty)!=null?s:!1,this.pretty?(this.indent=(a=i.indent)!=null?a:" ",this.newline=(u=i.newline)!=null?u:`
|
|
18
|
-
`,this.offset=(l=i.offset)!=null?l:0,this.dontprettytextnodes=(h=i.dontprettytextnodes)!=null?h:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(y=i.spacebeforeslash)!=null?y:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,v=i.writer||{};for(n in v)e.call(v,n)&&(S=v[n],this[n]=S)}return
|
|
19
|
-
`,this.offset="offset"in i?i.offset:0,this.dontprettytextnodes="dontprettytextnodes"in i?i.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in i?i.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,s=i.writer||{};for(n in s)e.call(s,n)&&(a=s[n],this[n]=a);return this},r.prototype.space=function(i){var n;return this.pretty?(n=(i||0)+this.offset+1,n>0?new Array(n).join(this.indent):""):""},r}()}).call(Bd)});var xs=P((Vd,zd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,O,g=o(function(D,E){for(var p in E)N.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return o(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),N={}.hasOwnProperty;a=eo(),u=oo(),t=$n(),e=Zn(),l=Qn(),y=so(),S=ao(),h=uo(),r=to(),i=io(),n=ro(),s=no(),O=za(),zd.exports=v=function(D){g(E,D);function E(p){E.__super__.constructor.call(this,p)}return o(E,"XMLStringWriter"),E.prototype.document=function(p){var C,R,_,T,A;for(this.textispresent=!1,T="",A=p.children,R=0,_=A.length;R<_;R++)C=A[R],T+=function(){switch(!1){case!(C instanceof a):return this.declaration(C);case!(C instanceof u):return this.docType(C);case!(C instanceof e):return this.comment(C);case!(C instanceof h):return this.processingInstruction(C);default:return this.element(C,0)}}.call(this);return this.pretty&&T.slice(-this.newline.length)===this.newline&&(T=T.slice(0,-this.newline.length)),T},E.prototype.attribute=function(p){return" "+p.name+'="'+p.value+'"'},E.prototype.cdata=function(p,C){return this.space(C)+"<![CDATA["+p.text+"]]>"+this.newline},E.prototype.comment=function(p,C){return this.space(C)+"<!-- "+p.text+" -->"+this.newline},E.prototype.declaration=function(p,C){var R;return R=this.space(C),R+='<?xml version="'+p.version+'"',p.encoding!=null&&(R+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(R+=' standalone="'+p.standalone+'"'),R+=this.spacebeforeslash+"?>",R+=this.newline,R},E.prototype.docType=function(p,C){var R,_,T,A,w;if(C||(C=0),A=this.space(C),A+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?A+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(A+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(A+=" [",A+=this.newline,w=p.children,_=0,T=w.length;_<T;_++)R=w[_],A+=function(){switch(!1){case!(R instanceof r):return this.dtdAttList(R,C+1);case!(R instanceof i):return this.dtdElement(R,C+1);case!(R instanceof n):return this.dtdEntity(R,C+1);case!(R instanceof s):return this.dtdNotation(R,C+1);case!(R instanceof t):return this.cdata(R,C+1);case!(R instanceof e):return this.comment(R,C+1);case!(R instanceof h):return this.processingInstruction(R,C+1);default:throw new Error("Unknown DTD node type: "+R.constructor.name)}}.call(this);A+="]"}return A+=this.spacebeforeslash+">",A+=this.newline,A},E.prototype.element=function(p,C){var R,_,T,A,w,K,X,F,oe,We,Fe,bt,Z;C||(C=0),Z=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),bt=this.space(C),F="",F+=bt+"<"+p.name,oe=p.attributes;for(X in oe)N.call(oe,X)&&(R=oe[X],F+=this.attribute(R));if(p.children.length===0||p.children.every(function(xr){return xr.value===""}))this.allowEmpty?F+="></"+p.name+">"+this.newline:F+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)F+=">",F+=p.children[0].value,F+="</"+p.name+">"+this.newline;else{if(this.dontprettytextnodes){for(We=p.children,T=0,w=We.length;T<w;T++)if(_=We[T],_.value!=null){this.textispresent++,Z=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,bt=this.space(C)),F+=">"+this.newline,Fe=p.children,A=0,K=Fe.length;A<K;A++)_=Fe[A],F+=function(){switch(!1){case!(_ instanceof t):return this.cdata(_,C+1);case!(_ instanceof e):return this.comment(_,C+1);case!(_ instanceof l):return this.element(_,C+1);case!(_ instanceof y):return this.raw(_,C+1);case!(_ instanceof S):return this.text(_,C+1);case!(_ instanceof h):return this.processingInstruction(_,C+1);default:throw new Error("Unknown XML node type: "+_.constructor.name)}}.call(this);Z&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),F+=bt+"</"+p.name+">"+this.newline}return F},E.prototype.processingInstruction=function(p,C){var R;return R=this.space(C)+"<?"+p.target,p.value&&(R+=" "+p.value),R+=this.spacebeforeslash+"?>"+this.newline,R},E.prototype.raw=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.text=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.dtdAttList=function(p,C){var R;return R=this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(R+=" "+p.defaultValueType),p.defaultValue&&(R+=' "'+p.defaultValue+'"'),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.dtdElement=function(p,C){return this.space(C)+"<!ELEMENT "+p.name+" "+p.value+this.spacebeforeslash+">"+this.newline},E.prototype.dtdEntity=function(p,C){var R;return R=this.space(C)+"<!ENTITY",p.pe&&(R+=" %"),R+=" "+p.name,p.value?R+=' "'+p.value+'"':(p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),p.nData&&(R+=" NDATA "+p.nData)),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.dtdNotation=function(p,C){var R;return R=this.space(C)+"<!NOTATION "+p.name,p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?R+=' PUBLIC "'+p.pubID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.openNode=function(p,C){var R,_,T,A;if(C||(C=0),p instanceof l){T=this.space(C)+"<"+p.name,A=p.attributes;for(_ in A)N.call(A,_)&&(R=A[_],T+=this.attribute(R));return T+=(p.children?">":"/>")+this.newline,T}else return T=this.space(C)+"<!DOCTYPE "+p.rootNodeName,p.pubID&&p.sysID?T+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(T+=' SYSTEM "'+p.sysID+'"'),T+=(p.children?" [":">")+this.newline,T},E.prototype.closeNode=function(p,C){switch(C||(C=0),!1){case!(p instanceof l):return this.space(C)+"</"+p.name+">"+this.newline;case!(p instanceof u):return this.space(C)+"]>"+this.newline}},E}(O)}).call(Vd)});var Kd=P((Hd,jd)=>{(function(){var t,e,r,i,n,s=o(function(u,l){for(var h in l)a.call(l,h)&&(u[h]=l[h]);function y(){this.constructor=u}return o(y,"ctor"),y.prototype=l.prototype,u.prototype=new y,u.__super__=l.prototype,u},"extend"),a={}.hasOwnProperty;n=Nr().isPlainObject,e=lt(),i=Va(),r=xs(),jd.exports=t=function(u){s(l,u);function l(h){l.__super__.constructor.call(this,null),h||(h={}),h.writer||(h.writer=new r),this.options=h,this.stringify=new i(h),this.isDocument=!0}return o(l,"XMLDocument"),l.prototype.end=function(h){var y;return h?n(h)&&(y=h,h=this.options.writer.set(y)):h=this.options.writer,h.document(this)},l.prototype.toString=function(h){return this.options.writer.set(h).document(this)},l}(e)}).call(Hd)});var Jd=P((Xd,Gd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,O,g,N,D,E,p,C,R={}.hasOwnProperty;C=Nr(),E=C.isObject,D=C.isFunction,p=C.isPlainObject,y=Qn(),e=$n(),r=Zn(),S=so(),N=ao(),v=uo(),u=eo(),l=oo(),i=to(),s=ro(),n=io(),a=no(),t=Ua(),g=Va(),O=xs(),Gd.exports=h=function(){function _(T,A,w){var K;T||(T={}),T.writer?p(T.writer)&&(K=T.writer,T.writer=new O(K)):T.writer=new O(T),this.options=T,this.writer=T.writer,this.stringify=new g(T),this.onDataCallback=A||function(){},this.onEndCallback=w||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(_,"XMLDocumentCB"),_.prototype.node=function(T,A,w){var K;if(T==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),T=T.valueOf(),A==null&&(A={}),A=A.valueOf(),E(A)||(K=[A,w],w=K[0],A=K[1]),this.currentNode=new y(this,T,A),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,w!=null&&this.text(w),this},_.prototype.element=function(T,A,w){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(T,A,w)},_.prototype.attribute=function(T,A){var w,K;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(T!=null&&(T=T.valueOf()),E(T))for(w in T)R.call(T,w)&&(K=T[w],this.attribute(w,K));else D(A)&&(A=A.apply()),(!this.options.skipNullAttributes||A!=null)&&(this.currentNode.attributes[T]=new t(this,T,A));return this},_.prototype.text=function(T){var A;return this.openCurrent(),A=new N(this,T),this.onData(this.writer.text(A,this.currentLevel+1)),this},_.prototype.cdata=function(T){var A;return this.openCurrent(),A=new e(this,T),this.onData(this.writer.cdata(A,this.currentLevel+1)),this},_.prototype.comment=function(T){var A;return this.openCurrent(),A=new r(this,T),this.onData(this.writer.comment(A,this.currentLevel+1)),this},_.prototype.raw=function(T){var A;return this.openCurrent(),A=new S(this,T),this.onData(this.writer.raw(A,this.currentLevel+1)),this},_.prototype.instruction=function(T,A){var w,K,X,F,oe;if(this.openCurrent(),T!=null&&(T=T.valueOf()),A!=null&&(A=A.valueOf()),Array.isArray(T))for(w=0,F=T.length;w<F;w++)K=T[w],this.instruction(K);else if(E(T))for(K in T)R.call(T,K)&&(X=T[K],this.instruction(K,X));else D(A)&&(A=A.apply()),oe=new v(this,T,A),this.onData(this.writer.processingInstruction(oe,this.currentLevel+1));return this},_.prototype.declaration=function(T,A,w){var K;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return K=new u(this,T,A,w),this.onData(this.writer.declaration(K,this.currentLevel+1)),this},_.prototype.doctype=function(T,A,w){if(this.openCurrent(),T==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new l(this,A,w),this.currentNode.rootNodeName=T,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},_.prototype.dtdElement=function(T,A){var w;return this.openCurrent(),w=new n(this,T,A),this.onData(this.writer.dtdElement(w,this.currentLevel+1)),this},_.prototype.attList=function(T,A,w,K,X){var F;return this.openCurrent(),F=new i(this,T,A,w,K,X),this.onData(this.writer.dtdAttList(F,this.currentLevel+1)),this},_.prototype.entity=function(T,A){var w;return this.openCurrent(),w=new s(this,!1,T,A),this.onData(this.writer.dtdEntity(w,this.currentLevel+1)),this},_.prototype.pEntity=function(T,A){var w;return this.openCurrent(),w=new s(this,!0,T,A),this.onData(this.writer.dtdEntity(w,this.currentLevel+1)),this},_.prototype.notation=function(T,A){var w;return this.openCurrent(),w=new a(this,T,A),this.onData(this.writer.dtdNotation(w,this.currentLevel+1)),this},_.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},_.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},_.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},_.prototype.openNode=function(T){if(!T.isOpen)return!this.root&&this.currentLevel===0&&T instanceof y&&(this.root=T),this.onData(this.writer.openNode(T,this.currentLevel)),T.isOpen=!0},_.prototype.closeNode=function(T){if(!T.isClosed)return this.onData(this.writer.closeNode(T,this.currentLevel)),T.isClosed=!0},_.prototype.onData=function(T){return this.documentStarted=!0,this.onDataCallback(T)},_.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},_.prototype.ele=function(){return this.element.apply(this,arguments)},_.prototype.nod=function(T,A,w){return this.node(T,A,w)},_.prototype.txt=function(T){return this.text(T)},_.prototype.dat=function(T){return this.cdata(T)},_.prototype.com=function(T){return this.comment(T)},_.prototype.ins=function(T,A){return this.instruction(T,A)},_.prototype.dec=function(T,A,w){return this.declaration(T,A,w)},_.prototype.dtd=function(T,A,w){return this.doctype(T,A,w)},_.prototype.e=function(T,A,w){return this.element(T,A,w)},_.prototype.n=function(T,A,w){return this.node(T,A,w)},_.prototype.t=function(T){return this.text(T)},_.prototype.d=function(T){return this.cdata(T)},_.prototype.c=function(T){return this.comment(T)},_.prototype.r=function(T){return this.raw(T)},_.prototype.i=function(T,A){return this.instruction(T,A)},_.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.ent=function(T,A){return this.entity(T,A)},_.prototype.pent=function(T,A){return this.pEntity(T,A)},_.prototype.not=function(T,A){return this.notation(T,A)},_}()}).call(Xd)});var $d=P((Yd,Qd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,O,g=o(function(D,E){for(var p in E)N.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return o(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),N={}.hasOwnProperty;a=eo(),u=oo(),t=$n(),e=Zn(),l=Qn(),y=so(),S=ao(),h=uo(),r=to(),i=io(),n=ro(),s=no(),O=za(),Qd.exports=v=function(D){g(E,D);function E(p,C){E.__super__.constructor.call(this,C),this.stream=p}return o(E,"XMLStreamWriter"),E.prototype.document=function(p){var C,R,_,T,A,w,K,X;for(w=p.children,R=0,T=w.length;R<T;R++)C=w[R],C.isLastRootNode=!1;for(p.children[p.children.length-1].isLastRootNode=!0,K=p.children,X=[],_=0,A=K.length;_<A;_++)switch(C=K[_],!1){case!(C instanceof a):X.push(this.declaration(C));break;case!(C instanceof u):X.push(this.docType(C));break;case!(C instanceof e):X.push(this.comment(C));break;case!(C instanceof h):X.push(this.processingInstruction(C));break;default:X.push(this.element(C))}return X},E.prototype.attribute=function(p){return this.stream.write(" "+p.name+'="'+p.value+'"')},E.prototype.cdata=function(p,C){return this.stream.write(this.space(C)+"<![CDATA["+p.text+"]]>"+this.endline(p))},E.prototype.comment=function(p,C){return this.stream.write(this.space(C)+"<!-- "+p.text+" -->"+this.endline(p))},E.prototype.declaration=function(p,C){return this.stream.write(this.space(C)),this.stream.write('<?xml version="'+p.version+'"'),p.encoding!=null&&this.stream.write(' encoding="'+p.encoding+'"'),p.standalone!=null&&this.stream.write(' standalone="'+p.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(p))},E.prototype.docType=function(p,C){var R,_,T,A;if(C||(C=0),this.stream.write(this.space(C)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p)),A=p.children,_=0,T=A.length;_<T;_++)switch(R=A[_],!1){case!(R instanceof r):this.dtdAttList(R,C+1);break;case!(R instanceof i):this.dtdElement(R,C+1);break;case!(R instanceof n):this.dtdEntity(R,C+1);break;case!(R instanceof s):this.dtdNotation(R,C+1);break;case!(R instanceof t):this.cdata(R,C+1);break;case!(R instanceof e):this.comment(R,C+1);break;case!(R instanceof h):this.processingInstruction(R,C+1);break;default:throw new Error("Unknown DTD node type: "+R.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(p))},E.prototype.element=function(p,C){var R,_,T,A,w,K,X,F;C||(C=0),F=this.space(C),this.stream.write(F+"<"+p.name),K=p.attributes;for(w in K)N.call(K,w)&&(R=K[w],this.attribute(R));if(p.children.length===0||p.children.every(function(oe){return oe.value===""}))this.allowEmpty?this.stream.write("></"+p.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)this.stream.write(">"),this.stream.write(p.children[0].value),this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.newline),X=p.children,T=0,A=X.length;T<A;T++)switch(_=X[T],!1){case!(_ instanceof t):this.cdata(_,C+1);break;case!(_ instanceof e):this.comment(_,C+1);break;case!(_ instanceof l):this.element(_,C+1);break;case!(_ instanceof y):this.raw(_,C+1);break;case!(_ instanceof S):this.text(_,C+1);break;case!(_ instanceof h):this.processingInstruction(_,C+1);break;default:throw new Error("Unknown XML node type: "+_.constructor.name)}this.stream.write(F+"</"+p.name+">")}return this.stream.write(this.endline(p))},E.prototype.processingInstruction=function(p,C){return this.stream.write(this.space(C)+"<?"+p.target),p.value&&this.stream.write(" "+p.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(p))},E.prototype.raw=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.text=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.dtdAttList=function(p,C){return this.stream.write(this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType),p.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+p.defaultValueType),p.defaultValue&&this.stream.write(' "'+p.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdElement=function(p,C){return this.stream.write(this.space(C)+"<!ELEMENT "+p.name+" "+p.value),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdEntity=function(p,C){return this.stream.write(this.space(C)+"<!ENTITY"),p.pe&&this.stream.write(" %"),this.stream.write(" "+p.name),p.value?this.stream.write(' "'+p.value+'"'):(p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.nData&&this.stream.write(" NDATA "+p.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdNotation=function(p,C){return this.stream.write(this.space(C)+"<!NOTATION "+p.name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.pubID?this.stream.write(' PUBLIC "'+p.pubID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.endline=function(p){return p.isLastRootNode?"":this.newline},E}(O)}).call(Yd)});var eh=P((Zd,co)=>{(function(){var t,e,r,i,n,s,a;a=Nr(),n=a.assign,s=a.isFunction,t=Kd(),e=Jd(),i=xs(),r=$d(),co.exports.create=function(u,l,h,y){var v,S;if(u==null)throw new Error("Root element needs a name");return y=n({},l,h,y),v=new t(y),S=v.element(u),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.doctype(y)),S},co.exports.begin=function(u,l,h){var y;return s(u)&&(y=[u,l],l=y[0],h=y[1],u={}),l?new e(u,l,h):new t(u)},co.exports.stringWriter=function(u){return new i(u)},co.exports.streamWriter=function(u,l){return new r(u,l)}}).call(Zd)});var th=P(Ha=>{(function(){"use strict";var t,e,r,i,n,s={}.hasOwnProperty;t=eh(),e=ws().defaults,i=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),n=o(function(a){return"<![CDATA["+r(a)+"]]>"},"wrapCDATA"),r=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),Ha.Builder=function(){function a(u){var l,h,y;this.options={},h=e["0.2"];for(l in h)s.call(h,l)&&(y=h[l],this.options[l]=y);for(l in u)s.call(u,l)&&(y=u[l],this.options[l]=y)}return o(a,"Builder"),a.prototype.buildObject=function(u){var l,h,y,v,S;return l=this.options.attrkey,h=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(S=Object.keys(u)[0],u=u[S]):S=this.options.rootName,y=function(O){return function(g,N){var D,E,p,C,R,_;if(typeof N!="object")O.options.cdata&&i(N)?g.raw(n(N)):g.txt(N);else if(Array.isArray(N)){for(C in N)if(s.call(N,C)){E=N[C];for(R in E)p=E[R],g=y(g.ele(R),p).up()}}else for(R in N)if(s.call(N,R))if(E=N[R],R===l){if(typeof E=="object")for(D in E)_=E[D],g=g.att(D,_)}else if(R===h)O.options.cdata&&i(E)?g=g.raw(n(E)):g=g.txt(E);else if(Array.isArray(E))for(C in E)s.call(E,C)&&(p=E[C],typeof p=="string"?O.options.cdata&&i(p)?g=g.ele(R).raw(n(p)).up():g=g.ele(R,p).up():g=y(g.ele(R),p).up());else typeof E=="object"?g=y(g.ele(R),E).up():typeof E=="string"&&O.options.cdata&&i(E)?g=g.ele(R).raw(n(E)).up():(E==null&&(E=""),g=g.ele(R,E.toString()).up());return g}}(this),v=t.create(S,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(v,u).end(this.options.renderOpts)},a}()}).call(Ha)});var rh=P(Es=>{(function(t){t.parser=function(m,f){return new r(m,f)},t.SAXParser=r,t.SAXStream=h,t.createStream=l,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(m,f){if(!(this instanceof r))return new r(m,f);var q=this;n(q),q.q=q.c="",q.bufferCheckPosition=t.MAX_BUFFER_LENGTH,q.opt=f||{},q.opt.lowercase=q.opt.lowercase||q.opt.lowercasetags,q.looseCase=q.opt.lowercase?"toLowerCase":"toUpperCase",q.tags=[],q.closed=q.closedRoot=q.sawRoot=!1,q.tag=q.error=null,q.strict=!!m,q.noscript=!!(m||q.opt.noscript),q.state=w.BEGIN,q.strictEntities=q.opt.strictEntities,q.ENTITIES=q.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),q.attribList=[],q.opt.xmlns&&(q.ns=Object.create(g)),q.trackPosition=q.opt.position!==!1,q.trackPosition&&(q.position=q.line=q.column=0),X(q,"onready")}o(r,"SAXParser"),Object.create||(Object.create=function(m){function f(){}o(f,"F"),f.prototype=m;var q=new f;return q}),Object.keys||(Object.keys=function(m){var f=[];for(var q in m)m.hasOwnProperty(q)&&f.push(q);return f});function i(m){for(var f=Math.max(t.MAX_BUFFER_LENGTH,10),q=0,I=0,te=e.length;I<te;I++){var we=m[e[I]].length;if(we>f)switch(e[I]){case"textNode":oe(m);break;case"cdata":F(m,"oncdata",m.cdata),m.cdata="";break;case"script":F(m,"onscript",m.script),m.script="";break;default:Fe(m,"Max buffer length exceeded: "+e[I])}q=Math.max(q,we)}var Te=t.MAX_BUFFER_LENGTH-q;m.bufferCheckPosition=Te+m.position}o(i,"checkBufferLength");function n(m){for(var f=0,q=e.length;f<q;f++)m[e[f]]=""}o(n,"clearBuffers");function s(m){oe(m),m.cdata!==""&&(F(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(F(m,"onscript",m.script),m.script="")}o(s,"flushBuffers"),r.prototype={end:function(){bt(this)},write:Kr,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=re("stream").Stream}catch{a=o(function(){},"Stream")}var u=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function l(m,f){return new h(m,f)}o(l,"createStream");function h(m,f){if(!(this instanceof h))return new h(m,f);a.apply(this),this._parser=new r(m,f),this.writable=!0,this.readable=!0;var q=this;this._parser.onend=function(){q.emit("end")},this._parser.onerror=function(I){q.emit("error",I),q._parser.error=null},this._decoder=null,u.forEach(function(I){Object.defineProperty(q,"on"+I,{get:function(){return q._parser["on"+I]},set:function(te){if(!te)return q.removeAllListeners(I),q._parser["on"+I]=te,te;q.on(I,te)},enumerable:!0,configurable:!1})})}o(h,"SAXStream"),h.prototype=Object.create(a.prototype,{constructor:{value:h}}),h.prototype.write=function(m){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)){if(!this._decoder){var f=re("string_decoder").StringDecoder;this._decoder=new f("utf8")}m=this._decoder.write(m)}return this._parser.write(m.toString()),this.emit("data",m),!0},h.prototype.end=function(m){return m&&m.length&&this.write(m),this._parser.end(),!0},h.prototype.on=function(m,f){var q=this;return!q._parser["on"+m]&&u.indexOf(m)!==-1&&(q._parser["on"+m]=function(){var I=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);I.splice(0,0,m),q.emit.apply(q,I)}),a.prototype.on.call(q,m,f)};var y="[CDATA[",v="DOCTYPE",S="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",g={xml:S,xmlns:O},N=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function C(m){return m===" "||m===`
|
|
20
|
-
`||m==="\r"||m===" "}
|
|
16
|
+
`);Oa.exports={suppress:!1};function Qy(){typeof process<"u"&&typeof process.emitWarning=="function"&&process.emitWarning(Yy,{type:"NOTE"})}s(Qy,"emitWarning");setTimeout(function(){Oa.exports.suppress||Qy()},0)});var V=P((Fq,jl)=>{var wr={util:Oe()},Zy={};Zy.toString();jl.exports=wr;wr.util.update(wr,{VERSION:"2.1326.0",Signers:{},Protocol:{Json:Ws(),Query:aa(),Rest:qn(),RestJson:la(),RestXml:da()},XML:{Builder:Uc(),Parser:null},JSON:{Builder:qs(),Parser:Ms()},Model:{Api:va(),Operation:ha(),Shape:_n(),Paginator:pa(),ResourceWaiter:ma()},apiLoader:$c(),EndpointCache:Qc().EndpointCache});wa();sl();ol();Gs();vl();xl();Cl();Tl();Vl();zl();Hl();wr.events=new wr.SequentialExecutor;wr.util.memoizedProperty(wr,"endpointCache",function(){return new wr.EndpointCache(wr.config.endpointCacheSize)},!0)});var Da=P(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.default=rv;var ev=tv(re("crypto"));function tv(t){return t&&t.__esModule?t:{default:t}}s(tv,"_interopRequireDefault");function rv(){return ev.default.randomBytes(16)}s(rv,"rng")});var so=P(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.default=void 0;var Kl=[];for(jn=0;jn<256;++jn)Kl[jn]=(jn+256).toString(16).substr(1);var jn;function iv(t,e){var r=e||0,i=Kl;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}s(iv,"bytesToUuid");var nv=iv;no.default=nv});var Jl=P(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.default=void 0;var sv=Gl(Da()),ov=Gl(so());function Gl(t){return t&&t.__esModule?t:{default:t}}s(Gl,"_interopRequireDefault");var Xl,Pa,_a=0,ka=0;function av(t,e,r){var i=e&&r||0,n=e||[];t=t||{};var o=t.node||Xl,a=t.clockseq!==void 0?t.clockseq:Pa;if(o==null||a==null){var u=t.random||(t.rng||sv.default)();o==null&&(o=Xl=[u[0]|1,u[1],u[2],u[3],u[4],u[5]]),a==null&&(a=Pa=(u[6]<<8|u[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),h=t.nsecs!==void 0?t.nsecs:ka+1,y=l-_a+(h-ka)/1e4;if(y<0&&t.clockseq===void 0&&(a=a+1&16383),(y<0||l>_a)&&t.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_a=l,ka=h,Pa=a,l+=122192928e5;var v=((l&268435455)*1e4+h)%4294967296;n[i++]=v>>>24&255,n[i++]=v>>>16&255,n[i++]=v>>>8&255,n[i++]=v&255;var S=l/4294967296*1e4&268435455;n[i++]=S>>>8&255,n[i++]=S&255,n[i++]=S>>>24&15|16,n[i++]=S>>>16&255,n[i++]=a>>>8|128,n[i++]=a&255;for(var O=0;O<6;++O)n[i+O]=o[O];return e||(0,ov.default)(n)}s(av,"v1");var uv=av;oo.default=uv});var qa=P(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.default=hv;di.URL=di.DNS=void 0;var cv=lv(so());function lv(t){return t&&t.__esModule?t:{default:t}}s(lv,"_interopRequireDefault");function fv(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(r){e.push(parseInt(r,16))}),e}s(fv,"uuidToBytes");function dv(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}s(dv,"stringToBytes");var $l="6ba7b810-9dad-11d1-80b4-00c04fd430c8";di.DNS=$l;var Yl="6ba7b811-9dad-11d1-80b4-00c04fd430c8";di.URL=Yl;function hv(t,e,r){var i=s(function(n,o,a,u){var l=a&&u||0;if(typeof n=="string"&&(n=dv(n)),typeof o=="string"&&(o=fv(o)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||o.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var h=r(o.concat(n));if(h[6]=h[6]&15|e,h[8]=h[8]&63|128,a)for(var y=0;y<16;++y)a[l+y]=h[y];return a||(0,cv.default)(h)},"generateUUID");try{i.name=t}catch{}return i.DNS=$l,i.URL=Yl,i}s(hv,"_default")});var Ql=P(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.default=void 0;var pv=mv(re("crypto"));function mv(t){return t&&t.__esModule?t:{default:t}}s(mv,"_interopRequireDefault");function yv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),pv.default.createHash("md5").update(t).digest()}s(yv,"md5");var vv=yv;ao.default=vv});var ef=P(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.default=void 0;var gv=Zl(qa()),Nv=Zl(Ql());function Zl(t){return t&&t.__esModule?t:{default:t}}s(Zl,"_interopRequireDefault");var wv=(0,gv.default)("v3",48,Nv.default),xv=wv;uo.default=xv});var rf=P(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.default=void 0;var Ev=tf(Da()),Cv=tf(so());function tf(t){return t&&t.__esModule?t:{default:t}}s(tf,"_interopRequireDefault");function Sv(t,e,r){var i=e&&r||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var n=t.random||(t.rng||Ev.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var o=0;o<16;++o)e[i+o]=n[o];return e||(0,Cv.default)(n)}s(Sv,"v4");var Tv=Sv;co.default=Tv});var nf=P(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.default=void 0;var bv=Av(re("crypto"));function Av(t){return t&&t.__esModule?t:{default:t}}s(Av,"_interopRequireDefault");function Iv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),bv.default.createHash("sha1").update(t).digest()}s(Iv,"sha1");var Ov=Iv;lo.default=Ov});var of=P(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var Rv=sf(qa()),Dv=sf(nf());function sf(t){return t&&t.__esModule?t:{default:t}}s(sf,"_interopRequireDefault");var Pv=(0,Rv.default)("v5",80,Dv.default),_v=Pv;fo.default=_v});var af=P(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Object.defineProperty(Ki,"v1",{enumerable:!0,get:function(){return kv.default}});Object.defineProperty(Ki,"v3",{enumerable:!0,get:function(){return qv.default}});Object.defineProperty(Ki,"v4",{enumerable:!0,get:function(){return Lv.default}});Object.defineProperty(Ki,"v5",{enumerable:!0,get:function(){return Mv.default}});var kv=ho(Jl()),qv=ho(ef()),Lv=ho(rf()),Mv=ho(of());function ho(t){return t&&t.__esModule?t:{default:t}}s(ho,"_interopRequireDefault")});var Oe=P((sL,uf)=>{var Ct,M={environment:"nodejs",engine:s(function(){if(M.isBrowser()&&typeof navigator<"u")return navigator.userAgent;var e=process.platform+"/"+process.version;return process.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+process.env.AWS_EXECUTION_ENV),e},"engine"),userAgent:s(function(){var e=M.environment,r="aws-sdk-"+e+"/"+V().VERSION;return e==="nodejs"&&(r+=" "+M.engine()),r},"userAgent"),uriEscape:s(function(e){var r=encodeURIComponent(e);return r=r.replace(/[^A-Za-z0-9_.~\-%]+/g,escape),r=r.replace(/[*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()}),r},"uriEscape"),uriEscapePath:s(function(e){var r=[];return M.arrayEach(e.split("/"),function(i){r.push(M.uriEscape(i))}),r.join("/")},"uriEscapePath"),urlParse:s(function(e){return M.url.parse(e)},"urlParse"),urlFormat:s(function(e){return M.url.format(e)},"urlFormat"),queryStringParse:s(function(e){return M.querystring.parse(e)},"queryStringParse"),queryParamsToString:s(function(e){var r=[],i=M.uriEscape,n=Object.keys(e).sort();return M.arrayEach(n,function(o){var a=e[o],u=i(o),l=u+"=";if(Array.isArray(a)){var h=[];M.arrayEach(a,function(y){h.push(i(y))}),l=u+"="+h.sort().join("&"+u+"=")}else a!=null&&(l=u+"="+i(a));r.push(l)}),r.join("&")},"queryParamsToString"),readFileSync:s(function(e){return M.isBrowser()?null:re("fs").readFileSync(e,"utf-8")},"readFileSync"),base64:{encode:s(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 encode number "+e));if(e===null||typeof e>"u")return e;var r=M.buffer.toBuffer(e);return r.toString("base64")},"encode64"),decode:s(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 decode number "+e));return e===null||typeof e>"u"?e:M.buffer.toBuffer(e,"base64")},"decode64")},buffer:{toBuffer:function(t,e){return typeof M.Buffer.from=="function"&&M.Buffer.from!==Uint8Array.from?M.Buffer.from(t,e):new M.Buffer(t,e)},alloc:function(t,e,r){if(typeof t!="number")throw new Error("size passed to alloc must be a number.");if(typeof M.Buffer.alloc=="function")return M.Buffer.alloc(t,e,r);var i=new M.Buffer(t);return e!==void 0&&typeof i.fill=="function"&&i.fill(e,void 0,void 0,r),i},toStream:s(function(e){M.Buffer.isBuffer(e)||(e=M.buffer.toBuffer(e));var r=new M.stream.Readable,i=0;return r._read=function(n){if(i>=e.length)return r.push(null);var o=i+n;o>e.length&&(o=e.length),r.push(e.slice(i,o)),i=o},r},"toStream"),concat:function(t){var e=0,r=0,i=null,n;for(n=0;n<t.length;n++)e+=t[n].length;for(i=M.buffer.alloc(e),n=0;n<t.length;n++)t[n].copy(i,r),r+=t[n].length;return i}},string:{byteLength:s(function(e){if(e==null)return 0;if(typeof e=="string"&&(e=M.buffer.toBuffer(e)),typeof e.byteLength=="number")return e.byteLength;if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.path=="string")return re("fs").lstatSync(e.path).size;throw M.error(new Error("Cannot determine length of "+e),{object:e})},"byteLength"),upperFirst:s(function(e){return e[0].toUpperCase()+e.substr(1)},"upperFirst"),lowerFirst:s(function(e){return e[0].toLowerCase()+e.substr(1)},"lowerFirst")},ini:{parse:s(function(e){var r,i={};return M.arrayEach(e.split(/\r?\n/),function(n){n=n.split(/(^|\s)[;#]/)[0].trim();var o=n[0]==="["&&n[n.length-1]==="]";if(o){if(r=n.substring(1,n.length-1),r==="__proto__"||r.split(/\s/)[1]==="__proto__")throw M.error(new Error("Cannot load profile name '"+r+"' from shared ini file."))}else if(r){var a=n.indexOf("="),u=0,l=n.length-1,h=a!==-1&&a!==u&&a!==l;if(h){var y=n.substring(0,a).trim(),v=n.substring(a+1).trim();i[r]=i[r]||{},i[r][y]=v}}}),i},"string")},fn:{noop:function(){},callback:function(t){if(t)throw t},makeAsync:s(function(e,r){return r&&r<=e.length?e:function(){var i=Array.prototype.slice.call(arguments,0),n=i.pop(),o=e.apply(null,i);n(o)}},"makeAsync")},date:{getDate:s(function(){return Ct||(Ct=V()),Ct.config.systemClockOffset?new Date(new Date().getTime()+Ct.config.systemClockOffset):new Date},"getDate"),iso8601:s(function(e){return e===void 0&&(e=M.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},"iso8601"),rfc822:s(function(e){return e===void 0&&(e=M.date.getDate()),e.toUTCString()},"rfc822"),unixTimestamp:s(function(e){return e===void 0&&(e=M.date.getDate()),e.getTime()/1e3},"unixTimestamp"),from:s(function(e){return typeof e=="number"?new Date(e*1e3):new Date(e)},"format"),format:s(function(e,r){return r||(r="iso8601"),M.date[r](M.date.from(e))},"format"),parseTimestamp:s(function(e){if(typeof e=="number")return new Date(e*1e3);if(e.match(/^\d+$/))return new Date(e*1e3);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw M.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})},"parseTimestamp")},crypto:{crc32Table:[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],crc32:s(function(e){var r=M.crypto.crc32Table,i=-1;typeof e=="string"&&(e=M.buffer.toBuffer(e));for(var n=0;n<e.length;n++){var o=e.readUInt8(n);i=i>>>8^r[(i^o)&255]}return(i^-1)>>>0},"crc32"),hmac:s(function(e,r,i,n){return i||(i="binary"),i==="buffer"&&(i=void 0),n||(n="sha256"),typeof r=="string"&&(r=M.buffer.toBuffer(r)),M.crypto.lib.createHmac(n,e).update(r).digest(i)},"hmac"),md5:s(function(e,r,i){return M.crypto.hash("md5",e,r,i)},"md5"),sha256:s(function(e,r,i){return M.crypto.hash("sha256",e,r,i)},"sha256"),hash:function(t,e,r,i){var n=M.crypto.createHash(t);r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=M.buffer.toBuffer(e));var o=M.arraySliceFn(e),a=M.Buffer.isBuffer(e);if(M.isBrowser()&&typeof ArrayBuffer<"u"&&e&&e.buffer instanceof ArrayBuffer&&(a=!0),i&&typeof e=="object"&&typeof e.on=="function"&&!a)e.on("data",function(v){n.update(v)}),e.on("error",function(v){i(v)}),e.on("end",function(){i(null,n.digest(r))});else if(i&&o&&!a&&typeof FileReader<"u"){var u=0,l=1024*512,h=new FileReader;h.onerror=function(){i(new Error("Failed to read data."))},h.onload=function(){var v=new M.Buffer(new Uint8Array(h.result));n.update(v),u+=v.length,h._continueReading()},h._continueReading=function(){if(u>=e.size){i(null,n.digest(r));return}var v=u+l;v>e.size&&(v=e.size),h.readAsArrayBuffer(o.call(e,u,v))},h._continueReading()}else{M.isBrowser()&&typeof e=="object"&&!a&&(e=new M.Buffer(new Uint8Array(e)));var y=n.update(e).digest(r);return i&&i(null,y),y}},toHex:s(function(e){for(var r=[],i=0;i<e.length;i++)r.push(("0"+e.charCodeAt(i).toString(16)).substr(-2,2));return r.join("")},"toHex"),createHash:s(function(e){return M.crypto.lib.createHash(e)},"createHash")},abort:{},each:s(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,i,e[i]);if(n===M.abort)break}},"each"),arrayEach:s(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,e[i],parseInt(i,10));if(n===M.abort)break}},"arrayEach"),update:s(function(e,r){return M.each(r,s(function(n,o){e[n]=o},"iterator")),e},"update"),merge:s(function(e,r){return M.update(M.copy(e),r)},"merge"),copy:s(function(e){if(e==null)return e;var r={};for(var i in e)r[i]=e[i];return r},"copy"),isEmpty:s(function(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!1;return!0},"isEmpty"),arraySliceFn:s(function(e){var r=e.slice||e.webkitSlice||e.mozSlice;return typeof r=="function"?r:null},"arraySliceFn"),isType:s(function(e,r){return typeof r=="function"&&(r=M.typeName(r)),Object.prototype.toString.call(e)==="[object "+r+"]"},"isType"),typeName:s(function(e){if(Object.prototype.hasOwnProperty.call(e,"name"))return e.name;var r=e.toString(),i=r.match(/^\s*function (.+)\(/);return i?i[1]:r},"typeName"),error:s(function(e,r){var i=null;return typeof e.message=="string"&&e.message!==""&&(typeof r=="string"||r&&r.message)&&(i=M.copy(e),i.message=e.message),e.message=e.message||null,typeof r=="string"?e.message=r:typeof r=="object"&&r!==null&&(M.update(e,r),r.message&&(e.message=r.message),(r.code||r.name)&&(e.code=r.code||r.name),r.stack&&(e.stack=r.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=String(r&&r.name||e.name||e.code||"Error"),e.time=new Date,i&&(e.originalError=i),e},"error"),inherit:s(function(e,r){var i=null;if(r===void 0)r=e,e=Object,i={};else{var n=s(function(){},"ConstructorWrapper");n.prototype=e.prototype,i=new n}return r.constructor===Object&&(r.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),r.constructor.prototype=i,M.update(r.constructor.prototype,r),r.constructor.__super__=e,r.constructor},"inherit"),mixin:s(function(){for(var e=arguments[0],r=1;r<arguments.length;r++)for(var i in arguments[r].prototype){var n=arguments[r].prototype[i];i!=="constructor"&&(e.prototype[i]=n)}return e},"mixin"),hideProperties:s(function(e,r){typeof Object.defineProperty=="function"&&M.arrayEach(r,function(i){Object.defineProperty(e,i,{enumerable:!1,writable:!0,configurable:!0})})},"hideProperties"),property:s(function(e,r,i,n,o){var a={configurable:!0,enumerable:n!==void 0?n:!0};typeof i=="function"&&!o?a.get=i:(a.value=i,a.writable=!0),Object.defineProperty(e,r,a)},"property"),memoizedProperty:s(function(e,r,i,n){var o=null;M.property(e,r,function(){return o===null&&(o=i()),o},n)},"memoizedProperty"),hoistPayloadMember:s(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i],o=n.output;if(o.payload&&!n.hasEventOutput){var a=o.members[o.payload],u=e.data[o.payload];a.type==="structure"&&M.each(u,function(l,h){M.property(e.data,l,h,!1)})}},"hoistPayloadMember"),computeSha256:s(function(e,r){if(M.isNode()){var i=M.stream.Stream,n=re("fs");if(typeof i=="function"&&e instanceof i)if(typeof e.path=="string"){var o={};typeof e.start=="number"&&(o.start=e.start),typeof e.end=="number"&&(o.end=e.end),e=n.createReadStream(e.path,o)}else return r(new Error("Non-file stream objects are not supported with SigV4"))}M.crypto.sha256(e,"hex",function(a,u){a?r(a):r(null,u)})},"computeSha256"),isClockSkewed:s(function(e){if(e)return M.property(Ct.config,"isClockSkewed",Math.abs(new Date().getTime()-e)>=3e5,!1),Ct.config.isClockSkewed},"isClockSkewed"),applyClockOffset:s(function(e){e&&(Ct.config.systemClockOffset=e-new Date().getTime())},"applyClockOffset"),extractRequestId:s(function(e){var r=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!r&&e.data&&e.data.ResponseMetadata&&(r=e.data.ResponseMetadata.RequestId),r&&(e.requestId=r),e.error&&(e.error.requestId=r)},"extractRequestId"),addPromises:s(function(e,r){var i=!1;r===void 0&&Ct&&Ct.config&&(r=Ct.config.getPromisesDependency()),r===void 0&&typeof Promise<"u"&&(r=Promise),typeof r!="function"&&(i=!0),Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var o=e[n];i?o.deletePromisesFromClass&&o.deletePromisesFromClass():o.addPromisesToClass&&o.addPromisesToClass(r)}},"addPromises"),promisifyMethod:s(function(e,r){return s(function(){var n=this,o=Array.prototype.slice.call(arguments);return new r(function(a,u){o.push(function(l,h){l?u(l):a(h)}),n[e].apply(n,o)})},"promise")},"promisifyMethod"),isDualstackAvailable:s(function(e){if(!e)return!1;var r=ya();return typeof e!="string"&&(e=e.serviceIdentifier),typeof e!="string"||!r.hasOwnProperty(e)?!1:!!r[e].dualstackAvailable},"isDualstackAvailable"),calculateRetryDelay:s(function(e,r,i){r||(r={});var n=r.customBackoff||null;if(typeof n=="function")return n(e,i);var o=typeof r.base=="number"?r.base:100,a=Math.random()*(Math.pow(2,e)*o);return a},"calculateRetryDelay"),handleRequestWithRetries:s(function(e,r,i){r||(r={});var n=Ct.HttpClient.getInstance(),o=r.httpOptions||{},a=0,u=s(function(h){var y=r.maxRetries||0;if(h&&h.code==="TimeoutError"&&(h.retryable=!0),h&&h.retryable&&a<y){var v=M.calculateRetryDelay(a,r.retryDelayOptions,h);if(v>=0){a++,setTimeout(l,v+(h.retryAfter||0));return}}i(h)},"errCallback"),l=s(function(){var h="";n.handleRequest(e,o,function(y){y.on("data",function(v){h+=v.toString()}),y.on("end",function(){var v=y.statusCode;if(v<300)i(null,h);else{var S=parseInt(y.headers["retry-after"],10)*1e3||0,O=M.error(new Error,{statusCode:v,retryable:v>=500||v===429});S&&O.retryable&&(O.retryAfter=S),u(O)}})},u)},"sendRequest");Ct.util.defer(l)},"handleRequestWithRetries"),uuid:{v4:s(function(){return af().v4()},"uuidV4")},convertPayloadToString:s(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i].output||{};n.payload&&e.data[n.payload]&&(e.data[n.payload]=e.data[n.payload].toString())},"convertPayloadToString"),defer:s(function(e){typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0)},"defer"),getRequestPayloadShape:s(function(e){var r=e.service.api.operations;if(r){var i=(r||{})[e.operation];if(!(!i||!i.input||!i.input.payload))return i.input.members[i.input.payload]}},"getRequestPayloadShape"),getProfilesFromSharedConfig:s(function(e,r){var i={},n={};if(process.env[M.configOptInEnv])var n=e.loadFrom({isConfig:!0,filename:process.env[M.sharedConfigFileEnv]});var o={};try{var o=e.loadFrom({filename:r||process.env[M.configOptInEnv]&&process.env[M.sharedCredentialsFileEnv]})}catch(h){if(!process.env[M.configOptInEnv])throw h}for(var a=0,u=Object.keys(n);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},n[u[a]]);for(var a=0,u=Object.keys(o);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},o[u[a]]);return i;function l(h,y){for(var v=0,S=Object.keys(y);v<S.length;v++)h[S[v]]=y[S[v]];return h}},"getProfilesFromSharedConfig"),ARN:{validate:s(function(e){return e&&e.indexOf("arn:")===0&&e.split(":").length>=6},"validateARN"),parse:s(function(e){var r=e.split(":");return{partition:r[1],service:r[2],region:r[3],accountId:r[4],resource:r.slice(5).join(":")}},"parseARN"),build:s(function(e){if(e.service===void 0||e.region===void 0||e.accountId===void 0||e.resource===void 0)throw M.error(new Error("Input ARN object is invalid"));return"arn:"+(e.partition||"aws")+":"+e.service+":"+e.region+":"+e.accountId+":"+e.resource},"buildARN")},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};uf.exports=M});var df=P((aL,ff)=>{var Fv=V().util,cf=re("stream").Transform,lf=Fv.buffer.alloc;function Kn(t){cf.call(this,t),this.currentMessageTotalLength=0,this.currentMessagePendingLength=0,this.currentMessage=null,this.messageLengthBuffer=null}s(Kn,"EventMessageChunkerStream");Kn.prototype=Object.create(cf.prototype);Kn.prototype._transform=function(t,e,r){for(var i=t.length,n=0;n<i;){if(!this.currentMessage){var o=i-n;this.messageLengthBuffer||(this.messageLengthBuffer=lf(4));var a=Math.min(4-this.currentMessagePendingLength,o);if(t.copy(this.messageLengthBuffer,this.currentMessagePendingLength,n,n+a),this.currentMessagePendingLength+=a,n+=a,this.currentMessagePendingLength<4)break;this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)),this.messageLengthBuffer=null}var u=Math.min(this.currentMessageTotalLength-this.currentMessagePendingLength,i-n);t.copy(this.currentMessage,this.currentMessagePendingLength,n,n+u),this.currentMessagePendingLength+=u,n+=u,this.currentMessageTotalLength&&this.currentMessageTotalLength===this.currentMessagePendingLength&&(this.push(this.currentMessage),this.currentMessage=null,this.currentMessageTotalLength=0,this.currentMessagePendingLength=0)}r()};Kn.prototype._flush=function(t){this.currentMessageTotalLength?this.currentMessageTotalLength===this.currentMessagePendingLength?t(null,this.currentMessage):t(new Error("Truncated event message received.")):t()};Kn.prototype.allocateMessage=function(t){if(typeof t!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+t);this.currentMessageTotalLength=t,this.currentMessagePendingLength=4,this.currentMessage=lf(t),this.currentMessage.writeUInt32BE(t,0)};ff.exports={EventMessageChunkerStream:Kn}});var yf=P((cL,mf)=>{var hf=V().util,Wv=hf.buffer.toBuffer;function Xn(t){if(t.length!==8)throw new Error("Int64 buffers must be exactly 8 bytes");hf.Buffer.isBuffer(t)||(t=Wv(t)),this.bytes=t}s(Xn,"Int64");Xn.fromNumber=function(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var e=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)e[r]=i;return t<0&&pf(e),new Xn(e)};Xn.prototype.valueOf=function(){var t=this.bytes.slice(0),e=t[0]&128;return e&&pf(t),parseInt(t.toString("hex"),16)*(e?-1:1)};Xn.prototype.toString=function(){return String(this.valueOf())};function pf(t){for(var e=0;e<8;e++)t[e]^=255;for(var e=7;e>-1&&(t[e]++,t[e]===0);e--);}s(pf,"negate");mf.exports={Int64:Xn}});var Nf=P((fL,gf)=>{var po=V().util,Bv=po.buffer.toBuffer,vf=4,mo=vf*2,Gn=4,Uv=mo+Gn*2;function Vv(t){if(po.Buffer.isBuffer(t)||(t=Bv(t)),t.length<Uv)throw new Error("Provided message too short to accommodate event stream message overhead");if(t.length!==t.readUInt32BE(0))throw new Error("Reported message length does not match received message length");var e=t.readUInt32BE(mo);if(e!==po.crypto.crc32(t.slice(0,mo)))throw new Error("The prelude checksum specified in the message ("+e+") does not match the calculated CRC32 checksum.");var r=t.readUInt32BE(t.length-Gn);if(r!==po.crypto.crc32(t.slice(0,t.length-Gn)))throw new Error("The message checksum did not match the expected value of "+r);var i=mo+Gn,n=i+t.readUInt32BE(vf);return{headers:t.slice(i,n),body:t.slice(n,t.length-Gn)}}s(Vv,"splitMessage");gf.exports={splitMessage:Vv}});var Cf=P((hL,Ef)=>{var wf=yf().Int64,zv=Nf().splitMessage,xf="boolean",Hv="byte",jv="short",Kv="integer",Xv="long",Gv="binary",Jv="string",$v="timestamp",Yv="uuid";function Qv(t){for(var e={},r=0;r<t.length;){var i=t.readUInt8(r++),n=t.slice(r,r+i).toString();switch(r+=i,t.readUInt8(r++)){case 0:e[n]={type:xf,value:!0};break;case 1:e[n]={type:xf,value:!1};break;case 2:e[n]={type:Hv,value:t.readInt8(r++)};break;case 3:e[n]={type:jv,value:t.readInt16BE(r)},r+=2;break;case 4:e[n]={type:Kv,value:t.readInt32BE(r)},r+=4;break;case 5:e[n]={type:Xv,value:new wf(t.slice(r,r+8))},r+=8;break;case 6:var o=t.readUInt16BE(r);r+=2,e[n]={type:Gv,value:t.slice(r,r+o)},r+=o;break;case 7:var a=t.readUInt16BE(r);r+=2,e[n]={type:Jv,value:t.slice(r,r+a).toString()},r+=a;break;case 8:e[n]={type:$v,value:new Date(new wf(t.slice(r,r+8)).valueOf())},r+=8;break;case 9:var u=t.slice(r,r+16).toString("hex");r+=16,e[n]={type:Yv,value:u.substr(0,8)+"-"+u.substr(8,4)+"-"+u.substr(12,4)+"-"+u.substr(16,4)+"-"+u.substr(20)};break;default:throw new Error("Unrecognized header type tag")}}return e}s(Qv,"parseHeaders");function Zv(t){var e=zv(t);return{headers:Qv(e.headers),body:e.body}}s(Zv,"parseMessage");Ef.exports={parseMessage:Zv}});var La=P((mL,Sf)=>{var eg=Cf().parseMessage;function tg(t,e,r){var i=eg(e),n=i.headers[":message-type"];if(n){if(n.value==="error")throw rg(i);if(n.value!=="event")return}var o=i.headers[":event-type"],a=r.members[o.value];if(a){var u={},l=a.eventPayloadMemberName;if(l){var h=a.members[l];h.type==="binary"?u[l]=i.body:u[l]=t.parse(i.body.toString(),h)}for(var y=a.eventHeaderMemberNames,v=0;v<y.length;v++){var S=y[v];i.headers[S]&&(u[S]=a.members[S].toType(i.headers[S].value))}var O={};return O[o.value]=u,O}}s(tg,"parseEvent");function rg(t){var e=t.headers[":error-code"],r=t.headers[":error-message"],i=new Error(r.value||r);return i.code=i.name=e.value||e,i}s(rg,"parseError");Sf.exports={parseEvent:tg}});var Af=P((vL,bf)=>{var Tf=re("stream").Transform,ig=La().parseEvent;function Ma(t){t=t||{},t.readableObjectMode=!0,Tf.call(this,t),this._readableState.objectMode=!0,this.parser=t.parser,this.eventStreamModel=t.eventStreamModel}s(Ma,"EventUnmarshallerStream");Ma.prototype=Object.create(Tf.prototype);Ma.prototype._transform=function(t,e,r){try{var i=ig(this.parser,t,this.eventStreamModel);return this.push(i),r()}catch(n){r(n)}};bf.exports={EventUnmarshallerStream:Ma}});var Of=P((NL,If)=>{var ng=df().EventMessageChunkerStream,sg=Af().EventUnmarshallerStream;function og(t,e,r){var i=new sg({parser:e,eventStreamModel:r}),n=new ng;return t.pipe(n).pipe(i),t.on("error",function(o){n.emit("error",o)}),n.on("error",function(o){i.emit("error",o)}),i}s(og,"createEventStream");If.exports={createEventStream:og}});var Df=P((xL,Rf)=>{function ag(t){for(var e=[],r=0;r<t.length;){var i=t.readInt32BE(r),n=t.slice(r,i+r);r+=i,e.push(n)}return e}s(ag,"eventMessageChunker");Rf.exports={eventMessageChunker:ag}});var _f=P((CL,Pf)=>{var ug=Df().eventMessageChunker,cg=La().parseEvent;function lg(t,e,r){for(var i=ug(t),n=[],o=0;o<i.length;o++)n.push(cg(e,i[o],r));return n}s(lg,"createEventStream");Pf.exports={createEventStream:lg}});var qf=P((TL,kf)=>{kf.exports={now:s(function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6},"now")}});var Mf=P((AL,Lf)=>{var fg=V().util,dg=re("dgram"),hg=fg.buffer.toBuffer,pg=1024*8;function hi(t){t=t||{},this.enabled=t.enabled||!1,this.port=t.port||31e3,this.clientId=t.clientId||"",this.address=t.host||"127.0.0.1",this.clientId.length>255&&(this.clientId=this.clientId.substr(0,255)),this.messagesInFlight=0}s(hi,"Publisher");hi.prototype.fieldsToTrim={UserAgent:256,SdkException:128,SdkExceptionMessage:512,AwsException:128,AwsExceptionMessage:512,FinalSdkException:128,FinalSdkExceptionMessage:512,FinalAwsException:128,FinalAwsExceptionMessage:512};hi.prototype.trimFields=function(t){for(var e=Object.keys(this.fieldsToTrim),r=0,i=e.length;r<i;r++){var n=e[r];if(t.hasOwnProperty(n)){var o=this.fieldsToTrim[n],a=t[n];a&&a.length>o&&(t[n]=a.substr(0,o))}}return t};hi.prototype.eventHandler=function(t){t.ClientId=this.clientId,this.trimFields(t);var e=hg(JSON.stringify(t));!this.enabled||e.length>pg||this.publishDatagram(e)};hi.prototype.publishDatagram=function(t){var e=this,r=this.getClient();this.messagesInFlight++,this.client.send(t,0,t.length,this.port,this.address,function(i,n){--e.messagesInFlight<=0&&e.destroyClient()})};hi.prototype.getClient=function(){return this.client||(this.client=dg.createSocket("udp4")),this.client};hi.prototype.destroyClient=function(){this.client&&(this.client.close(),this.client=void 0)};Lf.exports={Publisher:hi}});var Bf=P((OL,Wf)=>{var Fa=V();function mg(){var t={port:void 0,clientId:void 0,enabled:void 0,host:void 0};return yg(t)||vg(t),Ff(t)}s(mg,"resolveMonitoringConfig");function yg(t){return t.port=t.port||process.env.AWS_CSM_PORT,t.enabled=t.enabled||process.env.AWS_CSM_ENABLED,t.clientId=t.clientId||process.env.AWS_CSM_CLIENT_ID,t.host=t.host||process.env.AWS_CSM_HOST,t.port&&t.enabled&&t.clientId&&t.host||["false","0"].indexOf(t.enabled)>=0}s(yg,"fromEnvironment");function vg(t){var e;try{var r=Fa.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[Fa.util.sharedConfigFileEnv]}),e=r[process.env.AWS_PROFILE||Fa.util.defaultProfile]}catch{return!1}return e?(t.port=t.port||e.csm_port,t.enabled=t.enabled||e.csm_enabled,t.clientId=t.clientId||e.csm_client_id,t.host=t.host||e.csm_host,t.port&&t.enabled&&t.clientId&&t.host):t}s(vg,"fromConfigFile");function Ff(t){var e=["false","0",void 0];return!t.enabled||e.indexOf(t.enabled.toLowerCase())>=0?t.enabled=!1:t.enabled=!0,t.port=t.port?parseInt(t.port,10):void 0,t}s(Ff,"toJSType");Wf.exports=mg});var Wa=P((DL,zf)=>{var Xi=V(),Uf=re("os"),gg=re("path");function Vf(t){return Xi.util.ini.parse(Xi.util.readFileSync(t))}s(Vf,"parseFile");function Ng(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)||Object.defineProperty(e,r.replace(/^profile\s/,""),{value:t[r],enumerable:!0})}),e}s(Ng,"getProfiles");function wg(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)&&Object.defineProperty(e,r.replace(/^sso-session\s/,""),{value:t[r],enumerable:!0})}),e}s(wg,"getSsoSessions");Xi.IniLoader=Xi.util.inherit({constructor:s(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"IniLoader"),clearCachedFiles:s(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"clearCachedFiles"),loadFrom:s(function(e){e=e||{};var r=e.isConfig===!0,i=e.filename||this.getDefaultFilePath(r);if(!this.resolvedProfiles[i]){var n=Vf(i);r?Object.defineProperty(this.resolvedProfiles,i,{value:Ng(n)}):Object.defineProperty(this.resolvedProfiles,i,{value:n})}return this.resolvedProfiles[i]},"loadFrom"),loadSsoSessionsFrom:s(function(e){e=e||{};var r=e.filename||this.getDefaultFilePath(!0);if(!this.resolvedSsoSessions[r]){var i=Vf(r);Object.defineProperty(this.resolvedSsoSessions,r,{value:wg(i)})}return this.resolvedSsoSessions[r]},"loadSsoSessionsFrom"),getDefaultFilePath:s(function(e){return gg.join(this.getHomeDir(),".aws",e?"config":"credentials")},"getDefaultFilePath"),getHomeDir:s(function(){var e=process.env,r=e.HOME||e.USERPROFILE||(e.HOMEPATH?(e.HOMEDRIVE||"C:/")+e.HOMEPATH:null);if(r)return r;if(typeof Uf.homedir=="function")return Uf.homedir();throw Xi.util.error(new Error("Cannot load credentials, HOME path not set"))},"getHomeDir")});var xg=Xi.IniLoader;zf.exports={IniLoader:xg}});var jf=P((_L,Hf)=>{var Eg=Wa().IniLoader;Hf.exports.iniLoader=new Eg});var Xf=P((kL,Kf)=>{var Jn=V();function Ba(t,e){if(typeof t=="string"){if(["legacy","regional"].indexOf(t.toLowerCase())>=0)return t.toLowerCase();throw Jn.util.error(new Error,e)}}s(Ba,"validateRegionalEndpointsFlagValue");function Cg(t,e){t=t||{};var r;if(t[e.clientConfig]&&(r=Ba(t[e.clientConfig],{code:"InvalidConfiguration",message:'invalid "'+e.clientConfig+'" configuration. Expect "legacy" or "regional". Got "'+t[e.clientConfig]+'".'}),r)||!Jn.util.isNode())return r;if(Object.prototype.hasOwnProperty.call(process.env,e.env)){var i=process.env[e.env];if(r=Ba(i,{code:"InvalidEnvironmentalVariable",message:"invalid "+e.env+' environmental variable. Expect "legacy" or "regional". Got "'+process.env[e.env]+'".'}),r)return r}var n={};try{var o=Jn.util.getProfilesFromSharedConfig(Jn.util.iniLoader);n=o[process.env.AWS_PROFILE||Jn.util.defaultProfile]}catch{}if(n&&Object.prototype.hasOwnProperty.call(n,e.sharedConfig)){var a=n[e.sharedConfig];if(r=Ba(a,{code:"InvalidConfiguration",message:"invalid "+e.sharedConfig+' profile config. Expect "legacy" or "regional". Got "'+n[e.sharedConfig]+'".'}),r)return r}return r}s(Cg,"resolveRegionalEndpointsFlag");Kf.exports=Cg});var Gf=P(()=>{var yo=V(),Sg=Xf(),Tg="AWS_STS_REGIONAL_ENDPOINTS",bg="sts_regional_endpoints";yo.util.update(yo.STS.prototype,{credentialsFrom:s(function(e,r){return e?(r||(r=new yo.TemporaryCredentials),r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretAccessKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration,r):null},"credentialsFrom"),assumeRoleWithWebIdentity:s(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,r)},"assumeRoleWithWebIdentity"),assumeRoleWithSAML:s(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,r)},"assumeRoleWithSAML"),setupRequestListeners:s(function(e){e.addListener("validate",this.optInRegionalEndpoint,!0)},"setupRequestListeners"),optInRegionalEndpoint:s(function(e){var r=e.service,i=r.config;if(i.stsRegionalEndpoints=Sg(r._originalConfig,{env:Tg,sharedConfig:bg,clientConfig:"stsRegionalEndpoints"}),i.stsRegionalEndpoints==="regional"&&r.isGlobalEndpoint){if(!i.region)throw yo.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var n=i.endpoint.indexOf(".amazonaws.com"),o=i.endpoint.substring(0,n)+"."+i.region+i.endpoint.substring(n);e.httpRequest.updateEndpoint(o),e.httpRequest.region=i.region}},"optInRegionalEndpoint")})});var Jf=P((WL,Ag)=>{Ag.exports={version:"2.0",metadata:{apiVersion:"2011-06-15",endpointPrefix:"sts",globalEndpoint:"sts.amazonaws.com",protocol:"query",serviceAbbreviation:"AWS STS",serviceFullName:"AWS Security Token Service",serviceId:"STS",signatureVersion:"v4",uid:"sts-2011-06-15",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/"},operations:{AssumeRole:{input:{type:"structure",required:["RoleArn","RoleSessionName"],members:{RoleArn:{},RoleSessionName:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"},Tags:{shape:"S8"},TransitiveTagKeys:{type:"list",member:{}},ExternalId:{},SerialNumber:{},TokenCode:{},SourceIdentity:{}}},output:{resultWrapper:"AssumeRoleResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},SourceIdentity:{}}}},AssumeRoleWithSAML:{input:{type:"structure",required:["RoleArn","PrincipalArn","SAMLAssertion"],members:{RoleArn:{},PrincipalArn:{},SAMLAssertion:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithSAMLResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Subject:{},SubjectType:{},Issuer:{},Audience:{},NameQualifier:{},SourceIdentity:{}}}},AssumeRoleWithWebIdentity:{input:{type:"structure",required:["RoleArn","RoleSessionName","WebIdentityToken"],members:{RoleArn:{},RoleSessionName:{},WebIdentityToken:{},ProviderId:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithWebIdentityResult",type:"structure",members:{Credentials:{shape:"Si"},SubjectFromWebIdentityToken:{},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Provider:{},Audience:{},SourceIdentity:{}}}},DecodeAuthorizationMessage:{input:{type:"structure",required:["EncodedMessage"],members:{EncodedMessage:{}}},output:{resultWrapper:"DecodeAuthorizationMessageResult",type:"structure",members:{DecodedMessage:{}}}},GetAccessKeyInfo:{input:{type:"structure",required:["AccessKeyId"],members:{AccessKeyId:{}}},output:{resultWrapper:"GetAccessKeyInfoResult",type:"structure",members:{Account:{}}}},GetCallerIdentity:{input:{type:"structure",members:{}},output:{resultWrapper:"GetCallerIdentityResult",type:"structure",members:{UserId:{},Account:{},Arn:{}}}},GetFederationToken:{input:{type:"structure",required:["Name"],members:{Name:{},Policy:{},PolicyArns:{shape:"S4"},DurationSeconds:{type:"integer"},Tags:{shape:"S8"}}},output:{resultWrapper:"GetFederationTokenResult",type:"structure",members:{Credentials:{shape:"Si"},FederatedUser:{type:"structure",required:["FederatedUserId","Arn"],members:{FederatedUserId:{},Arn:{}}},PackedPolicySize:{type:"integer"}}}},GetSessionToken:{input:{type:"structure",members:{DurationSeconds:{type:"integer"},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"GetSessionTokenResult",type:"structure",members:{Credentials:{shape:"Si"}}}}},shapes:{S4:{type:"list",member:{type:"structure",members:{arn:{}}}},S8:{type:"list",member:{type:"structure",required:["Key","Value"],members:{Key:{},Value:{}}}},Si:{type:"structure",required:["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],members:{AccessKeyId:{},SecretAccessKey:{},SessionToken:{},Expiration:{type:"timestamp"}}},Sn:{type:"structure",required:["AssumedRoleId","Arn"],members:{AssumedRoleId:{},Arn:{}}}}}});var $f=P((BL,Ig)=>{Ig.exports={pagination:{}}});var Vr=P((UL,Qf)=>{go();var vo=V(),Og=vo.Service,Yf=vo.apiLoader;Yf.services.sts={};vo.STS=Og.defineService("sts",["2011-06-15"]);Gf();Object.defineProperty(Yf.services.sts,"2011-06-15",{get:s(function(){var e=Jf();return e.paginators=$f().pagination,e},"get"),enumerable:!0,configurable:!0});Qf.exports=vo.STS});var Zf=P(()=>{var pi=V(),Rg=Vr();pi.TemporaryCredentials=pi.util.inherit(pi.Credentials,{constructor:s(function(e,r){pi.Credentials.call(this),this.loadMasterCredentials(r),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},"TemporaryCredentials"),refresh:s(function(e){this.coalesceRefresh(e||pi.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.masterCredentials.get(function(){r.service.config.credentials=r.masterCredentials;var i=r.params.RoleArn?r.service.assumeRole:r.service.getSessionToken;i.call(r.service,function(n,o){n||r.service.credentialsFrom(o,r),e(n)})})},"load"),loadMasterCredentials:s(function(e){for(this.masterCredentials=e||pi.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;typeof this.masterCredentials.get!="function"&&(this.masterCredentials=new pi.Credentials(this.masterCredentials))},"loadMasterCredentials"),createClients:function(){this.service=this.service||new Rg({params:this.params})}})});var ed=P(()=>{var Zt=V(),Dg=Vr();Zt.ChainableTemporaryCredentials=Zt.util.inherit(Zt.Credentials,{constructor:s(function(e){Zt.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var r=Zt.util.copy(e.params)||{};if(r.RoleArn&&(r.RoleSessionName=r.RoleSessionName||"temporary-credentials"),r.SerialNumber){if(!e.tokenCodeFn||typeof e.tokenCodeFn!="function")throw new Zt.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var i=Zt.util.merge({params:r,credentials:e.masterCredentials||Zt.config.credentials},e.stsConfig||{});this.service=new Dg(i)},"ChainableTemporaryCredentials"),refresh:s(function(e){this.coalesceRefresh(e||Zt.util.fn.callback)},"refresh"),load:s(function(e){var r=this,i=r.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode(function(n,o){var a={};if(n){e(n);return}o&&(a.TokenCode=o),r.service[i](a,function(u,l){u||r.service.credentialsFrom(l,r),e(u)})})},"load"),getTokenCode:s(function(e){var r=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,function(i,n){if(i){var o=i;i instanceof Error&&(o=i.message),e(Zt.util.error(new Error("Error fetching MFA token: "+o),{code:r.errorCode}));return}e(null,n)}):e(null)},"getTokenCode")})});var td=P(()=>{var mi=V(),Pg=Vr();mi.WebIdentityCredentials=mi.util.inherit(mi.Credentials,{constructor:s(function(e,r){mi.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=mi.util.copy(r||{})},"WebIdentityCredentials"),refresh:s(function(e){this.coalesceRefresh(e||mi.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.service.assumeRoleWithWebIdentity(function(i,n){r.data=null,i||(r.data=n,r.service.credentialsFrom(n,r)),e(i)})},"load"),createClients:function(){if(!this.service){var t=mi.util.merge({},this._clientConfig);t.params=this.params,this.service=new Pg(t)}}})});var rd=P((QL,_g)=>{_g.exports={version:"2.0",metadata:{apiVersion:"2014-06-30",endpointPrefix:"cognito-identity",jsonVersion:"1.1",protocol:"json",serviceFullName:"Amazon Cognito Identity",serviceId:"Cognito Identity",signatureVersion:"v4",targetPrefix:"AWSCognitoIdentityService",uid:"cognito-identity-2014-06-30"},operations:{CreateIdentityPool:{input:{type:"structure",required:["IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},output:{shape:"Sk"}},DeleteIdentities:{input:{type:"structure",required:["IdentityIdsToDelete"],members:{IdentityIdsToDelete:{type:"list",member:{}}}},output:{type:"structure",members:{UnprocessedIdentityIds:{type:"list",member:{type:"structure",members:{IdentityId:{},ErrorCode:{}}}}}}},DeleteIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}}},DescribeIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{}}},output:{shape:"Sv"}},DescribeIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{shape:"Sk"}},GetCredentialsForIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"},CustomRoleArn:{}}},output:{type:"structure",members:{IdentityId:{},Credentials:{type:"structure",members:{AccessKeyId:{},SecretKey:{},SessionToken:{},Expiration:{type:"timestamp"}}}}},authtype:"none"},GetId:{input:{type:"structure",required:["IdentityPoolId"],members:{AccountId:{},IdentityPoolId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{}}},authtype:"none"},GetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{type:"structure",members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},GetOpenIdToken:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}},authtype:"none"},GetOpenIdTokenForDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId","Logins"],members:{IdentityPoolId:{},IdentityId:{},Logins:{shape:"S10"},PrincipalTags:{shape:"S1s"},TokenDuration:{type:"long"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},GetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},ListIdentities:{input:{type:"structure",required:["IdentityPoolId","MaxResults"],members:{IdentityPoolId:{},MaxResults:{type:"integer"},NextToken:{},HideDisabled:{type:"boolean"}}},output:{type:"structure",members:{IdentityPoolId:{},Identities:{type:"list",member:{shape:"Sv"}},NextToken:{}}}},ListIdentityPools:{input:{type:"structure",required:["MaxResults"],members:{MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityPools:{type:"list",member:{type:"structure",members:{IdentityPoolId:{},IdentityPoolName:{}}}},NextToken:{}}}},ListTagsForResource:{input:{type:"structure",required:["ResourceArn"],members:{ResourceArn:{}}},output:{type:"structure",members:{Tags:{shape:"Sh"}}}},LookupDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{},IdentityId:{},DeveloperUserIdentifier:{},MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityId:{},DeveloperUserIdentifierList:{type:"list",member:{}},NextToken:{}}}},MergeDeveloperIdentities:{input:{type:"structure",required:["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],members:{SourceUserIdentifier:{},DestinationUserIdentifier:{},DeveloperProviderName:{},IdentityPoolId:{}}},output:{type:"structure",members:{IdentityId:{}}}},SetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId","Roles"],members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},SetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},TagResource:{input:{type:"structure",required:["ResourceArn","Tags"],members:{ResourceArn:{},Tags:{shape:"Sh"}}},output:{type:"structure",members:{}}},UnlinkDeveloperIdentity:{input:{type:"structure",required:["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],members:{IdentityId:{},IdentityPoolId:{},DeveloperProviderName:{},DeveloperUserIdentifier:{}}}},UnlinkIdentity:{input:{type:"structure",required:["IdentityId","Logins","LoginsToRemove"],members:{IdentityId:{},Logins:{shape:"S10"},LoginsToRemove:{shape:"Sw"}}},authtype:"none"},UntagResource:{input:{type:"structure",required:["ResourceArn","TagKeys"],members:{ResourceArn:{},TagKeys:{type:"list",member:{}}}},output:{type:"structure",members:{}}},UpdateIdentityPool:{input:{shape:"Sk"},output:{shape:"Sk"}}},shapes:{S5:{type:"map",key:{},value:{}},S9:{type:"list",member:{}},Sb:{type:"list",member:{type:"structure",members:{ProviderName:{},ClientId:{},ServerSideTokenCheck:{type:"boolean"}}}},Sg:{type:"list",member:{}},Sh:{type:"map",key:{},value:{}},Sk:{type:"structure",required:["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolId:{},IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},Sv:{type:"structure",members:{IdentityId:{},Logins:{shape:"Sw"},CreationDate:{type:"timestamp"},LastModifiedDate:{type:"timestamp"}}},Sw:{type:"list",member:{}},S10:{type:"map",key:{},value:{}},S1c:{type:"map",key:{},value:{}},S1e:{type:"map",key:{},value:{type:"structure",required:["Type"],members:{Type:{},AmbiguousRoleResolution:{},RulesConfiguration:{type:"structure",required:["Rules"],members:{Rules:{type:"list",member:{type:"structure",required:["Claim","MatchType","Value","RoleARN"],members:{Claim:{},MatchType:{},Value:{},RoleARN:{}}}}}}}}},S1s:{type:"map",key:{},value:{}}}}});var id=P((ZL,kg)=>{kg.exports={pagination:{ListIdentityPools:{input_token:"NextToken",limit_key:"MaxResults",output_token:"NextToken",result_key:"IdentityPools"}}}});var od=P((eM,sd)=>{go();var No=V(),qg=No.Service,nd=No.apiLoader;nd.services.cognitoidentity={};No.CognitoIdentity=qg.defineService("cognitoidentity",["2014-06-30"]);Object.defineProperty(nd.services.cognitoidentity,"2014-06-30",{get:s(function(){var e=rd();return e.paginators=id().pagination,e},"get"),enumerable:!0,configurable:!0});sd.exports=No.CognitoIdentity});var ad=P(()=>{var Ft=V(),Lg=od(),Mg=Vr();Ft.CognitoIdentityCredentials=Ft.util.inherit(Ft.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:s(function(e,r){Ft.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=Ft.util.copy(r||{}),this.loadCachedId();var i=this;Object.defineProperty(this,"identityId",{get:function(){return i.loadCachedId(),i._identityId||i.params.IdentityId},set:function(n){i._identityId=n}})},"CognitoIdentityCredentials"),refresh:s(function(e){this.coalesceRefresh(e||Ft.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.data=null,r._identityId=null,r.getId(function(i){i?(r.clearIdOnNotAuthorized(i),e(i)):r.params.RoleArn?r.getCredentialsFromSTS(e):r.getCredentialsForIdentity(e)})},"load"),clearCachedId:s(function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,r=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+r],delete this.storage[this.localStorageKey.providers+e+r]},"clearCache"),clearIdOnNotAuthorized:s(function(e){var r=this;e.code=="NotAuthorizedException"&&r.clearCachedId()},"clearIdOnNotAuthorized"),getId:s(function(e){var r=this;if(typeof r.params.IdentityId=="string")return e(null,r.params.IdentityId);r.cognito.getId(function(i,n){!i&&n.IdentityId?(r.params.IdentityId=n.IdentityId,e(null,n.IdentityId)):e(i)})},"getId"),loadCredentials:s(function(e,r){!e||!r||(r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration)},"loadCredentials"),getCredentialsForIdentity:s(function(e){var r=this;r.cognito.getCredentialsForIdentity(function(i,n){i?r.clearIdOnNotAuthorized(i):(r.cacheId(n),r.data=n,r.loadCredentials(r.data,r)),e(i)})},"getCredentialsForIdentity"),getCredentialsFromSTS:s(function(e){var r=this;r.cognito.getOpenIdToken(function(i,n){i?(r.clearIdOnNotAuthorized(i),e(i)):(r.cacheId(n),r.params.WebIdentityToken=n.Token,r.webIdentityCredentials.refresh(function(o){o||(r.data=r.webIdentityCredentials.data,r.sts.credentialsFrom(r.data,r)),e(o)}))})},"getCredentialsFromSTS"),loadCachedId:s(function(){var e=this;if(Ft.util.isBrowser()&&!e.params.IdentityId){var r=e.getStorage("id");if(r&&e.params.Logins){var i=Object.keys(e.params.Logins),n=(e.getStorage("providers")||"").split(","),o=n.filter(function(a){return i.indexOf(a)!==-1});o.length!==0&&(e.params.IdentityId=r)}else r&&(e.params.IdentityId=r)}},"loadCachedId"),createClients:function(){var t=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new Ft.WebIdentityCredentials(this.params,t),!this.cognito){var e=Ft.util.merge({},t);e.params=this.params,this.cognito=new Lg(e)}this.sts=this.sts||new Mg(t)},cacheId:s(function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,Ft.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},"cacheId"),getStorage:s(function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},"getStorage"),setStorage:s(function(e,r){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=r}catch{}},"setStorage"),storage:function(){try{var t=Ft.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage=="object"?window.localStorage:{};return t["aws.test-storage"]="foobar",delete t["aws.test-storage"],t}catch{return{}}}()})});var ud=P(()=>{var $n=V(),Fg=Vr();$n.SAMLCredentials=$n.util.inherit($n.Credentials,{constructor:s(function(e){$n.Credentials.call(this),this.expired=!0,this.params=e},"SAMLCredentials"),refresh:s(function(e){this.coalesceRefresh(e||$n.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.service.assumeRoleWithSAML(function(i,n){i||r.service.credentialsFrom(n,r),e(i)})},"load"),createClients:function(){this.service=this.service||new Fg({params:this.params})}})});var Ua=P(()=>{var lt=V(),Wg=re("child_process"),cd=lt.util.iniLoader;lt.ProcessCredentials=lt.util.inherit(lt.Credentials,{constructor:s(function(e){lt.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||lt.util.defaultProfile,this.get(e.callback||lt.util.fn.noop)},"ProcessCredentials"),load:s(function(e){var r=this;try{var i=lt.util.getProfilesFromSharedConfig(cd,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw lt.util.error(new Error("Profile "+this.profile+" not found"),{code:"ProcessCredentialsProviderFailure"});if(n.credential_process)this.loadViaCredentialProcess(n,function(o,a){o?e(o,null):(r.expired=!1,r.accessKeyId=a.AccessKeyId,r.secretAccessKey=a.SecretAccessKey,r.sessionToken=a.SessionToken,a.Expiration&&(r.expireTime=new Date(a.Expiration)),e(null))});else throw lt.util.error(new Error("Profile "+this.profile+" did not include credential process"),{code:"ProcessCredentialsProviderFailure"})}catch(o){e(o)}},"load"),loadViaCredentialProcess:s(function(e,r){Wg.exec(e.credential_process,{env:process.env},function(i,n,o){if(i)r(lt.util.error(new Error("credential_process returned error"),{code:"ProcessCredentialsProviderFailure"}),null);else try{var a=JSON.parse(n);if(a.Expiration){var u=lt.util.date.getDate(),l=new Date(a.Expiration);if(l<u)throw Error("credential_process returned expired credentials")}if(a.Version!==1)throw Error("credential_process does not return Version == 1");r(null,a)}catch(h){r(lt.util.error(new Error(h.message),{code:"ProcessCredentialsProviderFailure"}),null)}})},"loadViaCredentialProcess"),refresh:s(function(e){cd.clearCachedFiles(),this.coalesceRefresh(e||lt.util.fn.callback)},"refresh")})});var wo=P(Va=>{(function(){Va.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
17
|
+
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(Va)});var xr=P((ld,yi)=>{(function(){var t,e,r,i,n,o,a=[].slice,u={}.hasOwnProperty;t=s(function(){var l,h,y,v,S,O;if(O=arguments[0],S=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,y=S.length;l<y;l++)if(v=S[l],v!=null)for(h in v)u.call(v,h)&&(O[h]=v[h]);return O},"assign"),i=s(function(l){return!!l&&Object.prototype.toString.call(l)==="[object Function]"},"isFunction"),n=s(function(l){var h;return!!l&&((h=typeof l)=="function"||h==="object")},"isObject"),e=s(function(l){return i(Array.isArray)?Array.isArray(l):Object.prototype.toString.call(l)==="[object Array]"},"isArray"),r=s(function(l){var h;if(e(l))return!l.length;for(h in l)if(u.call(l,h))return!1;return!0},"isEmpty"),o=s(function(l){var h,y;return n(l)&&(y=Object.getPrototypeOf(l))&&(h=y.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),yi.exports.assign=t,yi.exports.isFunction=i,yi.exports.isObject=n,yi.exports.isArray=e,yi.exports.isEmpty=r,yi.exports.isPlainObject=o}).call(ld)});var za=P((fd,dd)=>{(function(){var t;dd.exports=t=function(){function e(r,i,n){if(this.options=r.options,this.stringify=r.stringify,i==null)throw new Error("Missing attribute name of element "+r.name);if(n==null)throw new Error("Missing attribute value for attribute "+i+" of element "+r.name);this.name=this.stringify.attName(i),this.value=this.stringify.attValue(n)}return s(e,"XMLAttribute"),e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(r){return this.options.writer.set(r).attribute(this)},e}()}).call(fd)});var Yn=P((hd,pd)=>{(function(){var t,e,r,i,n,o,a=s(function(l,h){for(var y in h)u.call(h,y)&&(l[y]=h[y]);function v(){this.constructor=l}return s(v,"ctor"),v.prototype=h.prototype,l.prototype=new v,l.__super__=h.prototype,l},"extend"),u={}.hasOwnProperty;o=xr(),n=o.isObject,i=o.isFunction,r=ft(),t=za(),pd.exports=e=function(l){a(h,l);function h(y,v,S){if(h.__super__.constructor.call(this,y),v==null)throw new Error("Missing element name");this.name=this.stringify.eleName(v),this.attributes={},S!=null&&this.attribute(S),y.isDocument&&(this.isRoot=!0,this.documentObject=y,y.rootObject=this)}return s(h,"XMLElement"),h.prototype.clone=function(){var y,v,S,O;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attributes={},O=this.attributes;for(v in O)u.call(O,v)&&(y=O[v],S.attributes[v]=y.clone());return S.children=[],this.children.forEach(function(g){var N;return N=g.clone(),N.parent=S,S.children.push(N)}),S},h.prototype.attribute=function(y,v){var S,O;if(y!=null&&(y=y.valueOf()),n(y))for(S in y)u.call(y,S)&&(O=y[S],this.attribute(S,O));else i(v)&&(v=v.apply()),(!this.options.skipNullAttributes||v!=null)&&(this.attributes[y]=new t(this,y,v));return this},h.prototype.removeAttribute=function(y){var v,S,O;if(y==null)throw new Error("Missing attribute name");if(y=y.valueOf(),Array.isArray(y))for(S=0,O=y.length;S<O;S++)v=y[S],delete this.attributes[v];else delete this.attributes[y];return this},h.prototype.toString=function(y){return this.options.writer.set(y).element(this)},h.prototype.att=function(y,v){return this.attribute(y,v)},h.prototype.a=function(y,v){return this.attribute(y,v)},h}(r)}).call(hd)});var Qn=P((md,yd)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=ft(),yd.exports=t=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(u)}return s(o,"XMLCData"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).cdata(this)},o}(e)}).call(md)});var Zn=P((vd,gd)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=ft(),gd.exports=t=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing comment text");this.text=this.stringify.comment(u)}return s(o,"XMLComment"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).comment(this)},o}(e)}).call(vd)});var es=P((Nd,wd)=>{(function(){var t,e,r,i=s(function(o,a){for(var u in a)n.call(a,u)&&(o[u]=a[u]);function l(){this.constructor=o}return s(l,"ctor"),l.prototype=a.prototype,o.prototype=new l,o.__super__=a.prototype,o},"extend"),n={}.hasOwnProperty;r=xr().isObject,e=ft(),wd.exports=t=function(o){i(a,o);function a(u,l,h,y){var v;a.__super__.constructor.call(this,u),r(l)&&(v=l,l=v.version,h=v.encoding,y=v.standalone),l||(l="1.0"),this.version=this.stringify.xmlVersion(l),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),y!=null&&(this.standalone=this.stringify.xmlStandalone(y))}return s(a,"XMLDeclaration"),a.prototype.toString=function(u){return this.options.writer.set(u).declaration(this)},a}(e)}).call(Nd)});var ts=P((xd,Ed)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=ft(),Ed.exports=t=function(n){r(o,n);function o(a,u,l,h,y,v){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");if(l==null)throw new Error("Missing DTD attribute name");if(!h)throw new Error("Missing DTD attribute type");if(!y)throw new Error("Missing DTD attribute default");if(y.indexOf("#")!==0&&(y="#"+y),!y.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(v&&!y.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(u),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(h),this.defaultValue=this.stringify.dtdAttDefault(v),this.defaultValueType=y}return s(o,"XMLDTDAttList"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdAttList(this)},o}(e)}).call(xd)});var rs=P((Cd,Sd)=>{(function(){var t,e,r,i=s(function(o,a){for(var u in a)n.call(a,u)&&(o[u]=a[u]);function l(){this.constructor=o}return s(l,"ctor"),l.prototype=a.prototype,o.prototype=new l,o.__super__=a.prototype,o},"extend"),n={}.hasOwnProperty;r=xr().isObject,e=ft(),Sd.exports=t=function(o){i(a,o);function a(u,l,h,y){if(a.__super__.constructor.call(this,u),h==null)throw new Error("Missing entity name");if(y==null)throw new Error("Missing entity value");if(this.pe=!!l,this.name=this.stringify.eleName(h),!r(y))this.value=this.stringify.dtdEntityValue(y);else{if(!y.pubID&&!y.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(y.pubID&&!y.sysID)throw new Error("System identifier is required for a public external entity");if(y.pubID!=null&&(this.pubID=this.stringify.dtdPubID(y.pubID)),y.sysID!=null&&(this.sysID=this.stringify.dtdSysID(y.sysID)),y.nData!=null&&(this.nData=this.stringify.dtdNData(y.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}}return s(a,"XMLDTDEntity"),a.prototype.toString=function(u){return this.options.writer.set(u).dtdEntity(this)},a}(e)}).call(Cd)});var is=P((Td,bd)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=ft(),bd.exports=t=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.eleName(u),this.value=this.stringify.dtdElementValue(l)}return s(o,"XMLDTDElement"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdElement(this)},o}(e)}).call(Td)});var ns=P((Ad,Id)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=ft(),Id.exports=t=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing notation name");if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(u),l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return s(o,"XMLDTDNotation"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdNotation(this)},o}(e)}).call(Ad)});var ss=P((Od,Rd)=>{(function(){var t,e,r,i,n,o,a,u=s(function(h,y){for(var v in y)l.call(y,v)&&(h[v]=y[v]);function S(){this.constructor=h}return s(S,"ctor"),S.prototype=y.prototype,h.prototype=new S,h.__super__=y.prototype,h},"extend"),l={}.hasOwnProperty;a=xr().isObject,o=ft(),t=ts(),r=rs(),e=is(),i=ns(),Rd.exports=n=function(h){u(y,h);function y(v,S,O){var g,N;y.__super__.constructor.call(this,v),this.documentObject=v,a(S)&&(g=S,S=g.pubID,O=g.sysID),O==null&&(N=[S,O],O=N[0],S=N[1]),S!=null&&(this.pubID=this.stringify.dtdPubID(S)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return s(y,"XMLDocType"),y.prototype.element=function(v,S){var O;return O=new e(this,v,S),this.children.push(O),this},y.prototype.attList=function(v,S,O,g,N){var D;return D=new t(this,v,S,O,g,N),this.children.push(D),this},y.prototype.entity=function(v,S){var O;return O=new r(this,!1,v,S),this.children.push(O),this},y.prototype.pEntity=function(v,S){var O;return O=new r(this,!0,v,S),this.children.push(O),this},y.prototype.notation=function(v,S){var O;return O=new i(this,v,S),this.children.push(O),this},y.prototype.toString=function(v){return this.options.writer.set(v).docType(this)},y.prototype.ele=function(v,S){return this.element(v,S)},y.prototype.att=function(v,S,O,g,N){return this.attList(v,S,O,g,N)},y.prototype.ent=function(v,S){return this.entity(v,S)},y.prototype.pent=function(v,S){return this.pEntity(v,S)},y.prototype.not=function(v,S){return this.notation(v,S)},y.prototype.up=function(){return this.root()||this.documentObject},y}(o)}).call(Od)});var os=P((Dd,Pd)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=ft(),Pd.exports=e=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing raw text");this.value=this.stringify.raw(u)}return s(o,"XMLRaw"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).raw(this)},o}(t)}).call(Dd)});var as=P((_d,kd)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=ft(),kd.exports=e=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing element text");this.value=this.stringify.eleText(u)}return s(o,"XMLText"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).text(this)},o}(t)}).call(_d)});var us=P((qd,Ld)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=ft(),Ld.exports=e=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(u),l&&(this.value=this.stringify.insValue(l))}return s(o,"XMLProcessingInstruction"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).processingInstruction(this)},o}(t)}).call(qd)});var ft=P((Md,Fd)=>{(function(){var t,e,r,i,n,o,a,u,l,h,y,v,S,O={}.hasOwnProperty;S=xr(),v=S.isObject,y=S.isFunction,h=S.isEmpty,n=null,t=null,e=null,r=null,i=null,u=null,l=null,a=null,Fd.exports=o=function(){function g(N){this.parent=N,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],n||(n=Yn(),t=Qn(),e=Zn(),r=es(),i=ss(),u=os(),l=as(),a=us())}return s(g,"XMLNode"),g.prototype.element=function(N,D,E){var p,C,R,_,T,A,w,K,X,F;if(A=null,D==null&&(D={}),D=D.valueOf(),v(D)||(X=[D,E],E=X[0],D=X[1]),N!=null&&(N=N.valueOf()),Array.isArray(N))for(R=0,w=N.length;R<w;R++)C=N[R],A=this.element(C);else if(y(N))A=this.element(N.apply());else if(v(N)){for(T in N)if(O.call(N,T))if(F=N[T],y(F)&&(F=F.apply()),v(F)&&h(F)&&(F=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(T.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F))for(_=0,K=F.length;_<K;_++)C=F[_],p={},p[T]=C,A=this.element(p);else v(F)?(A=this.element(T),A.element(F)):A=this.element(T,F)}else!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?A=this.text(E):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&N.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(E):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&N.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(E):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&N.indexOf(this.stringify.convertRawKey)===0?A=this.raw(E):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&N.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(N.substr(this.stringify.convertPIKey.length),E):A=this.node(N,D,E);if(A==null)throw new Error("Could not create any elements with: "+N);return A},g.prototype.insertBefore=function(N,D,E){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C),p=this.parent.element(N,D,E),Array.prototype.push.apply(this.parent.children,R),p},g.prototype.insertAfter=function(N,D,E){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C+1),p=this.parent.element(N,D,E),Array.prototype.push.apply(this.parent.children,R),p},g.prototype.remove=function(){var N,D;if(this.isRoot)throw new Error("Cannot remove the root element");return N=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[N,N-N+1].concat(D=[])),this.parent},g.prototype.node=function(N,D,E){var p,C;return N!=null&&(N=N.valueOf()),D||(D={}),D=D.valueOf(),v(D)||(C=[D,E],E=C[0],D=C[1]),p=new n(this,N,D),E!=null&&p.text(E),this.children.push(p),p},g.prototype.text=function(N){var D;return D=new l(this,N),this.children.push(D),this},g.prototype.cdata=function(N){var D;return D=new t(this,N),this.children.push(D),this},g.prototype.comment=function(N){var D;return D=new e(this,N),this.children.push(D),this},g.prototype.commentBefore=function(N){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E),D=this.parent.comment(N),Array.prototype.push.apply(this.parent.children,p),this},g.prototype.commentAfter=function(N){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E+1),D=this.parent.comment(N),Array.prototype.push.apply(this.parent.children,p),this},g.prototype.raw=function(N){var D;return D=new u(this,N),this.children.push(D),this},g.prototype.instruction=function(N,D){var E,p,C,R,_;if(N!=null&&(N=N.valueOf()),D!=null&&(D=D.valueOf()),Array.isArray(N))for(R=0,_=N.length;R<_;R++)E=N[R],this.instruction(E);else if(v(N))for(E in N)O.call(N,E)&&(p=N[E],this.instruction(E,p));else y(D)&&(D=D.apply()),C=new a(this,N,D),this.children.push(C);return this},g.prototype.instructionBefore=function(N,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p),E=this.parent.instruction(N,D),Array.prototype.push.apply(this.parent.children,C),this},g.prototype.instructionAfter=function(N,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p+1),E=this.parent.instruction(N,D),Array.prototype.push.apply(this.parent.children,C),this},g.prototype.declaration=function(N,D,E){var p,C;return p=this.document(),C=new r(p,N,D,E),p.children[0]instanceof r?p.children[0]=C:p.children.unshift(C),p.root()||p},g.prototype.doctype=function(N,D){var E,p,C,R,_,T,A,w,K,X;for(p=this.document(),C=new i(p,N,D),K=p.children,R=_=0,A=K.length;_<A;R=++_)if(E=K[R],E instanceof i)return p.children[R]=C,C;for(X=p.children,R=T=0,w=X.length;T<w;R=++T)if(E=X[R],E.isRoot)return p.children.splice(R,0,C),C;return p.children.push(C),C},g.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},g.prototype.root=function(){var N;for(N=this;N;){if(N.isDocument)return N.rootObject;if(N.isRoot)return N;N=N.parent}},g.prototype.document=function(){var N;for(N=this;N;){if(N.isDocument)return N;N=N.parent}},g.prototype.end=function(N){return this.document().end(N)},g.prototype.prev=function(){var N;if(N=this.parent.children.indexOf(this),N<1)throw new Error("Already at the first node");return this.parent.children[N-1]},g.prototype.next=function(){var N;if(N=this.parent.children.indexOf(this),N===-1||N===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[N+1]},g.prototype.importDocument=function(N){var D;return D=N.root().clone(),D.parent=this,D.isRoot=!1,this.children.push(D),this},g.prototype.ele=function(N,D,E){return this.element(N,D,E)},g.prototype.nod=function(N,D,E){return this.node(N,D,E)},g.prototype.txt=function(N){return this.text(N)},g.prototype.dat=function(N){return this.cdata(N)},g.prototype.com=function(N){return this.comment(N)},g.prototype.ins=function(N,D){return this.instruction(N,D)},g.prototype.doc=function(){return this.document()},g.prototype.dec=function(N,D,E){return this.declaration(N,D,E)},g.prototype.dtd=function(N,D){return this.doctype(N,D)},g.prototype.e=function(N,D,E){return this.element(N,D,E)},g.prototype.n=function(N,D,E){return this.node(N,D,E)},g.prototype.t=function(N){return this.text(N)},g.prototype.d=function(N){return this.cdata(N)},g.prototype.c=function(N){return this.comment(N)},g.prototype.r=function(N){return this.raw(N)},g.prototype.i=function(N,D){return this.instruction(N,D)},g.prototype.u=function(){return this.up()},g.prototype.importXMLBuilder=function(N){return this.importDocument(N)},g}()}).call(Md)});var Ha=P((Wd,Bd)=>{(function(){var t,e=s(function(i,n){return function(){return i.apply(n,arguments)}},"bind"),r={}.hasOwnProperty;Bd.exports=t=function(){function i(n){this.assertLegalChar=e(this.assertLegalChar,this);var o,a,u;n||(n={}),this.noDoubleEncoding=n.noDoubleEncoding,a=n.stringify||{};for(o in a)r.call(a,o)&&(u=a[o],this[o]=u)}return s(i,"XMLStringifier"),i.prototype.eleName=function(n){return n=""+n||"",this.assertLegalChar(n)},i.prototype.eleText=function(n){return n=""+n||"",this.assertLegalChar(this.elEscape(n))},i.prototype.cdata=function(n){return n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n)},i.prototype.comment=function(n){if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},i.prototype.raw=function(n){return""+n||""},i.prototype.attName=function(n){return n=""+n||""},i.prototype.attValue=function(n){return n=""+n||"",this.attEscape(n)},i.prototype.insTarget=function(n){return""+n||""},i.prototype.insValue=function(n){if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return n},i.prototype.xmlVersion=function(n){if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},i.prototype.xmlEncoding=function(n){if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return n},i.prototype.xmlStandalone=function(n){return n?"yes":"no"},i.prototype.dtdPubID=function(n){return""+n||""},i.prototype.dtdSysID=function(n){return""+n||""},i.prototype.dtdElementValue=function(n){return""+n||""},i.prototype.dtdAttType=function(n){return""+n||""},i.prototype.dtdAttDefault=function(n){return n!=null?""+n||"":n},i.prototype.dtdEntityValue=function(n){return""+n||""},i.prototype.dtdNData=function(n){return""+n||""},i.prototype.convertAttKey="@",i.prototype.convertPIKey="?",i.prototype.convertTextKey="#text",i.prototype.convertCDataKey="#cdata",i.prototype.convertCommentKey="#comment",i.prototype.convertRawKey="#raw",i.prototype.assertLegalChar=function(n){var o;if(o=n.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),o)throw new Error("Invalid character in string: "+n+" at index "+o.index);return n},i.prototype.elEscape=function(n){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},i.prototype.attEscape=function(n){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},i}()}).call(Wd)});var ja=P((Ud,Vd)=>{(function(){var t,e={}.hasOwnProperty;Vd.exports=t=function(){function r(i){var n,o,a,u,l,h,y,v,S;i||(i={}),this.pretty=i.pretty||!1,this.allowEmpty=(o=i.allowEmpty)!=null?o:!1,this.pretty?(this.indent=(a=i.indent)!=null?a:" ",this.newline=(u=i.newline)!=null?u:`
|
|
18
|
+
`,this.offset=(l=i.offset)!=null?l:0,this.dontprettytextnodes=(h=i.dontprettytextnodes)!=null?h:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(y=i.spacebeforeslash)!=null?y:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,v=i.writer||{};for(n in v)e.call(v,n)&&(S=v[n],this[n]=S)}return s(r,"XMLWriterBase"),r.prototype.set=function(i){var n,o,a;i||(i={}),"pretty"in i&&(this.pretty=i.pretty),"allowEmpty"in i&&(this.allowEmpty=i.allowEmpty),this.pretty?(this.indent="indent"in i?i.indent:" ",this.newline="newline"in i?i.newline:`
|
|
19
|
+
`,this.offset="offset"in i?i.offset:0,this.dontprettytextnodes="dontprettytextnodes"in i?i.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in i?i.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=i.writer||{};for(n in o)e.call(o,n)&&(a=o[n],this[n]=a);return this},r.prototype.space=function(i){var n;return this.pretty?(n=(i||0)+this.offset+1,n>0?new Array(n).join(this.indent):""):""},r}()}).call(Ud)});var xo=P((zd,Hd)=>{(function(){var t,e,r,i,n,o,a,u,l,h,y,v,S,O,g=s(function(D,E){for(var p in E)N.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return s(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),N={}.hasOwnProperty;a=es(),u=ss(),t=Qn(),e=Zn(),l=Yn(),y=os(),S=as(),h=us(),r=ts(),i=is(),n=rs(),o=ns(),O=ja(),Hd.exports=v=function(D){g(E,D);function E(p){E.__super__.constructor.call(this,p)}return s(E,"XMLStringWriter"),E.prototype.document=function(p){var C,R,_,T,A;for(this.textispresent=!1,T="",A=p.children,R=0,_=A.length;R<_;R++)C=A[R],T+=function(){switch(!1){case!(C instanceof a):return this.declaration(C);case!(C instanceof u):return this.docType(C);case!(C instanceof e):return this.comment(C);case!(C instanceof h):return this.processingInstruction(C);default:return this.element(C,0)}}.call(this);return this.pretty&&T.slice(-this.newline.length)===this.newline&&(T=T.slice(0,-this.newline.length)),T},E.prototype.attribute=function(p){return" "+p.name+'="'+p.value+'"'},E.prototype.cdata=function(p,C){return this.space(C)+"<![CDATA["+p.text+"]]>"+this.newline},E.prototype.comment=function(p,C){return this.space(C)+"<!-- "+p.text+" -->"+this.newline},E.prototype.declaration=function(p,C){var R;return R=this.space(C),R+='<?xml version="'+p.version+'"',p.encoding!=null&&(R+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(R+=' standalone="'+p.standalone+'"'),R+=this.spacebeforeslash+"?>",R+=this.newline,R},E.prototype.docType=function(p,C){var R,_,T,A,w;if(C||(C=0),A=this.space(C),A+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?A+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(A+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(A+=" [",A+=this.newline,w=p.children,_=0,T=w.length;_<T;_++)R=w[_],A+=function(){switch(!1){case!(R instanceof r):return this.dtdAttList(R,C+1);case!(R instanceof i):return this.dtdElement(R,C+1);case!(R instanceof n):return this.dtdEntity(R,C+1);case!(R instanceof o):return this.dtdNotation(R,C+1);case!(R instanceof t):return this.cdata(R,C+1);case!(R instanceof e):return this.comment(R,C+1);case!(R instanceof h):return this.processingInstruction(R,C+1);default:throw new Error("Unknown DTD node type: "+R.constructor.name)}}.call(this);A+="]"}return A+=this.spacebeforeslash+">",A+=this.newline,A},E.prototype.element=function(p,C){var R,_,T,A,w,K,X,F,se,We,Fe,bt,Z;C||(C=0),Z=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),bt=this.space(C),F="",F+=bt+"<"+p.name,se=p.attributes;for(X in se)N.call(se,X)&&(R=se[X],F+=this.attribute(R));if(p.children.length===0||p.children.every(function(Cr){return Cr.value===""}))this.allowEmpty?F+="></"+p.name+">"+this.newline:F+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)F+=">",F+=p.children[0].value,F+="</"+p.name+">"+this.newline;else{if(this.dontprettytextnodes){for(We=p.children,T=0,w=We.length;T<w;T++)if(_=We[T],_.value!=null){this.textispresent++,Z=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,bt=this.space(C)),F+=">"+this.newline,Fe=p.children,A=0,K=Fe.length;A<K;A++)_=Fe[A],F+=function(){switch(!1){case!(_ instanceof t):return this.cdata(_,C+1);case!(_ instanceof e):return this.comment(_,C+1);case!(_ instanceof l):return this.element(_,C+1);case!(_ instanceof y):return this.raw(_,C+1);case!(_ instanceof S):return this.text(_,C+1);case!(_ instanceof h):return this.processingInstruction(_,C+1);default:throw new Error("Unknown XML node type: "+_.constructor.name)}}.call(this);Z&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),F+=bt+"</"+p.name+">"+this.newline}return F},E.prototype.processingInstruction=function(p,C){var R;return R=this.space(C)+"<?"+p.target,p.value&&(R+=" "+p.value),R+=this.spacebeforeslash+"?>"+this.newline,R},E.prototype.raw=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.text=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.dtdAttList=function(p,C){var R;return R=this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(R+=" "+p.defaultValueType),p.defaultValue&&(R+=' "'+p.defaultValue+'"'),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.dtdElement=function(p,C){return this.space(C)+"<!ELEMENT "+p.name+" "+p.value+this.spacebeforeslash+">"+this.newline},E.prototype.dtdEntity=function(p,C){var R;return R=this.space(C)+"<!ENTITY",p.pe&&(R+=" %"),R+=" "+p.name,p.value?R+=' "'+p.value+'"':(p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),p.nData&&(R+=" NDATA "+p.nData)),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.dtdNotation=function(p,C){var R;return R=this.space(C)+"<!NOTATION "+p.name,p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?R+=' PUBLIC "'+p.pubID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),R+=this.spacebeforeslash+">"+this.newline,R},E.prototype.openNode=function(p,C){var R,_,T,A;if(C||(C=0),p instanceof l){T=this.space(C)+"<"+p.name,A=p.attributes;for(_ in A)N.call(A,_)&&(R=A[_],T+=this.attribute(R));return T+=(p.children?">":"/>")+this.newline,T}else return T=this.space(C)+"<!DOCTYPE "+p.rootNodeName,p.pubID&&p.sysID?T+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(T+=' SYSTEM "'+p.sysID+'"'),T+=(p.children?" [":">")+this.newline,T},E.prototype.closeNode=function(p,C){switch(C||(C=0),!1){case!(p instanceof l):return this.space(C)+"</"+p.name+">"+this.newline;case!(p instanceof u):return this.space(C)+"]>"+this.newline}},E}(O)}).call(zd)});var Xd=P((jd,Kd)=>{(function(){var t,e,r,i,n,o=s(function(u,l){for(var h in l)a.call(l,h)&&(u[h]=l[h]);function y(){this.constructor=u}return s(y,"ctor"),y.prototype=l.prototype,u.prototype=new y,u.__super__=l.prototype,u},"extend"),a={}.hasOwnProperty;n=xr().isPlainObject,e=ft(),i=Ha(),r=xo(),Kd.exports=t=function(u){o(l,u);function l(h){l.__super__.constructor.call(this,null),h||(h={}),h.writer||(h.writer=new r),this.options=h,this.stringify=new i(h),this.isDocument=!0}return s(l,"XMLDocument"),l.prototype.end=function(h){var y;return h?n(h)&&(y=h,h=this.options.writer.set(y)):h=this.options.writer,h.document(this)},l.prototype.toString=function(h){return this.options.writer.set(h).document(this)},l}(e)}).call(jd)});var $d=P((Gd,Jd)=>{(function(){var t,e,r,i,n,o,a,u,l,h,y,v,S,O,g,N,D,E,p,C,R={}.hasOwnProperty;C=xr(),E=C.isObject,D=C.isFunction,p=C.isPlainObject,y=Yn(),e=Qn(),r=Zn(),S=os(),N=as(),v=us(),u=es(),l=ss(),i=ts(),o=rs(),n=is(),a=ns(),t=za(),g=Ha(),O=xo(),Jd.exports=h=function(){function _(T,A,w){var K;T||(T={}),T.writer?p(T.writer)&&(K=T.writer,T.writer=new O(K)):T.writer=new O(T),this.options=T,this.writer=T.writer,this.stringify=new g(T),this.onDataCallback=A||function(){},this.onEndCallback=w||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return s(_,"XMLDocumentCB"),_.prototype.node=function(T,A,w){var K;if(T==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),T=T.valueOf(),A==null&&(A={}),A=A.valueOf(),E(A)||(K=[A,w],w=K[0],A=K[1]),this.currentNode=new y(this,T,A),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,w!=null&&this.text(w),this},_.prototype.element=function(T,A,w){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(T,A,w)},_.prototype.attribute=function(T,A){var w,K;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(T!=null&&(T=T.valueOf()),E(T))for(w in T)R.call(T,w)&&(K=T[w],this.attribute(w,K));else D(A)&&(A=A.apply()),(!this.options.skipNullAttributes||A!=null)&&(this.currentNode.attributes[T]=new t(this,T,A));return this},_.prototype.text=function(T){var A;return this.openCurrent(),A=new N(this,T),this.onData(this.writer.text(A,this.currentLevel+1)),this},_.prototype.cdata=function(T){var A;return this.openCurrent(),A=new e(this,T),this.onData(this.writer.cdata(A,this.currentLevel+1)),this},_.prototype.comment=function(T){var A;return this.openCurrent(),A=new r(this,T),this.onData(this.writer.comment(A,this.currentLevel+1)),this},_.prototype.raw=function(T){var A;return this.openCurrent(),A=new S(this,T),this.onData(this.writer.raw(A,this.currentLevel+1)),this},_.prototype.instruction=function(T,A){var w,K,X,F,se;if(this.openCurrent(),T!=null&&(T=T.valueOf()),A!=null&&(A=A.valueOf()),Array.isArray(T))for(w=0,F=T.length;w<F;w++)K=T[w],this.instruction(K);else if(E(T))for(K in T)R.call(T,K)&&(X=T[K],this.instruction(K,X));else D(A)&&(A=A.apply()),se=new v(this,T,A),this.onData(this.writer.processingInstruction(se,this.currentLevel+1));return this},_.prototype.declaration=function(T,A,w){var K;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return K=new u(this,T,A,w),this.onData(this.writer.declaration(K,this.currentLevel+1)),this},_.prototype.doctype=function(T,A,w){if(this.openCurrent(),T==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new l(this,A,w),this.currentNode.rootNodeName=T,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},_.prototype.dtdElement=function(T,A){var w;return this.openCurrent(),w=new n(this,T,A),this.onData(this.writer.dtdElement(w,this.currentLevel+1)),this},_.prototype.attList=function(T,A,w,K,X){var F;return this.openCurrent(),F=new i(this,T,A,w,K,X),this.onData(this.writer.dtdAttList(F,this.currentLevel+1)),this},_.prototype.entity=function(T,A){var w;return this.openCurrent(),w=new o(this,!1,T,A),this.onData(this.writer.dtdEntity(w,this.currentLevel+1)),this},_.prototype.pEntity=function(T,A){var w;return this.openCurrent(),w=new o(this,!0,T,A),this.onData(this.writer.dtdEntity(w,this.currentLevel+1)),this},_.prototype.notation=function(T,A){var w;return this.openCurrent(),w=new a(this,T,A),this.onData(this.writer.dtdNotation(w,this.currentLevel+1)),this},_.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},_.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},_.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},_.prototype.openNode=function(T){if(!T.isOpen)return!this.root&&this.currentLevel===0&&T instanceof y&&(this.root=T),this.onData(this.writer.openNode(T,this.currentLevel)),T.isOpen=!0},_.prototype.closeNode=function(T){if(!T.isClosed)return this.onData(this.writer.closeNode(T,this.currentLevel)),T.isClosed=!0},_.prototype.onData=function(T){return this.documentStarted=!0,this.onDataCallback(T)},_.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},_.prototype.ele=function(){return this.element.apply(this,arguments)},_.prototype.nod=function(T,A,w){return this.node(T,A,w)},_.prototype.txt=function(T){return this.text(T)},_.prototype.dat=function(T){return this.cdata(T)},_.prototype.com=function(T){return this.comment(T)},_.prototype.ins=function(T,A){return this.instruction(T,A)},_.prototype.dec=function(T,A,w){return this.declaration(T,A,w)},_.prototype.dtd=function(T,A,w){return this.doctype(T,A,w)},_.prototype.e=function(T,A,w){return this.element(T,A,w)},_.prototype.n=function(T,A,w){return this.node(T,A,w)},_.prototype.t=function(T){return this.text(T)},_.prototype.d=function(T){return this.cdata(T)},_.prototype.c=function(T){return this.comment(T)},_.prototype.r=function(T){return this.raw(T)},_.prototype.i=function(T,A){return this.instruction(T,A)},_.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.ent=function(T,A){return this.entity(T,A)},_.prototype.pent=function(T,A){return this.pEntity(T,A)},_.prototype.not=function(T,A){return this.notation(T,A)},_}()}).call(Gd)});var Zd=P((Yd,Qd)=>{(function(){var t,e,r,i,n,o,a,u,l,h,y,v,S,O,g=s(function(D,E){for(var p in E)N.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return s(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),N={}.hasOwnProperty;a=es(),u=ss(),t=Qn(),e=Zn(),l=Yn(),y=os(),S=as(),h=us(),r=ts(),i=is(),n=rs(),o=ns(),O=ja(),Qd.exports=v=function(D){g(E,D);function E(p,C){E.__super__.constructor.call(this,C),this.stream=p}return s(E,"XMLStreamWriter"),E.prototype.document=function(p){var C,R,_,T,A,w,K,X;for(w=p.children,R=0,T=w.length;R<T;R++)C=w[R],C.isLastRootNode=!1;for(p.children[p.children.length-1].isLastRootNode=!0,K=p.children,X=[],_=0,A=K.length;_<A;_++)switch(C=K[_],!1){case!(C instanceof a):X.push(this.declaration(C));break;case!(C instanceof u):X.push(this.docType(C));break;case!(C instanceof e):X.push(this.comment(C));break;case!(C instanceof h):X.push(this.processingInstruction(C));break;default:X.push(this.element(C))}return X},E.prototype.attribute=function(p){return this.stream.write(" "+p.name+'="'+p.value+'"')},E.prototype.cdata=function(p,C){return this.stream.write(this.space(C)+"<![CDATA["+p.text+"]]>"+this.endline(p))},E.prototype.comment=function(p,C){return this.stream.write(this.space(C)+"<!-- "+p.text+" -->"+this.endline(p))},E.prototype.declaration=function(p,C){return this.stream.write(this.space(C)),this.stream.write('<?xml version="'+p.version+'"'),p.encoding!=null&&this.stream.write(' encoding="'+p.encoding+'"'),p.standalone!=null&&this.stream.write(' standalone="'+p.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(p))},E.prototype.docType=function(p,C){var R,_,T,A;if(C||(C=0),this.stream.write(this.space(C)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p)),A=p.children,_=0,T=A.length;_<T;_++)switch(R=A[_],!1){case!(R instanceof r):this.dtdAttList(R,C+1);break;case!(R instanceof i):this.dtdElement(R,C+1);break;case!(R instanceof n):this.dtdEntity(R,C+1);break;case!(R instanceof o):this.dtdNotation(R,C+1);break;case!(R instanceof t):this.cdata(R,C+1);break;case!(R instanceof e):this.comment(R,C+1);break;case!(R instanceof h):this.processingInstruction(R,C+1);break;default:throw new Error("Unknown DTD node type: "+R.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(p))},E.prototype.element=function(p,C){var R,_,T,A,w,K,X,F;C||(C=0),F=this.space(C),this.stream.write(F+"<"+p.name),K=p.attributes;for(w in K)N.call(K,w)&&(R=K[w],this.attribute(R));if(p.children.length===0||p.children.every(function(se){return se.value===""}))this.allowEmpty?this.stream.write("></"+p.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)this.stream.write(">"),this.stream.write(p.children[0].value),this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.newline),X=p.children,T=0,A=X.length;T<A;T++)switch(_=X[T],!1){case!(_ instanceof t):this.cdata(_,C+1);break;case!(_ instanceof e):this.comment(_,C+1);break;case!(_ instanceof l):this.element(_,C+1);break;case!(_ instanceof y):this.raw(_,C+1);break;case!(_ instanceof S):this.text(_,C+1);break;case!(_ instanceof h):this.processingInstruction(_,C+1);break;default:throw new Error("Unknown XML node type: "+_.constructor.name)}this.stream.write(F+"</"+p.name+">")}return this.stream.write(this.endline(p))},E.prototype.processingInstruction=function(p,C){return this.stream.write(this.space(C)+"<?"+p.target),p.value&&this.stream.write(" "+p.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(p))},E.prototype.raw=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.text=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.dtdAttList=function(p,C){return this.stream.write(this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType),p.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+p.defaultValueType),p.defaultValue&&this.stream.write(' "'+p.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdElement=function(p,C){return this.stream.write(this.space(C)+"<!ELEMENT "+p.name+" "+p.value),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdEntity=function(p,C){return this.stream.write(this.space(C)+"<!ENTITY"),p.pe&&this.stream.write(" %"),this.stream.write(" "+p.name),p.value?this.stream.write(' "'+p.value+'"'):(p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.nData&&this.stream.write(" NDATA "+p.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdNotation=function(p,C){return this.stream.write(this.space(C)+"<!NOTATION "+p.name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.pubID?this.stream.write(' PUBLIC "'+p.pubID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.endline=function(p){return p.isLastRootNode?"":this.newline},E}(O)}).call(Yd)});var th=P((eh,cs)=>{(function(){var t,e,r,i,n,o,a;a=xr(),n=a.assign,o=a.isFunction,t=Xd(),e=$d(),i=xo(),r=Zd(),cs.exports.create=function(u,l,h,y){var v,S;if(u==null)throw new Error("Root element needs a name");return y=n({},l,h,y),v=new t(y),S=v.element(u),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.doctype(y)),S},cs.exports.begin=function(u,l,h){var y;return o(u)&&(y=[u,l],l=y[0],h=y[1],u={}),l?new e(u,l,h):new t(u)},cs.exports.stringWriter=function(u){return new i(u)},cs.exports.streamWriter=function(u,l){return new r(u,l)}}).call(eh)});var rh=P(Ka=>{(function(){"use strict";var t,e,r,i,n,o={}.hasOwnProperty;t=th(),e=wo().defaults,i=s(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),n=s(function(a){return"<![CDATA["+r(a)+"]]>"},"wrapCDATA"),r=s(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),Ka.Builder=function(){function a(u){var l,h,y;this.options={},h=e["0.2"];for(l in h)o.call(h,l)&&(y=h[l],this.options[l]=y);for(l in u)o.call(u,l)&&(y=u[l],this.options[l]=y)}return s(a,"Builder"),a.prototype.buildObject=function(u){var l,h,y,v,S;return l=this.options.attrkey,h=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(S=Object.keys(u)[0],u=u[S]):S=this.options.rootName,y=function(O){return function(g,N){var D,E,p,C,R,_;if(typeof N!="object")O.options.cdata&&i(N)?g.raw(n(N)):g.txt(N);else if(Array.isArray(N)){for(C in N)if(o.call(N,C)){E=N[C];for(R in E)p=E[R],g=y(g.ele(R),p).up()}}else for(R in N)if(o.call(N,R))if(E=N[R],R===l){if(typeof E=="object")for(D in E)_=E[D],g=g.att(D,_)}else if(R===h)O.options.cdata&&i(E)?g=g.raw(n(E)):g=g.txt(E);else if(Array.isArray(E))for(C in E)o.call(E,C)&&(p=E[C],typeof p=="string"?O.options.cdata&&i(p)?g=g.ele(R).raw(n(p)).up():g=g.ele(R,p).up():g=y(g.ele(R),p).up());else typeof E=="object"?g=y(g.ele(R),E).up():typeof E=="string"&&O.options.cdata&&i(E)?g=g.ele(R).raw(n(E)).up():(E==null&&(E=""),g=g.ele(R,E.toString()).up());return g}}(this),v=t.create(S,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(v,u).end(this.options.renderOpts)},a}()}).call(Ka)});var ih=P(Eo=>{(function(t){t.parser=function(m,f){return new r(m,f)},t.SAXParser=r,t.SAXStream=h,t.createStream=l,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(m,f){if(!(this instanceof r))return new r(m,f);var q=this;n(q),q.q=q.c="",q.bufferCheckPosition=t.MAX_BUFFER_LENGTH,q.opt=f||{},q.opt.lowercase=q.opt.lowercase||q.opt.lowercasetags,q.looseCase=q.opt.lowercase?"toLowerCase":"toUpperCase",q.tags=[],q.closed=q.closedRoot=q.sawRoot=!1,q.tag=q.error=null,q.strict=!!m,q.noscript=!!(m||q.opt.noscript),q.state=w.BEGIN,q.strictEntities=q.opt.strictEntities,q.ENTITIES=q.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),q.attribList=[],q.opt.xmlns&&(q.ns=Object.create(g)),q.trackPosition=q.opt.position!==!1,q.trackPosition&&(q.position=q.line=q.column=0),X(q,"onready")}s(r,"SAXParser"),Object.create||(Object.create=function(m){function f(){}s(f,"F"),f.prototype=m;var q=new f;return q}),Object.keys||(Object.keys=function(m){var f=[];for(var q in m)m.hasOwnProperty(q)&&f.push(q);return f});function i(m){for(var f=Math.max(t.MAX_BUFFER_LENGTH,10),q=0,I=0,te=e.length;I<te;I++){var we=m[e[I]].length;if(we>f)switch(e[I]){case"textNode":se(m);break;case"cdata":F(m,"oncdata",m.cdata),m.cdata="";break;case"script":F(m,"onscript",m.script),m.script="";break;default:Fe(m,"Max buffer length exceeded: "+e[I])}q=Math.max(q,we)}var be=t.MAX_BUFFER_LENGTH-q;m.bufferCheckPosition=be+m.position}s(i,"checkBufferLength");function n(m){for(var f=0,q=e.length;f<q;f++)m[e[f]]=""}s(n,"clearBuffers");function o(m){se(m),m.cdata!==""&&(F(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(F(m,"onscript",m.script),m.script="")}s(o,"flushBuffers"),r.prototype={end:function(){bt(this)},write:Kr,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){o(this)}};var a;try{a=re("stream").Stream}catch{a=s(function(){},"Stream")}var u=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function l(m,f){return new h(m,f)}s(l,"createStream");function h(m,f){if(!(this instanceof h))return new h(m,f);a.apply(this),this._parser=new r(m,f),this.writable=!0,this.readable=!0;var q=this;this._parser.onend=function(){q.emit("end")},this._parser.onerror=function(I){q.emit("error",I),q._parser.error=null},this._decoder=null,u.forEach(function(I){Object.defineProperty(q,"on"+I,{get:function(){return q._parser["on"+I]},set:function(te){if(!te)return q.removeAllListeners(I),q._parser["on"+I]=te,te;q.on(I,te)},enumerable:!0,configurable:!1})})}s(h,"SAXStream"),h.prototype=Object.create(a.prototype,{constructor:{value:h}}),h.prototype.write=function(m){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)){if(!this._decoder){var f=re("string_decoder").StringDecoder;this._decoder=new f("utf8")}m=this._decoder.write(m)}return this._parser.write(m.toString()),this.emit("data",m),!0},h.prototype.end=function(m){return m&&m.length&&this.write(m),this._parser.end(),!0},h.prototype.on=function(m,f){var q=this;return!q._parser["on"+m]&&u.indexOf(m)!==-1&&(q._parser["on"+m]=function(){var I=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);I.splice(0,0,m),q.emit.apply(q,I)}),a.prototype.on.call(q,m,f)};var y="[CDATA[",v="DOCTYPE",S="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",g={xml:S,xmlns:O},N=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function C(m){return m===" "||m===`
|
|
20
|
+
`||m==="\r"||m===" "}s(C,"isWhitespace");function R(m){return m==='"'||m==="'"}s(R,"isQuote");function _(m){return m===">"||C(m)}s(_,"isAttribEnd");function T(m,f){return m.test(f)}s(T,"isMatch");function A(m,f){return!T(m,f)}s(A,"notMatch");var w=0;t.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(m){var f=t.ENTITIES[m],q=typeof f=="number"?String.fromCharCode(f):f;t.ENTITIES[m]=q});for(var K in t.STATE)t.STATE[t.STATE[K]]=K;w=t.STATE;function X(m,f,q){m[f]&&m[f](q)}s(X,"emit");function F(m,f,q){m.textNode&&se(m),X(m,f,q)}s(F,"emitNode");function se(m){m.textNode=We(m.opt,m.textNode),m.textNode&&X(m,"ontext",m.textNode),m.textNode=""}s(se,"closeText");function We(m,f){return m.trim&&(f=f.trim()),m.normalize&&(f=f.replace(/\s+/g," ")),f}s(We,"textopts");function Fe(m,f){return se(m),m.trackPosition&&(f+=`
|
|
21
21
|
Line: `+m.line+`
|
|
22
22
|
Column: `+m.column+`
|
|
23
|
-
Char: `+m.c),f=new Error(f),m.error=f,X(m,"onerror",f),m}
|
|
23
|
+
Char: `+m.c),f=new Error(f),m.error=f,X(m,"onerror",f),m}s(Fe,"error");function bt(m){return m.sawRoot&&!m.closedRoot&&Z(m,"Unclosed root tag"),m.state!==w.BEGIN&&m.state!==w.BEGIN_WHITESPACE&&m.state!==w.TEXT&&Fe(m,"Unexpected end"),se(m),m.c="",m.closed=!0,X(m,"onend"),r.call(m,m.strict,m.opt),m}s(bt,"end");function Z(m,f){if(typeof m!="object"||!(m instanceof r))throw new Error("bad call to strictFail");m.strict&&Fe(m,f)}s(Z,"strictFail");function Cr(m){m.strict||(m.tagName=m.tagName[m.looseCase]());var f=m.tags[m.tags.length-1]||m,q=m.tag={name:m.tagName,attributes:{}};m.opt.xmlns&&(q.ns=f.ns),m.attribList.length=0,F(m,"onopentagstart",q)}s(Cr,"newTag");function Sr(m,f){var q=m.indexOf(":"),I=q<0?["",m]:m.split(":"),te=I[0],we=I[1];return f&&m==="xmlns"&&(te="xmlns",we=""),{prefix:te,local:we}}s(Sr,"qname");function Tr(m){if(m.strict||(m.attribName=m.attribName[m.looseCase]()),m.attribList.indexOf(m.attribName)!==-1||m.tag.attributes.hasOwnProperty(m.attribName)){m.attribName=m.attribValue="";return}if(m.opt.xmlns){var f=Sr(m.attribName,!0),q=f.prefix,I=f.local;if(q==="xmlns")if(I==="xml"&&m.attribValue!==S)Z(m,"xml: prefix must be bound to "+S+`
|
|
24
24
|
Actual: `+m.attribValue);else if(I==="xmlns"&&m.attribValue!==O)Z(m,"xmlns: prefix must be bound to "+O+`
|
|
25
|
-
Actual: `+m.attribValue);else{var te=m.tag,we=m.tags[m.tags.length-1]||m;te.ns===we.ns&&(te.ns=Object.create(we.ns)),te.ns[I]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,F(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}
|
|
25
|
+
Actual: `+m.attribValue);else{var te=m.tag,we=m.tags[m.tags.length-1]||m;te.ns===we.ns&&(te.ns=Object.create(we.ns)),te.ns[I]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,F(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}s(Tr,"attrib");function Nt(m,f){if(m.opt.xmlns){var q=m.tag,I=Sr(m.tagName);q.prefix=I.prefix,q.local=I.local,q.uri=q.ns[I.prefix]||"",q.prefix&&!q.uri&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(m.tagName)),q.uri=I.prefix);var te=m.tags[m.tags.length-1]||m;q.ns&&te.ns!==q.ns&&Object.keys(q.ns).forEach(function(Ji){F(m,"onopennamespace",{prefix:Ji,uri:q.ns[Ji]})});for(var we=0,be=m.attribList.length;we<be;we++){var Je=m.attribList[we],wt=Je[0],Ar=Je[1],De=Sr(wt,!0),It=De.prefix,Gi=De.local,J=It===""?"":q.ns[It]||"",Xr={name:wt,value:Ar,prefix:It,local:Gi,uri:J};It&&It!=="xmlns"&&!J&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(It)),Xr.uri=It),m.tag.attributes[wt]=Xr,F(m,"onattribute",Xr)}m.attribList.length=0}m.tag.isSelfClosing=!!f,m.sawRoot=!0,m.tags.push(m.tag),F(m,"onopentag",m.tag),f||(!m.noscript&&m.tagName.toLowerCase()==="script"?m.state=w.SCRIPT:m.state=w.TEXT,m.tag=null,m.tagName=""),m.attribName=m.attribValue="",m.attribList.length=0}s(Nt,"openTag");function br(m){if(!m.tagName){Z(m,"Weird empty close tag."),m.textNode+="</>",m.state=w.TEXT;return}if(m.script){if(m.tagName!=="script"){m.script+="</"+m.tagName+">",m.tagName="",m.state=w.SCRIPT;return}F(m,"onscript",m.script),m.script=""}var f=m.tags.length,q=m.tagName;m.strict||(q=q[m.looseCase]());for(var I=q;f--;){var te=m.tags[f];if(te.name!==I)Z(m,"Unexpected close tag");else break}if(f<0){Z(m,"Unmatched closing tag: "+m.tagName),m.textNode+="</"+m.tagName+">",m.state=w.TEXT;return}m.tagName=q;for(var we=m.tags.length;we-- >f;){var be=m.tag=m.tags.pop();m.tagName=m.tag.name,F(m,"onclosetag",m.tagName);var Je={};for(var wt in be.ns)Je[wt]=be.ns[wt];var Ar=m.tags[m.tags.length-1]||m;m.opt.xmlns&&be.ns!==Ar.ns&&Object.keys(be.ns).forEach(function(De){var It=be.ns[De];F(m,"onclosenamespace",{prefix:De,uri:It})})}f===0&&(m.closedRoot=!0),m.tagName=m.attribValue=m.attribName="",m.attribList.length=0,m.state=w.TEXT}s(br,"closeTag");function wi(m){var f=m.entity,q=f.toLowerCase(),I,te="";return m.ENTITIES[f]?m.ENTITIES[f]:m.ENTITIES[q]?m.ENTITIES[q]:(f=q,f.charAt(0)==="#"&&(f.charAt(1)==="x"?(f=f.slice(2),I=parseInt(f,16),te=I.toString(16)):(f=f.slice(1),I=parseInt(f,10),te=I.toString(10))),f=f.replace(/^0+/,""),isNaN(I)||te.toLowerCase()!==f?(Z(m,"Invalid character entity"),"&"+m.entity+";"):String.fromCodePoint(I))}s(wi,"parseEntity");function At(m,f){f==="<"?(m.state=w.OPEN_WAKA,m.startTagPosition=m.position):C(f)||(Z(m,"Non-whitespace before first tag."),m.textNode=f,m.state=w.TEXT)}s(At,"beginWhiteSpace");function Ut(m,f){var q="";return f<m.length&&(q=m.charAt(f)),q}s(Ut,"charAt");function Kr(m){var f=this;if(this.error)throw this.error;if(f.closed)return Fe(f,"Cannot write after close. Assign an onready handler.");if(m===null)return bt(f);typeof m=="object"&&(m=m.toString());for(var q=0,I="";I=Ut(m,q++),f.c=I,!!I;)switch(f.trackPosition&&(f.position++,I===`
|
|
26
26
|
`?(f.line++,f.column=0):f.column++),f.state){case w.BEGIN:if(f.state=w.BEGIN_WHITESPACE,I==="\uFEFF")continue;At(f,I);continue;case w.BEGIN_WHITESPACE:At(f,I);continue;case w.TEXT:if(f.sawRoot&&!f.closedRoot){for(var te=q-1;I&&I!=="<"&&I!=="&";)I=Ut(m,q++),I&&f.trackPosition&&(f.position++,I===`
|
|
27
|
-
`?(f.line++,f.column=0):f.column++);f.textNode+=m.substring(te,q-1)}I==="<"&&!(f.sawRoot&&f.closedRoot&&!f.strict)?(f.state=w.OPEN_WAKA,f.startTagPosition=f.position):(!C(I)&&(!f.sawRoot||f.closedRoot)&&Z(f,"Text data outside of root node."),I==="&"?f.state=w.TEXT_ENTITY:f.textNode+=I);continue;case w.SCRIPT:I==="<"?f.state=w.SCRIPT_ENDING:f.script+=I;continue;case w.SCRIPT_ENDING:I==="/"?f.state=w.CLOSE_TAG:(f.script+="<"+I,f.state=w.SCRIPT);continue;case w.OPEN_WAKA:if(I==="!")f.state=w.SGML_DECL,f.sgmlDecl="";else if(!C(I))if(T(N,I))f.state=w.OPEN_TAG,f.tagName=I;else if(I==="/")f.state=w.CLOSE_TAG,f.tagName="";else if(I==="?")f.state=w.PROC_INST,f.procInstName=f.procInstBody="";else{if(Z(f,"Unencoded <"),f.startTagPosition+1<f.position){var we=f.position-f.startTagPosition;I=new Array(we).join(" ")+I}f.textNode+="<"+I,f.state=w.TEXT}continue;case w.SGML_DECL:(f.sgmlDecl+I).toUpperCase()===y?(F(f,"onopencdata"),f.state=w.CDATA,f.sgmlDecl="",f.cdata=""):f.sgmlDecl+I==="--"?(f.state=w.COMMENT,f.comment="",f.sgmlDecl=""):(f.sgmlDecl+I).toUpperCase()===v?(f.state=w.DOCTYPE,(f.doctype||f.sawRoot)&&Z(f,"Inappropriately located doctype declaration"),f.doctype="",f.sgmlDecl=""):I===">"?(F(f,"onsgmldeclaration",f.sgmlDecl),f.sgmlDecl="",f.state=w.TEXT):(R(I)&&(f.state=w.SGML_DECL_QUOTED),f.sgmlDecl+=I);continue;case w.SGML_DECL_QUOTED:I===f.q&&(f.state=w.SGML_DECL,f.q=""),f.sgmlDecl+=I;continue;case w.DOCTYPE:I===">"?(f.state=w.TEXT,F(f,"ondoctype",f.doctype),f.doctype=!0):(f.doctype+=I,I==="["?f.state=w.DOCTYPE_DTD:R(I)&&(f.state=w.DOCTYPE_QUOTED,f.q=I));continue;case w.DOCTYPE_QUOTED:f.doctype+=I,I===f.q&&(f.q="",f.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:f.doctype+=I,I==="]"?f.state=w.DOCTYPE:R(I)&&(f.state=w.DOCTYPE_DTD_QUOTED,f.q=I);continue;case w.DOCTYPE_DTD_QUOTED:f.doctype+=I,I===f.q&&(f.state=w.DOCTYPE_DTD,f.q="");continue;case w.COMMENT:I==="-"?f.state=w.COMMENT_ENDING:f.comment+=I;continue;case w.COMMENT_ENDING:I==="-"?(f.state=w.COMMENT_ENDED,f.comment=We(f.opt,f.comment),f.comment&&F(f,"oncomment",f.comment),f.comment=""):(f.comment+="-"+I,f.state=w.COMMENT);continue;case w.COMMENT_ENDED:I!==">"?(Z(f,"Malformed comment"),f.comment+="--"+I,f.state=w.COMMENT):f.state=w.TEXT;continue;case w.CDATA:I==="]"?f.state=w.CDATA_ENDING:f.cdata+=I;continue;case w.CDATA_ENDING:I==="]"?f.state=w.CDATA_ENDING_2:(f.cdata+="]"+I,f.state=w.CDATA);continue;case w.CDATA_ENDING_2:I===">"?(f.cdata&&F(f,"oncdata",f.cdata),F(f,"onclosecdata"),f.cdata="",f.state=w.TEXT):I==="]"?f.cdata+="]":(f.cdata+="]]"+I,f.state=w.CDATA);continue;case w.PROC_INST:I==="?"?f.state=w.PROC_INST_ENDING:C(I)?f.state=w.PROC_INST_BODY:f.procInstName+=I;continue;case w.PROC_INST_BODY:if(!f.procInstBody&&C(I))continue;I==="?"?f.state=w.PROC_INST_ENDING:f.procInstBody+=I;continue;case w.PROC_INST_ENDING:I===">"?(F(f,"onprocessinginstruction",{name:f.procInstName,body:f.procInstBody}),f.procInstName=f.procInstBody="",f.state=w.TEXT):(f.procInstBody+="?"+I,f.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:T(D,I)?f.tagName+=I:(xr(f),I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:(C(I)||Z(f,"Invalid character in tag name"),f.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:I===">"?(Nt(f,!0),Sr(f)):(Z(f,"Forward-slash in opening tag not followed by >"),f.state=w.ATTRIB);continue;case w.ATTRIB:if(C(I))continue;I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:T(N,I)?(f.attribName=I,f.attribValue="",f.state=w.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case w.ATTRIB_NAME:I==="="?f.state=w.ATTRIB_VALUE:I===">"?(Z(f,"Attribute without value"),f.attribValue=f.attribName,Cr(f),Nt(f)):C(I)?f.state=w.ATTRIB_NAME_SAW_WHITE:T(D,I)?f.attribName+=I:Z(f,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if(I==="=")f.state=w.ATTRIB_VALUE;else{if(C(I))continue;Z(f,"Attribute without value"),f.tag.attributes[f.attribName]="",f.attribValue="",F(f,"onattribute",{name:f.attribName,value:""}),f.attribName="",I===">"?Nt(f):T(N,I)?(f.attribName=I,f.state=w.ATTRIB_NAME):(Z(f,"Invalid attribute name"),f.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(C(I))continue;R(I)?(f.q=I,f.state=w.ATTRIB_VALUE_QUOTED):(Z(f,"Unquoted attribute value"),f.state=w.ATTRIB_VALUE_UNQUOTED,f.attribValue=I);continue;case w.ATTRIB_VALUE_QUOTED:if(I!==f.q){I==="&"?f.state=w.ATTRIB_VALUE_ENTITY_Q:f.attribValue+=I;continue}Cr(f),f.q="",f.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:C(I)?f.state=w.ATTRIB:I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:T(N,I)?(Z(f,"No whitespace between attributes"),f.attribName=I,f.attribValue="",f.state=w.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(!_(I)){I==="&"?f.state=w.ATTRIB_VALUE_ENTITY_U:f.attribValue+=I;continue}Cr(f),I===">"?Nt(f):f.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(f.tagName)I===">"?Sr(f):T(D,I)?f.tagName+=I:f.script?(f.script+="</"+f.tagName,f.tagName="",f.state=w.SCRIPT):(C(I)||Z(f,"Invalid tagname in closing tag"),f.state=w.CLOSE_TAG_SAW_WHITE);else{if(C(I))continue;A(N,I)?f.script?(f.script+="</"+I,f.state=w.SCRIPT):Z(f,"Invalid tagname in closing tag."):f.tagName=I}continue;case w.CLOSE_TAG_SAW_WHITE:if(C(I))continue;I===">"?Sr(f):Z(f,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var Te,Je;switch(f.state){case w.TEXT_ENTITY:Te=w.TEXT,Je="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:Te=w.ATTRIB_VALUE_QUOTED,Je="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:Te=w.ATTRIB_VALUE_UNQUOTED,Je="attribValue";break}I===";"?(f[Je]+=wi(f),f.entity="",f.state=Te):T(f.entity.length?p:E,I)?f.entity+=I:(Z(f,"Invalid character in entity name"),f[Je]+="&"+f.entity+I,f.entity="",f.state=Te);continue;default:throw new Error(f,"Unknown state: "+f.state)}return f.position>=f.bufferCheckPosition&&i(f),f}o(Kr,"write");String.fromCodePoint||function(){var m=String.fromCharCode,f=Math.floor,q=o(function(){var I=16384,te=[],we,Te,Je=-1,wt=arguments.length;if(!wt)return"";for(var Tr="";++Je<wt;){var De=Number(arguments[Je]);if(!isFinite(De)||De<0||De>1114111||f(De)!==De)throw RangeError("Invalid code point: "+De);De<=65535?te.push(De):(De-=65536,we=(De>>10)+55296,Te=De%1024+56320,te.push(we,Te)),(Je+1===wt||te.length>I)&&(Tr+=m.apply(null,te),te.length=0)}return Tr},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:q,configurable:!0,writable:!0}):String.fromCodePoint=q}()})(typeof Es>"u"?Es.sax={}:Es)});var ih=P(ja=>{(function(){"use strict";ja.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call(ja)});var Ka=P(vi=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),vi.normalize=function(e){return e.toLowerCase()},vi.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vi.stripPrefix=function(e){return e.replace(t,"")},vi.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},vi.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(vi)});var nh=P(gi=>{(function(){"use strict";var t,e,r,i,n,s,a,u,l=o(function(v,S){return function(){return v.apply(S,arguments)}},"bind"),h=o(function(v,S){for(var O in S)y.call(S,O)&&(v[O]=S[O]);function g(){this.constructor=v}return o(g,"ctor"),g.prototype=S.prototype,v.prototype=new g,v.__super__=S.prototype,v},"extend"),y={}.hasOwnProperty;a=rh(),r=re("events"),t=ih(),s=Ka(),u=re("timers").setImmediate,e=ws().defaults,i=o(function(v){return typeof v=="object"&&v!=null&&Object.keys(v).length===0},"isEmpty"),n=o(function(v,S,O){var g,N,D;for(g=0,N=v.length;g<N;g++)D=v[g],S=D(S,O);return S},"processItem"),gi.Parser=function(v){h(S,v);function S(O){this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var g,N,D;if(!(this instanceof gi.Parser))return new gi.Parser(O);this.options={},N=e["0.2"];for(g in N)y.call(N,g)&&(D=N[g],this.options[g]=D);for(g in O)y.call(O,g)&&(D=O[g],this.options[g]=D);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return o(S,"Parser"),S.prototype.processAsync=function(){var O,g;try{return this.remaining.length<=this.options.chunkSize?(O=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(O),this.saxParser.close()):(O=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(O),u(this.processAsync))}catch(N){if(g=N,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(g)}},S.prototype.assignOrPush=function(O,g,N){return g in O?(O[g]instanceof Array||(O[g]=[O[g]]),O[g].push(N)):this.options.explicitArray?O[g]=[N]:O[g]=N},S.prototype.reset=function(){var O,g,N,D;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(E){return function(p){if(E.saxParser.resume(),!E.saxParser.errThrown)return E.saxParser.errThrown=!0,E.emit("error",p)}}(this),this.saxParser.onend=function(E){return function(){if(!E.saxParser.ended)return E.saxParser.ended=!0,E.emit("end",E.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,D=[],O=this.options.attrkey,g=this.options.charkey,this.saxParser.onopentag=function(E){return function(p){var C,R,_,T,A;if(_={},_[g]="",!E.options.ignoreAttrs){A=p.attributes;for(C in A)y.call(A,C)&&(!(O in _)&&!E.options.mergeAttrs&&(_[O]={}),R=E.options.attrValueProcessors?n(E.options.attrValueProcessors,p.attributes[C],C):p.attributes[C],T=E.options.attrNameProcessors?n(E.options.attrNameProcessors,C):C,E.options.mergeAttrs?E.assignOrPush(_,T,R):_[O][T]=R)}return _["#name"]=E.options.tagNameProcessors?n(E.options.tagNameProcessors,p.name):p.name,E.options.xmlns&&(_[E.options.xmlnskey]={uri:p.uri,local:p.local}),D.push(_)}}(this),this.saxParser.onclosetag=function(E){return function(){var p,C,R,_,T,A,w,K,X,F;if(A=D.pop(),T=A["#name"],(!E.options.explicitChildren||!E.options.preserveChildrenOrder)&&delete A["#name"],A.cdata===!0&&(p=A.cdata,delete A.cdata),X=D[D.length-1],A[g].match(/^\s*$/)&&!p?(C=A[g],delete A[g]):(E.options.trim&&(A[g]=A[g].trim()),E.options.normalize&&(A[g]=A[g].replace(/\s{2,}/g," ").trim()),A[g]=E.options.valueProcessors?n(E.options.valueProcessors,A[g],T):A[g],Object.keys(A).length===1&&g in A&&!E.EXPLICIT_CHARKEY&&(A=A[g])),i(A)&&(A=E.options.emptyTag!==""?E.options.emptyTag:C),E.options.validator!=null&&(F="/"+function(){var oe,We,Fe;for(Fe=[],oe=0,We=D.length;oe<We;oe++)_=D[oe],Fe.push(_["#name"]);return Fe}().concat(T).join("/"),function(){var oe;try{return A=E.options.validator(F,X&&X[T],A)}catch(We){return oe=We,E.emit("error",oe)}}()),E.options.explicitChildren&&!E.options.mergeAttrs&&typeof A=="object"){if(!E.options.preserveChildrenOrder)_={},E.options.attrkey in A&&(_[E.options.attrkey]=A[E.options.attrkey],delete A[E.options.attrkey]),!E.options.charsAsChildren&&E.options.charkey in A&&(_[E.options.charkey]=A[E.options.charkey],delete A[E.options.charkey]),Object.getOwnPropertyNames(A).length>0&&(_[E.options.childkey]=A),A=_;else if(X){X[E.options.childkey]=X[E.options.childkey]||[],w={};for(R in A)y.call(A,R)&&(w[R]=A[R]);X[E.options.childkey].push(w),delete A["#name"],Object.keys(A).length===1&&g in A&&!E.EXPLICIT_CHARKEY&&(A=A[g])}}return D.length>0?E.assignOrPush(X,T,A):(E.options.explicitRoot&&(K=A,A={},A[T]=K),E.resultObject=A,E.saxParser.ended=!0,E.emit("end",E.resultObject))}}(this),N=function(E){return function(p){var C,R;if(R=D[D.length-1],R)return R[g]+=p,E.options.explicitChildren&&E.options.preserveChildrenOrder&&E.options.charsAsChildren&&(E.options.includeWhiteChars||p.replace(/\\n/g,"").trim()!=="")&&(R[E.options.childkey]=R[E.options.childkey]||[],C={"#name":"__text__"},C[g]=p,E.options.normalize&&(C[g]=C[g].replace(/\s{2,}/g," ").trim()),R[E.options.childkey].push(C)),R}}(this),this.saxParser.ontext=N,this.saxParser.oncdata=function(E){return function(p){var C;if(C=N(p),C)return C.cdata=!0}}(this)},S.prototype.parseString=function(O,g){var N;g!=null&&typeof g=="function"&&(this.on("end",function(D){return this.reset(),g(null,D)}),this.on("error",function(D){return this.reset(),g(D)}));try{return O=O.toString(),O.trim()===""?(this.emit("end",null),!0):(O=t.stripBOM(O),this.options.async?(this.remaining=O,u(this.processAsync),this.saxParser):this.saxParser.write(O).close())}catch(D){if(N=D,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw N}else return this.emit("error",N),this.saxParser.errThrown=!0}},S}(r.EventEmitter),gi.parseString=function(v,S,O){var g,N,D;return O!=null?(typeof O=="function"&&(g=O),typeof S=="object"&&(N=S)):(typeof S=="function"&&(g=S),N={}),D=new gi.Parser(N),D.parseString(v,g)}}).call(gi)});var oh=P(zr=>{(function(){"use strict";var t,e,r,i,n=o(function(a,u){for(var l in u)s.call(u,l)&&(a[l]=u[l]);function h(){this.constructor=a}return o(h,"ctor"),h.prototype=u.prototype,a.prototype=new h,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;e=ws(),t=th(),r=nh(),i=Ka(),zr.defaults=e.defaults,zr.processors=i,zr.ValidationError=function(a){n(u,a);function u(l){this.message=l}return o(u,"ValidationError"),u}(Error),zr.Builder=t.Builder,zr.Parser=r.Parser,zr.parseString=r.parseString}).call(zr)});var fh=P((FM,lh)=>{var sh=V(),lo=sh.util,Wg=sh.Model.Shape,Bg=oh(),Ug={explicitCharkey:!1,trim:!1,normalize:!1,explicitRoot:!1,emptyTag:null,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,validator:null};function ah(){}o(ah,"NodeXmlParser");ah.prototype.parse=function(t,e){e=e||{};var r=null,i=null,n=new Bg.Parser(Ug);if(n.parseString(t,function(a,u){i=a,r=u}),r){var s=wr(r,e);return r.ResponseMetadata&&(s.ResponseMetadata=wr(r.ResponseMetadata[0],{})),s}else{if(i)throw lo.error(i,{code:"XMLParserError",retryable:!0});return wr({},e)}};function wr(t,e){switch(e.type){case"structure":return Vg(t,e);case"map":return zg(t,e);case"list":return uh(t,e);case void 0:case null:return Hg(t);default:return ch(t,e)}}o(wr,"parseXml");function Vg(t,e){var r={};return t===null||lo.each(e.members,function(i,n){var s=n.name;if(Object.prototype.hasOwnProperty.call(t,s)&&Array.isArray(t[s])){var a=t[s];n.flattened||(a=a[0]),r[i]=wr(a,n)}else n.isXmlAttribute&&t.$&&Object.prototype.hasOwnProperty.call(t.$,s)?r[i]=ch(t.$[s],n):n.type==="list"&&!e.api.xmlNoDefaultLists&&(r[i]=n.defaultValue)}),r}o(Vg,"parseStructure");function zg(t,e){var r={};if(t===null)return r;var i=e.key.name||"key",n=e.value.name||"value",s=e.flattened?t:t.entry;return Array.isArray(s)&&lo.arrayEach(s,function(a){r[a[i][0]]=wr(a[n][0],e.value)}),r}o(zg,"parseMap");function uh(t,e){var r=[],i=e.member.name||"member";return e.flattened?lo.arrayEach(t,function(n){r.push(wr(n,e.member))}):t&&Array.isArray(t[i])&&lo.arrayEach(t[i],function(n){r.push(wr(n,e.member))}),r}o(uh,"parseList");function ch(t,e){return t&&t.$&&t.$.encoding==="base64"&&(e=new Wg.create({type:t.$.encoding})),t&&t._&&(t=t._),typeof e.toType=="function"?e.toType(t):t}o(ch,"parseScalar");function Hg(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t)){var e=[];for(i=0;i<t.length;i++)e.push(wr(t[i],{}));return e}var r=Object.keys(t),i;if(r.length===0||r.length===1&&r[0]==="$")return{};var n={};for(i=0;i<r.length;i++){var s=r[i],a=t[s];s!=="$"&&(a.length>1?n[s]=uh(a,{member:{}}):n[s]=wr(a[0],{}))}return n}o(Hg,"parseUnknown");lh.exports=ah});var hh=P(()=>{var Ce=V(),jg=Ce.util.stream.Stream,dh=Ce.util.stream.Transform,Kg=Ce.util.stream.Readable;Jo();var Xg="AWS_NODEJS_CONNECTION_REUSE_ENABLED";Ce.NodeHttpClient=Ce.util.inherit({handleRequest:o(function(e,r,i,n){var s=this,a=e.endpoint,u="";r||(r={}),r.proxy&&(u=a.protocol+"//"+a.hostname,a.port!==80&&a.port!==443&&(u+=":"+a.port),a=new Ce.Endpoint(r.proxy));var l=a.protocol==="https:",h=l?re("https"):re("http"),y={host:a.hostname,port:a.port,method:e.method,headers:e.headers,path:u+e.path};r.agent||(y.agent=this.getAgent(l,{keepAlive:process.env[Xg]==="1"})),Ce.util.update(y,r),delete y.proxy,delete y.timeout;var v=h.request(y,function(g){v.didCallback||(i(g),g.emit("headers",g.statusCode,g.headers,g.statusMessage))});if(e.stream=v,v.didCallback=!1,r.connectTimeout){var S;v.on("socket",function(g){g.connecting&&(S=setTimeout(o(function(){v.didCallback||(v.didCallback=!0,v.abort(),n(Ce.util.error(new Error("Socket timed out without establishing a connection"),{code:"TimeoutError"})))},"connectTimeout"),r.connectTimeout),g.on("connect",function(){clearTimeout(S),S=null}))})}v.setTimeout(r.timeout||0,function(){if(!v.didCallback){v.didCallback=!0;var g="Connection timed out after "+r.timeout+"ms";n(Ce.util.error(new Error(g),{code:"TimeoutError"})),v.abort()}}),v.on("error",function(g){S&&(clearTimeout(S),S=null),!v.didCallback&&(v.didCallback=!0,g.code==="ECONNRESET"||g.code==="EPIPE"||g.code==="ETIMEDOUT"?n(Ce.util.error(g,{code:"TimeoutError"})):n(g))});var O=e.headers.Expect||e.headers.expect;return O==="100-continue"?v.once("continue",function(){s.writeBody(v,e)}):this.writeBody(v,e),v},"handleRequest"),writeBody:o(function(e,r){var i=r.body,n=parseInt(r.headers["Content-Length"],10);if(i instanceof jg){var s=this.progressStream(e,n);s?i.pipe(s).pipe(e):i.pipe(e)}else i?(e.once("finish",function(){e.emit("sendProgress",{loaded:n,total:n})}),e.end(i)):e.end()},"writeBody"),getAgent:o(function(e,r){var i=e?re("https"):re("http");return e?(Ce.NodeHttpClient.sslAgent||(Ce.NodeHttpClient.sslAgent=new i.Agent(Ce.util.merge({rejectUnauthorized:process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"},r||{})),Ce.NodeHttpClient.sslAgent.setMaxListeners(0),Object.defineProperty(Ce.NodeHttpClient.sslAgent,"maxSockets",{enumerable:!0,get:function(){var n=50,s=i.globalAgent;return s&&s.maxSockets!==1/0&&typeof s.maxSockets=="number"?s.maxSockets:n}})),Ce.NodeHttpClient.sslAgent):(Ce.NodeHttpClient.agent||(Ce.NodeHttpClient.agent=new i.Agent(r)),Ce.NodeHttpClient.agent)},"getAgent"),progressStream:o(function(e,r){if(!(typeof dh>"u")){var i=0,n=new dh;return n._transform=function(s,a,u){s&&(i+=s.length,e.emit("sendProgress",{loaded:i,total:r})),u(null,s)},n}},"progressStream"),emitter:null});Ce.HttpClient.prototype=Ce.NodeHttpClient.prototype;Ce.HttpClient.streamsApiVersion=Kg?2:1});var ph=P(()=>{var St=V(),Gg=re("fs"),Jg=Vr(),Yg=St.util.iniLoader;St.TokenFileWebIdentityCredentials=St.util.inherit(St.Credentials,{constructor:o(function(e){St.Credentials.call(this),this.data=null,this.clientConfig=St.util.copy(e||{})},"TokenFileWebIdentityCredentials"),getParamsFromEnv:o(function(){var e="AWS_WEB_IDENTITY_TOKEN_FILE",r="AWS_ROLE_ARN";if(process.env[e]&&process.env[r])return[{envTokenFile:process.env[e],roleArn:process.env[r],roleSessionName:process.env.AWS_ROLE_SESSION_NAME}]},"getParamsFromEnv"),getParamsFromSharedConfig:o(function(){var e=St.util.getProfilesFromSharedConfig(Yg),r=process.env.AWS_PROFILE||St.util.defaultProfile,i=e[r]||{};if(Object.keys(i).length===0)throw St.util.error(new Error("Profile "+r+" not found"),{code:"TokenFileWebIdentityCredentialsProviderFailure"});for(var n=[];!i.web_identity_token_file&&i.source_profile;){n.unshift({roleArn:i.role_arn,roleSessionName:i.role_session_name});var s=i.source_profile;i=e[s]}return n.unshift({envTokenFile:i.web_identity_token_file,roleArn:i.role_arn,roleSessionName:i.role_session_name}),n},"getParamsFromSharedConfig"),refresh:o(function(e){this.coalesceRefresh(e||St.util.fn.callback)},"refresh"),assumeRoleChaining:o(function(e,r){var i=this;if(e.length===0)i.service.credentialsFrom(i.data,i),r();else{var n=e.shift();i.service.config.credentials=i.service.credentialsFrom(i.data,i),i.service.assumeRole({RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(s,a){i.data=null,s?r(s):(i.data=a,i.assumeRoleChaining(e,r))})}},"assumeRoleChaining"),load:o(function(e){var r=this;try{var i=r.getParamsFromEnv();if(i||(i=r.getParamsFromSharedConfig()),i){var n=i.shift(),s=Gg.readFileSync(n.envTokenFile,{encoding:"ascii"});r.service||r.createClients(),r.service.assumeRoleWithWebIdentity({WebIdentityToken:s,RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(a,u){r.data=null,a?e(a):(r.data=u,r.assumeRoleChaining(i,e))})}}catch(a){e(a)}},"load"),createClients:function(){if(!this.service){var t=St.util.merge({},this.clientConfig);this.service=new Jg(t),this.service.retryableError=function(e){return e.code==="IDPCommunicationErrorException"||e.code==="InvalidIdentityToken"?!0:St.Service.prototype.retryableError.call(this,e)}}}})});var yh=P((KM,mh)=>{var Qg=o(function(){return{IPv4:"http://169.254.169.254",IPv6:"http://[fd00:ec2::254]"}},"getEndpoint");mh.exports=Qg});var Xa=P((GM,vh)=>{var $g=o(function(){return{IPv4:"IPv4",IPv6:"IPv6"}},"getEndpointMode");vh.exports=$g});var Nh=P((YM,gh)=>{var Zg="AWS_EC2_METADATA_SERVICE_ENDPOINT",eN="ec2_metadata_service_endpoint",tN=o(function(){return{environmentVariableSelector:function(t){return t[Zg]},configFileSelector:function(t){return t[eN]},default:void 0}},"getEndpointConfigOptions");gh.exports=tN});var xh=P(($M,wh)=>{var rN=Xa()(),iN="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",nN="ec2_metadata_service_endpoint_mode",oN=o(function(){return{environmentVariableSelector:function(t){return t[iN]},configFileSelector:function(t){return t[nN]},default:rN.IPv4}},"getEndpointModeConfigOptions");wh.exports=oN});var bh=P((eF,Th)=>{var Eh=V(),Ch=yh()(),Sh=Xa()(),sN=Nh()(),aN=xh()(),uN=o(function(){var t=Eh.util.loadConfig(sN);if(t!==void 0)return t;var e=Eh.util.loadConfig(aN);switch(e){case Sh.IPv4:return Ch.IPv4;case Sh.IPv6:return Ch.IPv6;default:throw new Error("Unsupported endpoint mode: "+e)}},"getMetadataServiceEndpoint");Th.exports=uN});var Oh=P((rF,Ih)=>{var Wt=V();Jo();var cN=Wt.util.inherit,lN=bh(),Ah=re("url").URL;Wt.MetadataService=cN({endpoint:lN(),httpOptions:{timeout:0},disableFetchToken:!1,constructor:o(function(e){e&&e.host&&(e.endpoint="http://"+e.host,delete e.host),Wt.util.update(this,e)},"MetadataService"),request:o(function(e,r,i){if(arguments.length===2&&(i=r,r={}),process.env[Wt.util.imdsDisabledEnv]){i(new Error("EC2 Instance Metadata Service access disabled"));return}e=e||"/",Ah&&new Ah(this.endpoint);var n=new Wt.HttpRequest(this.endpoint+e);n.method=r.method||"GET",r.headers&&(n.headers=r.headers),Wt.util.handleRequestWithRetries(n,this,i)},"request"),loadCredentialsCallbacks:[],fetchMetadataToken:o(function(e){var r=this,i="/latest/api/token";r.request(i,{method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}},e)},"fetchMetadataToken"),fetchCredentials:o(function(e,r){var i=this,n="/latest/meta-data/iam/security-credentials/";i.request(n,e,function(s,a){if(s){i.disableFetchToken=s.statusCode!==401,r(Wt.util.error(s,{message:"EC2 Metadata roleName request returned error"}));return}a=a.split(`
|
|
28
|
-
`)[0],i.request(n+a,e,function(u,l){if(u){i.disableFetchToken=u.statusCode!==401,r(Wt.util.error(u,{message:"EC2 Metadata creds request returned error"}));return}try{var h=JSON.parse(l);r(null,h)}catch(y){r(y)}})})},"fetchCredentials"),loadCredentials:
|
|
29
|
-
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`)}},"extendExpirationIfExpired"),setCredentials:o(function(e){var r=gt.util.date.getDate().getTime(),i=new Date(e.Expiration);this.expired=r>=i,this.metadata=e,this.accessKeyId=e.AccessKeyId,this.secretAccessKey=e.SecretAccessKey,this.sessionToken=e.Token,this.expireTime=i},"setCredentials")})});var _h=P(()=>{var Xe=V(),Ga="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Cs="AWS_CONTAINER_CREDENTIALS_FULL_URI",fN="AWS_CONTAINER_AUTHORIZATION_TOKEN",dN=["https:"],Dh=["http:","https:"],Ph=["localhost","127.0.0.1"],hN="169.254.170.2";Xe.RemoteCredentials=Xe.util.inherit(Xe.Credentials,{constructor:o(function(e){Xe.Credentials.call(this),e=e?Xe.util.copy(e):{},e.httpOptions||(e.httpOptions={}),e.httpOptions=Xe.util.merge(this.httpOptions,e.httpOptions),Xe.util.update(this,e)},"RemoteCredentials"),httpOptions:{timeout:1e3},maxRetries:3,isConfiguredForEcsCredentials:o(function(){return Boolean(process&&process.env&&(process.env[Ga]||process.env[Cs]))},"isConfiguredForEcsCredentials"),getECSFullUri:o(function(){if(process&&process.env){var e=process.env[Ga],r=process.env[Cs];if(e)return"http://"+hN+e;if(r){var i=Xe.util.urlParse(r);if(Dh.indexOf(i.protocol)<0)throw Xe.util.error(new Error("Unsupported protocol: AWS.RemoteCredentials supports "+Dh.join(",")+" only; "+i.protocol+" requested."),{code:"ECSCredentialsProviderFailure"});if(dN.indexOf(i.protocol)<0&&Ph.indexOf(i.hostname)<0)throw Xe.util.error(new Error("Unsupported hostname: AWS.RemoteCredentials only supports "+Ph.join(",")+" for "+i.protocol+"; "+i.protocol+"//"+i.hostname+" requested."),{code:"ECSCredentialsProviderFailure"});return r}else throw Xe.util.error(new Error("Variable "+Ga+" or "+Cs+" must be set to use AWS.RemoteCredentials."),{code:"ECSCredentialsProviderFailure"})}else throw Xe.util.error(new Error("No process info available"),{code:"ECSCredentialsProviderFailure"})},"getECSFullUri"),getECSAuthToken:o(function(){if(process&&process.env&&process.env[Cs])return process.env[fN]},"getECSAuthToken"),credsFormatIsValid:o(function(e){return!!e.accessKeyId&&!!e.secretAccessKey&&!!e.sessionToken&&!!e.expireTime},"credsFormatIsValid"),formatCreds:o(function(e){return e.credentials&&(e=e.credentials),{expired:!1,accessKeyId:e.accessKeyId||e.AccessKeyId,secretAccessKey:e.secretAccessKey||e.SecretAccessKey,sessionToken:e.sessionToken||e.Token,expireTime:new Date(e.expiration||e.Expiration)}},"formatCreds"),request:o(function(e,r){var i=new Xe.HttpRequest(e);i.method="GET",i.headers.Accept="application/json";var n=this.getECSAuthToken();n&&(i.headers.Authorization=n),Xe.util.handleRequestWithRetries(i,this,r)},"request"),refresh:o(function(e){this.coalesceRefresh(e||Xe.util.fn.callback)},"refresh"),load:o(function(e){var r=this,i;try{i=this.getECSFullUri()}catch(n){e(n);return}this.request(i,function(n,s){if(!n)try{s=JSON.parse(s);var a=r.formatCreds(s);if(!r.credsFormatIsValid(a))throw Xe.util.error(new Error("Response data is not in valid format"),{code:"ECSCredentialsProviderFailure"});Xe.util.update(r,a)}catch(u){n=u}e(n,a)})},"load")})});var qh=P(()=>{var kh=V();kh.ECSCredentials=kh.RemoteCredentials});var Lh=P(()=>{var Hr=V();Hr.EnvironmentCredentials=Hr.util.inherit(Hr.Credentials,{constructor:o(function(e){Hr.Credentials.call(this),this.envPrefix=e,this.get(function(){})},"EnvironmentCredentials"),refresh:o(function(e){if(e||(e=Hr.util.fn.callback),!process||!process.env){e(Hr.util.error(new Error("No process info or environment variables available"),{code:"EnvironmentCredentialsProviderFailure"}));return}for(var r=["ACCESS_KEY_ID","SECRET_ACCESS_KEY","SESSION_TOKEN"],i=[],n=0;n<r.length;n++){var s="";if(this.envPrefix&&(s=this.envPrefix+"_"),i[n]=process.env[s+r[n]],!i[n]&&r[n]!=="SESSION_TOKEN"){e(Hr.util.error(new Error("Variable "+s+r[n]+" not set."),{code:"EnvironmentCredentialsProviderFailure"}));return}}this.expired=!1,Hr.Credentials.apply(this,i),e()},"refresh")})});var Mh=P(()=>{var jr=V();jr.FileSystemCredentials=jr.util.inherit(jr.Credentials,{constructor:o(function(e){jr.Credentials.call(this),this.filename=e,this.get(function(){})},"FileSystemCredentials"),refresh:o(function(e){e||(e=jr.util.fn.callback);try{var r=JSON.parse(jr.util.readFileSync(this.filename));if(jr.Credentials.call(this,r),!this.accessKeyId||!this.secretAccessKey)throw jr.util.error(new Error("Credentials not set in "+this.filename),{code:"FileSystemCredentialsProviderFailure"});this.expired=!1,e()}catch(i){e(i)}},"refresh")})});var Wh=P(()=>{var Ge=V(),pN=Vr(),Fh=Ge.util.iniLoader,mN="us-east-1";Ge.SharedIniFileCredentials=Ge.util.inherit(Ge.Credentials,{constructor:o(function(e){Ge.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Ge.util.defaultProfile,this.disableAssumeRole=Boolean(e.disableAssumeRole),this.preferStaticCredentials=Boolean(e.preferStaticCredentials),this.tokenCodeFn=e.tokenCodeFn||null,this.httpOptions=e.httpOptions||null,this.get(e.callback||Ge.util.fn.noop)},"SharedIniFileCredentials"),load:o(function(e){var r=this;try{var i=Ge.util.getProfilesFromSharedConfig(Fh,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Ge.util.error(new Error("Profile "+this.profile+" not found"),{code:"SharedIniFileCredentialsProviderFailure"});var s=Boolean(this.preferStaticCredentials&&n.aws_access_key_id&&n.aws_secret_access_key);if(n.role_arn&&!s){this.loadRoleProfile(i,n,function(a,u){a?e(a):(r.expired=!1,r.accessKeyId=u.Credentials.AccessKeyId,r.secretAccessKey=u.Credentials.SecretAccessKey,r.sessionToken=u.Credentials.SessionToken,r.expireTime=u.Credentials.Expiration,e(null))});return}if(this.accessKeyId=n.aws_access_key_id,this.secretAccessKey=n.aws_secret_access_key,this.sessionToken=n.aws_session_token,!this.accessKeyId||!this.secretAccessKey)throw Ge.util.error(new Error("Credentials not set for profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});this.expired=!1,e(null)}catch(a){e(a)}},"load"),refresh:o(function(e){Fh.clearCachedFiles(),this.coalesceRefresh(e||Ge.util.fn.callback,this.disableAssumeRole)},"refresh"),loadRoleProfile:o(function(e,r,i){if(this.disableAssumeRole)throw Ge.util.error(new Error("Role assumption profiles are disabled. Failed to load profile "+this.profile+" from "+e.filename),{code:"SharedIniFileCredentialsProviderFailure"});var n=this,s=r.role_arn,a=r.role_session_name,u=r.external_id,l=r.mfa_serial,h=r.source_profile,y=r.region||mN;if(!h)throw Ge.util.error(new Error("source_profile is not set using profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});var v=e[h];if(typeof v!="object")throw Ge.util.error(new Error("source_profile "+h+" using profile "+this.profile+" does not exist"),{code:"SharedIniFileCredentialsProviderFailure"});var S=new Ge.SharedIniFileCredentials(Ge.util.merge(this.options||{},{profile:h,preferStaticCredentials:!0}));this.roleArn=s;var O=new pN({credentials:S,region:y,httpOptions:this.httpOptions}),g={RoleArn:s,RoleSessionName:a||"aws-sdk-js-"+Date.now()};if(u&&(g.ExternalId=u),l&&n.tokenCodeFn){g.SerialNumber=l,n.tokenCodeFn(l,function(N,D){if(N){var E;N instanceof Error?E=N.message:E=N,i(Ge.util.error(new Error("Error fetching MFA token: "+E),{code:"SharedIniFileCredentialsProviderFailure"}));return}g.TokenCode=D,O.assumeRole(g,i)});return}O.assumeRole(g,i)},"loadRoleProfile")})});var Bh=P(()=>{var Re=V(),yN=re("path"),vN=re("crypto"),Ja=Re.util.iniLoader;Re.SsoCredentials=Re.util.inherit(Re.Credentials,{constructor:o(function(e){Re.Credentials.call(this),e=e||{},this.errorCode="SsoCredentialsProviderFailure",this.expired=!0,this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Re.util.defaultProfile,this.service=e.ssoClient,this.httpOptions=e.httpOptions||null,this.get(e.callback||Re.util.fn.noop)},"SsoCredentials"),load:o(function(e){var r=this;try{var i=Re.util.getProfilesFromSharedConfig(Ja,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Re.util.error(new Error("Profile "+this.profile+" not found"),{code:r.errorCode});if(n.sso_session){if(!n.sso_account_id||!n.sso_role_name)throw Re.util.error(new Error("Profile "+this.profile+" with session "+n.sso_session+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", "sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:r.errorCode})}else if(!n.sso_start_url||!n.sso_account_id||!n.sso_region||!n.sso_role_name)throw Re.util.error(new Error("Profile "+this.profile+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:r.errorCode});this.getToken(this.profile,n,function(s,a){if(s)return e(s);var u={accessToken:a,accountId:n.sso_account_id,roleName:n.sso_role_name};(!r.service||r.service.config.region!==n.sso_region)&&(r.service=new Re.SSO({region:n.sso_region,httpOptions:r.httpOptions})),r.service.getRoleCredentials(u,function(l,h){if(l||!h||!h.roleCredentials)e(Re.util.error(l||new Error('Please log in using "aws sso login"'),{code:r.errorCode}),null);else{if(!h.roleCredentials.accessKeyId||!h.roleCredentials.secretAccessKey||!h.roleCredentials.sessionToken||!h.roleCredentials.expiration)throw Re.util.error(new Error("SSO returns an invalid temporary credential."));r.expired=!1,r.accessKeyId=h.roleCredentials.accessKeyId,r.secretAccessKey=h.roleCredentials.secretAccessKey,r.sessionToken=h.roleCredentials.sessionToken,r.expireTime=new Date(h.roleCredentials.expiration),e(null)}})})}catch(s){e(s)}},"load"),getToken:o(function(e,r,i){var n=this;if(r.sso_session){var s=Re.util.iniLoader,a=s.loadSsoSessionsFrom(),u=a[r.sso_session];Object.assign(r,u);var l=new Re.SSOTokenProvider({profile:e});l.load(function(N){return N?i(N):i(null,l.token)});return}try{var h=9e5,y=vN.createHash("sha1"),v=y.update(r.sso_start_url).digest("hex")+".json",S=yN.join(Ja.getHomeDir(),".aws","sso","cache",v),O=Re.util.readFileSync(S),g=null;if(O&&(g=JSON.parse(O)),!g)throw Re.util.error(new Error("Cached credentials not found under "+this.profile+" profile. Please make sure you log in with aws sso login first"),{code:n.errorCode});if(!g.startUrl||!g.region||!g.accessToken||!g.expiresAt)throw Re.util.error(new Error("Cached credentials are missing required properties. Try running aws sso login."));if(new Date(g.expiresAt).getTime()-Date.now()<=h)throw Re.util.error(new Error("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile."));return i(null,g.accessToken)}catch(N){return i(N,null)}},"getToken"),refresh:o(function(e){Ja.clearCachedFiles(),this.coalesceRefresh(e||Re.util.fn.callback)},"refresh")})});var Uh=P(()=>{var Tt=V();Tt.Token=Tt.util.inherit({constructor:o(function(e){if(Tt.util.hideProperties(this,["token"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1){var e=arguments[0];this.token=e.token,this.expireTime=e.expireTime}},"Token"),expiryWindow:15,needsRefresh:o(function(){var e=Tt.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.token},"needsRefresh"),get:o(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:o(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:o(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(o(function(s){Tt.util.arrayEach(i.refreshCallbacks,function(a){r?a(s):Tt.util.defer(function(){a(s)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:o(function(e){e()},"load")});Tt.Token.addPromisesToClass=o(function(e){this.prototype.getPromise=Tt.util.promisifyMethod("get",e),this.prototype.refreshPromise=Tt.util.promisifyMethod("refresh",e)},"addPromisesToClass");Tt.Token.deletePromisesFromClass=o(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Tt.util.addPromises(Tt.Token)});var Vh=P(()=>{var Bt=V();Bt.TokenProviderChain=Bt.util.inherit(Bt.Token,{constructor:o(function(e){e?this.providers=e:this.providers=Bt.TokenProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"TokenProviderChain"),resolve:o(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Bt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var s=a;o(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Bt.TokenProviderChain.defaultProviders=[];Bt.TokenProviderChain.addPromisesToClass=o(function(e){this.prototype.resolvePromise=Bt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Bt.TokenProviderChain.deletePromisesFromClass=o(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Bt.util.addPromises(Bt.TokenProviderChain)});var jh=P(()=>{var Me=V(),gN=re("crypto"),zh=re("fs"),NN=re("path"),Ss=Me.util.iniLoader,Hh=0,Ni=o(function(e,r){if(!e[r])throw Me.util.error(new Error('Key "'+r+'" not present in SSO Token'),{code:"SSOTokenProviderFailure"})},"validateTokenKey"),Ya=o(function(e,r,i){if(r>e)i(null);else throw Me.util.error(new Error('SSO Token refresh failed. Please log in using "aws sso login"'),{code:"SSOTokenProviderFailure"})},"refreshUnsuccessful");Me.SSOTokenProvider=Me.util.inherit(Me.Token,{expiryWindow:5*60,constructor:o(function(e){Me.Token.call(this),e=e||{},this.expired=!0,this.profile=e.profile||process.env.AWS_PROFILE||Me.util.defaultProfile,this.get(e.callback||Me.util.fn.noop)},"SSOTokenProvider"),load:o(function(e){var r=this,i=Ss.loadFrom({isConfig:!0}),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Me.util.error(new Error('Profile "'+this.profile+'" not found'),{code:"SSOTokenProviderFailure"});if(!n.sso_session)throw Me.util.error(new Error('Profile "'+profileName+'" is missing required property "sso_session".'),{code:"SSOTokenProviderFailure"});var s=n.sso_session,a=Ss.loadSsoSessionsFrom(),u=a[s];if(u)if(u.sso_start_url){if(!u.sso_region)throw Me.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_region".'),{code:"SSOTokenProviderFailure"})}else throw Me.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_start_url".'),{code:"SSOTokenProviderFailure"});else throw Me.util.error(new Error('Sso session "'+s+'" not found'),{code:"SSOTokenProviderFailure"});var l=gN.createHash("sha1"),h=l.update(s).digest("hex")+".json",y=NN.join(Ss.getHomeDir(),".aws","sso","cache",h),v=JSON.parse(zh.readFileSync(y));if(!v)throw Me.util.error(new Error('Cached token not found. Please log in using "aws sso login" for profile "'+this.profile+'".'),{code:"SSOTokenProviderFailure"});Ni(v,"accessToken"),Ni(v,"expiresAt");var S=Me.util.date.getDate().getTime(),O=new Date(S+this.expiryWindow*1e3),g=new Date(v.expiresAt);if(g>O){r.token=v.accessToken,r.expireTime=g,r.expired=!1,e(null);return}if(S-Hh<30*1e3){Ya(S,g,e);return}Ni(v,"clientId"),Ni(v,"clientSecret"),Ni(v,"refreshToken"),(!r.service||r.service.config.region!==u.sso_region)&&(r.service=new Me.SSOOIDC({region:u.sso_region}));var N={clientId:v.clientId,clientSecret:v.clientSecret,refreshToken:v.refreshToken,grantType:"refresh_token"};Hh=Me.util.date.getDate().getTime(),r.service.createToken(N,function(D,E){if(D||!E)Ya(S,g,e);else try{Ni(E,"accessToken"),Ni(E,"expiresIn"),r.expired=!1,r.token=E.accessToken,r.expireTime=new Date(Date.now()+E.expiresIn*1e3),e(null);try{v.accessToken=E.accessToken,v.expiresAt=r.expireTime.toISOString(),v.refreshToken=E.refreshToken,zh.writeFileSync(y,JSON.stringify(v,null,2))}catch{}}catch{Ya(S,g,e)}})},"load"),refresh:o(function(e){Ss.clearCachedFiles(),this.coalesceRefresh(e||Me.util.fn.callback)},"refresh")})});var gs=P((_F,Gh)=>{var Se=Oe(),Xh=Na(),wN=Xh.isFipsRegion,xN=Xh.getRealRegion;Se.isBrowser=function(){return!1};Se.isNode=function(){return!0};Se.crypto.lib=re("crypto");Se.Buffer=re("buffer").Buffer;Se.domain=re("domain");Se.stream=re("stream");Se.url=re("url");Se.querystring=re("querystring");Se.environment="nodejs";Se.createEventStream=Se.stream.Readable?If().createEventStream:Pf().createEventStream;Se.realClock=kf();Se.clientSideMonitoring={Publisher:Lf().Publisher,configProvider:Wf()};Se.iniLoader=Hf().iniLoader;Se.getSystemErrorName=re("util").getSystemErrorName;Se.loadConfig=function(t){var e=t.environmentVariableSelector(process.env);if(e!==void 0)return e;var r={};try{r=Se.iniLoader?Se.iniLoader.loadFrom({isConfig:!0,filename:process.env[Se.sharedConfigFileEnv]}):{}}catch{}var i=r[process.env.AWS_PROFILE||Se.defaultProfile]||{},n=t.configFileSelector(i);return n!==void 0?n:typeof t.default=="function"?t.default():t.default};var fe;Gh.exports=fe=V();xa();Ea();$f();Zf();ed();sd();ad();Wa();fe.XML.Parser=fh();hh();Ma();ph();Rh();_h();qh();Lh();Mh();Wh();Wa();Bh();fe.CredentialProviderChain.defaultProviders=[function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SsoCredentials},function(){return new fe.SharedIniFileCredentials},function(){return new fe.ECSCredentials},function(){return new fe.ProcessCredentials},function(){return new fe.TokenFileWebIdentityCredentials},function(){return new fe.EC2MetadataCredentials}];Uh();Vh();jh();fe.TokenProviderChain.defaultProviders=[function(){return new fe.SSOTokenProvider}];var Kh=o(function(){var t=process.env,e=t.AWS_REGION||t.AMAZON_REGION;if(t[fe.util.configOptInEnv])for(var r=[{filename:t[fe.util.sharedCredentialsFileEnv]},{isConfig:!0,filename:t[fe.util.sharedConfigFileEnv]}],i=fe.util.iniLoader;!e&&r.length;){var n={},s=r.shift();try{n=i.loadFrom(s)}catch(u){if(s.isConfig)throw u}var a=n[t.AWS_PROFILE||fe.util.defaultProfile];e=a&&a.region}return e},"getRegion"),Ts=o(function(t){return t==="true"?!0:t==="false"?!1:void 0},"getBooleanValue"),EN={environmentVariableSelector:function(t){return Ts(t.AWS_USE_FIPS_ENDPOINT)},configFileSelector:function(t){return Ts(t.use_fips_endpoint)},default:!1},CN={environmentVariableSelector:function(t){return Ts(t.AWS_USE_DUALSTACK_ENDPOINT)},configFileSelector:function(t){return Ts(t.use_dualstack_endpoint)},default:!1};fe.util.update(fe.Config.prototype.keys,{credentials:function(){var t=null;return new fe.CredentialProviderChain([function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SharedIniFileCredentials({disableAssumeRole:!0})}]).resolve(function(e,r){e||(t=r)}),t},credentialProvider:function(){return new fe.CredentialProviderChain},logger:function(){return process.env.AWSJS_DEBUG?console:null},region:function(){var t=Kh();return t?xN(t):void 0},tokenProvider:function(){return new fe.TokenProviderChain},useFipsEndpoint:function(){var t=Kh();return wN(t)?!0:Se.loadConfig(EN)},useDualstackEndpoint:function(){return Se.loadConfig(CN)}});fe.config=new fe.Config});var Jh=P(()=>{var Qa=V();Qa.util.update(Qa.RDSDataService.prototype,{retryableError:o(function(e){if(e.code==="BadRequestException"&&e.message&&e.message.match(/^Communications link failure/)&&e.statusCode===400)return!0;var r=Qa.Service.prototype.retryableError;return r.call(this,e)},"retryableError")})});var Yh=P((FF,SN)=>{SN.exports={version:"2.0",metadata:{apiVersion:"2018-08-01",endpointPrefix:"rds-data",jsonVersion:"1.1",protocol:"rest-json",serviceFullName:"AWS RDS DataService",serviceId:"RDS Data",signatureVersion:"v4",signingName:"rds-data",uid:"rds-data-2018-08-01"},operations:{BatchExecuteStatement:{http:{requestUri:"/BatchExecute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameterSets:{type:"list",member:{shape:"S6"}},transactionId:{}}},output:{type:"structure",members:{updateResults:{type:"list",member:{type:"structure",members:{generatedFields:{shape:"Sq"}}}}}}},BeginTransaction:{http:{requestUri:"/BeginTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn"],members:{resourceArn:{},secretArn:{},database:{},schema:{}}},output:{type:"structure",members:{transactionId:{}}}},CommitTransaction:{http:{requestUri:"/CommitTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}},ExecuteSql:{http:{requestUri:"/ExecuteSql",responseCode:200},input:{type:"structure",required:["dbClusterOrInstanceArn","awsSecretStoreArn","sqlStatements"],members:{dbClusterOrInstanceArn:{},awsSecretStoreArn:{},sqlStatements:{},database:{},schema:{}}},output:{type:"structure",members:{sqlStatementResults:{type:"list",member:{type:"structure",members:{resultFrame:{type:"structure",members:{resultSetMetadata:{type:"structure",members:{columnCount:{type:"long"},columnMetadata:{shape:"S13"}}},records:{type:"list",member:{type:"structure",members:{values:{type:"list",member:{shape:"S1a"}}}}}}},numberOfRecordsUpdated:{type:"long"}}}}}},deprecated:!0,deprecatedMessage:"The ExecuteSql API is deprecated, please use the ExecuteStatement API."},ExecuteStatement:{http:{requestUri:"/Execute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameters:{shape:"S6"},transactionId:{},includeResultMetadata:{type:"boolean"},continueAfterTimeout:{type:"boolean"},resultSetOptions:{type:"structure",members:{decimalReturnType:{},longReturnType:{}}},formatRecordsAs:{}}},output:{type:"structure",members:{records:{type:"list",member:{shape:"Sq"}},columnMetadata:{shape:"S13"},numberOfRecordsUpdated:{type:"long"},generatedFields:{shape:"Sq"},formattedRecords:{}}}},RollbackTransaction:{http:{requestUri:"/RollbackTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}}},shapes:{S6:{type:"list",member:{type:"structure",members:{name:{},value:{shape:"S9"},typeHint:{}}}},S9:{type:"structure",members:{isNull:{type:"boolean"},booleanValue:{type:"boolean"},longValue:{type:"long"},doubleValue:{type:"double"},stringValue:{},blobValue:{type:"blob"},arrayValue:{shape:"Sf"}},union:!0},Sf:{type:"structure",members:{booleanValues:{type:"list",member:{type:"boolean"}},longValues:{type:"list",member:{type:"long"}},doubleValues:{type:"list",member:{type:"double"}},stringValues:{type:"list",member:{}},arrayValues:{type:"list",member:{shape:"Sf"}}},union:!0},Sq:{type:"list",member:{shape:"S9"}},S13:{type:"list",member:{type:"structure",members:{name:{},type:{type:"integer"},typeName:{},label:{},schemaName:{},tableName:{},isAutoIncrement:{type:"boolean"},isSigned:{type:"boolean"},isCurrency:{type:"boolean"},isCaseSensitive:{type:"boolean"},nullable:{type:"integer"},precision:{type:"integer"},scale:{type:"integer"},arrayBaseColumnType:{type:"integer"}}}},S1a:{type:"structure",members:{isNull:{type:"boolean"},bitValue:{type:"boolean"},bigIntValue:{type:"long"},intValue:{type:"integer"},doubleValue:{type:"double"},realValue:{type:"float"},stringValue:{},blobValue:{type:"blob"},arrayValues:{shape:"S1d"},structValue:{type:"structure",members:{attributes:{shape:"S1d"}}}},union:!0},S1d:{type:"list",member:{shape:"S1a"}}}}});var Qh=P((WF,TN)=>{TN.exports={pagination:{}}});var ep=P((BF,Zh)=>{gs();var bs=V(),bN=bs.Service,$h=bs.apiLoader;$h.services.rdsdataservice={};bs.RDSDataService=bN.defineService("rdsdataservice",["2018-08-01"]);Jh();Object.defineProperty($h.services.rdsdataservice,"2018-08-01",{get:o(function(){var e=Yh();return e.paginators=Qh().pagination,e},"get"),enumerable:!0,configurable:!0});Zh.exports=bs.RDSDataService});import AN from"path";function ou(t){return t===void 0}o(ou,"isUndefined");function Ze(t){return typeof t=="string"}o(Ze,"isString");function su(t){return typeof t=="number"}o(su,"isNumber");function ho(t){return typeof t=="boolean"}o(ho,"isBoolean");function po(t){return t===null}o(po,"isNull");function au(t){return t instanceof Date}o(au,"isDate");function uu(t){return typeof t=="bigint"}o(uu,"isBigInt");function ft(t){return typeof t=="function"}o(ft,"isFunction");function dt(t){return typeof t=="object"&&t!==null}o(dt,"isObject");function cu(t){return t[t.length-1]}o(cu,"getLast");function c(t){return Object.freeze(t)}o(c,"freeze");function br(t){return Array.isArray(t)}o(br,"isReadonlyArray");function Ar(t){return t}o(Ar,"noop");var $=c({is(t){return t.kind==="IdentifierNode"},create(t){return c({kind:"IdentifierNode",name:t})}});var ot=c({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return c({kind:"SchemableIdentifierNode",identifier:$.create(t)})},createWithSchema(t,e){return c({kind:"SchemableIdentifierNode",schema:$.create(t),identifier:$.create(e)})}});var st=c({is(t){return t.kind==="TableNode"},create(t){return c({kind:"TableNode",table:ot.create(t)})},createWithSchema(t,e){return c({kind:"TableNode",table:ot.createWithSchema(t,e)})}});var he=c({is(t){return t.kind==="AlterTableNode"},create(t){return c({kind:"AlterTableNode",table:st.create(t)})},cloneWithTableProps(t,e){return c({...t,...e})},cloneWithColumnAlteration(t,e){return c({...t,columnAlterations:t.columnAlterations?[...t.columnAlterations,e]:[e]})}});var er=c({is(t){return t.kind==="CreateIndexNode"},create(t){return c({kind:"CreateIndexNode",name:$.create(t)})},cloneWith(t,e){return c({...t,...e})}});var mo=c({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return c({kind:"CreateSchemaNode",schema:$.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var lu=["preserve rows","delete rows","drop"],ht=c({is(t){return t.kind==="CreateTableNode"},create(t){return c({kind:"CreateTableNode",table:t,columns:c([])})},cloneWithColumn(t,e){return c({...t,columns:c([...t.columns,e])})},cloneWithConstraint(t,e){return c({...t,constraints:t.constraints?c([...t.constraints,e]):c([e])})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWith(t,e){return c({...t,...e})}});var xi=c({is(t){return t.kind==="DropIndexNode"},create(t,e){return c({kind:"DropIndexNode",name:ot.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Ji=c({is(t){return t.kind==="DropSchemaNode"},create(t,e){return c({kind:"DropSchemaNode",schema:$.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Yi=c({is(t){return t.kind==="DropTableNode"},create(t,e){return c({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return c({...t,...e})}});var xt=c({is(t){return t.kind==="AliasNode"},create(t,e){return c({kind:"AliasNode",node:t,alias:e})}});function Ye(t){return dt(t)&&ft(t.toOperationNode)}o(Ye,"isOperationNodeSource");function fu(t){return dt(t)&&"expressionType"in t&&Ye(t)}o(fu,"isExpression");var Ei=c({is(t){return t.kind==="AndNode"},create(t,e){return c({kind:"AndNode",left:t,right:e})}});var Ci=c({is(t){return t.kind==="OrNode"},create(t,e){return c({kind:"OrNode",left:t,right:e})}});var Si=c({is(t){return t.kind==="OnNode"},create(t){return c({kind:"OnNode",on:t})},cloneWithOperation(t,e,r){return c({...t,on:e==="And"?Ei.create(t.on,r):Ci.create(t.on,r)})}});var at=c({is(t){return t.kind==="JoinNode"},create(t,e){return c({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return c({kind:"JoinNode",joinType:t,table:e,on:Si.create(r)})},cloneWithOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"And",e):Si.create(e)})},cloneWithOrOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"Or",e):Si.create(e)})}});var tr=c({is(t){return t.kind==="OrderByNode"},create(t){return c({kind:"OrderByNode",items:c([t])})},cloneWithItem(t,e){return c({...t,items:c([...t.items,e])})}});var qs=c({is(t){return t.kind==="PartitionByNode"},create(t){return c({kind:"PartitionByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var Qi=c({is(t){return t.kind==="OverNode"},create(){return c({kind:"OverNode"})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithPartitionByItems(t,e){return c({...t,partitionBy:t.partitionBy?qs.cloneWithItems(t.partitionBy,e):qs.create(e)})}});var Gr=c({is(t){return t.kind==="FromNode"},create(t){return c({kind:"FromNode",froms:c(t)})},cloneWithFroms(t,e){return c({...t,froms:c([...t.froms,...e])})}});var Ls=c({is(t){return t.kind==="GroupByNode"},create(t){return c({kind:"GroupByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var $i=c({is(t){return t.kind==="HavingNode"},create(t){return c({kind:"HavingNode",having:t})},cloneWithOperation(t,e,r){return c({...t,having:e==="And"?Ei.create(t.having,r):Ci.create(t.having,r)})}});var Y=c({is(t){return t.kind==="SelectQueryNode"},create(t,e){return c({kind:"SelectQueryNode",from:Gr.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})},cloneWithDistinctOn(t,e){return c({...t,distinctOn:t.distinctOn?c([...t.distinctOn,...e]):c(e)})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithGroupByItems(t,e){return c({...t,groupBy:t.groupBy?Ls.cloneWithItems(t.groupBy,e):Ls.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithOffset(t,e){return c({...t,offset:e})},cloneWithHaving(t,e){return c({...t,having:t.having?$i.cloneWithOperation(t.having,"And",e):$i.create(e)})},cloneWithOrHaving(t,e){return c({...t,having:t.having?$i.cloneWithOperation(t.having,"Or",e):$i.create(e)})},cloneWithSetOperation(t,e){return c({...t,setOperations:t.setOperations?c([...t.setOperations,e]):c([e])})},cloneWithExplain(t,e){return c({...t,explain:e})},cloneWithoutSelections(t){return c({...t,selections:[]})},cloneWithoutLimit(t){return c({...t,limit:void 0})},cloneWithoutOffset(t){return c({...t,offset:void 0})},cloneWithoutOrderBy(t){return c({...t,orderBy:void 0})}});var Vt=c({is(t){return t.kind==="SelectModifierNode"},create(t){return c({kind:"SelectModifierNode",modifier:t})},createWithExpression(t){return c({kind:"SelectModifierNode",rawModifier:t})}});var yo=c({is(t){return t.kind==="BinaryOperationNode"},create(t,e,r){return c({kind:"BinaryOperationNode",leftOperand:t,operator:e,rightOperand:r})}});var pe=c({is(t){return t.kind==="RawNode"},create(t,e){return c({kind:"RawNode",sqlFragments:c(t),parameters:c(e)})},createWithSql(t){return pe.create([t],[])},createWithChild(t){return pe.create(["",""],[t])},createWithChildren(t){return pe.create(new Array(t.length+1).fill(""),t)}});var du=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","ilike","not ilike","@>","<@","?","?&","!<","!>","<=>","!~","~","~*","!~*","&&","||","@@","@@@","!!","<->"];var vo=c({is(t){return t.kind==="OperatorNode"},create(t){return c({kind:"OperatorNode",operator:t})}});var go=c({is(t){return t.kind==="ParensNode"},create(t){return c({kind:"ParensNode",node:t})}});var ie=c({is(t){return t.kind==="ColumnNode"},create(t){return c({kind:"ColumnNode",column:$.create(t)})}});var Ti=c({is(t){return t.kind==="SelectAllNode"},create(){return c({kind:"SelectAllNode"})}});var Jr=c({is(t){return t.kind==="ReferenceNode"},create(t,e){return c({kind:"ReferenceNode",table:t,column:e})},createSelectAll(t){return c({kind:"ReferenceNode",table:t,column:Ti.create()})}});function nr(t){return Ze(t)?ir(t):t.toOperationNode()}o(nr,"parseSimpleReferenceExpression");function Ir(t){return br(t)?t.map(e=>rr(e)):[rr(t)]}o(Ir,"parseReferenceExpressionOrList");function rr(t){return Yr(t)?bi(t):nr(t)}o(rr,"parseReferenceExpression");function ir(t){let e=".";if(t.includes(e)){let r=t.split(e).map(pu);if(r.length===3)return hp(r);if(r.length===2)return pp(r);throw new Error(`invalid column reference ${t}`)}else return ie.create(t)}o(ir,"parseStringReference");function hu(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(pu);return xt.create(ir(r),$.create(i))}else return ir(t)}o(hu,"parseAliasedStringReference");function Zi(t){return ie.create(t)}o(Zi,"parseColumnName");function hp(t){let[e,r,i]=t;return Jr.create(st.createWithSchema(e,r),ie.create(i))}o(hp,"parseStringReferenceWithTableAndSchema");function pp(t){let[e,r]=t;return Jr.create(st.create(e),ie.create(r))}o(pp,"parseStringReferenceWithTable");function pu(t){return t.trim()}o(pu,"trim");var No=c({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return c({kind:"PrimitiveValueListNode",values:c([...t])})}});var Ai=c({is(t){return t.kind==="ValueListNode"},create(t){return c({kind:"ValueListNode",values:c(t)})}});var ut=c({is(t){return t.kind==="ValueNode"},create(t){return c({kind:"ValueNode",value:t})},createImmediate(t){return c({kind:"ValueNode",value:t,immediate:!0})}});function wo(t){return br(t)?mp(t):zt(t)}o(wo,"parseValueExpressionOrList");function zt(t){return Yr(t)?bi(t):ut.create(t)}o(zt,"parseValueExpression");function mp(t){return t.some(Yr)?Ai.create(t.map(e=>zt(e))):No.create(t)}o(mp,"parseValueExpressionList");function Be(t){return Bs("where",t)}o(Be,"parseWhere");function Fs(t){return Bs("having",t)}o(Fs,"parseHaving");function Ws(t){return Bs("on",t)}o(Ws,"parseOn");function me(t,e,r){return yo.create(rr(t),Us(e),rr(r))}o(me,"parseReferentialFilter");function Bs(t,e){if(e.length===3)return yp(e[0],e[1],e[2]);if(e.length===1)return gp(t,e[0]);throw mu(t,e)}o(Bs,"parseFilterExpression");function yp(t,e,r){return(e==="is"||e==="is not")&&(po(r)||ho(r))?vp(t,e,r):yo.create(rr(t),Us(e),wo(r))}o(yp,"parseFilter");function vp(t,e,r){return yo.create(rr(t),Us(e),ut.createImmediate(r))}o(vp,"parseIs");function Us(t){if(Ze(t)&&du.includes(t))return vo.create(t);if(Ye(t))return t.toOperationNode();throw new Error(`invalid comparison operator ${JSON.stringify(t)} passed to a filter method`)}o(Us,"parseComparisonOperatorExpression");function gp(t,e){if(ft(e))return Np[t](e);if(Ye(e)){let r=e.toOperationNode();if(pe.is(r))return r}throw mu(t,e)}o(gp,"parseOneArgFilterExpression");function mu(t,e){return new Error(`invalid arguments passed to a '${t}' method: ${JSON.stringify(e)}`)}o(mu,"createFilterExpressionError");var Np=c({where(t){let r=t(Ms()).toOperationNode();if(!r.where)throw new Error("no `where` methods called inside a group callback");return go.create(r.where.where)},having(t){let r=t(Ms()).toOperationNode();if(!r.having)throw new Error("no `having` methods called inside a group callback");return go.create(r.having.having)},on(t){let r=t(xo("InnerJoin","table")).toOperationNode();if(!r.on)throw new Error("no `on` methods called inside a group callback");return go.create(r.on.on)}});function Ue(t,e){if(e.length===3)return xp(t,e[0],e[1],e[2]);if(e.length===2)return wp(t,e[0],e[1]);throw new Error("not implemented")}o(Ue,"parseJoin");function wp(t,e,r){return r(xo(t,e)).toOperationNode()}o(wp,"parseCallbackJoin");function xp(t,e,r,i){return at.createWithOn(t,or(e),me(r,"=",i))}o(xp,"parseSingleOnJoin");var Ii=c({is(t){return t.kind==="SelectionNode"},create(t){return c({kind:"SelectionNode",selection:t})},createSelectAll(){return c({kind:"SelectionNode",selection:Ti.create()})},createSelectAllFromTable(t){return c({kind:"SelectionNode",selection:Jr.createSelectAll(t)})}});var en=class{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return nr(this.#e)}};o(en,"DynamicReferenceBuilder");function yu(t){return dt(t)&&Ye(t)&&Ze(t.dynamicReference)}o(yu,"isDynamicReferenceBuilder");function Or(t){return br(t)?t.map(e=>vu(e)):[vu(t)]}o(Or,"parseSelectExpressionOrList");function vu(t){return Ze(t)?Ii.create(hu(t)):yu(t)?Ii.create(t.toOperationNode()):Ii.create(Eo(t))}o(vu,"parseSelectExpression");function Rr(t){return t?Array.isArray(t)?t.map(gu):[gu(t)]:[Ii.createSelectAll()]}o(Rr,"parseSelectAll");function gu(t){if(Ze(t))return Ii.createSelectAllFromTable(be(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}o(gu,"parseSelectAllArg");var et=c({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return c({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return c({...t,...e})}});var Dr=c({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return c({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return c({...t,from:t.from?Gr.cloneWithFroms(t.from,e):Gr.create(e)})},cloneWithUpdates(t,e){return c({...t,updates:t.updates?c([...t.updates,...e]):e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var Pr=c({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return c({kind:"DeleteQueryNode",from:Gr.create([t]),...e&&{with:e}})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var qe=c({is(t){return t.kind==="WhereNode"},create(t){return c({kind:"WhereNode",where:t})},cloneWithOperation(t,e,r){return c({...t,where:e==="And"?Ei.create(t.where,r):Ci.create(t.where,r)})}});var Vs=c({is(t){return t.kind==="ReturningNode"},create(t){return c({kind:"ReturningNode",selections:c(t)})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})}});var H=c({is(t){return Pr.is(t)||et.is(t)||Dr.is(t)||Y.is(t)},cloneWithWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"And",e):qe.create(e)})},cloneWithOrWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"Or",e):qe.create(e)})},cloneWithJoin(t,e){return c({...t,joins:t.joins?c([...t.joins,e]):c([e])})},cloneWithReturning(t,e){return c({...t,returning:t.returning?Vs.cloneWithSelections(t.returning,e):Vs.create(e)})},cloneWithoutWhere(t){return c({...t,where:void 0})}});var Nu=c({is(t){return t.kind==="OrderByItemNode"},create(t,e){return c({kind:"OrderByItemNode",orderBy:t,direction:e})}});function Oi(t,e){return Nu.create(Ep(t),Cp(e))}o(Oi,"parseOrderBy");function Ep(t){return rr(t)}o(Ep,"parseOrderByExpression");function Cp(t){if(t)return t==="asc"||t==="desc"?pe.createWithSql(t):t.toOperationNode()}o(Cp,"parseOrderByDirectionExpression");function z(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}o(z,"preventAwait");var Co=c({is(t){return t.kind==="LimitNode"},create(t){return c({kind:"LimitNode",limit:ut.create(t)})}});var wu=c({is(t){return t.kind==="OffsetNode"},create(t){return c({kind:"OffsetNode",offset:ut.create(t)})}});var xu=c({is(t){return t.kind==="GroupByItemNode"},create(t){return c({kind:"GroupByItemNode",groupBy:t})}});function Eu(t){return Ir(t).map(xu.create)}o(Eu,"parseGroupBy");var Rt=class extends Error{node;constructor(e){super("no result"),this.node=e}};o(Rt,"NoResultError");var _r=c({is(t){return t.kind==="ExplainNode"},create(t,e){return c({kind:"ExplainNode",format:t,options:e})}});var So=c({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return c({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function Qr(t,e,r){return So.create(t,e.toOperationNode(),r)}o(Qr,"parseSetOperation");var Cu=c({is(t){return t.kind==="UnaryOperationNode"},create(t,e){return c({kind:"UnaryOperationNode",operator:t,operand:e})}});function xe(t){return Su("exists",t)}o(xe,"parseExists");function Ee(t){return Su("not exists",t)}o(Ee,"parseNotExists");function Su(t,e){return Cu.create(vo.create(t),wo(e))}o(Su,"parseUnaryOperation");var B=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}where(...e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}having(...e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,Fs(e))})}havingRef(e,r,i){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,me(e,r,i))})}orHaving(...e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,Fs(e))})}orHavingRef(e,r,i){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,me(e,r,i))})}havingExists(e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,xe(e))})}havingNotExist(e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,Ee(e))})}orHavingExists(e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,xe(e))})}orHavingNotExists(e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,Ee(e))})}select(e){return new B({...this.#e,queryNode:Y.cloneWithSelections(this.#e.queryNode,Or(e))})}distinctOn(e){return new B({...this.#e,queryNode:Y.cloneWithDistinctOn(this.#e.queryNode,Ir(e))})}modifyFront(e){return new B({...this.#e,queryNode:Y.cloneWithFrontModifier(this.#e.queryNode,Vt.createWithExpression(e.toOperationNode()))})}modifyEnd(e){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.createWithExpression(e.toOperationNode()))})}distinct(){return new B({...this.#e,queryNode:Y.cloneWithFrontModifier(this.#e.queryNode,Vt.create("Distinct"))})}forUpdate(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForUpdate"))})}forShare(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForShare"))})}forKeyShare(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForKeyShare"))})}forNoKeyUpdate(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForNoKeyUpdate"))})}skipLocked(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("SkipLocked"))})}noWait(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("NoWait"))})}selectAll(e){return new B({...this.#e,queryNode:Y.cloneWithSelections(this.#e.queryNode,Rr(e))})}innerJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}innerJoinLateral(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralInnerJoin",e))})}leftJoinLateral(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralLeftJoin",e))})}orderBy(e,r){return new B({...this.#e,queryNode:Y.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}groupBy(e){return new B({...this.#e,queryNode:Y.cloneWithGroupByItems(this.#e.queryNode,Eu(e))})}limit(e){return new B({...this.#e,queryNode:Y.cloneWithLimit(this.#e.queryNode,Co.create(e))})}offset(e){return new B({...this.#e,queryNode:Y.cloneWithOffset(this.#e.queryNode,wu.create(e))})}union(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("union",e,!1))})}unionAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("union",e,!0))})}intersect(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("intersect",e,!1))})}intersectAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("intersect",e,!0))})}except(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("except",e,!1))})}exceptAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("except",e,!0))})}clearSelect(){return new B({...this.#e,queryNode:Y.cloneWithoutSelections(this.#e.queryNode)})}clearWhere(){return new B({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}clearLimit(){return new B({...this.#e,queryNode:Y.cloneWithoutLimit(this.#e.queryNode)})}clearOffset(){return new B({...this.#e,queryNode:Y.cloneWithoutOffset(this.#e.queryNode)})}clearOrderBy(){return new B({...this.#e,queryNode:Y.cloneWithoutOrderBy(this.#e.queryNode)})}call(e){return e(this)}if(e,r){return e?r(this):new B({...this.#e})}as(e){return new To(this,e)}castTo(){return new B(this.#e)}assertType(){return new B(this.#e)}withPlugin(e){return new B({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async*stream(e=100){let r=this.compile(),i=this.#e.executor.stream(r,e,this.#e.queryId);for await(let n of i)yield*n.rows}async explain(e,r){return await new B({...this.#e,queryNode:Y.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(B,"SelectQueryBuilder");z(B,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var To=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),$.create(this.#t))}};o(To,"AliasedSelectQueryBuilder");var $r=class{nodeStack=[];#e=c({AliasNode:this.transformAlias.bind(this),ColumnNode:this.transformColumn.bind(this),IdentifierNode:this.transformIdentifier.bind(this),SchemableIdentifierNode:this.transformSchemableIdentifier.bind(this),RawNode:this.transformRaw.bind(this),ReferenceNode:this.transformReference.bind(this),SelectQueryNode:this.transformSelectQuery.bind(this),SelectionNode:this.transformSelection.bind(this),TableNode:this.transformTable.bind(this),FromNode:this.transformFrom.bind(this),SelectAllNode:this.transformSelectAll.bind(this),AndNode:this.transformAnd.bind(this),OrNode:this.transformOr.bind(this),ValueNode:this.transformValue.bind(this),ValueListNode:this.transformValueList.bind(this),PrimitiveValueListNode:this.transformPrimitiveValueList.bind(this),ParensNode:this.transformParens.bind(this),JoinNode:this.transformJoin.bind(this),OperatorNode:this.transformOperator.bind(this),WhereNode:this.transformWhere.bind(this),InsertQueryNode:this.transformInsertQuery.bind(this),DeleteQueryNode:this.transformDeleteQuery.bind(this),ReturningNode:this.transformReturning.bind(this),CreateTableNode:this.transformCreateTable.bind(this),AddColumnNode:this.transformAddColumn.bind(this),ColumnDefinitionNode:this.transformColumnDefinition.bind(this),DropTableNode:this.transformDropTable.bind(this),DataTypeNode:this.transformDataType.bind(this),OrderByNode:this.transformOrderBy.bind(this),OrderByItemNode:this.transformOrderByItem.bind(this),GroupByNode:this.transformGroupBy.bind(this),GroupByItemNode:this.transformGroupByItem.bind(this),UpdateQueryNode:this.transformUpdateQuery.bind(this),ColumnUpdateNode:this.transformColumnUpdate.bind(this),LimitNode:this.transformLimit.bind(this),OffsetNode:this.transformOffset.bind(this),OnConflictNode:this.transformOnConflict.bind(this),OnDuplicateKeyNode:this.transformOnDuplicateKey.bind(this),CreateIndexNode:this.transformCreateIndex.bind(this),DropIndexNode:this.transformDropIndex.bind(this),ListNode:this.transformList.bind(this),PrimaryKeyConstraintNode:this.transformPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.transformUniqueConstraint.bind(this),ReferencesNode:this.transformReferences.bind(this),CheckConstraintNode:this.transformCheckConstraint.bind(this),WithNode:this.transformWith.bind(this),CommonTableExpressionNode:this.transformCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.transformCommonTableExpressionName.bind(this),HavingNode:this.transformHaving.bind(this),CreateSchemaNode:this.transformCreateSchema.bind(this),DropSchemaNode:this.transformDropSchema.bind(this),AlterTableNode:this.transformAlterTable.bind(this),DropColumnNode:this.transformDropColumn.bind(this),RenameColumnNode:this.transformRenameColumn.bind(this),AlterColumnNode:this.transformAlterColumn.bind(this),ModifyColumnNode:this.transformModifyColumn.bind(this),AddConstraintNode:this.transformAddConstraint.bind(this),DropConstraintNode:this.transformDropConstraint.bind(this),ForeignKeyConstraintNode:this.transformForeignKeyConstraint.bind(this),CreateViewNode:this.transformCreateView.bind(this),DropViewNode:this.transformDropView.bind(this),GeneratedNode:this.transformGenerated.bind(this),DefaultValueNode:this.transformDefaultValue.bind(this),OnNode:this.transformOn.bind(this),ValuesNode:this.transformValues.bind(this),SelectModifierNode:this.transformSelectModifier.bind(this),CreateTypeNode:this.transformCreateType.bind(this),DropTypeNode:this.transformDropType.bind(this),ExplainNode:this.transformExplain.bind(this),DefaultInsertValueNode:this.transformDefaultInsertValue.bind(this),AggregateFunctionNode:this.transformAggregateFunction.bind(this),OverNode:this.transformOver.bind(this),PartitionByNode:this.transformPartitionBy.bind(this),PartitionByItemNode:this.transformPartitionByItem.bind(this),SetOperationNode:this.transformSetOperation.bind(this),BinaryOperationNode:this.transformBinaryOperation.bind(this),UnaryOperationNode:this.transformUnaryOperation.bind(this)});transformNode(e){if(!e)return e;this.nodeStack.push(e);let r=this.transformNodeImpl(e);return this.nodeStack.pop(),c(r)}transformNodeImpl(e){return this.#e[e.kind](e)}transformNodeList(e){return e&&c(e.map(r=>this.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOn:this.transformNodeList(e.distinctOn),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",table:this.transformNode(e.table),column:this.transformNode(e.column)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:c([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain)}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),expression:this.transformNode(e.expression),unique:e.unique,using:this.transformNode(e.using)}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),columnAlterations:this.transformNodeList(e.columnAlterations),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",column:this.transformNode(e.column),distinct:e.distinct,filter:this.transformNode(e.filter),func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformBinaryOperation(e){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(e.leftOperand),operator:this.transformNode(e.operator),rightOperand:this.transformNode(e.rightOperand)}}transformUnaryOperation(e){return{kind:"UnaryOperationNode",operator:this.transformNode(e.operator),operand:this.transformNode(e.operand)}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}};o($r,"OperationNodeTransformer");var Sp=c({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0}),tn=class extends $r{#e;#t=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#r(e))return super.transformNodeImpl(e);let r=this.#i(e);for(let n of r)this.#t.add(n);let i=super.transformNodeImpl(e);for(let n of r)this.#t.delete(n);return i}transformSchemableIdentifier(e){let r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:$.create(this.#e)}}transformReferences(e){let r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:st.createWithSchema(this.#e,r.table.table.identifier.name)}}#r(e){return e.kind in Sp}#i(e){let r=new Set;if("name"in e&&e.name&&ot.is(e.name)&&this.#o(e.name,r),"from"in e&&e.from)for(let i of e.from.froms)this.#n(i,r);if("into"in e&&e.into&&this.#n(e.into,r),"table"in e&&e.table&&this.#n(e.table,r),"joins"in e&&e.joins)for(let i of e.joins)this.#n(i.table,r);return"with"in e&&e.with&&this.#s(e.with,r),r}#n(e,r){let i=st.is(e)?e:xt.is(e)&&st.is(e.node)?e.node:null;i&&this.#o(i.table,r)}#o(e,r){this.#t.has(e.identifier.name)||r.add(e.identifier.name)}#s(e,r){for(let i of e.expressions)r.delete(i.name.table.table.identifier.name)}};o(tn,"WithSchemaTransformer");var Dt=class{#e;constructor(e){this.#e=new tn(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}};o(Dt,"WithSchemaPlugin");var Tu=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function bu(t){let e="";for(let r=0;r<t;++r)e+=Tp();return e}o(bu,"randomString");function Tp(){return Tu[~~(Math.random()*Tu.length)]}o(Tp,"randomChar");function ne(){return new bo}o(ne,"createQueryId");var bo=class{#e;get queryId(){return this.#e===void 0&&(this.#e=bu(8)),this.#e}};o(bo,"LazyQueryId");var Ve=c({is(t){return t.kind==="AggregateFunctionNode"},create(t,e){return c({kind:"AggregateFunctionNode",func:t,column:e})},cloneWithDistinct(t){return c({...t,distinct:!0})},cloneWithFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"And",e):qe.create(e)})},cloneWithOrFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"Or",e):qe.create(e)})},cloneWithOver(t,e){return c({...t,over:e})}});function Au(t){return pe.create(t.length>1?["coalesce(",...new Array(t.length-1).fill(", "),")"]:["coalesce(",")"],Ir(t))}o(Au,"parseCoalesce");var Ri=class{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}};o(Ri,"Deferred");var Iu=new Set;function Ou(t){Iu.has(t)||(Iu.add(t),console.log(t))}o(Ou,"logOnce");var bp=c([]),Zr=class{#e;constructor(e=bp){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(let i of this.#e){let n=i.transformQuery({node:e,queryId:r});if(n.kind===e.kind)e=n;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${n.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async i=>{let n=await i.executeQuery(e),s=await this.#t(n,r);return Ap(n,s),s})}async*stream(e,r,i){let n=new Ri,s=new Ri;this.provideConnection(async u=>(n.resolve(u),await s.promise)).catch(u=>n.reject(u));let a=await n.promise;try{for await(let u of a.streamQuery(e,r))yield await this.#t(u,i)}finally{s.resolve()}}async#t(e,r){for(let i of this.#e)e=await i.transformResult({result:e,queryId:r});return e}};o(Zr,"QueryExecutorBase");function Ap(t,e){let{numAffectedRows:r}=t;r===void 0&&t.numUpdatedOrDeletedRows===void 0||r!==void 0&&e.numAffectedRows!==void 0||Ou("kysely:warning: outdated driver/plugin detected! QueryResult.numUpdatedOrDeletedRows is deprecated and will be removed in a future release.")}o(Ap,"warnOfOutdatedDriverOrPlugins");var sr=class extends Zr{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new sr([...this.plugins,e])}withPlugins(e){return new sr([...this.plugins,...e])}withPluginAtFront(e){return new sr([e,...this.plugins])}withoutPlugins(){return new sr([])}};o(sr,"NoopQueryExecutor");var ei=new sr;var Pe=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new Ao(this,e)}castTo(){return new Pe({...this.#e})}withPlugin(e){return new Pe({...this.#e,plugins:this.#e.plugins!==void 0?c([...this.#e.plugins,e]):c([e])})}toOperationNode(){let e=this.#e.plugins!==void 0?ei.withPlugins(this.#e.plugins):ei;return this.#t(e)}async execute(e){let r=this.#e.plugins!==void 0?e.getExecutor().withPlugins(this.#e.plugins):e.getExecutor();return r.executeQuery(this.#r(r),this.#e.queryId)}#t(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#r(e){return e.compileQuery(this.#t(e),this.#e.queryId)}};o(Pe,"RawBuilder");z(Pe,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");var Ao=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),Ye(this.#t)?this.#t.toOperationNode():$.create(this.#t))}};o(Ao,"AliasedRawBuilder");var Ae=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new Io(this,e)}distinct(){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithDistinct(this.#e.aggregateFunctionNode)})}filterWhere(...e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Be(e))})}filterWhereExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,xe(e))})}filterWhereNotExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Ee(e))})}filterWhereRef(e,r,i){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}orFilterWhere(...e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Be(e))})}orFilterWhereExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,xe(e))})}orFilterWhereNotExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Ee(e))})}orFilterWhereRef(e,r,i){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}over(e){let r=Ru();return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}toOperationNode(){return this.#e.aggregateFunctionNode}};o(Ae,"AggregateFunctionBuilder");z(Ae,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");var Io=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),$.create(this.#t))}};o(Io,"AliasedAggregateFunctionBuilder");var ti=class{constructor(){this.avg=this.avg.bind(this),this.coalesce=this.coalesce.bind(this),this.count=this.count.bind(this),this.max=this.max.bind(this),this.min=this.min.bind(this),this.sum=this.sum.bind(this)}avg(e){return new Ae({aggregateFunctionNode:Ve.create("avg",nr(e))})}coalesce(e,...r){return new Pe({queryId:ne(),rawNode:Au([e,...r])})}count(e){return new Ae({aggregateFunctionNode:Ve.create("count",nr(e))})}max(e){return new Ae({aggregateFunctionNode:Ve.create("max",nr(e))})}min(e){return new Ae({aggregateFunctionNode:Ve.create("min",nr(e))})}sum(e){return new Ae({aggregateFunctionNode:Ve.create("sum",nr(e))})}};o(ti,"FunctionModule");var ri=class{#e;constructor(e){this.#e=c(e)}get fn(){return new ti}selectFrom(e){return new B({queryId:ne(),executor:this.#e.executor,queryNode:Y.create(kr(e))})}withSchema(e){return new ri({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}ref(e){return new Pe({queryId:ne(),plugins:this.#e.executor.plugins,rawNode:pe.createWithChild(ir(e))})}};o(ri,"ExpressionBuilder");var Qe=class{#e;constructor(e){this.#e=c(e)}on(...e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Ws(e))})}orOn(...e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Ws(e))})}onRef(e,r,i){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,me(e,r,i))})}orOnRef(e,r,i){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,me(e,r,i))})}onExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,xe(e))})}onNotExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Ee(e))})}orOnExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,xe(e))})}orOnNotExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Ee(e))})}onTrue(){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,pe.createWithSql("true"))})}toOperationNode(){return this.#e.joinNode}};o(Qe,"JoinBuilder");z(Qe,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");var Du=c({is(t){return t.kind==="PartitionByItemNode"},create(t){return c({kind:"PartitionByItemNode",partitionBy:t})}});function Pu(t){return Ir(t).map(Du.create)}o(Pu,"parsePartitionBy");var ar=class{#e;constructor(e){this.#e=c(e)}orderBy(e,r){return new ar({overNode:Qi.cloneWithOrderByItem(this.#e.overNode,Oi(e,r))})}partitionBy(e){return new ar({overNode:Qi.cloneWithPartitionByItems(this.#e.overNode,Pu(e))})}toOperationNode(){return this.#e.overNode}};o(ar,"OverBuilder");z(ar,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");var _u=c({is(t){return t.kind==="ValuesNode"},create(t){return c({kind:"ValuesNode",values:c(t)})}});var ku=c({is(t){return t.kind==="DefaultInsertValueNode"},create(){return c({kind:"DefaultInsertValueNode"})}});function qu(t){return Ip(Array.isArray(t)?t:[t])}o(qu,"parseInsertObjectOrList");function Ip(t){let e=Op(t);return[c([...e.keys()].map(ie.create)),_u.create(t.map(r=>Rp(r,e)))]}o(Ip,"parseInsertColumnsAndValues");function Op(t){let e=new Map;for(let r of t){let i=Object.keys(r);for(let n of i)!e.has(n)&&r[n]!==void 0&&e.set(n,e.size)}return e}o(Op,"parseColumnNamesAndIndexes");function Rp(t,e){let r=Object.keys(t),i=Array.from({length:e.size}),n=!1;for(let a of r){let u=e.get(a);if(u!==void 0){let l=t[a];Yr(l)&&(n=!0),i[u]=l}}if(r.length<e.size||n){let a=ku.create();return Ai.create(i.map(u=>ou(u)?a:zt(u)))}return No.create(i)}o(Rp,"parseRowValues");var Lu=c({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return c({kind:"ColumnUpdateNode",column:t,value:e})}});function Di(t){return Object.entries(t).filter(([e,r])=>r!==void 0).map(([e,r])=>Lu.create(ie.create(e),zt(r)))}o(Di,"parseUpdateObject");var Mu=c({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return c({kind:"OnDuplicateKeyNode",updates:t})}});var rn=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get insertId(){return this.#e}get numInsertedOrUpdatedRows(){return this.#t}};o(rn,"InsertResult");var de=c({is(t){return t.kind==="OnConflictNode"},create(){return c({kind:"OnConflictNode"})},cloneWith(t,e){return c({...t,...e})},cloneWithIndexWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"And",e):qe.create(e)})},cloneWithIndexOrWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"Or",e):qe.create(e)})},cloneWithUpdateWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"And",e):qe.create(e)})},cloneWithUpdateOrWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"Or",e):qe.create(e)})},cloneWithoutIndexWhere(t){return c({...t,indexWhere:void 0})},cloneWithoutUpdateWhere(t){return c({...t,updateWhere:void 0})}});var _e=class{#e;constructor(e){this.#e=c(e)}column(e){let r=ie.create(e);return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,r]):c([r])})})}columns(e){let r=e.map(ie.create);return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,...r]):c(r)})})}constraint(e){return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{constraint:$.create(e)})})}expression(e){return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,xe(e))})}whereNotExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Ee(e))})}orWhereExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,xe(e))})}orWhereNotExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Ee(e))})}clearWhere(){return new _e({...this.#e,onConflictNode:de.cloneWithoutIndexWhere(this.#e.onConflictNode)})}doNothing(){return new nn({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new tt({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{updates:Di(e)})})}};o(_e,"OnConflictBuilder");z(_e,"don't await OnConflictBuilder instances.");var nn=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.onConflictNode}};o(nn,"OnConflictDoNothingBuilder");z(nn,"don't await OnConflictDoNothingBuilder instances.");var tt=class{#e;constructor(e){this.#e=c(e)}where(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,xe(e))})}whereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Ee(e))})}orWhereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,xe(e))})}orWhereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Ee(e))})}clearWhere(){return new tt({...this.#e,onConflictNode:de.cloneWithoutUpdateWhere(this.#e.onConflictNode)})}toOperationNode(){return this.#e.onConflictNode}};o(tt,"OnConflictUpdateBuilder");z(tt,"don't await OnConflictUpdateBuilder instances.");var Ie=class{#e;constructor(e){this.#e=c(e)}values(e){let[r,i]=qu(e);return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:r,values:i})})}columns(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:c(e.map(ie.create))})})}expression(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{values:bi(e)})})}ignore(){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onConflict:e(new _e({onConflictNode:de.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onDuplicateKey:Mu.create(Di(e))})})}returning(e){return new Ie({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new Ie({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}call(e){return e(this)}if(e,r){return e?r(this):new Ie({...this.#e})}castTo(){return new Ie(this.#e)}assertType(){return new Ie(this.#e)}withPlugin(e){return new Ie({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new rn(i.insertId,i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{explain:_r.create(e,r?.toOperationNode())})}).execute()}};o(Ie,"InsertQueryBuilder");z(Ie,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var on=class{#e;constructor(e){this.#e=e}get numDeletedRows(){return this.#e}};o(on,"DeleteResult");var ae=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}clearWhere(){return new ae({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}innerJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}returning(e){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}orderBy(e,r){return new ae({...this.#e,queryNode:Pr.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}limit(e){return new ae({...this.#e,queryNode:Pr.cloneWithLimit(this.#e.queryNode,Co.create(e))})}call(e){return e(this)}if(e,r){return e?r(this):new ae({...this.#e})}castTo(){return new ae(this.#e)}assertType(){return new ae(this.#e)}withPlugin(e){return new ae({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new on(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ae({...this.#e,queryNode:Pr.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(ae,"DeleteQueryBuilder");z(ae,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var sn=class{#e;constructor(e){this.#e=e}get numUpdatedRows(){return this.#e}};o(sn,"UpdateResult");var ue=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}clearWhere(){return new ue({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}from(e){return new ue({...this.#e,queryNode:Dr.cloneWithFromItems(this.#e.queryNode,kr(e))})}innerJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}set(e){return new ue({...this.#e,queryNode:Dr.cloneWithUpdates(this.#e.queryNode,Di(e))})}returning(e){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}call(e){return e(this)}if(e,r){return e?r(this):new ue({...this.#e})}castTo(){return new ue(this.#e)}assertType(){return new ue(this.#e)}withPlugin(e){return new ue({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new sn(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ue({...this.#e,queryNode:Dr.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(ue,"UpdateQueryBuilder");z(ue,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var Fu=c({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return c({kind:"CommonTableExpressionNode",name:t,expression:e})}});var zs=c({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return c({kind:"CommonTableExpressionNameNode",table:st.create(t),columns:e?c(e.map(ie.create)):void 0})}});function Hs(t,e){let r=e(Wu());return Fu.create(Dp(t),r.toOperationNode())}o(Hs,"parseCommonTableExpression");function Dp(t){if(t.includes("(")){let e=t.split(/[\(\)]/),r=e[0],i=e[1].split(",").map(n=>n.trim());return zs.create(r,i)}else return zs.create(t)}o(Dp,"parseCommonTableExpressionName");var an=c({is(t){return t.kind==="WithNode"},create(t,e){return c({kind:"WithNode",expressions:c([t]),...e})},cloneWithExpression(t,e){return c({...t,expressions:c([...t.expressions,e])})}});var pt=class{#e;constructor(e){this.#e=c(e)}selectFrom(e){return new B({queryId:ne(),executor:this.#e.executor,queryNode:Y.create(kr(e),this.#e.withNode)})}insertInto(e){return new Ie({queryId:ne(),executor:this.#e.executor,queryNode:et.create(be(e),this.#e.withNode)})}replaceInto(e){return new Ie({queryId:ne(),executor:this.#e.executor,queryNode:et.create(be(e),this.#e.withNode,!0)})}deleteFrom(e){return new ae({queryId:ne(),executor:this.#e.executor,queryNode:Pr.create(or(e),this.#e.withNode)})}updateTable(e){return new ue({queryId:ne(),executor:this.#e.executor,queryNode:Dr.create(or(e),this.#e.withNode)})}with(e,r){let i=Hs(e,r);return new pt({...this.#e,withNode:this.#e.withNode?an.cloneWithExpression(this.#e.withNode,i):an.create(i)})}withRecursive(e,r){let i=Hs(e,r);return new pt({...this.#e,withNode:this.#e.withNode?an.cloneWithExpression(this.#e.withNode,i):an.create(i,{recursive:!0})})}withPlugin(e){return new pt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new pt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new pt({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}};o(pt,"QueryCreator");function Ms(){return new B({queryId:ne(),executor:ei,queryNode:Y.create(kr([]))})}o(Ms,"createSelectQueryBuilder");function js(){return new ri({executor:ei})}o(js,"createExpressionBuilder");function Wu(){return new pt({executor:ei})}o(Wu,"createQueryCreator");function xo(t,e){return new Qe({joinNode:at.create(t,or(e))})}o(xo,"createJoinBuilder");function Ru(){return new ar({overNode:Qi.create()})}o(Ru,"createOverBuilder");function bi(t){if(Ye(t))return t.toOperationNode();if(ft(t))return t(js()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}o(bi,"parseExpression");function Eo(t){if(Ye(t))return t.toOperationNode();if(ft(t))return t(js()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}o(Eo,"parseAliasedExpression");function Yr(t){return fu(t)||ft(t)}o(Yr,"isExpressionOrFactory");function kr(t){return br(t)?t.map(e=>or(e)):[or(t)]}o(kr,"parseTableExpressionOrList");function or(t){return Ze(t)?Pp(t):Eo(t)}o(or,"parseTableExpression");function Pp(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(Bu);return xt.create(be(r),$.create(i))}else return be(t)}o(Pp,"parseAliasedTable");function be(t){let e=".";if(t.includes(e)){let[r,i]=t.split(e).map(Bu);return st.createWithSchema(r,i)}else return st.create(t)}o(be,"parseTable");function Bu(t){return t.trim()}o(Bu,"trim");var Ks=c({is(t){return t.kind==="AddColumnNode"},create(t){return c({kind:"AddColumnNode",column:t})}});var ur=c({is(t){return t.kind==="AlterColumnNode"},create(t){return c({kind:"AlterColumnNode",column:ie.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ye=c({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return c({kind:"ColumnDefinitionNode",column:ie.create(t),dataType:e})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):[e]})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):[e]})},cloneWith(t,e){return c({...t,...e})}});var Xs=c({is(t){return t.kind==="DropColumnNode"},create(t){return c({kind:"DropColumnNode",column:ie.create(t)})}});var Gs=c({is(t){return t.kind==="RenameColumnNode"},create(t,e){return c({kind:"RenameColumnNode",column:ie.create(t),renameTo:ie.create(e)})}});var Pi=c({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return c({kind:"CheckConstraintNode",expression:t,name:e?$.create(e):void 0})}});var Uu=["no action","restrict","cascade","set null","set default"],_i=c({is(t){return t.kind==="ReferencesNode"},create(t,e){return c({kind:"ReferencesNode",table:t,columns:c([...e])})},cloneWithOnDelete(t,e){return c({...t,onDelete:e})},cloneWithOnUpdate(t,e){return c({...t,onUpdate:e})}});function Oo(t){return Ye(t)?t.toOperationNode():ut.createImmediate(t)}o(Oo,"parseDefaultValueExpression");var un=c({is(t){return t.kind==="GeneratedNode"},create(t){return c({kind:"GeneratedNode",...t})},createWithExpression(t){return c({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return c({...t,...e})}});var Vu=c({is(t){return t.kind==="DefaultValueNode"},create(t){return c({kind:"DefaultValueNode",defaultValue:t})}});function ki(t){if(Uu.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}o(ki,"parseOnModifyForeignAction");var le=class{#e;constructor(e){this.#e=e}autoIncrement(){return new le(ye.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new le(ye.cloneWith(this.#e,{primaryKey:!0}))}references(e){let r=ir(e);if(!Jr.is(r)||Ti.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new le(ye.cloneWith(this.#e,{references:_i.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnDelete(this.#e.references,ki(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnUpdate(this.#e.references,ki(e))}))}unique(){return new le(ye.cloneWith(this.#e,{unique:!0}))}notNull(){return new le(ye.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new le(ye.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new le(ye.cloneWith(this.#e,{defaultTo:Vu.create(Oo(e))}))}check(e){return new le(ye.cloneWith(this.#e,{check:Pi.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new le(ye.cloneWith(this.#e,{generated:un.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:un.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:un.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new le(ye.cloneWith(this.#e,{generated:un.cloneWith(this.#e.generated,{stored:!0})}))}modifyFront(e){return new le(ye.cloneWithFrontModifier(this.#e,e.toOperationNode()))}modifyEnd(e){return new le(ye.cloneWithEndModifier(this.#e,e.toOperationNode()))}toOperationNode(){return this.#e}};o(le,"ColumnDefinitionBuilder");z(le,"don't await ColumnDefinitionBuilder instances directly.");var Js=c({is(t){return t.kind==="ModifyColumnNode"},create(t){return c({kind:"ModifyColumnNode",column:t})}});var Ro=c({is(t){return t.kind==="DataTypeNode"},create(t){return c({kind:"DataTypeNode",dataType:t})}});function ii(t){return Ye(t)?t.toOperationNode():Ro.create(t)}o(ii,"parseDataTypeExpression");var ni=c({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,i){return c({kind:"ForeignKeyConstraintNode",columns:t,references:_i.create(e,r),name:i?$.create(i):void 0})},cloneWith(t,e){return c({...t,...e})}});var Pt=class{#e;constructor(e){this.#e=e}onDelete(e){return new Pt(ni.cloneWith(this.#e,{onDelete:ki(e)}))}onUpdate(e){return new Pt(ni.cloneWith(this.#e,{onUpdate:ki(e)}))}toOperationNode(){return this.#e}};o(Pt,"ForeignKeyConstraintBuilder");z(Pt,"don't await ForeignKeyConstraintBuilder instances directly.");var cn=c({is(t){return t.kind==="AddConstraintNode"},create(t){return c({kind:"AddConstraintNode",constraint:t})}});var Do=c({is(t){return t.kind==="UniqueConstraintNode"},create(t,e){return c({kind:"UniqueConstraintNode",columns:c(t.map(ie.create)),name:e?$.create(e):void 0})}});var qi=c({is(t){return t.kind==="DropConstraintNode"},create(t){return c({kind:"DropConstraintNode",constraintName:$.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Lr=class{alterColumnNode;constructor(e){this.alterColumnNode=e}setDataType(e){return new qr(ur.cloneWith(this.alterColumnNode,{dataType:Ro.create(e)}))}setDefault(e){return new qr(ur.cloneWith(this.alterColumnNode,{setDefault:Oo(e)}))}dropDefault(){return new qr(ur.cloneWith(this.alterColumnNode,{dropDefault:!0}))}setNotNull(){return new qr(ur.cloneWith(this.alterColumnNode,{setNotNull:!0}))}dropNotNull(){return new qr(ur.cloneWith(this.alterColumnNode,{dropNotNull:!0}))}};o(Lr,"AlterColumnBuilder");var qr=class extends Lr{toOperationNode(){return this.alterColumnNode}};o(qr,"AlteredColumnBuilder");var cr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(cr,"AlterTableExecutor");z(cr,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");var lr=class{#e;constructor(e){this.#e=c(e)}onDelete(e){return new lr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new lr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}toOperationNode(){return this.#e.executor.transformQuery(he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(lr,"AlterTableAddForeignKeyConstraintBuilder");z(lr,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");var Ht=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{ifExists:!0})})})}cascade(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{modifier:"restrict"})})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Ht,"AlterTableDropConstraintBuilder");z(Ht,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");var Li=class{#e;constructor(e){this.#e=c(e)}renameTo(e){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{renameTo:be(e)})})}setSchema(e){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{setSchema:$.create(e)})})}alterColumn(e,r){let i=r(new Lr(ur.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xs.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Gs.create(e,r))})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Ks.create(n.toOperationNode()))})}modifyColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Js.create(n.toOperationNode()))})}addUniqueConstraint(e,r){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(Do.create(r,e))})})}addCheckConstraint(e,r){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(Pi.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,i,n){return new lr({...this.#e,constraintBuilder:new Pt(ni.create(r.map(ie.create),be(i),n.map(ie.create),e))})}dropConstraint(e){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.create(e)})})}call(e){return e(this)}};o(Li,"AlterTableBuilder");var rt=class{#e;constructor(e){this.#e=c(e)}alterColumn(e,r){let i=r(new Lr(ur.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xs.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Gs.create(e,r))})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Ks.create(n.toOperationNode()))})}modifyColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Js.create(n.toOperationNode()))})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(rt,"AlterTableColumnAlteringBuilder");z(Li,"don't await AlterTableBuilder instances");z(Lr,"don't await AlterColumnBuilder instances");z(rt,"don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`");var zu=c({is(t){return t.kind==="ListNode"},create(t){return c({kind:"ListNode",items:c(t)})}});var mt=class{#e;constructor(e){this.#e=c(e)}unique(){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{unique:!0})})}on(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{table:be(e)})})}column(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:Zi(e)})})}columns(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:zu.create(e.map(Zi))})})}expression(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:e.toOperationNode()})})}using(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{using:pe.createWithSql(e)})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(mt,"CreateIndexBuilder");z(mt,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");var Mr=class{#e;constructor(e){this.#e=c(e)}ifNotExists(){return new Mr({...this.#e,node:mo.cloneWith(this.#e.node,{ifNotExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Mr,"CreateSchemaBuilder");z(Mr,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");var Hu=c({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return c({kind:"PrimaryKeyConstraintNode",columns:c(t.map(ie.create)),name:e?$.create(e):void 0})}});function ju(t){if(lu.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}o(ju,"parseOnCommitAction");var ze=class{#e;constructor(e){this.#e=c(e)}temporary(){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{temporary:!0})})}onCommit(e){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{onCommit:ju(e)})})}ifNotExists(){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{ifNotExists:!0})})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new ze({...this.#e,node:ht.cloneWithColumn(this.#e.node,n.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,Hu.create(r,e))})}addUniqueConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,Do.create(r,e))})}addCheckConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,Pi.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,i,n,s=Ar){let a=s(new Pt(ni.create(r.map(ie.create),be(i),n.map(ie.create),e)));return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,a.toOperationNode())})}modifyFront(e){return new ze({...this.#e,node:ht.cloneWithFrontModifier(this.#e.node,e.toOperationNode())})}modifyEnd(e){return new ze({...this.#e,node:ht.cloneWithEndModifier(this.#e.node,e.toOperationNode())})}call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(ze,"CreateTableBuilder");z(ze,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");var jt=class{#e;constructor(e){this.#e=c(e)}on(e){return new jt({...this.#e,node:xi.cloneWith(this.#e.node,{table:be(e)})})}ifExists(){return new jt({...this.#e,node:xi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new jt({...this.#e,node:xi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(jt,"DropIndexBuilder");z(jt,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");var fr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new fr({...this.#e,node:Ji.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new fr({...this.#e,node:Ji.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(fr,"DropSchemaBuilder");z(fr,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");var dr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new dr({...this.#e,node:Yi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new dr({...this.#e,node:Yi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(dr,"DropTableBuilder");z(dr,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");var _t=c({is(t){return t.kind==="CreateViewNode"},create(t){return c({kind:"CreateViewNode",name:ot.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ln=class extends $r{transformValue(e){return{...super.transformValue(e),immediate:!0}}};o(ln,"ImmediateValueTransformer");var fn=class{#e=new ln;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}};o(fn,"ImmediateValuePlugin");var yt=class{#e;constructor(e){this.#e=c(e)}temporary(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{temporary:!0})})}materialized(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{materialized:!0})})}ifNotExists(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{ifNotExists:!0})})}orReplace(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{orReplace:!0})})}columns(e){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{columns:e.map(Zi)})})}as(e){let r=e.withPlugin(new fn).toOperationNode();return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{as:r})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(yt,"CreateViewBuilder");z(yt,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");var Mi=c({is(t){return t.kind==="DropViewNode"},create(t){return c({kind:"DropViewNode",name:ot.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Kt=class{#e;constructor(e){this.#e=c(e)}materialized(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{materialized:!0})})}ifExists(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Kt,"DropViewBuilder");z(Kt,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");var Po=c({is(t){return t.kind==="CreateTypeNode"},create(t){return c({kind:"CreateTypeNode",name:t})},cloneWithEnum(t,e){return c({...t,enum:Ai.create(e.map(r=>ut.createImmediate(r)))})}});var Fr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}asEnum(e){return new Fr({...this.#e,node:Po.cloneWithEnum(this.#e.node,e)})}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Fr,"CreateTypeBuilder");z(Fr,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");var _o=c({is(t){return t.kind==="DropTypeNode"},create(t){return c({kind:"DropTypeNode",name:t})},cloneWith(t,e){return c({...t,...e})}});var Wr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Wr({...this.#e,node:_o.cloneWith(this.#e.node,{ifExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Wr,"DropTypeBuilder");z(Wr,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");function Ys(t){let e=".";if(t.includes(e)){let r=t.split(e).map(_p);if(r.length===2)return ot.createWithSchema(r[0],r[1]);throw new Error(`invalid schemable identifier ${t}`)}else return ot.create(t)}o(Ys,"parseSchemableIdentifier");function _p(t){return t.trim()}o(_p,"trim");var hr=class{#e;constructor(e){this.#e=e}createTable(e){return new ze({queryId:ne(),executor:this.#e,node:ht.create(be(e))})}dropTable(e){return new dr({queryId:ne(),executor:this.#e,node:Yi.create(be(e))})}createIndex(e){return new mt({queryId:ne(),executor:this.#e,node:er.create(e)})}dropIndex(e){return new jt({queryId:ne(),executor:this.#e,node:xi.create(e)})}createSchema(e){return new Mr({queryId:ne(),executor:this.#e,node:mo.create(e)})}dropSchema(e){return new fr({queryId:ne(),executor:this.#e,node:Ji.create(e)})}alterTable(e){return new Li({queryId:ne(),executor:this.#e,node:he.create(e)})}createView(e){return new yt({queryId:ne(),executor:this.#e,node:_t.create(e)})}dropView(e){return new Kt({queryId:ne(),executor:this.#e,node:Mi.create(e)})}createType(e){return new Fr({queryId:ne(),executor:this.#e,node:Po.create(Ys(e))})}dropType(e){return new Wr({queryId:ne(),executor:this.#e,node:_o.create(Ys(e))})}withPlugin(e){return new hr(this.#e.withPlugin(e))}withoutPlugins(){return new hr(this.#e.withoutPlugins())}withSchema(e){return new hr(this.#e.withPluginAtFront(new Dt(e)))}};o(hr,"SchemaModule");var dn=class{ref(e){return new en(e)}};o(dn,"DynamicModule");var hn=class{#e;constructor(e){this.#e=e}async provideConnection(e){let r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}};o(hn,"DefaultConnectionProvider");var kt=class extends Zr{#e;#t;#r;constructor(e,r,i,n=[]){super(n),this.#e=e,this.#t=r,this.#r=i}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new kt(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new kt(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new kt(this.#e,this.#t,this.#r,[])}};o(kt,"DefaultQueryExecutor");function Qs(){return typeof performance<"u"&&ft(performance.now)?performance.now():Date.now()}o(Qs,"performanceNow");var pn=class{#e;#t;#r;#i;#n=new WeakSet;constructor(e,r){this.#e=e,this.#t=r}async init(){this.#r||(this.#r=this.#e.init().catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){await this.init();let e=await this.#e.acquireConnection();return this.#n.has(e)||(this.#o()&&this.#s(e),this.#n.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#o(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#s(e){let r=e.executeQuery;e.executeQuery=async i=>{let n=Qs();try{return await r.call(e,i)}catch(s){throw this.#u(s),s}finally{this.#c(i,n)}}}#u(e){this.#t.error(()=>({level:"error",error:e}))}#c(e,r){this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#l(r)}))}#l(e){return Qs()-e}};o(pn,"RuntimeDriver");var Fi=class{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t;let r=this.#r(e);return this.#t=r.then(()=>{this.#t=void 0}).catch(()=>{this.#t=void 0}),r}async#r(e){return await e(this.#e)}};o(Fi,"SingleConnectionProvider");var Ku=["read uncommitted","read committed","repeatable read","serializable"];var rP=c(["query","error"]),mn=class{#e;#t;constructor(e){ft(e)?(this.#t=e,this.#e=c({query:!0,error:!0})):(this.#t=kp,this.#e=c({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}query(e){this.#e.query&&this.#t(e())}error(e){this.#e.error&&this.#t(e())}};o(mn,"Log");function kp(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${t}`))}o(kp,"defaultLogger");var qt=class extends pt{#e;constructor(e){let r,i;if(qp(e))r={executor:e.executor},i={...e};else{let n=e.dialect,s=n.createDriver(),a=n.createQueryCompiler(),u=n.createAdapter(),l=new mn(e.log??[]),h=new pn(s,l),y=new hn(h),v=new kt(a,u,y,e.plugins??[]);r={executor:v},i={config:e,executor:v,dialect:n,driver:h}}super(r),this.#e=c(i)}get schema(){return new hr(this.#e.executor)}get dynamic(){return new dn}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}get fn(){return new ti}transaction(){return new oi({...this.#e})}connection(){return new yn({...this.#e})}withPlugin(e){return new qt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new qt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new qt({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}};o(qt,"Kysely");var Br=class extends qt{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new Br({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Br({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new Br({...this.#e})}};o(Br,"Transaction");function qp(t){return dt(t)&&dt(t.config)&&dt(t.driver)&&dt(t.executor)&&dt(t.dialect)}o(qp,"isKyselyProps");var yn=class{#e;constructor(e){this.#e=c(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{let i=this.#e.executor.withConnectionProvider(new Fi(r)),n=new qt({...this.#e,executor:i});return await e(n)})}};o(yn,"ConnectionBuilder");z(yn,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");var oi=class{#e;constructor(e){this.#e=c(e)}setIsolationLevel(e){return new oi({...this.#e,isolationLevel:e})}async execute(e){let{isolationLevel:r,...i}=this.#e,n={isolationLevel:r};return Lp(n),this.#e.executor.provideConnection(async s=>{let a=this.#e.executor.withConnectionProvider(new Fi(s)),u=new Br({...i,executor:a});try{await this.#e.driver.beginTransaction(s,n);let l=await e(u);return await this.#e.driver.commitTransaction(s),l}catch(l){throw await this.#e.driver.rollbackTransaction(s),l}})}};o(oi,"TransactionBuilder");z(oi,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function Lp(t){if(t.isolationLevel&&!Ku.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}o(Lp,"validateTransactionSettings");var it=Object.assign((t,...e)=>new Pe({queryId:ne(),rawNode:pe.create(t,e?.map(zt)??[])}),{ref(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(ir(t))})},value(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(zt(t))})},table(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(be(t))})},id(...t){let e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",new Pe({queryId:ne(),rawNode:pe.create(e,t.map($.create))})},literal(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(ut.createImmediate(t))})},raw(t){return new Pe({queryId:ne(),rawNode:pe.createWithSql(t)})},join(t,e=it`, `){let r=new Array(2*t.length-1),i=e.toOperationNode();for(let n=0;n<t.length;++n)r[2*n]=zt(t[n]),n!==t.length-1&&(r[2*n+1]=i);return new Pe({queryId:ne(),rawNode:pe.createWithChildren(r)})}});var vn=class{nodeStack=[];get parentNode(){return this.nodeStack[this.nodeStack.length-2]}#e=c({AliasNode:this.visitAlias.bind(this),ColumnNode:this.visitColumn.bind(this),IdentifierNode:this.visitIdentifier.bind(this),SchemableIdentifierNode:this.visitSchemableIdentifier.bind(this),RawNode:this.visitRaw.bind(this),ReferenceNode:this.visitReference.bind(this),SelectQueryNode:this.visitSelectQuery.bind(this),SelectionNode:this.visitSelection.bind(this),TableNode:this.visitTable.bind(this),FromNode:this.visitFrom.bind(this),SelectAllNode:this.visitSelectAll.bind(this),AndNode:this.visitAnd.bind(this),OrNode:this.visitOr.bind(this),ValueNode:this.visitValue.bind(this),ValueListNode:this.visitValueList.bind(this),PrimitiveValueListNode:this.visitPrimitiveValueList.bind(this),ParensNode:this.visitParens.bind(this),JoinNode:this.visitJoin.bind(this),OperatorNode:this.visitOperator.bind(this),WhereNode:this.visitWhere.bind(this),InsertQueryNode:this.visitInsertQuery.bind(this),DeleteQueryNode:this.visitDeleteQuery.bind(this),ReturningNode:this.visitReturning.bind(this),CreateTableNode:this.visitCreateTable.bind(this),AddColumnNode:this.visitAddColumn.bind(this),ColumnDefinitionNode:this.visitColumnDefinition.bind(this),DropTableNode:this.visitDropTable.bind(this),DataTypeNode:this.visitDataType.bind(this),OrderByNode:this.visitOrderBy.bind(this),OrderByItemNode:this.visitOrderByItem.bind(this),GroupByNode:this.visitGroupBy.bind(this),GroupByItemNode:this.visitGroupByItem.bind(this),UpdateQueryNode:this.visitUpdateQuery.bind(this),ColumnUpdateNode:this.visitColumnUpdate.bind(this),LimitNode:this.visitLimit.bind(this),OffsetNode:this.visitOffset.bind(this),OnConflictNode:this.visitOnConflict.bind(this),OnDuplicateKeyNode:this.visitOnDuplicateKey.bind(this),CreateIndexNode:this.visitCreateIndex.bind(this),DropIndexNode:this.visitDropIndex.bind(this),ListNode:this.visitList.bind(this),PrimaryKeyConstraintNode:this.visitPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.visitUniqueConstraint.bind(this),ReferencesNode:this.visitReferences.bind(this),CheckConstraintNode:this.visitCheckConstraint.bind(this),WithNode:this.visitWith.bind(this),CommonTableExpressionNode:this.visitCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.visitCommonTableExpressionName.bind(this),HavingNode:this.visitHaving.bind(this),CreateSchemaNode:this.visitCreateSchema.bind(this),DropSchemaNode:this.visitDropSchema.bind(this),AlterTableNode:this.visitAlterTable.bind(this),DropColumnNode:this.visitDropColumn.bind(this),RenameColumnNode:this.visitRenameColumn.bind(this),AlterColumnNode:this.visitAlterColumn.bind(this),ModifyColumnNode:this.visitModifyColumn.bind(this),AddConstraintNode:this.visitAddConstraint.bind(this),DropConstraintNode:this.visitDropConstraint.bind(this),ForeignKeyConstraintNode:this.visitForeignKeyConstraint.bind(this),CreateViewNode:this.visitCreateView.bind(this),DropViewNode:this.visitDropView.bind(this),GeneratedNode:this.visitGenerated.bind(this),DefaultValueNode:this.visitDefaultValue.bind(this),OnNode:this.visitOn.bind(this),ValuesNode:this.visitValues.bind(this),SelectModifierNode:this.visitSelectModifier.bind(this),CreateTypeNode:this.visitCreateType.bind(this),DropTypeNode:this.visitDropType.bind(this),ExplainNode:this.visitExplain.bind(this),DefaultInsertValueNode:this.visitDefaultInsertValue.bind(this),AggregateFunctionNode:this.visitAggregateFunction.bind(this),OverNode:this.visitOver.bind(this),PartitionByNode:this.visitPartitionBy.bind(this),PartitionByItemNode:this.visitPartitionByItem.bind(this),SetOperationNode:this.visitSetOperation.bind(this),BinaryOperationNode:this.visitBinaryOperation.bind(this),UnaryOperationNode:this.visitUnaryOperation.bind(this)});visitNode=e=>{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}};o(vn,"OperationNodeVisitor");var si=class extends vn{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),c({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){let r=this.parentNode!==void 0&&!et.is(this.parentNode)&&!_t.is(this.parentNode)&&!So.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select "),e.distinctOn&&(this.compileDistinctOn(e.distinctOn),this.append(" ")),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.selections&&(this.compileList(e.selections),this.append(" ")),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){let i=e.length-1;for(let n=0;n<=i;n++)this.visitNode(e[n]),n<i&&this.append(r)}visitWhere(e){this.append("where "),this.visitNode(e.where)}visitHaving(e){this.append("having "),this.visitNode(e.having)}visitInsertQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append(e.replace?"replace":"insert"),e.ignore&&this.append(" ignore"),this.append(" into "),this.visitNode(e.into),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.values&&(this.append(" "),this.visitNode(e.values)),e.onConflict&&(this.append(" "),this.visitNode(e.onConflict)),e.onDuplicateKey&&(this.append(" "),this.visitNode(e.onDuplicateKey)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitValues(e){this.append("values "),this.compileList(e.values)}visitDeleteQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("delete "),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitReturning(e){this.append("returning "),this.compileList(e.selections)}visitAlias(e){this.visitNode(e.node),this.append(" as "),this.visitNode(e.alias)}visitReference(e){this.visitNode(e.table),this.append("."),this.visitNode(e.column)}visitSelectAll(e){this.append("*")}visitIdentifier(e){this.append(this.getLeftIdentifierWrapper()),this.compileUnwrappedIdentifier(e),this.append(this.getRightIdentifierWrapper())}compileUnwrappedIdentifier(e){if(!Ze(e.name))throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");this.append(this.sanitizeIdentifier(e.name))}visitAnd(e){this.visitNode(e.left),this.append(" and "),this.visitNode(e.right)}visitOr(e){this.visitNode(e.left),this.append(" or "),this.visitNode(e.right)}visitValue(e){e.immediate?this.appendImmediateValue(e.value):this.appendValue(e.value)}visitValueList(e){this.append("("),this.compileList(e.values),this.append(")")}visitPrimitiveValueList(e){this.append("(");let{values:r}=e;for(let i=0;i<r.length;++i)this.appendValue(r[i]),i!==r.length-1&&this.append(", ");this.append(")")}visitParens(e){this.append("("),this.visitNode(e.node),this.append(")")}visitJoin(e){this.append(Fp[e.joinType]),this.append(" "),this.visitNode(e.table),e.on&&(this.append(" "),this.visitNode(e.on))}visitOn(e){this.append("on "),this.visitNode(e.on)}visitRaw(e){let{sqlFragments:r,parameters:i}=e;for(let n=0;n<r.length;++n)this.append(r[n]),i.length>n&&this.visitNode(i[n])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.frontModifiers&&e.frontModifiers.length>0&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.expression&&(this.append(" ("),this.visitNode(e.expression),this.append(")"))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.columnAlterations&&this.compileList(e.columnAlterations)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(Mp[e.modifier])}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.visitNode(e.column),this.append(")"),e.filter&&(this.append(" filter("),this.visitNode(e.filter),this.append(")")),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}visitBinaryOperation(e){this.visitNode(e.leftOperand),this.append(" "),this.visitNode(e.operator),this.append(" "),this.visitNode(e.rightOperand)}visitUnaryOperation(e){this.visitNode(e.operator),this.append(" "),this.visitNode(e.operand)}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){let r=this.getLeftIdentifierWrapper(),i=this.getRightIdentifierWrapper(),n="";for(let s of e)n+=s,s===r?n+=r:s===i&&(n+=i);return n}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(Ze(e))this.append(`'${e}'`);else if(su(e)||ho(e))this.append(e.toString());else if(po(e))this.append("null");else if(au(e))this.appendImmediateValue(e.toISOString());else if(uu(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}};o(si,"DefaultQueryCompiler");var Mp=c({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),Fp=c({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"});var ai=class{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}};o(ai,"DialectAdapterBase");var gn=class{transformQuery(e){return e.node}async transformResult(e){return e.result}};o(gn,"NoopPlugin");var wn="kysely_migration",xn="kysely_migration_lock",Xu="migration_lock",$s=c({__noMigrations__:!0}),Nn=class{#e;constructor(e){this.#e=c(e)}async getMigrations(){let e=await this.#a(this.#i)?await this.#e.db.withPlugin(this.#o).selectFrom(this.#i).select(["name","timestamp"]).execute():[];return(await this.#h()).map(({name:i,...n})=>{let s=e.find(a=>a.name===i);return{name:i,migration:n,executedAt:s?new Date(s.timestamp):void 0}})}async migrateToLatest(){return this.#t(({migrations:e})=>e.length-1)}async migrateTo(e){return this.#t(({migrations:r})=>{if(e===$s)return-1;let i=r.findIndex(n=>n.name===e);if(i===-1)throw new Error(`migration "${e}" doesn't exist`);return i})}async migrateUp(){return this.#t(({currentIndex:e,migrations:r})=>Math.min(e+1,r.length-1))}async migrateDown(){return this.#t(({currentIndex:e})=>Math.max(e-1,-1))}async#t(e){try{return await this.#s(),await this.#m(e)}catch(r){return r instanceof Wi?r.resultSet:{error:r}}}get#r(){return this.#e.migrationTableSchema}get#i(){return this.#e.migrationTableName??wn}get#n(){return this.#e.migrationLockTableName??xn}get#o(){return this.#r?new Dt(this.#r):new gn}async#s(){await this.#u(),await this.#c(),await this.#l(),await this.#p()}async#u(){if(this.#r&&!await this.#f())try{await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute()}catch(e){if(!await this.#f())throw e}}async#c(){if(!await this.#a(this.#i))try{this.#r&&await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute(),await this.#e.db.schema.withPlugin(this.#o).createTable(this.#i).ifNotExists().addColumn("name","varchar(255)",e=>e.notNull().primaryKey()).addColumn("timestamp","varchar(255)",e=>e.notNull()).execute()}catch(e){if(!await this.#a(this.#i))throw e}}async#l(){if(!await this.#a(this.#n))try{await this.#e.db.schema.withPlugin(this.#o).createTable(this.#n).ifNotExists().addColumn("id","varchar(255)",e=>e.notNull().primaryKey()).addColumn("is_locked","integer",e=>e.notNull().defaultTo(0)).execute()}catch(e){if(!await this.#a(this.#n))throw e}}async#p(){if(!await this.#d())try{await this.#e.db.withPlugin(this.#o).insertInto(this.#n).values({id:Xu,is_locked:0}).execute()}catch(e){if(!await this.#d())throw e}}async#f(){return(await this.#e.db.introspection.getSchemas()).some(r=>r.name===this.#r)}async#a(e){let r=this.#r;return(await this.#e.db.introspection.getTables({withInternalKyselyTables:!0})).some(n=>n.name===e&&(!r||n.schema===r))}async#d(){return!!await this.#e.db.withPlugin(this.#o).selectFrom(this.#n).where("id","=",Xu).select("id").executeTakeFirst()}async#m(e){let r=this.#e.db.getExecutor().adapter,i=o(async n=>{try{await r.acquireMigrationLock(n);let s=await this.#y(n);if(s.migrations.length===0)return{results:[]};let a=e(s);return a===void 0?{results:[]}:a<s.currentIndex?await this.#N(n,s,a):a>s.currentIndex?await this.#w(n,s,a):{results:[]}}finally{await r.releaseMigrationLock(n)}},"run");return r.supportsTransactionalDdl?this.#e.db.transaction().execute(i):this.#e.db.connection().execute(i)}async#y(e){let r=await this.#h(),i=await this.#v(e);return this.#g(r,i),c({migrations:r,currentIndex:r.findIndex(n=>n.name===cu(i))})}async#h(){let e=await this.#e.provider.getMigrations();return Object.keys(e).sort().map(r=>({...e[r],name:r}))}async#v(e){return(await e.withPlugin(this.#o).selectFrom(this.#i).select("name").orderBy("name").execute()).map(i=>i.name)}#g(e,r){for(let i of r)if(!e.some(n=>n.name===i))throw new Error(`corrupted migrations: previously executed migration ${i} is missing`);for(let i=0;i<r.length;++i)if(e[i].name!==r[i])throw new Error(`corrupted migrations: expected previously executed migration ${r[i]} to be at index ${i} but ${e[i].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`)}async#N(e,r,i){let n=[];for(let s=r.currentIndex;s>i;--s)n.push({migrationName:r.migrations[s].name,direction:"Down",status:"NotExecuted"});for(let s=0;s<n.length;++s){let a=r.migrations.find(u=>u.name===n[s].migrationName);try{a.down&&(await a.down(e),await e.withPlugin(this.#o).deleteFrom(this.#i).where("name","=",a.name).execute(),n[s]={migrationName:a.name,direction:"Down",status:"Success"})}catch(u){throw n[s]={migrationName:a.name,direction:"Down",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}async#w(e,r,i){let n=[];for(let s=r.currentIndex+1;s<=i;++s)n.push({migrationName:r.migrations[s].name,direction:"Up",status:"NotExecuted"});for(let s=0;s<n.length;++s){let a=r.migrations.find(u=>u.name===n[s].migrationName);try{await a.up(e),await e.withPlugin(this.#o).insertInto(this.#i).values({name:a.name,timestamp:new Date().toISOString()}).execute(),n[s]={migrationName:a.name,direction:"Up",status:"Success"}}catch(u){throw n[s]={migrationName:a.name,direction:"Up",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}};o(Nn,"Migrator");var Wi=class extends Error{#e;constructor(e){super(),this.#e=e}get resultSet(){return this.#e}};o(Wi,"MigrationResultSetError");var Wp=/"/g,En=class extends si{sanitizeIdentifier(e){return e.replace(Wp,'""')}};o(En,"PostgresQueryCompiler");var Cn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("pg_catalog.pg_namespace").select("nspname").castTo().execute()).map(r=>({name:r.nspname}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("pg_catalog.pg_attribute as a").innerJoin("pg_catalog.pg_class as c","a.attrelid","c.oid").innerJoin("pg_catalog.pg_namespace as ns","c.relnamespace","ns.oid").innerJoin("pg_catalog.pg_type as typ","a.atttypid","typ.oid").innerJoin("pg_catalog.pg_namespace as dtns","typ.typnamespace","dtns.oid").select(["a.attname as column","a.attnotnull as not_null","a.atthasdef as has_default","c.relname as table","ns.nspname as schema","typ.typname as type","dtns.nspname as type_schema",this.#e.selectFrom("pg_class").select(it`true`.as("auto_incrementing")).whereRef("relnamespace","=","c.relnamespace").where("relkind","=","S").where("relname","=",it`c.relname || '_' || a.attname || '_seq'`).as("auto_incrementing")]).where("c.relkind","=","r").where("ns.nspname","!~","^pg_").where("ns.nspname","!=","information_schema").where("a.attnum",">=",0).where("a.attisdropped","!=",!0).orderBy("ns.nspname").orderBy("c.relname").orderBy("a.attnum").castTo();e.withInternalKyselyTables||(r=r.where("c.relname","!=",wn).where("c.relname","!=",xn));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(s=>s.name===i.table&&s.schema===i.schema);return n||(n=c({name:i.table,schema:i.schema,columns:[]}),r.push(n)),n.columns.push(c({name:i.column,dataType:i.type,dataTypeSchema:i.type_schema,isNullable:!i.not_null,isAutoIncrementing:!!i.auto_incrementing,hasDefaultValue:i.has_default})),r},[])}};o(Cn,"PostgresIntrospector");var Bp=BigInt("3853314791062309107"),Sn=class extends ai{get supportsTransactionalDdl(){return!0}get supportsReturning(){return!0}async acquireMigrationLock(e){await it`select pg_advisory_xact_lock(${it.literal(Bp)})`.execute(e)}async releaseMigrationLock(){}};o(Sn,"PostgresAdapter");var Up=/`/g,Tn=class extends si{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getExplainOptionAssignment(){return"="}getExplainOptionsDelimiter(){return" "}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return"`"}getRightIdentifierWrapper(){return"`"}sanitizeIdentifier(e){return e.replace(Up,"``")}};o(Tn,"MysqlQueryCompiler");var bn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("information_schema.schemata").select("schema_name").castTo().execute()).map(r=>({name:r.SCHEMA_NAME}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("information_schema.columns").select(["COLUMN_NAME","COLUMN_DEFAULT","TABLE_NAME","TABLE_SCHEMA","IS_NULLABLE","DATA_TYPE","EXTRA"]).where("table_schema","=",it`database()`).orderBy("table_name").orderBy("ordinal_position").castTo();e.withInternalKyselyTables||(r=r.where("table_name","!=",wn).where("table_name","!=",xn));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(s=>s.name===i.TABLE_NAME);return n||(n=c({name:i.TABLE_NAME,schema:i.TABLE_SCHEMA,columns:[]}),r.push(n)),n.columns.push(c({name:i.COLUMN_NAME,dataType:i.DATA_TYPE,isNullable:i.IS_NULLABLE==="YES",isAutoIncrementing:i.EXTRA.toLowerCase().includes("auto_increment"),hasDefaultValue:i.COLUMN_DEFAULT!==null})),r},[])}};o(bn,"MysqlIntrospector");var Gu="ea586330-2c93-47c8-908d-981d9d270f9d",Vp=60*60,An=class extends ai{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}async acquireMigrationLock(e){await it`select get_lock(${it.literal(Gu)}, ${it.literal(Vp)})`.execute(e)}async releaseMigrationLock(e){await it`select release_lock(${it.literal(Gu)})`.execute(e)}};o(An,"MysqlAdapter");var In=class{#e;constructor(e){this.#e=e}async init(){}async acquireConnection(){return new ko(this.#e)}async beginTransaction(e){await e.beginTransaction()}async commitTransaction(e){await e.commitTransaction()}async rollbackTransaction(e){await e.rollbackTransaction()}async releaseConnection(e){}async destroy(){}};o(In,"DataApiDriver");var ko=class{#e;#t;constructor(e){this.#e=e}async beginTransaction(){let e=await this.#e.client.beginTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,database:this.#e.database}).promise();this.#t=e.transactionId}async commitTransaction(){if(!this.#t)throw new Error("Cannot commit a transaction before creating it");await this.#e.client.commitTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async rollbackTransaction(){if(!this.#t)throw new Error("Cannot rollback a transaction before creating it");await this.#e.client.rollbackTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async executeQuery(e){let r=await this.#e.client.executeStatement({transactionId:this.#t,secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,sql:e.sql,parameters:e.parameters,database:this.#e.database,includeResultMetadata:!0}).promise();return r.columnMetadata?{rows:r.records?.filter(s=>s.length!==0).map(s=>Object.fromEntries(s.map((a,u)=>[r.columnMetadata[u].label||r.columnMetadata[u].name,a.stringValue??a.blobValue??a.longValue??a.arrayValue??a.doubleValue??(a.isNull?null:a.booleanValue)])))||[]}:{numUpdatedOrDeletedRows:BigInt(r.numberOfRecordsUpdated||0),rows:[]}}async*streamQuery(e,r){throw new Error("Data API does not support streaming")}};o(ko,"DataApiConnection");var On=class extends En{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Ju(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};o(On,"PostgresDataApiQueryCompiler");var Rn=class extends Tn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Ju(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};o(Rn,"MysqlDataApiQueryCompiler");function Ju(t){switch(typeof t){case"bigint":return{value:{doubleValue:Number(t)}};case"boolean":return{value:{booleanValue:t}};case"number":return Number.isInteger(t)?{value:{longValue:t}}:{value:{doubleValue:t}};case"object":if(t==null)return{value:{isNull:!0}};if(Buffer.isBuffer(t))return{value:{blobValue:t}};if(t instanceof Date)return{typeHint:"TIMESTAMP",value:{stringValue:Yu(t.toISOString())}};if(t?.value&&jp(t.value))return t.typeHint&&t.value.stringValue&&typeof t.value.stringValue=="string"&&(t.value.stringValue=zp(t.typeHint,t.value.stringValue)),t;break;case"string":return{value:{stringValue:t}}}throw new Bi("Could not serialize value")}o(Ju,"serialize");function zp(t,e){switch(t){case"DATE":return Zs(e).slice(0,10);case"TIME":return e.match(/^\d{4}-\d{2}-\d{2}/)?Zs(e).slice(11,23):Hp(e);case"TIMESTAMP":return Yu(Zs(e))}return e}o(zp,"fixStringValue");function Hp(t){let e=(t||"00:00:00").split(":");for(;e.length<3;)e.push("00");return e.join(":").slice(0,12)}o(Hp,"fixTimeString");function Yu(t){return t.replace("T"," ").slice(0,23)}o(Yu,"fixISOString");function Zs(t){return new Date(Date.parse(t)).toISOString()}o(Zs,"parseToISOString");function jp(t){for(let e of Xp)if(t[e])return!0;if(t.arrayValue){for(let e of Kp)if(t.arrayValue?.[e])return!0}return!1}o(jp,"isValueObject");var Bi=class extends Error{constructor(e){super(e),this.name=Bi.name}};o(Bi,"QueryCompilerError");var Kp=["booleanValues","doubleValues","longValues","stringValues"],Xp=["blobValue","booleanValue","doubleValue","isNull","longValue","stringValue"];var Dn=class{#e;constructor(e){this.#e=e}createAdapter(){if(this.#e.mode==="postgres")return new Sn;if(this.#e.mode==="mysql")return new An;throw new Error("Unknown mode "+this.#e.mode)}createDriver(){return new In(this.#e.driver)}createQueryCompiler(){if(this.#e.mode==="postgres")return new On;if(this.#e.mode==="mysql")return new Rn;throw new Error("Unknown mode "+this.#e.mode)}createIntrospector(e){if(this.#e.mode==="postgres")return new Cn(e);if(this.#e.mode==="mysql")return new bn(e);throw new Error("Unknown mode "+this.#e.mode)}};o(Dn,"DataApiDialect");var tp=dp(ep(),1);import IN from"url";async function KF(t){let e=new qt({dialect:new Dn({mode:process.env.RDS_ENGINE_MODE,driver:{client:new tp.default,database:t?.database||process.env.RDS_DATABASE,secretArn:process.env.RDS_SECRET,resourceArn:process.env.RDS_ARN}})}),r=new Nn({db:e,provider:new As(AN.resolve(process.env.RDS_MIGRATIONS_PATH))});if(!t.type||t.type==="latest"){let i=await r.migrateToLatest(),n=i.error||i.results?.find(s=>s.status==="Error");if(n)throw n;return i}if(t.type==="to"){if(!t.data.name)return await r.migrateTo($s);let i=await r.migrateTo(t.data.name),n=i.error||i.results?.find(s=>s.status==="Error");if(n)throw n;return i}if(t.type==="list")return await r.getMigrations()}o(KF,"handler");var As=class{#e;constructor(e){this.#e=e}async getMigrations(){let e=await import("fs/promises"),r=await import("path"),i={},n=await e.readdir(this.#e);for(let s of n)if(s.endsWith(".js")||s.endsWith(".cjs")||s.endsWith(".mjs")){let[a]=r.basename(s).split("."),u=r.join(this.#e,s);if(process.env.LAMBDA_TASK_ROOT){let h=await import(u);i[a]=h;continue}let l=u.replace(/(mjs|cjs|js)/g,`${Date.now()}.$1`);try{await e.copyFile(u,l);let h=await import(IN.pathToFileURL(l).href);i[a]=h}catch(h){console.error(h)}await e.rm(l)}return i}};o(As,"DynamicFileMigrationProvider");export{KF as handler};
|
|
27
|
+
`?(f.line++,f.column=0):f.column++);f.textNode+=m.substring(te,q-1)}I==="<"&&!(f.sawRoot&&f.closedRoot&&!f.strict)?(f.state=w.OPEN_WAKA,f.startTagPosition=f.position):(!C(I)&&(!f.sawRoot||f.closedRoot)&&Z(f,"Text data outside of root node."),I==="&"?f.state=w.TEXT_ENTITY:f.textNode+=I);continue;case w.SCRIPT:I==="<"?f.state=w.SCRIPT_ENDING:f.script+=I;continue;case w.SCRIPT_ENDING:I==="/"?f.state=w.CLOSE_TAG:(f.script+="<"+I,f.state=w.SCRIPT);continue;case w.OPEN_WAKA:if(I==="!")f.state=w.SGML_DECL,f.sgmlDecl="";else if(!C(I))if(T(N,I))f.state=w.OPEN_TAG,f.tagName=I;else if(I==="/")f.state=w.CLOSE_TAG,f.tagName="";else if(I==="?")f.state=w.PROC_INST,f.procInstName=f.procInstBody="";else{if(Z(f,"Unencoded <"),f.startTagPosition+1<f.position){var we=f.position-f.startTagPosition;I=new Array(we).join(" ")+I}f.textNode+="<"+I,f.state=w.TEXT}continue;case w.SGML_DECL:(f.sgmlDecl+I).toUpperCase()===y?(F(f,"onopencdata"),f.state=w.CDATA,f.sgmlDecl="",f.cdata=""):f.sgmlDecl+I==="--"?(f.state=w.COMMENT,f.comment="",f.sgmlDecl=""):(f.sgmlDecl+I).toUpperCase()===v?(f.state=w.DOCTYPE,(f.doctype||f.sawRoot)&&Z(f,"Inappropriately located doctype declaration"),f.doctype="",f.sgmlDecl=""):I===">"?(F(f,"onsgmldeclaration",f.sgmlDecl),f.sgmlDecl="",f.state=w.TEXT):(R(I)&&(f.state=w.SGML_DECL_QUOTED),f.sgmlDecl+=I);continue;case w.SGML_DECL_QUOTED:I===f.q&&(f.state=w.SGML_DECL,f.q=""),f.sgmlDecl+=I;continue;case w.DOCTYPE:I===">"?(f.state=w.TEXT,F(f,"ondoctype",f.doctype),f.doctype=!0):(f.doctype+=I,I==="["?f.state=w.DOCTYPE_DTD:R(I)&&(f.state=w.DOCTYPE_QUOTED,f.q=I));continue;case w.DOCTYPE_QUOTED:f.doctype+=I,I===f.q&&(f.q="",f.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:f.doctype+=I,I==="]"?f.state=w.DOCTYPE:R(I)&&(f.state=w.DOCTYPE_DTD_QUOTED,f.q=I);continue;case w.DOCTYPE_DTD_QUOTED:f.doctype+=I,I===f.q&&(f.state=w.DOCTYPE_DTD,f.q="");continue;case w.COMMENT:I==="-"?f.state=w.COMMENT_ENDING:f.comment+=I;continue;case w.COMMENT_ENDING:I==="-"?(f.state=w.COMMENT_ENDED,f.comment=We(f.opt,f.comment),f.comment&&F(f,"oncomment",f.comment),f.comment=""):(f.comment+="-"+I,f.state=w.COMMENT);continue;case w.COMMENT_ENDED:I!==">"?(Z(f,"Malformed comment"),f.comment+="--"+I,f.state=w.COMMENT):f.state=w.TEXT;continue;case w.CDATA:I==="]"?f.state=w.CDATA_ENDING:f.cdata+=I;continue;case w.CDATA_ENDING:I==="]"?f.state=w.CDATA_ENDING_2:(f.cdata+="]"+I,f.state=w.CDATA);continue;case w.CDATA_ENDING_2:I===">"?(f.cdata&&F(f,"oncdata",f.cdata),F(f,"onclosecdata"),f.cdata="",f.state=w.TEXT):I==="]"?f.cdata+="]":(f.cdata+="]]"+I,f.state=w.CDATA);continue;case w.PROC_INST:I==="?"?f.state=w.PROC_INST_ENDING:C(I)?f.state=w.PROC_INST_BODY:f.procInstName+=I;continue;case w.PROC_INST_BODY:if(!f.procInstBody&&C(I))continue;I==="?"?f.state=w.PROC_INST_ENDING:f.procInstBody+=I;continue;case w.PROC_INST_ENDING:I===">"?(F(f,"onprocessinginstruction",{name:f.procInstName,body:f.procInstBody}),f.procInstName=f.procInstBody="",f.state=w.TEXT):(f.procInstBody+="?"+I,f.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:T(D,I)?f.tagName+=I:(Cr(f),I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:(C(I)||Z(f,"Invalid character in tag name"),f.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:I===">"?(Nt(f,!0),br(f)):(Z(f,"Forward-slash in opening tag not followed by >"),f.state=w.ATTRIB);continue;case w.ATTRIB:if(C(I))continue;I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:T(N,I)?(f.attribName=I,f.attribValue="",f.state=w.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case w.ATTRIB_NAME:I==="="?f.state=w.ATTRIB_VALUE:I===">"?(Z(f,"Attribute without value"),f.attribValue=f.attribName,Tr(f),Nt(f)):C(I)?f.state=w.ATTRIB_NAME_SAW_WHITE:T(D,I)?f.attribName+=I:Z(f,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if(I==="=")f.state=w.ATTRIB_VALUE;else{if(C(I))continue;Z(f,"Attribute without value"),f.tag.attributes[f.attribName]="",f.attribValue="",F(f,"onattribute",{name:f.attribName,value:""}),f.attribName="",I===">"?Nt(f):T(N,I)?(f.attribName=I,f.state=w.ATTRIB_NAME):(Z(f,"Invalid attribute name"),f.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(C(I))continue;R(I)?(f.q=I,f.state=w.ATTRIB_VALUE_QUOTED):(Z(f,"Unquoted attribute value"),f.state=w.ATTRIB_VALUE_UNQUOTED,f.attribValue=I);continue;case w.ATTRIB_VALUE_QUOTED:if(I!==f.q){I==="&"?f.state=w.ATTRIB_VALUE_ENTITY_Q:f.attribValue+=I;continue}Tr(f),f.q="",f.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:C(I)?f.state=w.ATTRIB:I===">"?Nt(f):I==="/"?f.state=w.OPEN_TAG_SLASH:T(N,I)?(Z(f,"No whitespace between attributes"),f.attribName=I,f.attribValue="",f.state=w.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(!_(I)){I==="&"?f.state=w.ATTRIB_VALUE_ENTITY_U:f.attribValue+=I;continue}Tr(f),I===">"?Nt(f):f.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(f.tagName)I===">"?br(f):T(D,I)?f.tagName+=I:f.script?(f.script+="</"+f.tagName,f.tagName="",f.state=w.SCRIPT):(C(I)||Z(f,"Invalid tagname in closing tag"),f.state=w.CLOSE_TAG_SAW_WHITE);else{if(C(I))continue;A(N,I)?f.script?(f.script+="</"+I,f.state=w.SCRIPT):Z(f,"Invalid tagname in closing tag."):f.tagName=I}continue;case w.CLOSE_TAG_SAW_WHITE:if(C(I))continue;I===">"?br(f):Z(f,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var be,Je;switch(f.state){case w.TEXT_ENTITY:be=w.TEXT,Je="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:be=w.ATTRIB_VALUE_QUOTED,Je="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:be=w.ATTRIB_VALUE_UNQUOTED,Je="attribValue";break}I===";"?(f[Je]+=wi(f),f.entity="",f.state=be):T(f.entity.length?p:E,I)?f.entity+=I:(Z(f,"Invalid character in entity name"),f[Je]+="&"+f.entity+I,f.entity="",f.state=be);continue;default:throw new Error(f,"Unknown state: "+f.state)}return f.position>=f.bufferCheckPosition&&i(f),f}s(Kr,"write");String.fromCodePoint||function(){var m=String.fromCharCode,f=Math.floor,q=s(function(){var I=16384,te=[],we,be,Je=-1,wt=arguments.length;if(!wt)return"";for(var Ar="";++Je<wt;){var De=Number(arguments[Je]);if(!isFinite(De)||De<0||De>1114111||f(De)!==De)throw RangeError("Invalid code point: "+De);De<=65535?te.push(De):(De-=65536,we=(De>>10)+55296,be=De%1024+56320,te.push(we,be)),(Je+1===wt||te.length>I)&&(Ar+=m.apply(null,te),te.length=0)}return Ar},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:q,configurable:!0,writable:!0}):String.fromCodePoint=q}()})(typeof Eo>"u"?Eo.sax={}:Eo)});var nh=P(Xa=>{(function(){"use strict";Xa.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call(Xa)});var Ga=P(vi=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),vi.normalize=function(e){return e.toLowerCase()},vi.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vi.stripPrefix=function(e){return e.replace(t,"")},vi.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},vi.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(vi)});var sh=P(gi=>{(function(){"use strict";var t,e,r,i,n,o,a,u,l=s(function(v,S){return function(){return v.apply(S,arguments)}},"bind"),h=s(function(v,S){for(var O in S)y.call(S,O)&&(v[O]=S[O]);function g(){this.constructor=v}return s(g,"ctor"),g.prototype=S.prototype,v.prototype=new g,v.__super__=S.prototype,v},"extend"),y={}.hasOwnProperty;a=ih(),r=re("events"),t=nh(),o=Ga(),u=re("timers").setImmediate,e=wo().defaults,i=s(function(v){return typeof v=="object"&&v!=null&&Object.keys(v).length===0},"isEmpty"),n=s(function(v,S,O){var g,N,D;for(g=0,N=v.length;g<N;g++)D=v[g],S=D(S,O);return S},"processItem"),gi.Parser=function(v){h(S,v);function S(O){this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var g,N,D;if(!(this instanceof gi.Parser))return new gi.Parser(O);this.options={},N=e["0.2"];for(g in N)y.call(N,g)&&(D=N[g],this.options[g]=D);for(g in O)y.call(O,g)&&(D=O[g],this.options[g]=D);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return s(S,"Parser"),S.prototype.processAsync=function(){var O,g;try{return this.remaining.length<=this.options.chunkSize?(O=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(O),this.saxParser.close()):(O=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(O),u(this.processAsync))}catch(N){if(g=N,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(g)}},S.prototype.assignOrPush=function(O,g,N){return g in O?(O[g]instanceof Array||(O[g]=[O[g]]),O[g].push(N)):this.options.explicitArray?O[g]=[N]:O[g]=N},S.prototype.reset=function(){var O,g,N,D;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(E){return function(p){if(E.saxParser.resume(),!E.saxParser.errThrown)return E.saxParser.errThrown=!0,E.emit("error",p)}}(this),this.saxParser.onend=function(E){return function(){if(!E.saxParser.ended)return E.saxParser.ended=!0,E.emit("end",E.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,D=[],O=this.options.attrkey,g=this.options.charkey,this.saxParser.onopentag=function(E){return function(p){var C,R,_,T,A;if(_={},_[g]="",!E.options.ignoreAttrs){A=p.attributes;for(C in A)y.call(A,C)&&(!(O in _)&&!E.options.mergeAttrs&&(_[O]={}),R=E.options.attrValueProcessors?n(E.options.attrValueProcessors,p.attributes[C],C):p.attributes[C],T=E.options.attrNameProcessors?n(E.options.attrNameProcessors,C):C,E.options.mergeAttrs?E.assignOrPush(_,T,R):_[O][T]=R)}return _["#name"]=E.options.tagNameProcessors?n(E.options.tagNameProcessors,p.name):p.name,E.options.xmlns&&(_[E.options.xmlnskey]={uri:p.uri,local:p.local}),D.push(_)}}(this),this.saxParser.onclosetag=function(E){return function(){var p,C,R,_,T,A,w,K,X,F;if(A=D.pop(),T=A["#name"],(!E.options.explicitChildren||!E.options.preserveChildrenOrder)&&delete A["#name"],A.cdata===!0&&(p=A.cdata,delete A.cdata),X=D[D.length-1],A[g].match(/^\s*$/)&&!p?(C=A[g],delete A[g]):(E.options.trim&&(A[g]=A[g].trim()),E.options.normalize&&(A[g]=A[g].replace(/\s{2,}/g," ").trim()),A[g]=E.options.valueProcessors?n(E.options.valueProcessors,A[g],T):A[g],Object.keys(A).length===1&&g in A&&!E.EXPLICIT_CHARKEY&&(A=A[g])),i(A)&&(A=E.options.emptyTag!==""?E.options.emptyTag:C),E.options.validator!=null&&(F="/"+function(){var se,We,Fe;for(Fe=[],se=0,We=D.length;se<We;se++)_=D[se],Fe.push(_["#name"]);return Fe}().concat(T).join("/"),function(){var se;try{return A=E.options.validator(F,X&&X[T],A)}catch(We){return se=We,E.emit("error",se)}}()),E.options.explicitChildren&&!E.options.mergeAttrs&&typeof A=="object"){if(!E.options.preserveChildrenOrder)_={},E.options.attrkey in A&&(_[E.options.attrkey]=A[E.options.attrkey],delete A[E.options.attrkey]),!E.options.charsAsChildren&&E.options.charkey in A&&(_[E.options.charkey]=A[E.options.charkey],delete A[E.options.charkey]),Object.getOwnPropertyNames(A).length>0&&(_[E.options.childkey]=A),A=_;else if(X){X[E.options.childkey]=X[E.options.childkey]||[],w={};for(R in A)y.call(A,R)&&(w[R]=A[R]);X[E.options.childkey].push(w),delete A["#name"],Object.keys(A).length===1&&g in A&&!E.EXPLICIT_CHARKEY&&(A=A[g])}}return D.length>0?E.assignOrPush(X,T,A):(E.options.explicitRoot&&(K=A,A={},A[T]=K),E.resultObject=A,E.saxParser.ended=!0,E.emit("end",E.resultObject))}}(this),N=function(E){return function(p){var C,R;if(R=D[D.length-1],R)return R[g]+=p,E.options.explicitChildren&&E.options.preserveChildrenOrder&&E.options.charsAsChildren&&(E.options.includeWhiteChars||p.replace(/\\n/g,"").trim()!=="")&&(R[E.options.childkey]=R[E.options.childkey]||[],C={"#name":"__text__"},C[g]=p,E.options.normalize&&(C[g]=C[g].replace(/\s{2,}/g," ").trim()),R[E.options.childkey].push(C)),R}}(this),this.saxParser.ontext=N,this.saxParser.oncdata=function(E){return function(p){var C;if(C=N(p),C)return C.cdata=!0}}(this)},S.prototype.parseString=function(O,g){var N;g!=null&&typeof g=="function"&&(this.on("end",function(D){return this.reset(),g(null,D)}),this.on("error",function(D){return this.reset(),g(D)}));try{return O=O.toString(),O.trim()===""?(this.emit("end",null),!0):(O=t.stripBOM(O),this.options.async?(this.remaining=O,u(this.processAsync),this.saxParser):this.saxParser.write(O).close())}catch(D){if(N=D,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw N}else return this.emit("error",N),this.saxParser.errThrown=!0}},S}(r.EventEmitter),gi.parseString=function(v,S,O){var g,N,D;return O!=null?(typeof O=="function"&&(g=O),typeof S=="object"&&(N=S)):(typeof S=="function"&&(g=S),N={}),D=new gi.Parser(N),D.parseString(v,g)}}).call(gi)});var oh=P(zr=>{(function(){"use strict";var t,e,r,i,n=s(function(a,u){for(var l in u)o.call(u,l)&&(a[l]=u[l]);function h(){this.constructor=a}return s(h,"ctor"),h.prototype=u.prototype,a.prototype=new h,a.__super__=u.prototype,a},"extend"),o={}.hasOwnProperty;e=wo(),t=rh(),r=sh(),i=Ga(),zr.defaults=e.defaults,zr.processors=i,zr.ValidationError=function(a){n(u,a);function u(l){this.message=l}return s(u,"ValidationError"),u}(Error),zr.Builder=t.Builder,zr.Parser=r.Parser,zr.parseString=r.parseString}).call(zr)});var dh=P((zM,fh)=>{var ah=V(),ls=ah.util,Bg=ah.Model.Shape,Ug=oh(),Vg={explicitCharkey:!1,trim:!1,normalize:!1,explicitRoot:!1,emptyTag:null,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,validator:null};function uh(){}s(uh,"NodeXmlParser");uh.prototype.parse=function(t,e){e=e||{};var r=null,i=null,n=new Ug.Parser(Vg);if(n.parseString(t,function(a,u){i=a,r=u}),r){var o=Er(r,e);return r.ResponseMetadata&&(o.ResponseMetadata=Er(r.ResponseMetadata[0],{})),o}else{if(i)throw ls.error(i,{code:"XMLParserError",retryable:!0});return Er({},e)}};function Er(t,e){switch(e.type){case"structure":return zg(t,e);case"map":return Hg(t,e);case"list":return ch(t,e);case void 0:case null:return jg(t);default:return lh(t,e)}}s(Er,"parseXml");function zg(t,e){var r={};return t===null||ls.each(e.members,function(i,n){var o=n.name;if(Object.prototype.hasOwnProperty.call(t,o)&&Array.isArray(t[o])){var a=t[o];n.flattened||(a=a[0]),r[i]=Er(a,n)}else n.isXmlAttribute&&t.$&&Object.prototype.hasOwnProperty.call(t.$,o)?r[i]=lh(t.$[o],n):n.type==="list"&&!e.api.xmlNoDefaultLists&&(r[i]=n.defaultValue)}),r}s(zg,"parseStructure");function Hg(t,e){var r={};if(t===null)return r;var i=e.key.name||"key",n=e.value.name||"value",o=e.flattened?t:t.entry;return Array.isArray(o)&&ls.arrayEach(o,function(a){r[a[i][0]]=Er(a[n][0],e.value)}),r}s(Hg,"parseMap");function ch(t,e){var r=[],i=e.member.name||"member";return e.flattened?ls.arrayEach(t,function(n){r.push(Er(n,e.member))}):t&&Array.isArray(t[i])&&ls.arrayEach(t[i],function(n){r.push(Er(n,e.member))}),r}s(ch,"parseList");function lh(t,e){return t&&t.$&&t.$.encoding==="base64"&&(e=new Bg.create({type:t.$.encoding})),t&&t._&&(t=t._),typeof e.toType=="function"?e.toType(t):t}s(lh,"parseScalar");function jg(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t)){var e=[];for(i=0;i<t.length;i++)e.push(Er(t[i],{}));return e}var r=Object.keys(t),i;if(r.length===0||r.length===1&&r[0]==="$")return{};var n={};for(i=0;i<r.length;i++){var o=r[i],a=t[o];o!=="$"&&(a.length>1?n[o]=ch(a,{member:{}}):n[o]=Er(a[0],{}))}return n}s(jg,"parseUnknown");fh.exports=uh});var ph=P(()=>{var Se=V(),Kg=Se.util.stream.Stream,hh=Se.util.stream.Transform,Xg=Se.util.stream.Readable;Gs();var Gg="AWS_NODEJS_CONNECTION_REUSE_ENABLED";Se.NodeHttpClient=Se.util.inherit({handleRequest:s(function(e,r,i,n){var o=this,a=e.endpoint,u="";r||(r={}),r.proxy&&(u=a.protocol+"//"+a.hostname,a.port!==80&&a.port!==443&&(u+=":"+a.port),a=new Se.Endpoint(r.proxy));var l=a.protocol==="https:",h=l?re("https"):re("http"),y={host:a.hostname,port:a.port,method:e.method,headers:e.headers,path:u+e.path};r.agent||(y.agent=this.getAgent(l,{keepAlive:process.env[Gg]==="1"})),Se.util.update(y,r),delete y.proxy,delete y.timeout;var v=h.request(y,function(g){v.didCallback||(i(g),g.emit("headers",g.statusCode,g.headers,g.statusMessage))});if(e.stream=v,v.didCallback=!1,r.connectTimeout){var S;v.on("socket",function(g){g.connecting&&(S=setTimeout(s(function(){v.didCallback||(v.didCallback=!0,v.abort(),n(Se.util.error(new Error("Socket timed out without establishing a connection"),{code:"TimeoutError"})))},"connectTimeout"),r.connectTimeout),g.on("connect",function(){clearTimeout(S),S=null}))})}v.setTimeout(r.timeout||0,function(){if(!v.didCallback){v.didCallback=!0;var g="Connection timed out after "+r.timeout+"ms";n(Se.util.error(new Error(g),{code:"TimeoutError"})),v.abort()}}),v.on("error",function(g){S&&(clearTimeout(S),S=null),!v.didCallback&&(v.didCallback=!0,g.code==="ECONNRESET"||g.code==="EPIPE"||g.code==="ETIMEDOUT"?n(Se.util.error(g,{code:"TimeoutError"})):n(g))});var O=e.headers.Expect||e.headers.expect;return O==="100-continue"?v.once("continue",function(){o.writeBody(v,e)}):this.writeBody(v,e),v},"handleRequest"),writeBody:s(function(e,r){var i=r.body,n=parseInt(r.headers["Content-Length"],10);if(i instanceof Kg){var o=this.progressStream(e,n);o?i.pipe(o).pipe(e):i.pipe(e)}else i?(e.once("finish",function(){e.emit("sendProgress",{loaded:n,total:n})}),e.end(i)):e.end()},"writeBody"),getAgent:s(function(e,r){var i=e?re("https"):re("http");return e?(Se.NodeHttpClient.sslAgent||(Se.NodeHttpClient.sslAgent=new i.Agent(Se.util.merge({rejectUnauthorized:process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"},r||{})),Se.NodeHttpClient.sslAgent.setMaxListeners(0),Object.defineProperty(Se.NodeHttpClient.sslAgent,"maxSockets",{enumerable:!0,get:function(){var n=50,o=i.globalAgent;return o&&o.maxSockets!==1/0&&typeof o.maxSockets=="number"?o.maxSockets:n}})),Se.NodeHttpClient.sslAgent):(Se.NodeHttpClient.agent||(Se.NodeHttpClient.agent=new i.Agent(r)),Se.NodeHttpClient.agent)},"getAgent"),progressStream:s(function(e,r){if(!(typeof hh>"u")){var i=0,n=new hh;return n._transform=function(o,a,u){o&&(i+=o.length,e.emit("sendProgress",{loaded:i,total:r})),u(null,o)},n}},"progressStream"),emitter:null});Se.HttpClient.prototype=Se.NodeHttpClient.prototype;Se.HttpClient.streamsApiVersion=Xg?2:1});var mh=P(()=>{var St=V(),Jg=re("fs"),$g=Vr(),Yg=St.util.iniLoader;St.TokenFileWebIdentityCredentials=St.util.inherit(St.Credentials,{constructor:s(function(e){St.Credentials.call(this),this.data=null,this.clientConfig=St.util.copy(e||{})},"TokenFileWebIdentityCredentials"),getParamsFromEnv:s(function(){var e="AWS_WEB_IDENTITY_TOKEN_FILE",r="AWS_ROLE_ARN";if(process.env[e]&&process.env[r])return[{envTokenFile:process.env[e],roleArn:process.env[r],roleSessionName:process.env.AWS_ROLE_SESSION_NAME}]},"getParamsFromEnv"),getParamsFromSharedConfig:s(function(){var e=St.util.getProfilesFromSharedConfig(Yg),r=process.env.AWS_PROFILE||St.util.defaultProfile,i=e[r]||{};if(Object.keys(i).length===0)throw St.util.error(new Error("Profile "+r+" not found"),{code:"TokenFileWebIdentityCredentialsProviderFailure"});for(var n=[];!i.web_identity_token_file&&i.source_profile;){n.unshift({roleArn:i.role_arn,roleSessionName:i.role_session_name});var o=i.source_profile;i=e[o]}return n.unshift({envTokenFile:i.web_identity_token_file,roleArn:i.role_arn,roleSessionName:i.role_session_name}),n},"getParamsFromSharedConfig"),refresh:s(function(e){this.coalesceRefresh(e||St.util.fn.callback)},"refresh"),assumeRoleChaining:s(function(e,r){var i=this;if(e.length===0)i.service.credentialsFrom(i.data,i),r();else{var n=e.shift();i.service.config.credentials=i.service.credentialsFrom(i.data,i),i.service.assumeRole({RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(o,a){i.data=null,o?r(o):(i.data=a,i.assumeRoleChaining(e,r))})}},"assumeRoleChaining"),load:s(function(e){var r=this;try{var i=r.getParamsFromEnv();if(i||(i=r.getParamsFromSharedConfig()),i){var n=i.shift(),o=Jg.readFileSync(n.envTokenFile,{encoding:"ascii"});r.service||r.createClients(),r.service.assumeRoleWithWebIdentity({WebIdentityToken:o,RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(a,u){r.data=null,a?e(a):(r.data=u,r.assumeRoleChaining(i,e))})}}catch(a){e(a)}},"load"),createClients:function(){if(!this.service){var t=St.util.merge({},this.clientConfig);this.service=new $g(t),this.service.retryableError=function(e){return e.code==="IDPCommunicationErrorException"||e.code==="InvalidIdentityToken"?!0:St.Service.prototype.retryableError.call(this,e)}}}})});var vh=P((YM,yh)=>{var Qg=s(function(){return{IPv4:"http://169.254.169.254",IPv6:"http://[fd00:ec2::254]"}},"getEndpoint");yh.exports=Qg});var Ja=P((ZM,gh)=>{var Zg=s(function(){return{IPv4:"IPv4",IPv6:"IPv6"}},"getEndpointMode");gh.exports=Zg});var wh=P((tF,Nh)=>{var eN="AWS_EC2_METADATA_SERVICE_ENDPOINT",tN="ec2_metadata_service_endpoint",rN=s(function(){return{environmentVariableSelector:function(t){return t[eN]},configFileSelector:function(t){return t[tN]},default:void 0}},"getEndpointConfigOptions");Nh.exports=rN});var Eh=P((iF,xh)=>{var iN=Ja()(),nN="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",sN="ec2_metadata_service_endpoint_mode",oN=s(function(){return{environmentVariableSelector:function(t){return t[nN]},configFileSelector:function(t){return t[sN]},default:iN.IPv4}},"getEndpointModeConfigOptions");xh.exports=oN});var Ah=P((sF,bh)=>{var Ch=V(),Sh=vh()(),Th=Ja()(),aN=wh()(),uN=Eh()(),cN=s(function(){var t=Ch.util.loadConfig(aN);if(t!==void 0)return t;var e=Ch.util.loadConfig(uN);switch(e){case Th.IPv4:return Sh.IPv4;case Th.IPv6:return Sh.IPv6;default:throw new Error("Unsupported endpoint mode: "+e)}},"getMetadataServiceEndpoint");bh.exports=cN});var Rh=P((aF,Oh)=>{var Wt=V();Gs();var lN=Wt.util.inherit,fN=Ah(),Ih=re("url").URL;Wt.MetadataService=lN({endpoint:fN(),httpOptions:{timeout:0},disableFetchToken:!1,constructor:s(function(e){e&&e.host&&(e.endpoint="http://"+e.host,delete e.host),Wt.util.update(this,e)},"MetadataService"),request:s(function(e,r,i){if(arguments.length===2&&(i=r,r={}),process.env[Wt.util.imdsDisabledEnv]){i(new Error("EC2 Instance Metadata Service access disabled"));return}e=e||"/",Ih&&new Ih(this.endpoint);var n=new Wt.HttpRequest(this.endpoint+e);n.method=r.method||"GET",r.headers&&(n.headers=r.headers),Wt.util.handleRequestWithRetries(n,this,i)},"request"),loadCredentialsCallbacks:[],fetchMetadataToken:s(function(e){var r=this,i="/latest/api/token";r.request(i,{method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}},e)},"fetchMetadataToken"),fetchCredentials:s(function(e,r){var i=this,n="/latest/meta-data/iam/security-credentials/";i.request(n,e,function(o,a){if(o){i.disableFetchToken=o.statusCode!==401,r(Wt.util.error(o,{message:"EC2 Metadata roleName request returned error"}));return}a=a.split(`
|
|
28
|
+
`)[0],i.request(n+a,e,function(u,l){if(u){i.disableFetchToken=u.statusCode!==401,r(Wt.util.error(u,{message:"EC2 Metadata creds request returned error"}));return}try{var h=JSON.parse(l);r(null,h)}catch(y){r(y)}})})},"fetchCredentials"),loadCredentials:s(function(e){var r=this;if(r.loadCredentialsCallbacks.push(e),r.loadCredentialsCallbacks.length>1)return;function i(n,o){for(var a;(a=r.loadCredentialsCallbacks.shift())!==void 0;)a(n,o)}s(i,"callbacks"),r.disableFetchToken?r.fetchCredentials({},i):r.fetchMetadataToken(function(n,o){if(n){if(n.code==="TimeoutError")r.disableFetchToken=!0;else if(n.retryable===!0){i(Wt.util.error(n,{message:"EC2 Metadata token request returned error"}));return}else if(n.statusCode===400){i(Wt.util.error(n,{message:"EC2 Metadata token request returned 400"}));return}}var a={};o&&(a.headers={"x-aws-ec2-metadata-token":o}),r.fetchCredentials(a,i)})},"loadCredentials")});Oh.exports=Wt.MetadataService});var Dh=P(()=>{var gt=V();Rh();gt.EC2MetadataCredentials=gt.util.inherit(gt.Credentials,{constructor:s(function(e){gt.Credentials.call(this),e=e?gt.util.copy(e):{},e=gt.util.merge({maxRetries:this.defaultMaxRetries},e),e.httpOptions||(e.httpOptions={}),e.httpOptions=gt.util.merge({timeout:this.defaultTimeout,connectTimeout:this.defaultConnectTimeout},e.httpOptions),this.metadataService=new gt.MetadataService(e),this.logger=e.logger||gt.config&>.config.logger},"EC2MetadataCredentials"),defaultTimeout:1e3,defaultConnectTimeout:1e3,defaultMaxRetries:3,originalExpiration:void 0,refresh:s(function(e){this.coalesceRefresh(e||gt.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.metadataService.loadCredentials(function(i,n){i?r.hasLoadedCredentials()?(r.extendExpirationIfExpired(),e()):e(i):(r.setCredentials(n),r.extendExpirationIfExpired(),e())})},"load"),hasLoadedCredentials:s(function(){return this.AccessKeyId&&this.secretAccessKey},"hasLoadedCredentials"),extendExpirationIfExpired:s(function(){if(this.needsRefresh()){this.originalExpiration=this.originalExpiration||this.expireTime,this.expired=!1;var e=15*60+Math.floor(Math.random()*5*60),r=gt.util.date.getDate().getTime();this.expireTime=new Date(r+e*1e3),this.logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again at "+this.expireTime+`
|
|
29
|
+
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`)}},"extendExpirationIfExpired"),setCredentials:s(function(e){var r=gt.util.date.getDate().getTime(),i=new Date(e.Expiration);this.expired=r>=i,this.metadata=e,this.accessKeyId=e.AccessKeyId,this.secretAccessKey=e.SecretAccessKey,this.sessionToken=e.Token,this.expireTime=i},"setCredentials")})});var kh=P(()=>{var Xe=V(),$a="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Co="AWS_CONTAINER_CREDENTIALS_FULL_URI",dN="AWS_CONTAINER_AUTHORIZATION_TOKEN",hN=["https:"],Ph=["http:","https:"],_h=["localhost","127.0.0.1"],pN="169.254.170.2";Xe.RemoteCredentials=Xe.util.inherit(Xe.Credentials,{constructor:s(function(e){Xe.Credentials.call(this),e=e?Xe.util.copy(e):{},e.httpOptions||(e.httpOptions={}),e.httpOptions=Xe.util.merge(this.httpOptions,e.httpOptions),Xe.util.update(this,e)},"RemoteCredentials"),httpOptions:{timeout:1e3},maxRetries:3,isConfiguredForEcsCredentials:s(function(){return Boolean(process&&process.env&&(process.env[$a]||process.env[Co]))},"isConfiguredForEcsCredentials"),getECSFullUri:s(function(){if(process&&process.env){var e=process.env[$a],r=process.env[Co];if(e)return"http://"+pN+e;if(r){var i=Xe.util.urlParse(r);if(Ph.indexOf(i.protocol)<0)throw Xe.util.error(new Error("Unsupported protocol: AWS.RemoteCredentials supports "+Ph.join(",")+" only; "+i.protocol+" requested."),{code:"ECSCredentialsProviderFailure"});if(hN.indexOf(i.protocol)<0&&_h.indexOf(i.hostname)<0)throw Xe.util.error(new Error("Unsupported hostname: AWS.RemoteCredentials only supports "+_h.join(",")+" for "+i.protocol+"; "+i.protocol+"//"+i.hostname+" requested."),{code:"ECSCredentialsProviderFailure"});return r}else throw Xe.util.error(new Error("Variable "+$a+" or "+Co+" must be set to use AWS.RemoteCredentials."),{code:"ECSCredentialsProviderFailure"})}else throw Xe.util.error(new Error("No process info available"),{code:"ECSCredentialsProviderFailure"})},"getECSFullUri"),getECSAuthToken:s(function(){if(process&&process.env&&process.env[Co])return process.env[dN]},"getECSAuthToken"),credsFormatIsValid:s(function(e){return!!e.accessKeyId&&!!e.secretAccessKey&&!!e.sessionToken&&!!e.expireTime},"credsFormatIsValid"),formatCreds:s(function(e){return e.credentials&&(e=e.credentials),{expired:!1,accessKeyId:e.accessKeyId||e.AccessKeyId,secretAccessKey:e.secretAccessKey||e.SecretAccessKey,sessionToken:e.sessionToken||e.Token,expireTime:new Date(e.expiration||e.Expiration)}},"formatCreds"),request:s(function(e,r){var i=new Xe.HttpRequest(e);i.method="GET",i.headers.Accept="application/json";var n=this.getECSAuthToken();n&&(i.headers.Authorization=n),Xe.util.handleRequestWithRetries(i,this,r)},"request"),refresh:s(function(e){this.coalesceRefresh(e||Xe.util.fn.callback)},"refresh"),load:s(function(e){var r=this,i;try{i=this.getECSFullUri()}catch(n){e(n);return}this.request(i,function(n,o){if(!n)try{o=JSON.parse(o);var a=r.formatCreds(o);if(!r.credsFormatIsValid(a))throw Xe.util.error(new Error("Response data is not in valid format"),{code:"ECSCredentialsProviderFailure"});Xe.util.update(r,a)}catch(u){n=u}e(n,a)})},"load")})});var Lh=P(()=>{var qh=V();qh.ECSCredentials=qh.RemoteCredentials});var Mh=P(()=>{var Hr=V();Hr.EnvironmentCredentials=Hr.util.inherit(Hr.Credentials,{constructor:s(function(e){Hr.Credentials.call(this),this.envPrefix=e,this.get(function(){})},"EnvironmentCredentials"),refresh:s(function(e){if(e||(e=Hr.util.fn.callback),!process||!process.env){e(Hr.util.error(new Error("No process info or environment variables available"),{code:"EnvironmentCredentialsProviderFailure"}));return}for(var r=["ACCESS_KEY_ID","SECRET_ACCESS_KEY","SESSION_TOKEN"],i=[],n=0;n<r.length;n++){var o="";if(this.envPrefix&&(o=this.envPrefix+"_"),i[n]=process.env[o+r[n]],!i[n]&&r[n]!=="SESSION_TOKEN"){e(Hr.util.error(new Error("Variable "+o+r[n]+" not set."),{code:"EnvironmentCredentialsProviderFailure"}));return}}this.expired=!1,Hr.Credentials.apply(this,i),e()},"refresh")})});var Fh=P(()=>{var jr=V();jr.FileSystemCredentials=jr.util.inherit(jr.Credentials,{constructor:s(function(e){jr.Credentials.call(this),this.filename=e,this.get(function(){})},"FileSystemCredentials"),refresh:s(function(e){e||(e=jr.util.fn.callback);try{var r=JSON.parse(jr.util.readFileSync(this.filename));if(jr.Credentials.call(this,r),!this.accessKeyId||!this.secretAccessKey)throw jr.util.error(new Error("Credentials not set in "+this.filename),{code:"FileSystemCredentialsProviderFailure"});this.expired=!1,e()}catch(i){e(i)}},"refresh")})});var Bh=P(()=>{var Ge=V(),mN=Vr(),Wh=Ge.util.iniLoader,yN="us-east-1";Ge.SharedIniFileCredentials=Ge.util.inherit(Ge.Credentials,{constructor:s(function(e){Ge.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Ge.util.defaultProfile,this.disableAssumeRole=Boolean(e.disableAssumeRole),this.preferStaticCredentials=Boolean(e.preferStaticCredentials),this.tokenCodeFn=e.tokenCodeFn||null,this.httpOptions=e.httpOptions||null,this.get(e.callback||Ge.util.fn.noop)},"SharedIniFileCredentials"),load:s(function(e){var r=this;try{var i=Ge.util.getProfilesFromSharedConfig(Wh,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Ge.util.error(new Error("Profile "+this.profile+" not found"),{code:"SharedIniFileCredentialsProviderFailure"});var o=Boolean(this.preferStaticCredentials&&n.aws_access_key_id&&n.aws_secret_access_key);if(n.role_arn&&!o){this.loadRoleProfile(i,n,function(a,u){a?e(a):(r.expired=!1,r.accessKeyId=u.Credentials.AccessKeyId,r.secretAccessKey=u.Credentials.SecretAccessKey,r.sessionToken=u.Credentials.SessionToken,r.expireTime=u.Credentials.Expiration,e(null))});return}if(this.accessKeyId=n.aws_access_key_id,this.secretAccessKey=n.aws_secret_access_key,this.sessionToken=n.aws_session_token,!this.accessKeyId||!this.secretAccessKey)throw Ge.util.error(new Error("Credentials not set for profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});this.expired=!1,e(null)}catch(a){e(a)}},"load"),refresh:s(function(e){Wh.clearCachedFiles(),this.coalesceRefresh(e||Ge.util.fn.callback,this.disableAssumeRole)},"refresh"),loadRoleProfile:s(function(e,r,i){if(this.disableAssumeRole)throw Ge.util.error(new Error("Role assumption profiles are disabled. Failed to load profile "+this.profile+" from "+e.filename),{code:"SharedIniFileCredentialsProviderFailure"});var n=this,o=r.role_arn,a=r.role_session_name,u=r.external_id,l=r.mfa_serial,h=r.source_profile,y=r.region||yN;if(!h)throw Ge.util.error(new Error("source_profile is not set using profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});var v=e[h];if(typeof v!="object")throw Ge.util.error(new Error("source_profile "+h+" using profile "+this.profile+" does not exist"),{code:"SharedIniFileCredentialsProviderFailure"});var S=new Ge.SharedIniFileCredentials(Ge.util.merge(this.options||{},{profile:h,preferStaticCredentials:!0}));this.roleArn=o;var O=new mN({credentials:S,region:y,httpOptions:this.httpOptions}),g={RoleArn:o,RoleSessionName:a||"aws-sdk-js-"+Date.now()};if(u&&(g.ExternalId=u),l&&n.tokenCodeFn){g.SerialNumber=l,n.tokenCodeFn(l,function(N,D){if(N){var E;N instanceof Error?E=N.message:E=N,i(Ge.util.error(new Error("Error fetching MFA token: "+E),{code:"SharedIniFileCredentialsProviderFailure"}));return}g.TokenCode=D,O.assumeRole(g,i)});return}O.assumeRole(g,i)},"loadRoleProfile")})});var Uh=P(()=>{var Re=V(),vN=re("path"),gN=re("crypto"),Ya=Re.util.iniLoader;Re.SsoCredentials=Re.util.inherit(Re.Credentials,{constructor:s(function(e){Re.Credentials.call(this),e=e||{},this.errorCode="SsoCredentialsProviderFailure",this.expired=!0,this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Re.util.defaultProfile,this.service=e.ssoClient,this.httpOptions=e.httpOptions||null,this.get(e.callback||Re.util.fn.noop)},"SsoCredentials"),load:s(function(e){var r=this;try{var i=Re.util.getProfilesFromSharedConfig(Ya,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Re.util.error(new Error("Profile "+this.profile+" not found"),{code:r.errorCode});if(n.sso_session){if(!n.sso_account_id||!n.sso_role_name)throw Re.util.error(new Error("Profile "+this.profile+" with session "+n.sso_session+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", "sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:r.errorCode})}else if(!n.sso_start_url||!n.sso_account_id||!n.sso_region||!n.sso_role_name)throw Re.util.error(new Error("Profile "+this.profile+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:r.errorCode});this.getToken(this.profile,n,function(o,a){if(o)return e(o);var u={accessToken:a,accountId:n.sso_account_id,roleName:n.sso_role_name};(!r.service||r.service.config.region!==n.sso_region)&&(r.service=new Re.SSO({region:n.sso_region,httpOptions:r.httpOptions})),r.service.getRoleCredentials(u,function(l,h){if(l||!h||!h.roleCredentials)e(Re.util.error(l||new Error('Please log in using "aws sso login"'),{code:r.errorCode}),null);else{if(!h.roleCredentials.accessKeyId||!h.roleCredentials.secretAccessKey||!h.roleCredentials.sessionToken||!h.roleCredentials.expiration)throw Re.util.error(new Error("SSO returns an invalid temporary credential."));r.expired=!1,r.accessKeyId=h.roleCredentials.accessKeyId,r.secretAccessKey=h.roleCredentials.secretAccessKey,r.sessionToken=h.roleCredentials.sessionToken,r.expireTime=new Date(h.roleCredentials.expiration),e(null)}})})}catch(o){e(o)}},"load"),getToken:s(function(e,r,i){var n=this;if(r.sso_session){var o=Re.util.iniLoader,a=o.loadSsoSessionsFrom(),u=a[r.sso_session];Object.assign(r,u);var l=new Re.SSOTokenProvider({profile:e});l.load(function(N){return N?i(N):i(null,l.token)});return}try{var h=9e5,y=gN.createHash("sha1"),v=y.update(r.sso_start_url).digest("hex")+".json",S=vN.join(Ya.getHomeDir(),".aws","sso","cache",v),O=Re.util.readFileSync(S),g=null;if(O&&(g=JSON.parse(O)),!g)throw Re.util.error(new Error("Cached credentials not found under "+this.profile+" profile. Please make sure you log in with aws sso login first"),{code:n.errorCode});if(!g.startUrl||!g.region||!g.accessToken||!g.expiresAt)throw Re.util.error(new Error("Cached credentials are missing required properties. Try running aws sso login."));if(new Date(g.expiresAt).getTime()-Date.now()<=h)throw Re.util.error(new Error("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile."));return i(null,g.accessToken)}catch(N){return i(N,null)}},"getToken"),refresh:s(function(e){Ya.clearCachedFiles(),this.coalesceRefresh(e||Re.util.fn.callback)},"refresh")})});var Vh=P(()=>{var Tt=V();Tt.Token=Tt.util.inherit({constructor:s(function(e){if(Tt.util.hideProperties(this,["token"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1){var e=arguments[0];this.token=e.token,this.expireTime=e.expireTime}},"Token"),expiryWindow:15,needsRefresh:s(function(){var e=Tt.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.token},"needsRefresh"),get:s(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:s(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:s(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(s(function(o){Tt.util.arrayEach(i.refreshCallbacks,function(a){r?a(o):Tt.util.defer(function(){a(o)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:s(function(e){e()},"load")});Tt.Token.addPromisesToClass=s(function(e){this.prototype.getPromise=Tt.util.promisifyMethod("get",e),this.prototype.refreshPromise=Tt.util.promisifyMethod("refresh",e)},"addPromisesToClass");Tt.Token.deletePromisesFromClass=s(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Tt.util.addPromises(Tt.Token)});var zh=P(()=>{var Bt=V();Bt.TokenProviderChain=Bt.util.inherit(Bt.Token,{constructor:s(function(e){e?this.providers=e:this.providers=Bt.TokenProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"TokenProviderChain"),resolve:s(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Bt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var o=a;s(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Bt.TokenProviderChain.defaultProviders=[];Bt.TokenProviderChain.addPromisesToClass=s(function(e){this.prototype.resolvePromise=Bt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Bt.TokenProviderChain.deletePromisesFromClass=s(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Bt.util.addPromises(Bt.TokenProviderChain)});var Kh=P(()=>{var Me=V(),NN=re("crypto"),Hh=re("fs"),wN=re("path"),So=Me.util.iniLoader,jh=0,Ni=s(function(e,r){if(!e[r])throw Me.util.error(new Error('Key "'+r+'" not present in SSO Token'),{code:"SSOTokenProviderFailure"})},"validateTokenKey"),Qa=s(function(e,r,i){if(r>e)i(null);else throw Me.util.error(new Error('SSO Token refresh failed. Please log in using "aws sso login"'),{code:"SSOTokenProviderFailure"})},"refreshUnsuccessful");Me.SSOTokenProvider=Me.util.inherit(Me.Token,{expiryWindow:5*60,constructor:s(function(e){Me.Token.call(this),e=e||{},this.expired=!0,this.profile=e.profile||process.env.AWS_PROFILE||Me.util.defaultProfile,this.get(e.callback||Me.util.fn.noop)},"SSOTokenProvider"),load:s(function(e){var r=this,i=So.loadFrom({isConfig:!0}),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Me.util.error(new Error('Profile "'+this.profile+'" not found'),{code:"SSOTokenProviderFailure"});if(!n.sso_session)throw Me.util.error(new Error('Profile "'+profileName+'" is missing required property "sso_session".'),{code:"SSOTokenProviderFailure"});var o=n.sso_session,a=So.loadSsoSessionsFrom(),u=a[o];if(u)if(u.sso_start_url){if(!u.sso_region)throw Me.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_region".'),{code:"SSOTokenProviderFailure"})}else throw Me.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_start_url".'),{code:"SSOTokenProviderFailure"});else throw Me.util.error(new Error('Sso session "'+o+'" not found'),{code:"SSOTokenProviderFailure"});var l=NN.createHash("sha1"),h=l.update(o).digest("hex")+".json",y=wN.join(So.getHomeDir(),".aws","sso","cache",h),v=JSON.parse(Hh.readFileSync(y));if(!v)throw Me.util.error(new Error('Cached token not found. Please log in using "aws sso login" for profile "'+this.profile+'".'),{code:"SSOTokenProviderFailure"});Ni(v,"accessToken"),Ni(v,"expiresAt");var S=Me.util.date.getDate().getTime(),O=new Date(S+this.expiryWindow*1e3),g=new Date(v.expiresAt);if(g>O){r.token=v.accessToken,r.expireTime=g,r.expired=!1,e(null);return}if(S-jh<30*1e3){Qa(S,g,e);return}Ni(v,"clientId"),Ni(v,"clientSecret"),Ni(v,"refreshToken"),(!r.service||r.service.config.region!==u.sso_region)&&(r.service=new Me.SSOOIDC({region:u.sso_region}));var N={clientId:v.clientId,clientSecret:v.clientSecret,refreshToken:v.refreshToken,grantType:"refresh_token"};jh=Me.util.date.getDate().getTime(),r.service.createToken(N,function(D,E){if(D||!E)Qa(S,g,e);else try{Ni(E,"accessToken"),Ni(E,"expiresIn"),r.expired=!1,r.token=E.accessToken,r.expireTime=new Date(Date.now()+E.expiresIn*1e3),e(null);try{v.accessToken=E.accessToken,v.expiresAt=r.expireTime.toISOString(),v.refreshToken=E.refreshToken,Hh.writeFileSync(y,JSON.stringify(v,null,2))}catch{}}catch{Qa(S,g,e)}})},"load"),refresh:s(function(e){So.clearCachedFiles(),this.coalesceRefresh(e||Me.util.fn.callback)},"refresh")})});var go=P((FF,Jh)=>{var Te=Oe(),Gh=xa(),xN=Gh.isFipsRegion,EN=Gh.getRealRegion;Te.isBrowser=function(){return!1};Te.isNode=function(){return!0};Te.crypto.lib=re("crypto");Te.Buffer=re("buffer").Buffer;Te.domain=re("domain");Te.stream=re("stream");Te.url=re("url");Te.querystring=re("querystring");Te.environment="nodejs";Te.createEventStream=Te.stream.Readable?Of().createEventStream:_f().createEventStream;Te.realClock=qf();Te.clientSideMonitoring={Publisher:Mf().Publisher,configProvider:Bf()};Te.iniLoader=jf().iniLoader;Te.getSystemErrorName=re("util").getSystemErrorName;Te.loadConfig=function(t){var e=t.environmentVariableSelector(process.env);if(e!==void 0)return e;var r={};try{r=Te.iniLoader?Te.iniLoader.loadFrom({isConfig:!0,filename:process.env[Te.sharedConfigFileEnv]}):{}}catch{}var i=r[process.env.AWS_PROFILE||Te.defaultProfile]||{},n=t.configFileSelector(i);return n!==void 0?n:typeof t.default=="function"?t.default():t.default};var fe;Jh.exports=fe=V();Ca();Sa();Zf();ed();td();ad();ud();Ua();fe.XML.Parser=dh();ph();Wa();mh();Dh();kh();Lh();Mh();Fh();Bh();Ua();Uh();fe.CredentialProviderChain.defaultProviders=[function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SsoCredentials},function(){return new fe.SharedIniFileCredentials},function(){return new fe.ECSCredentials},function(){return new fe.ProcessCredentials},function(){return new fe.TokenFileWebIdentityCredentials},function(){return new fe.EC2MetadataCredentials}];Vh();zh();Kh();fe.TokenProviderChain.defaultProviders=[function(){return new fe.SSOTokenProvider}];var Xh=s(function(){var t=process.env,e=t.AWS_REGION||t.AMAZON_REGION;if(t[fe.util.configOptInEnv])for(var r=[{filename:t[fe.util.sharedCredentialsFileEnv]},{isConfig:!0,filename:t[fe.util.sharedConfigFileEnv]}],i=fe.util.iniLoader;!e&&r.length;){var n={},o=r.shift();try{n=i.loadFrom(o)}catch(u){if(o.isConfig)throw u}var a=n[t.AWS_PROFILE||fe.util.defaultProfile];e=a&&a.region}return e},"getRegion"),To=s(function(t){return t==="true"?!0:t==="false"?!1:void 0},"getBooleanValue"),CN={environmentVariableSelector:function(t){return To(t.AWS_USE_FIPS_ENDPOINT)},configFileSelector:function(t){return To(t.use_fips_endpoint)},default:!1},SN={environmentVariableSelector:function(t){return To(t.AWS_USE_DUALSTACK_ENDPOINT)},configFileSelector:function(t){return To(t.use_dualstack_endpoint)},default:!1};fe.util.update(fe.Config.prototype.keys,{credentials:function(){var t=null;return new fe.CredentialProviderChain([function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SharedIniFileCredentials({disableAssumeRole:!0})}]).resolve(function(e,r){e||(t=r)}),t},credentialProvider:function(){return new fe.CredentialProviderChain},logger:function(){return process.env.AWSJS_DEBUG?console:null},region:function(){var t=Xh();return t?EN(t):void 0},tokenProvider:function(){return new fe.TokenProviderChain},useFipsEndpoint:function(){var t=Xh();return xN(t)?!0:Te.loadConfig(CN)},useDualstackEndpoint:function(){return Te.loadConfig(SN)}});fe.config=new fe.Config});var $h=P(()=>{var Za=V();Za.util.update(Za.RDSDataService.prototype,{retryableError:s(function(e){if(e.code==="BadRequestException"&&e.message&&e.message.match(/^Communications link failure/)&&e.statusCode===400)return!0;var r=Za.Service.prototype.retryableError;return r.call(this,e)},"retryableError")})});var Yh=P((zF,TN)=>{TN.exports={version:"2.0",metadata:{apiVersion:"2018-08-01",endpointPrefix:"rds-data",jsonVersion:"1.1",protocol:"rest-json",serviceFullName:"AWS RDS DataService",serviceId:"RDS Data",signatureVersion:"v4",signingName:"rds-data",uid:"rds-data-2018-08-01"},operations:{BatchExecuteStatement:{http:{requestUri:"/BatchExecute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameterSets:{type:"list",member:{shape:"S6"}},transactionId:{}}},output:{type:"structure",members:{updateResults:{type:"list",member:{type:"structure",members:{generatedFields:{shape:"Sq"}}}}}}},BeginTransaction:{http:{requestUri:"/BeginTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn"],members:{resourceArn:{},secretArn:{},database:{},schema:{}}},output:{type:"structure",members:{transactionId:{}}}},CommitTransaction:{http:{requestUri:"/CommitTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}},ExecuteSql:{http:{requestUri:"/ExecuteSql",responseCode:200},input:{type:"structure",required:["dbClusterOrInstanceArn","awsSecretStoreArn","sqlStatements"],members:{dbClusterOrInstanceArn:{},awsSecretStoreArn:{},sqlStatements:{},database:{},schema:{}}},output:{type:"structure",members:{sqlStatementResults:{type:"list",member:{type:"structure",members:{resultFrame:{type:"structure",members:{resultSetMetadata:{type:"structure",members:{columnCount:{type:"long"},columnMetadata:{shape:"S13"}}},records:{type:"list",member:{type:"structure",members:{values:{type:"list",member:{shape:"S1a"}}}}}}},numberOfRecordsUpdated:{type:"long"}}}}}},deprecated:!0,deprecatedMessage:"The ExecuteSql API is deprecated, please use the ExecuteStatement API."},ExecuteStatement:{http:{requestUri:"/Execute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameters:{shape:"S6"},transactionId:{},includeResultMetadata:{type:"boolean"},continueAfterTimeout:{type:"boolean"},resultSetOptions:{type:"structure",members:{decimalReturnType:{},longReturnType:{}}},formatRecordsAs:{}}},output:{type:"structure",members:{records:{type:"list",member:{shape:"Sq"}},columnMetadata:{shape:"S13"},numberOfRecordsUpdated:{type:"long"},generatedFields:{shape:"Sq"},formattedRecords:{}}}},RollbackTransaction:{http:{requestUri:"/RollbackTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}}},shapes:{S6:{type:"list",member:{type:"structure",members:{name:{},value:{shape:"S9"},typeHint:{}}}},S9:{type:"structure",members:{isNull:{type:"boolean"},booleanValue:{type:"boolean"},longValue:{type:"long"},doubleValue:{type:"double"},stringValue:{},blobValue:{type:"blob"},arrayValue:{shape:"Sf"}},union:!0},Sf:{type:"structure",members:{booleanValues:{type:"list",member:{type:"boolean"}},longValues:{type:"list",member:{type:"long"}},doubleValues:{type:"list",member:{type:"double"}},stringValues:{type:"list",member:{}},arrayValues:{type:"list",member:{shape:"Sf"}}},union:!0},Sq:{type:"list",member:{shape:"S9"}},S13:{type:"list",member:{type:"structure",members:{name:{},type:{type:"integer"},typeName:{},label:{},schemaName:{},tableName:{},isAutoIncrement:{type:"boolean"},isSigned:{type:"boolean"},isCurrency:{type:"boolean"},isCaseSensitive:{type:"boolean"},nullable:{type:"integer"},precision:{type:"integer"},scale:{type:"integer"},arrayBaseColumnType:{type:"integer"}}}},S1a:{type:"structure",members:{isNull:{type:"boolean"},bitValue:{type:"boolean"},bigIntValue:{type:"long"},intValue:{type:"integer"},doubleValue:{type:"double"},realValue:{type:"float"},stringValue:{},blobValue:{type:"blob"},arrayValues:{shape:"S1d"},structValue:{type:"structure",members:{attributes:{shape:"S1d"}}}},union:!0},S1d:{type:"list",member:{shape:"S1a"}}}}});var Qh=P((HF,bN)=>{bN.exports={pagination:{}}});var tp=P((jF,ep)=>{go();var bo=V(),AN=bo.Service,Zh=bo.apiLoader;Zh.services.rdsdataservice={};bo.RDSDataService=AN.defineService("rdsdataservice",["2018-08-01"]);$h();Object.defineProperty(Zh.services.rdsdataservice,"2018-08-01",{get:s(function(){var e=Yh();return e.paginators=Qh().pagination,e},"get"),enumerable:!0,configurable:!0});ep.exports=bo.RDSDataService});import IN from"path";function au(t){return t===void 0}s(au,"isUndefined");function Ze(t){return typeof t=="string"}s(Ze,"isString");function uu(t){return typeof t=="number"}s(uu,"isNumber");function ds(t){return typeof t=="boolean"}s(ds,"isBoolean");function hs(t){return t===null}s(hs,"isNull");function cu(t){return t instanceof Date}s(cu,"isDate");function lu(t){return typeof t=="bigint"}s(lu,"isBigInt");function dt(t){return typeof t=="function"}s(dt,"isFunction");function ht(t){return typeof t=="object"&&t!==null}s(ht,"isObject");function fu(t){return t[t.length-1]}s(fu,"getLast");function c(t){return Object.freeze(t)}s(c,"freeze");function Ir(t){return Array.isArray(t)}s(Ir,"isReadonlyArray");function Or(t){return t}s(Or,"noop");var Q=c({is(t){return t.kind==="IdentifierNode"},create(t){return c({kind:"IdentifierNode",name:t})}});var st=c({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return c({kind:"SchemableIdentifierNode",identifier:Q.create(t)})},createWithSchema(t,e){return c({kind:"SchemableIdentifierNode",schema:Q.create(t),identifier:Q.create(e)})}});var ot=c({is(t){return t.kind==="TableNode"},create(t){return c({kind:"TableNode",table:st.create(t)})},createWithSchema(t,e){return c({kind:"TableNode",table:st.createWithSchema(t,e)})}});var he=c({is(t){return t.kind==="AlterTableNode"},create(t){return c({kind:"AlterTableNode",table:ot.create(t)})},cloneWithTableProps(t,e){return c({...t,...e})},cloneWithColumnAlteration(t,e){return c({...t,columnAlterations:t.columnAlterations?[...t.columnAlterations,e]:[e]})}});var Vt=c({is(t){return t.kind==="CreateIndexNode"},create(t){return c({kind:"CreateIndexNode",name:Q.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ps=c({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return c({kind:"CreateSchemaNode",schema:Q.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var du=["preserve rows","delete rows","drop"],pt=c({is(t){return t.kind==="CreateTableNode"},create(t){return c({kind:"CreateTableNode",table:t,columns:c([])})},cloneWithColumn(t,e){return c({...t,columns:c([...t.columns,e])})},cloneWithConstraint(t,e){return c({...t,constraints:t.constraints?c([...t.constraints,e]):c([e])})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWith(t,e){return c({...t,...e})}});var xi=c({is(t){return t.kind==="DropIndexNode"},create(t,e){return c({kind:"DropIndexNode",name:st.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var $i=c({is(t){return t.kind==="DropSchemaNode"},create(t,e){return c({kind:"DropSchemaNode",schema:Q.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Yi=c({is(t){return t.kind==="DropTableNode"},create(t,e){return c({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return c({...t,...e})}});var xt=c({is(t){return t.kind==="AliasNode"},create(t,e){return c({kind:"AliasNode",node:t,alias:e})}});function $e(t){return ht(t)&&dt(t.toOperationNode)}s($e,"isOperationNodeSource");function hu(t){return ht(t)&&"expressionType"in t&&$e(t)}s(hu,"isExpression");var Ei=c({is(t){return t.kind==="AndNode"},create(t,e){return c({kind:"AndNode",left:t,right:e})}});var Ci=c({is(t){return t.kind==="OrNode"},create(t,e){return c({kind:"OrNode",left:t,right:e})}});var Si=c({is(t){return t.kind==="OnNode"},create(t){return c({kind:"OnNode",on:t})},cloneWithOperation(t,e,r){return c({...t,on:e==="And"?Ei.create(t.on,r):Ci.create(t.on,r)})}});var at=c({is(t){return t.kind==="JoinNode"},create(t,e){return c({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return c({kind:"JoinNode",joinType:t,table:e,on:Si.create(r)})},cloneWithOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"And",e):Si.create(e)})},cloneWithOrOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"Or",e):Si.create(e)})}});var rr=c({is(t){return t.kind==="OrderByNode"},create(t){return c({kind:"OrderByNode",items:c([t])})},cloneWithItem(t,e){return c({...t,items:c([...t.items,e])})}});var qo=c({is(t){return t.kind==="PartitionByNode"},create(t){return c({kind:"PartitionByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var Qi=c({is(t){return t.kind==="OverNode"},create(){return c({kind:"OverNode"})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithPartitionByItems(t,e){return c({...t,partitionBy:t.partitionBy?qo.cloneWithItems(t.partitionBy,e):qo.create(e)})}});var Gr=c({is(t){return t.kind==="FromNode"},create(t){return c({kind:"FromNode",froms:c(t)})},cloneWithFroms(t,e){return c({...t,froms:c([...t.froms,...e])})}});var Lo=c({is(t){return t.kind==="GroupByNode"},create(t){return c({kind:"GroupByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var Zi=c({is(t){return t.kind==="HavingNode"},create(t){return c({kind:"HavingNode",having:t})},cloneWithOperation(t,e,r){return c({...t,having:e==="And"?Ei.create(t.having,r):Ci.create(t.having,r)})}});var $=c({is(t){return t.kind==="SelectQueryNode"},create(t,e){return c({kind:"SelectQueryNode",from:Gr.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})},cloneWithDistinctOn(t,e){return c({...t,distinctOn:t.distinctOn?c([...t.distinctOn,...e]):c(e)})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithGroupByItems(t,e){return c({...t,groupBy:t.groupBy?Lo.cloneWithItems(t.groupBy,e):Lo.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithOffset(t,e){return c({...t,offset:e})},cloneWithHaving(t,e){return c({...t,having:t.having?Zi.cloneWithOperation(t.having,"And",e):Zi.create(e)})},cloneWithOrHaving(t,e){return c({...t,having:t.having?Zi.cloneWithOperation(t.having,"Or",e):Zi.create(e)})},cloneWithSetOperation(t,e){return c({...t,setOperations:t.setOperations?c([...t.setOperations,e]):c([e])})},cloneWithExplain(t,e){return c({...t,explain:e})},cloneWithoutSelections(t){return c({...t,selections:[]})},cloneWithoutLimit(t){return c({...t,limit:void 0})},cloneWithoutOffset(t){return c({...t,offset:void 0})},cloneWithoutOrderBy(t){return c({...t,orderBy:void 0})}});var zt=c({is(t){return t.kind==="SelectModifierNode"},create(t){return c({kind:"SelectModifierNode",modifier:t})},createWithExpression(t){return c({kind:"SelectModifierNode",rawModifier:t})}});var ms=c({is(t){return t.kind==="BinaryOperationNode"},create(t,e,r){return c({kind:"BinaryOperationNode",leftOperand:t,operator:e,rightOperand:r})}});var pe=c({is(t){return t.kind==="RawNode"},create(t,e){return c({kind:"RawNode",sqlFragments:c(t),parameters:c(e)})},createWithSql(t){return pe.create([t],[])},createWithChild(t){return pe.create(["",""],[t])},createWithChildren(t){return pe.create(new Array(t.length+1).fill(""),t)}});var pu=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","match","ilike","not ilike","@>","<@","?","?&","!<","!>","<=>","!~","~","~*","!~*","&&","||","@@","@@@","!!","<->"];var ys=c({is(t){return t.kind==="OperatorNode"},create(t){return c({kind:"OperatorNode",operator:t})}});var vs=c({is(t){return t.kind==="ParensNode"},create(t){return c({kind:"ParensNode",node:t})}});var ie=c({is(t){return t.kind==="ColumnNode"},create(t){return c({kind:"ColumnNode",column:Q.create(t)})}});var Ti=c({is(t){return t.kind==="SelectAllNode"},create(){return c({kind:"SelectAllNode"})}});var Jr=c({is(t){return t.kind==="ReferenceNode"},create(t,e){return c({kind:"ReferenceNode",table:t,column:e})},createSelectAll(t){return c({kind:"ReferenceNode",table:t,column:Ti.create()})}});function sr(t){return Ze(t)?nr(t):t.toOperationNode()}s(sr,"parseSimpleReferenceExpression");function Rr(t){return Ir(t)?t.map(e=>ir(e)):[ir(t)]}s(Rr,"parseReferenceExpressionOrList");function ir(t){return $r(t)?bi(t):sr(t)}s(ir,"parseReferenceExpression");function nr(t){let e=".";if(t.includes(e)){let r=t.split(e).map(yu);if(r.length===3)return pp(r);if(r.length===2)return mp(r);throw new Error(`invalid column reference ${t}`)}else return ie.create(t)}s(nr,"parseStringReference");function mu(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(yu);return xt.create(nr(r),Q.create(i))}else return nr(t)}s(mu,"parseAliasedStringReference");function en(t){return ie.create(t)}s(en,"parseColumnName");function pp(t){let[e,r,i]=t;return Jr.create(ot.createWithSchema(e,r),ie.create(i))}s(pp,"parseStringReferenceWithTableAndSchema");function mp(t){let[e,r]=t;return Jr.create(ot.create(e),ie.create(r))}s(mp,"parseStringReferenceWithTable");function yu(t){return t.trim()}s(yu,"trim");var gs=c({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return c({kind:"PrimitiveValueListNode",values:c([...t])})}});var Ai=c({is(t){return t.kind==="ValueListNode"},create(t){return c({kind:"ValueListNode",values:c(t)})}});var ut=c({is(t){return t.kind==="ValueNode"},create(t){return c({kind:"ValueNode",value:t})},createImmediate(t){return c({kind:"ValueNode",value:t,immediate:!0})}});function Ns(t){return Ir(t)?yp(t):Ht(t)}s(Ns,"parseValueExpressionOrList");function Ht(t){return $r(t)?bi(t):ut.create(t)}s(Ht,"parseValueExpression");function yp(t){return t.some($r)?Ai.create(t.map(e=>Ht(e))):gs.create(t)}s(yp,"parseValueExpressionList");function Be(t){return Bo("where",t)}s(Be,"parseWhere");function Fo(t){return Bo("having",t)}s(Fo,"parseHaving");function Wo(t){return Bo("on",t)}s(Wo,"parseOn");function me(t,e,r){return ms.create(ir(t),Uo(e),ir(r))}s(me,"parseReferentialFilter");function Bo(t,e){if(e.length===3)return vp(e[0],e[1],e[2]);if(e.length===1)return Np(t,e[0]);throw vu(t,e)}s(Bo,"parseFilterExpression");function vp(t,e,r){return(e==="is"||e==="is not")&&(hs(r)||ds(r))?gp(t,e,r):ms.create(ir(t),Uo(e),Ns(r))}s(vp,"parseFilter");function gp(t,e,r){return ms.create(ir(t),Uo(e),ut.createImmediate(r))}s(gp,"parseIs");function Uo(t){if(Ze(t)&&pu.includes(t))return ys.create(t);if($e(t))return t.toOperationNode();throw new Error(`invalid comparison operator ${JSON.stringify(t)} passed to a filter method`)}s(Uo,"parseComparisonOperatorExpression");function Np(t,e){if(dt(e))return wp[t](e);if($e(e)){let r=e.toOperationNode();if(pe.is(r))return r}throw vu(t,e)}s(Np,"parseOneArgFilterExpression");function vu(t,e){return new Error(`invalid arguments passed to a '${t}' method: ${JSON.stringify(e)}`)}s(vu,"createFilterExpressionError");var wp=c({where(t){let r=t(Mo()).toOperationNode();if(!r.where)throw new Error("no `where` methods called inside a group callback");return vs.create(r.where.where)},having(t){let r=t(Mo()).toOperationNode();if(!r.having)throw new Error("no `having` methods called inside a group callback");return vs.create(r.having.having)},on(t){let r=t(ws("InnerJoin","table")).toOperationNode();if(!r.on)throw new Error("no `on` methods called inside a group callback");return vs.create(r.on.on)}});function Ue(t,e){if(e.length===3)return Ep(t,e[0],e[1],e[2]);if(e.length===2)return xp(t,e[0],e[1]);throw new Error("not implemented")}s(Ue,"parseJoin");function xp(t,e,r){return r(ws(t,e)).toOperationNode()}s(xp,"parseCallbackJoin");function Ep(t,e,r,i){return at.createWithOn(t,or(e),me(r,"=",i))}s(Ep,"parseSingleOnJoin");var Ii=c({is(t){return t.kind==="SelectionNode"},create(t){return c({kind:"SelectionNode",selection:t})},createSelectAll(){return c({kind:"SelectionNode",selection:Ti.create()})},createSelectAllFromTable(t){return c({kind:"SelectionNode",selection:Jr.createSelectAll(t)})}});var tn=class{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return sr(this.#e)}};s(tn,"DynamicReferenceBuilder");function gu(t){return ht(t)&&$e(t)&&Ze(t.dynamicReference)}s(gu,"isDynamicReferenceBuilder");function Dr(t){return Ir(t)?t.map(e=>Nu(e)):[Nu(t)]}s(Dr,"parseSelectExpressionOrList");function Nu(t){return Ze(t)?Ii.create(mu(t)):gu(t)?Ii.create(t.toOperationNode()):Ii.create(xs(t))}s(Nu,"parseSelectExpression");function Pr(t){return t?Array.isArray(t)?t.map(wu):[wu(t)]:[Ii.createSelectAll()]}s(Pr,"parseSelectAll");function wu(t){if(Ze(t))return Ii.createSelectAllFromTable(Ae(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}s(wu,"parseSelectAllArg");var et=c({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return c({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return c({...t,...e})}});var _r=c({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return c({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return c({...t,from:t.from?Gr.cloneWithFroms(t.from,e):Gr.create(e)})},cloneWithUpdates(t,e){return c({...t,updates:t.updates?c([...t.updates,...e]):e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var Vo=c({is(t){return t.kind==="UsingNode"},create(t){return c({kind:"UsingNode",tables:c(t)})},cloneWithTables(t,e){return c({...t,tables:c([...t.tables,...e])})}});var ar=c({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return c({kind:"DeleteQueryNode",from:Gr.create([t]),...e&&{with:e}})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithExplain(t,e){return c({...t,explain:e})},cloneWithUsing(t,e){return c({...t,using:t.using!==void 0?Vo.cloneWithTables(t.using,e):Vo.create(e)})}});var qe=c({is(t){return t.kind==="WhereNode"},create(t){return c({kind:"WhereNode",where:t})},cloneWithOperation(t,e,r){return c({...t,where:e==="And"?Ei.create(t.where,r):Ci.create(t.where,r)})}});var zo=c({is(t){return t.kind==="ReturningNode"},create(t){return c({kind:"ReturningNode",selections:c(t)})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})}});var H=c({is(t){return ar.is(t)||et.is(t)||_r.is(t)||$.is(t)},cloneWithWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"And",e):qe.create(e)})},cloneWithOrWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"Or",e):qe.create(e)})},cloneWithJoin(t,e){return c({...t,joins:t.joins?c([...t.joins,e]):c([e])})},cloneWithReturning(t,e){return c({...t,returning:t.returning?zo.cloneWithSelections(t.returning,e):zo.create(e)})},cloneWithoutWhere(t){return c({...t,where:void 0})}});var xu=c({is(t){return t.kind==="OrderByItemNode"},create(t,e){return c({kind:"OrderByItemNode",orderBy:t,direction:e})}});function Oi(t,e){return xu.create(Cp(t),Sp(e))}s(Oi,"parseOrderBy");function Cp(t){return ir(t)}s(Cp,"parseOrderByExpression");function Sp(t){if(t)return t==="asc"||t==="desc"?pe.createWithSql(t):t.toOperationNode()}s(Sp,"parseOrderByDirectionExpression");function z(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}s(z,"preventAwait");var Es=c({is(t){return t.kind==="LimitNode"},create(t){return c({kind:"LimitNode",limit:ut.create(t)})}});var Eu=c({is(t){return t.kind==="OffsetNode"},create(t){return c({kind:"OffsetNode",offset:ut.create(t)})}});var Cu=c({is(t){return t.kind==="GroupByItemNode"},create(t){return c({kind:"GroupByItemNode",groupBy:t})}});function Su(t){return Rr(t).map(Cu.create)}s(Su,"parseGroupBy");var Rt=class extends Error{node;constructor(e){super("no result"),this.node=e}};s(Rt,"NoResultError");var kr=c({is(t){return t.kind==="ExplainNode"},create(t,e){return c({kind:"ExplainNode",format:t,options:e})}});var Cs=c({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return c({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function Yr(t,e,r){return Cs.create(t,e.toOperationNode(),r)}s(Yr,"parseSetOperation");var Tu=c({is(t){return t.kind==="UnaryOperationNode"},create(t,e){return c({kind:"UnaryOperationNode",operator:t,operand:e})}});function xe(t){return bu("exists",t)}s(xe,"parseExists");function Ee(t){return bu("not exists",t)}s(Ee,"parseNotExists");function bu(t,e){return Tu.create(ys.create(t),Ns(e))}s(bu,"parseUnaryOperation");var W=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}where(...e){return new W({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new W({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new W({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new W({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new W({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new W({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new W({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new W({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}having(...e){return new W({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,Fo(e))})}havingRef(e,r,i){return new W({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,me(e,r,i))})}orHaving(...e){return new W({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,Fo(e))})}orHavingRef(e,r,i){return new W({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,me(e,r,i))})}havingExists(e){return new W({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,xe(e))})}havingNotExist(e){return new W({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,Ee(e))})}orHavingExists(e){return new W({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,xe(e))})}orHavingNotExists(e){return new W({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,Ee(e))})}select(e){return new W({...this.#e,queryNode:$.cloneWithSelections(this.#e.queryNode,Dr(e))})}distinctOn(e){return new W({...this.#e,queryNode:$.cloneWithDistinctOn(this.#e.queryNode,Rr(e))})}modifyFront(e){return new W({...this.#e,queryNode:$.cloneWithFrontModifier(this.#e.queryNode,zt.createWithExpression(e.toOperationNode()))})}modifyEnd(e){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.createWithExpression(e.toOperationNode()))})}distinct(){return new W({...this.#e,queryNode:$.cloneWithFrontModifier(this.#e.queryNode,zt.create("Distinct"))})}forUpdate(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("ForUpdate"))})}forShare(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("ForShare"))})}forKeyShare(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("ForKeyShare"))})}forNoKeyUpdate(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("ForNoKeyUpdate"))})}skipLocked(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("SkipLocked"))})}noWait(){return new W({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,zt.create("NoWait"))})}selectAll(e){return new W({...this.#e,queryNode:$.cloneWithSelections(this.#e.queryNode,Pr(e))})}innerJoin(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}innerJoinLateral(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralInnerJoin",e))})}leftJoinLateral(...e){return new W({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralLeftJoin",e))})}orderBy(e,r){return new W({...this.#e,queryNode:$.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}groupBy(e){return new W({...this.#e,queryNode:$.cloneWithGroupByItems(this.#e.queryNode,Su(e))})}limit(e){return new W({...this.#e,queryNode:$.cloneWithLimit(this.#e.queryNode,Es.create(e))})}offset(e){return new W({...this.#e,queryNode:$.cloneWithOffset(this.#e.queryNode,Eu.create(e))})}union(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("union",e,!1))})}unionAll(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("union",e,!0))})}intersect(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("intersect",e,!1))})}intersectAll(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("intersect",e,!0))})}except(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("except",e,!1))})}exceptAll(e){return new W({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,Yr("except",e,!0))})}as(e){return new Ss(this,e)}clearSelect(){return new W({...this.#e,queryNode:$.cloneWithoutSelections(this.#e.queryNode)})}clearWhere(){return new W({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}clearLimit(){return new W({...this.#e,queryNode:$.cloneWithoutLimit(this.#e.queryNode)})}clearOffset(){return new W({...this.#e,queryNode:$.cloneWithoutOffset(this.#e.queryNode)})}clearOrderBy(){return new W({...this.#e,queryNode:$.cloneWithoutOrderBy(this.#e.queryNode)})}$call(e){return e(this)}call(e){return this.$call(e)}$if(e,r){return e?r(this):new W({...this.#e})}if(e,r){return this.$if(e,r)}$castTo(){return new W(this.#e)}castTo(){return this.$castTo()}$assertType(){return new W(this.#e)}assertType(){return new W(this.#e)}withPlugin(e){return new W({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async*stream(e=100){let r=this.compile(),i=this.#e.executor.stream(r,e,this.#e.queryId);for await(let n of i)yield*n.rows}async explain(e,r){return await new W({...this.#e,queryNode:$.cloneWithExplain(this.#e.queryNode,kr.create(e,r?.toOperationNode()))}).execute()}};s(W,"SelectQueryBuilder");z(W,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var Ss=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),Q.create(this.#t))}};s(Ss,"AliasedSelectQueryBuilder");var Qr=class{nodeStack=[];#e=c({AliasNode:this.transformAlias.bind(this),ColumnNode:this.transformColumn.bind(this),IdentifierNode:this.transformIdentifier.bind(this),SchemableIdentifierNode:this.transformSchemableIdentifier.bind(this),RawNode:this.transformRaw.bind(this),ReferenceNode:this.transformReference.bind(this),SelectQueryNode:this.transformSelectQuery.bind(this),SelectionNode:this.transformSelection.bind(this),TableNode:this.transformTable.bind(this),FromNode:this.transformFrom.bind(this),SelectAllNode:this.transformSelectAll.bind(this),AndNode:this.transformAnd.bind(this),OrNode:this.transformOr.bind(this),ValueNode:this.transformValue.bind(this),ValueListNode:this.transformValueList.bind(this),PrimitiveValueListNode:this.transformPrimitiveValueList.bind(this),ParensNode:this.transformParens.bind(this),JoinNode:this.transformJoin.bind(this),OperatorNode:this.transformOperator.bind(this),WhereNode:this.transformWhere.bind(this),InsertQueryNode:this.transformInsertQuery.bind(this),DeleteQueryNode:this.transformDeleteQuery.bind(this),ReturningNode:this.transformReturning.bind(this),CreateTableNode:this.transformCreateTable.bind(this),AddColumnNode:this.transformAddColumn.bind(this),ColumnDefinitionNode:this.transformColumnDefinition.bind(this),DropTableNode:this.transformDropTable.bind(this),DataTypeNode:this.transformDataType.bind(this),OrderByNode:this.transformOrderBy.bind(this),OrderByItemNode:this.transformOrderByItem.bind(this),GroupByNode:this.transformGroupBy.bind(this),GroupByItemNode:this.transformGroupByItem.bind(this),UpdateQueryNode:this.transformUpdateQuery.bind(this),ColumnUpdateNode:this.transformColumnUpdate.bind(this),LimitNode:this.transformLimit.bind(this),OffsetNode:this.transformOffset.bind(this),OnConflictNode:this.transformOnConflict.bind(this),OnDuplicateKeyNode:this.transformOnDuplicateKey.bind(this),CreateIndexNode:this.transformCreateIndex.bind(this),DropIndexNode:this.transformDropIndex.bind(this),ListNode:this.transformList.bind(this),PrimaryKeyConstraintNode:this.transformPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.transformUniqueConstraint.bind(this),ReferencesNode:this.transformReferences.bind(this),CheckConstraintNode:this.transformCheckConstraint.bind(this),WithNode:this.transformWith.bind(this),CommonTableExpressionNode:this.transformCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.transformCommonTableExpressionName.bind(this),HavingNode:this.transformHaving.bind(this),CreateSchemaNode:this.transformCreateSchema.bind(this),DropSchemaNode:this.transformDropSchema.bind(this),AlterTableNode:this.transformAlterTable.bind(this),DropColumnNode:this.transformDropColumn.bind(this),RenameColumnNode:this.transformRenameColumn.bind(this),AlterColumnNode:this.transformAlterColumn.bind(this),ModifyColumnNode:this.transformModifyColumn.bind(this),AddConstraintNode:this.transformAddConstraint.bind(this),DropConstraintNode:this.transformDropConstraint.bind(this),ForeignKeyConstraintNode:this.transformForeignKeyConstraint.bind(this),CreateViewNode:this.transformCreateView.bind(this),DropViewNode:this.transformDropView.bind(this),GeneratedNode:this.transformGenerated.bind(this),DefaultValueNode:this.transformDefaultValue.bind(this),OnNode:this.transformOn.bind(this),ValuesNode:this.transformValues.bind(this),SelectModifierNode:this.transformSelectModifier.bind(this),CreateTypeNode:this.transformCreateType.bind(this),DropTypeNode:this.transformDropType.bind(this),ExplainNode:this.transformExplain.bind(this),DefaultInsertValueNode:this.transformDefaultInsertValue.bind(this),AggregateFunctionNode:this.transformAggregateFunction.bind(this),OverNode:this.transformOver.bind(this),PartitionByNode:this.transformPartitionBy.bind(this),PartitionByItemNode:this.transformPartitionByItem.bind(this),SetOperationNode:this.transformSetOperation.bind(this),BinaryOperationNode:this.transformBinaryOperation.bind(this),UnaryOperationNode:this.transformUnaryOperation.bind(this),UsingNode:this.transformUsing.bind(this)});transformNode(e){if(!e)return e;this.nodeStack.push(e);let r=this.transformNodeImpl(e);return this.nodeStack.pop(),c(r)}transformNodeImpl(e){return this.#e[e.kind](e)}transformNodeList(e){return e&&c(e.map(r=>this.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOn:this.transformNodeList(e.distinctOn),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",table:this.transformNode(e.table),column:this.transformNode(e.column)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:c([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain)}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),using:this.transformNode(e.using),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),expression:this.transformNode(e.expression),unique:e.unique,using:this.transformNode(e.using),ifNotExists:e.ifNotExists}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),columnAlterations:this.transformNodeList(e.columnAlterations),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",column:this.transformNode(e.column),distinct:e.distinct,filter:this.transformNode(e.filter),func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformBinaryOperation(e){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(e.leftOperand),operator:this.transformNode(e.operator),rightOperand:this.transformNode(e.rightOperand)}}transformUnaryOperation(e){return{kind:"UnaryOperationNode",operator:this.transformNode(e.operator),operand:this.transformNode(e.operand)}}transformUsing(e){return{kind:"UsingNode",tables:e.tables}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}};s(Qr,"OperationNodeTransformer");var Tp=c({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0}),rn=class extends Qr{#e;#t=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#r(e))return super.transformNodeImpl(e);let r=this.#i(e);for(let n of r)this.#t.add(n);let i=super.transformNodeImpl(e);for(let n of r)this.#t.delete(n);return i}transformSchemableIdentifier(e){let r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:Q.create(this.#e)}}transformReferences(e){let r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:ot.createWithSchema(this.#e,r.table.table.identifier.name)}}#r(e){return e.kind in Tp}#i(e){let r=new Set;if("name"in e&&e.name&&st.is(e.name)&&this.#s(e.name,r),"from"in e&&e.from)for(let i of e.from.froms)this.#n(i,r);if("into"in e&&e.into&&this.#n(e.into,r),"table"in e&&e.table&&this.#n(e.table,r),"joins"in e&&e.joins)for(let i of e.joins)this.#n(i.table,r);return"with"in e&&e.with&&this.#o(e.with,r),r}#n(e,r){let i=ot.is(e)?e:xt.is(e)&&ot.is(e.node)?e.node:null;i&&this.#s(i.table,r)}#s(e,r){this.#t.has(e.identifier.name)||r.add(e.identifier.name)}#o(e,r){for(let i of e.expressions)r.delete(i.name.table.table.identifier.name)}};s(rn,"WithSchemaTransformer");var Dt=class{#e;constructor(e){this.#e=new rn(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}};s(Dt,"WithSchemaPlugin");var Au=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function Iu(t){let e="";for(let r=0;r<t;++r)e+=bp();return e}s(Iu,"randomString");function bp(){return Au[~~(Math.random()*Au.length)]}s(bp,"randomChar");function ne(){return new Ts}s(ne,"createQueryId");var Ts=class{#e;get queryId(){return this.#e===void 0&&(this.#e=Iu(8)),this.#e}};s(Ts,"LazyQueryId");var Ve=c({is(t){return t.kind==="AggregateFunctionNode"},create(t,e){return c({kind:"AggregateFunctionNode",func:t,column:e})},cloneWithDistinct(t){return c({...t,distinct:!0})},cloneWithFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"And",e):qe.create(e)})},cloneWithOrFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"Or",e):qe.create(e)})},cloneWithOver(t,e){return c({...t,over:e})}});function Ou(t){return pe.create(t.length>1?["coalesce(",...new Array(t.length-1).fill(", "),")"]:["coalesce(",")"],Rr(t))}s(Ou,"parseCoalesce");var Ri=class{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}};s(Ri,"Deferred");var Ru=new Set;function Du(t){Ru.has(t)||(Ru.add(t),console.log(t))}s(Du,"logOnce");var Ap=c([]),Zr=class{#e;constructor(e=Ap){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(let i of this.#e){let n=i.transformQuery({node:e,queryId:r});if(n.kind===e.kind)e=n;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${n.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async i=>{let n=await i.executeQuery(e),o=await this.#t(n,r);return Ip(n,o),o})}async*stream(e,r,i){let n=new Ri,o=new Ri;this.provideConnection(async u=>(n.resolve(u),await o.promise)).catch(u=>n.reject(u));let a=await n.promise;try{for await(let u of a.streamQuery(e,r))yield await this.#t(u,i)}finally{o.resolve()}}async#t(e,r){for(let i of this.#e)e=await i.transformResult({result:e,queryId:r});return e}};s(Zr,"QueryExecutorBase");function Ip(t,e){let{numAffectedRows:r}=t;r===void 0&&t.numUpdatedOrDeletedRows===void 0||r!==void 0&&e.numAffectedRows!==void 0||Du("kysely:warning: outdated driver/plugin detected! QueryResult.numUpdatedOrDeletedRows is deprecated and will be removed in a future release.")}s(Ip,"warnOfOutdatedDriverOrPlugins");var ur=class extends Zr{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new ur([...this.plugins,e])}withPlugins(e){return new ur([...this.plugins,...e])}withPluginAtFront(e){return new ur([e,...this.plugins])}withoutPlugins(){return new ur([])}};s(ur,"NoopQueryExecutor");var ei=new ur;var Pe=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new bs(this,e)}$castTo(){return new Pe({...this.#e})}castTo(){return this.$castTo()}withPlugin(e){return new Pe({...this.#e,plugins:this.#e.plugins!==void 0?c([...this.#e.plugins,e]):c([e])})}toOperationNode(){let e=this.#e.plugins!==void 0?ei.withPlugins(this.#e.plugins):ei;return this.#t(e)}async execute(e){let r=this.#e.plugins!==void 0?e.getExecutor().withPlugins(this.#e.plugins):e.getExecutor();return r.executeQuery(this.#r(r),this.#e.queryId)}#t(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#r(e){return e.compileQuery(this.#t(e),this.#e.queryId)}};s(Pe,"RawBuilder");z(Pe,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");var bs=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),$e(this.#t)?this.#t.toOperationNode():Q.create(this.#t))}};s(bs,"AliasedRawBuilder");var Ie=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new As(this,e)}distinct(){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithDistinct(this.#e.aggregateFunctionNode)})}filterWhere(...e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Be(e))})}filterWhereExists(e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,xe(e))})}filterWhereNotExists(e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Ee(e))})}filterWhereRef(e,r,i){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}orFilterWhere(...e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Be(e))})}orFilterWhereExists(e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,xe(e))})}orFilterWhereNotExists(e){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Ee(e))})}orFilterWhereRef(e,r,i){return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}over(e){let r=Pu();return new Ie({...this.#e,aggregateFunctionNode:Ve.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}toOperationNode(){return this.#e.aggregateFunctionNode}};s(Ie,"AggregateFunctionBuilder");z(Ie,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");var As=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return xt.create(this.#e.toOperationNode(),Q.create(this.#t))}};s(As,"AliasedAggregateFunctionBuilder");var ti=class{constructor(){this.avg=this.avg.bind(this),this.coalesce=this.coalesce.bind(this),this.count=this.count.bind(this),this.max=this.max.bind(this),this.min=this.min.bind(this),this.sum=this.sum.bind(this)}avg(e){return new Ie({aggregateFunctionNode:Ve.create("avg",sr(e))})}coalesce(e,...r){return new Pe({queryId:ne(),rawNode:Ou([e,...r])})}count(e){return new Ie({aggregateFunctionNode:Ve.create("count",sr(e))})}max(e){return new Ie({aggregateFunctionNode:Ve.create("max",sr(e))})}min(e){return new Ie({aggregateFunctionNode:Ve.create("min",sr(e))})}sum(e){return new Ie({aggregateFunctionNode:Ve.create("sum",sr(e))})}};s(ti,"FunctionModule");var ri=class{#e;constructor(e){this.#e=c(e)}get fn(){return new ti}selectFrom(e){return new W({queryId:ne(),executor:this.#e.executor,queryNode:$.create(jt(e))})}withSchema(e){return new ri({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}ref(e){return new Pe({queryId:ne(),plugins:this.#e.executor.plugins,rawNode:pe.createWithChild(nr(e))})}};s(ri,"ExpressionBuilder");var Ye=class{#e;constructor(e){this.#e=c(e)}on(...e){return new Ye({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Wo(e))})}orOn(...e){return new Ye({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Wo(e))})}onRef(e,r,i){return new Ye({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,me(e,r,i))})}orOnRef(e,r,i){return new Ye({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,me(e,r,i))})}onExists(e){return new Ye({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,xe(e))})}onNotExists(e){return new Ye({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Ee(e))})}orOnExists(e){return new Ye({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,xe(e))})}orOnNotExists(e){return new Ye({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Ee(e))})}onTrue(){return new Ye({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,pe.createWithSql("true"))})}toOperationNode(){return this.#e.joinNode}};s(Ye,"JoinBuilder");z(Ye,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");var _u=c({is(t){return t.kind==="PartitionByItemNode"},create(t){return c({kind:"PartitionByItemNode",partitionBy:t})}});function ku(t){return Rr(t).map(_u.create)}s(ku,"parsePartitionBy");var cr=class{#e;constructor(e){this.#e=c(e)}orderBy(e,r){return new cr({overNode:Qi.cloneWithOrderByItem(this.#e.overNode,Oi(e,r))})}partitionBy(e){return new cr({overNode:Qi.cloneWithPartitionByItems(this.#e.overNode,ku(e))})}toOperationNode(){return this.#e.overNode}};s(cr,"OverBuilder");z(cr,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");var qu=c({is(t){return t.kind==="ValuesNode"},create(t){return c({kind:"ValuesNode",values:c(t)})}});var Lu=c({is(t){return t.kind==="DefaultInsertValueNode"},create(){return c({kind:"DefaultInsertValueNode"})}});function Mu(t){return Op(Array.isArray(t)?t:[t])}s(Mu,"parseInsertObjectOrList");function Op(t){let e=Rp(t);return[c([...e.keys()].map(ie.create)),qu.create(t.map(r=>Dp(r,e)))]}s(Op,"parseInsertColumnsAndValues");function Rp(t){let e=new Map;for(let r of t){let i=Object.keys(r);for(let n of i)!e.has(n)&&r[n]!==void 0&&e.set(n,e.size)}return e}s(Rp,"parseColumnNamesAndIndexes");function Dp(t,e){let r=Object.keys(t),i=Array.from({length:e.size}),n=!1;for(let a of r){let u=e.get(a);if(u!==void 0){let l=t[a];$r(l)&&(n=!0),i[u]=l}}if(r.length<e.size||n){let a=Lu.create();return Ai.create(i.map(u=>au(u)?a:Ht(u)))}return gs.create(i)}s(Dp,"parseRowValues");var Fu=c({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return c({kind:"ColumnUpdateNode",column:t,value:e})}});function Di(t){return Object.entries(t).filter(([e,r])=>r!==void 0).map(([e,r])=>Fu.create(ie.create(e),Ht(r)))}s(Di,"parseUpdateObject");var Wu=c({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return c({kind:"OnDuplicateKeyNode",updates:t})}});var nn=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get insertId(){return this.#e}get numInsertedOrUpdatedRows(){return this.#t}};s(nn,"InsertResult");var de=c({is(t){return t.kind==="OnConflictNode"},create(){return c({kind:"OnConflictNode"})},cloneWith(t,e){return c({...t,...e})},cloneWithIndexWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"And",e):qe.create(e)})},cloneWithIndexOrWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"Or",e):qe.create(e)})},cloneWithUpdateWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"And",e):qe.create(e)})},cloneWithUpdateOrWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"Or",e):qe.create(e)})},cloneWithoutIndexWhere(t){return c({...t,indexWhere:void 0})},cloneWithoutUpdateWhere(t){return c({...t,updateWhere:void 0})}});var _e=class{#e;constructor(e){this.#e=c(e)}column(e){let r=ie.create(e);return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,r]):c([r])})})}columns(e){let r=e.map(ie.create);return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,...r]):c(r)})})}constraint(e){return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{constraint:Q.create(e)})})}expression(e){return new _e({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,xe(e))})}whereNotExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Ee(e))})}orWhereExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,xe(e))})}orWhereNotExists(e){return new _e({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Ee(e))})}clearWhere(){return new _e({...this.#e,onConflictNode:de.cloneWithoutIndexWhere(this.#e.onConflictNode)})}doNothing(){return new sn({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new tt({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{updates:Di(e)})})}};s(_e,"OnConflictBuilder");z(_e,"don't await OnConflictBuilder instances.");var sn=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.onConflictNode}};s(sn,"OnConflictDoNothingBuilder");z(sn,"don't await OnConflictDoNothingBuilder instances.");var tt=class{#e;constructor(e){this.#e=c(e)}where(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,xe(e))})}whereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Ee(e))})}orWhereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,xe(e))})}orWhereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Ee(e))})}clearWhere(){return new tt({...this.#e,onConflictNode:de.cloneWithoutUpdateWhere(this.#e.onConflictNode)})}toOperationNode(){return this.#e.onConflictNode}};s(tt,"OnConflictUpdateBuilder");z(tt,"don't await OnConflictUpdateBuilder instances.");var Ce=class{#e;constructor(e){this.#e=c(e)}values(e){let[r,i]=Mu(e);return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:r,values:i})})}columns(e){return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:c(e.map(ie.create))})})}expression(e){return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{values:bi(e)})})}ignore(){return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onConflict:e(new _e({onConflictNode:de.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onDuplicateKey:Wu.create(Di(e))})})}returning(e){return new Ce({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Dr(e))})}returningAll(){return new Ce({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Pr())})}$call(e){return e(this)}call(e){return this.$call(e)}$if(e,r){return e?r(this):new Ce({...this.#e})}if(e,r){return this.$if(e,r)}$castTo(){return new Ce(this.#e)}castTo(){return this.$castTo()}$assertType(){return new Ce(this.#e)}assertType(){return new Ce(this.#e)}withPlugin(e){return new Ce({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new nn(i.insertId,i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new Ce({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{explain:kr.create(e,r?.toOperationNode())})}).execute()}};s(Ce,"InsertQueryBuilder");z(Ce,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var on=class{#e;constructor(e){this.#e=e}get numDeletedRows(){return this.#e}};s(on,"DeleteResult");var ae=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}clearWhere(){return new ae({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}using(e){return new ae({...this.#e,queryNode:ar.cloneWithUsing(this.#e.queryNode,jt(e))})}innerJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}returning(e){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Dr(e))})}returningAll(){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Pr())})}orderBy(e,r){return new ae({...this.#e,queryNode:ar.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}limit(e){return new ae({...this.#e,queryNode:ar.cloneWithLimit(this.#e.queryNode,Es.create(e))})}$call(e){return e(this)}call(e){return this.$call(e)}$if(e,r){return e?r(this):new ae({...this.#e})}if(e,r){return this.$if(e,r)}$castTo(){return new ae(this.#e)}castTo(){return this.$castTo()}$assertType(){return new ae(this.#e)}assertType(){return new ae(this.#e)}withPlugin(e){return new ae({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new on(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ae({...this.#e,queryNode:ar.cloneWithExplain(this.#e.queryNode,kr.create(e,r?.toOperationNode()))}).execute()}};s(ae,"DeleteQueryBuilder");z(ae,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var an=class{#e;constructor(e){this.#e=e}get numUpdatedRows(){return this.#e}};s(an,"UpdateResult");var ue=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}whereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}orWhereExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}orWhereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}clearWhere(){return new ue({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}from(e){return new ue({...this.#e,queryNode:_r.cloneWithFromItems(this.#e.queryNode,jt(e))})}innerJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}set(e){return new ue({...this.#e,queryNode:_r.cloneWithUpdates(this.#e.queryNode,Di(e))})}returning(e){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Dr(e))})}returningAll(){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Pr())})}$call(e){return e(this)}call(e){return this.$call(e)}$if(e,r){return e?r(this):new ue({...this.#e})}if(e,r){return this.$if(e,r)}$castTo(){return new ue(this.#e)}castTo(){return this.$castTo()}$assertType(){return new ue(this.#e)}assertType(){return new ue(this.#e)}withPlugin(e){return new ue({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new an(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ue({...this.#e,queryNode:_r.cloneWithExplain(this.#e.queryNode,kr.create(e,r?.toOperationNode()))}).execute()}};s(ue,"UpdateQueryBuilder");z(ue,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var Bu=c({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return c({kind:"CommonTableExpressionNode",name:t,expression:e})}});var Ho=c({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return c({kind:"CommonTableExpressionNameNode",table:ot.create(t),columns:e?c(e.map(ie.create)):void 0})}});function jo(t,e){let r=e(Uu());return Bu.create(Pp(t),r.toOperationNode())}s(jo,"parseCommonTableExpression");function Pp(t){if(t.includes("(")){let e=t.split(/[\(\)]/),r=e[0],i=e[1].split(",").map(n=>n.trim());return Ho.create(r,i)}else return Ho.create(t)}s(Pp,"parseCommonTableExpressionName");var un=c({is(t){return t.kind==="WithNode"},create(t,e){return c({kind:"WithNode",expressions:c([t]),...e})},cloneWithExpression(t,e){return c({...t,expressions:c([...t.expressions,e])})}});var mt=class{#e;constructor(e){this.#e=c(e)}selectFrom(e){return new W({queryId:ne(),executor:this.#e.executor,queryNode:$.create(jt(e),this.#e.withNode)})}insertInto(e){return new Ce({queryId:ne(),executor:this.#e.executor,queryNode:et.create(Ae(e),this.#e.withNode)})}replaceInto(e){return new Ce({queryId:ne(),executor:this.#e.executor,queryNode:et.create(Ae(e),this.#e.withNode,!0)})}deleteFrom(e){return new ae({queryId:ne(),executor:this.#e.executor,queryNode:ar.create(or(e),this.#e.withNode)})}updateTable(e){return new ue({queryId:ne(),executor:this.#e.executor,queryNode:_r.create(or(e),this.#e.withNode)})}with(e,r){let i=jo(e,r);return new mt({...this.#e,withNode:this.#e.withNode?un.cloneWithExpression(this.#e.withNode,i):un.create(i)})}withRecursive(e,r){let i=jo(e,r);return new mt({...this.#e,withNode:this.#e.withNode?un.cloneWithExpression(this.#e.withNode,i):un.create(i,{recursive:!0})})}withPlugin(e){return new mt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new mt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new mt({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}};s(mt,"QueryCreator");function Mo(){return new W({queryId:ne(),executor:ei,queryNode:$.create(jt([]))})}s(Mo,"createSelectQueryBuilder");function Ko(){return new ri({executor:ei})}s(Ko,"createExpressionBuilder");function Uu(){return new mt({executor:ei})}s(Uu,"createQueryCreator");function ws(t,e){return new Ye({joinNode:at.create(t,or(e))})}s(ws,"createJoinBuilder");function Pu(){return new cr({overNode:Qi.create()})}s(Pu,"createOverBuilder");function bi(t){if($e(t))return t.toOperationNode();if(dt(t))return t(Ko()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}s(bi,"parseExpression");function xs(t){if($e(t))return t.toOperationNode();if(dt(t))return t(Ko()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}s(xs,"parseAliasedExpression");function $r(t){return hu(t)||dt(t)}s($r,"isExpressionOrFactory");function jt(t){return Ir(t)?t.map(e=>or(e)):[or(t)]}s(jt,"parseTableExpressionOrList");function or(t){return Ze(t)?_p(t):xs(t)}s(or,"parseTableExpression");function _p(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(Vu);return xt.create(Ae(r),Q.create(i))}else return Ae(t)}s(_p,"parseAliasedTable");function Ae(t){let e=".";if(t.includes(e)){let[r,i]=t.split(e).map(Vu);return ot.createWithSchema(r,i)}else return ot.create(t)}s(Ae,"parseTable");function Vu(t){return t.trim()}s(Vu,"trim");var Xo=c({is(t){return t.kind==="AddColumnNode"},create(t){return c({kind:"AddColumnNode",column:t})}});var lr=c({is(t){return t.kind==="AlterColumnNode"},create(t){return c({kind:"AlterColumnNode",column:ie.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ye=c({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return c({kind:"ColumnDefinitionNode",column:ie.create(t),dataType:e})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):[e]})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):[e]})},cloneWith(t,e){return c({...t,...e})}});var Go=c({is(t){return t.kind==="DropColumnNode"},create(t){return c({kind:"DropColumnNode",column:ie.create(t)})}});var Jo=c({is(t){return t.kind==="RenameColumnNode"},create(t,e){return c({kind:"RenameColumnNode",column:ie.create(t),renameTo:ie.create(e)})}});var Pi=c({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return c({kind:"CheckConstraintNode",expression:t,name:e?Q.create(e):void 0})}});var zu=["no action","restrict","cascade","set null","set default"],_i=c({is(t){return t.kind==="ReferencesNode"},create(t,e){return c({kind:"ReferencesNode",table:t,columns:c([...e])})},cloneWithOnDelete(t,e){return c({...t,onDelete:e})},cloneWithOnUpdate(t,e){return c({...t,onUpdate:e})}});function Is(t){return $e(t)?t.toOperationNode():ut.createImmediate(t)}s(Is,"parseDefaultValueExpression");var cn=c({is(t){return t.kind==="GeneratedNode"},create(t){return c({kind:"GeneratedNode",...t})},createWithExpression(t){return c({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return c({...t,...e})}});var Hu=c({is(t){return t.kind==="DefaultValueNode"},create(t){return c({kind:"DefaultValueNode",defaultValue:t})}});function ki(t){if(zu.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}s(ki,"parseOnModifyForeignAction");var le=class{#e;constructor(e){this.#e=e}autoIncrement(){return new le(ye.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new le(ye.cloneWith(this.#e,{primaryKey:!0}))}references(e){let r=nr(e);if(!Jr.is(r)||Ti.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new le(ye.cloneWith(this.#e,{references:_i.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnDelete(this.#e.references,ki(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnUpdate(this.#e.references,ki(e))}))}unique(){return new le(ye.cloneWith(this.#e,{unique:!0}))}notNull(){return new le(ye.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new le(ye.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new le(ye.cloneWith(this.#e,{defaultTo:Hu.create(Is(e))}))}check(e){return new le(ye.cloneWith(this.#e,{check:Pi.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new le(ye.cloneWith(this.#e,{generated:cn.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:cn.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:cn.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new le(ye.cloneWith(this.#e,{generated:cn.cloneWith(this.#e.generated,{stored:!0})}))}modifyFront(e){return new le(ye.cloneWithFrontModifier(this.#e,e.toOperationNode()))}modifyEnd(e){return new le(ye.cloneWithEndModifier(this.#e,e.toOperationNode()))}toOperationNode(){return this.#e}};s(le,"ColumnDefinitionBuilder");z(le,"don't await ColumnDefinitionBuilder instances directly.");var $o=c({is(t){return t.kind==="ModifyColumnNode"},create(t){return c({kind:"ModifyColumnNode",column:t})}});var Os=c({is(t){return t.kind==="DataTypeNode"},create(t){return c({kind:"DataTypeNode",dataType:t})}});function ii(t){return $e(t)?t.toOperationNode():Os.create(t)}s(ii,"parseDataTypeExpression");var ni=c({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,i){return c({kind:"ForeignKeyConstraintNode",columns:t,references:_i.create(e,r),name:i?Q.create(i):void 0})},cloneWith(t,e){return c({...t,...e})}});var Pt=class{#e;constructor(e){this.#e=e}onDelete(e){return new Pt(ni.cloneWith(this.#e,{onDelete:ki(e)}))}onUpdate(e){return new Pt(ni.cloneWith(this.#e,{onUpdate:ki(e)}))}toOperationNode(){return this.#e}};s(Pt,"ForeignKeyConstraintBuilder");z(Pt,"don't await ForeignKeyConstraintBuilder instances directly.");var ln=c({is(t){return t.kind==="AddConstraintNode"},create(t){return c({kind:"AddConstraintNode",constraint:t})}});var Rs=c({is(t){return t.kind==="UniqueConstraintNode"},create(t,e){return c({kind:"UniqueConstraintNode",columns:c(t.map(ie.create)),name:e?Q.create(e):void 0})}});var qi=c({is(t){return t.kind==="DropConstraintNode"},create(t){return c({kind:"DropConstraintNode",constraintName:Q.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Lr=class{alterColumnNode;constructor(e){this.alterColumnNode=e}setDataType(e){return new qr(lr.cloneWith(this.alterColumnNode,{dataType:Os.create(e)}))}setDefault(e){return new qr(lr.cloneWith(this.alterColumnNode,{setDefault:Is(e)}))}dropDefault(){return new qr(lr.cloneWith(this.alterColumnNode,{dropDefault:!0}))}setNotNull(){return new qr(lr.cloneWith(this.alterColumnNode,{setNotNull:!0}))}dropNotNull(){return new qr(lr.cloneWith(this.alterColumnNode,{dropNotNull:!0}))}};s(Lr,"AlterColumnBuilder");var qr=class extends Lr{toOperationNode(){return this.alterColumnNode}};s(qr,"AlteredColumnBuilder");var fr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(fr,"AlterTableExecutor");z(fr,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");var dr=class{#e;constructor(e){this.#e=c(e)}onDelete(e){return new dr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new dr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}toOperationNode(){return this.#e.executor.transformQuery(he.cloneWithTableProps(this.#e.node,{addConstraint:ln.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(dr,"AlterTableAddForeignKeyConstraintBuilder");z(dr,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");var Kt=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Kt({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{ifExists:!0})})})}cascade(){return new Kt({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new Kt({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.cloneWith(this.#e.node.dropConstraint,{modifier:"restrict"})})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Kt,"AlterTableDropConstraintBuilder");z(Kt,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");var Li=class{#e;constructor(e){this.#e=c(e)}renameTo(e){return new fr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{renameTo:Ae(e)})})}setSchema(e){return new fr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{setSchema:Q.create(e)})})}alterColumn(e,r){let i=r(new Lr(lr.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Go.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Jo.create(e,r))})}addColumn(e,r,i=Or){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xo.create(n.toOperationNode()))})}modifyColumn(e,r,i=Or){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,$o.create(n.toOperationNode()))})}addUniqueConstraint(e,r){return new fr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:ln.create(Rs.create(r,e))})})}addCheckConstraint(e,r){return new fr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:ln.create(Pi.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,i,n){return new dr({...this.#e,constraintBuilder:new Pt(ni.create(r.map(ie.create),Ae(i),n.map(ie.create),e))})}dropConstraint(e){return new Kt({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:qi.create(e)})})}$call(e){return e(this)}call(e){return this.$call(e)}};s(Li,"AlterTableBuilder");var rt=class{#e;constructor(e){this.#e=c(e)}alterColumn(e,r){let i=r(new Lr(lr.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Go.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Jo.create(e,r))})}addColumn(e,r,i=Or){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xo.create(n.toOperationNode()))})}modifyColumn(e,r,i=Or){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,$o.create(n.toOperationNode()))})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(rt,"AlterTableColumnAlteringBuilder");z(Li,"don't await AlterTableBuilder instances");z(Lr,"don't await AlterColumnBuilder instances");z(rt,"don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`");var ju=c({is(t){return t.kind==="ListNode"},create(t){return c({kind:"ListNode",items:c(t)})}});var ct=class{#e;constructor(e){this.#e=c(e)}ifNotExists(){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{ifNotExists:!0})})}unique(){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{unique:!0})})}on(e){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{table:Ae(e)})})}column(e){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{expression:en(e)})})}columns(e){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{expression:ju.create(e.map(en))})})}expression(e){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{expression:e.toOperationNode()})})}using(e){return new ct({...this.#e,node:Vt.cloneWith(this.#e.node,{using:pe.createWithSql(e)})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(ct,"CreateIndexBuilder");z(ct,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");var Mr=class{#e;constructor(e){this.#e=c(e)}ifNotExists(){return new Mr({...this.#e,node:ps.cloneWith(this.#e.node,{ifNotExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Mr,"CreateSchemaBuilder");z(Mr,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");var Ku=c({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return c({kind:"PrimaryKeyConstraintNode",columns:c(t.map(ie.create)),name:e?Q.create(e):void 0})}});function Xu(t){if(du.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}s(Xu,"parseOnCommitAction");var ze=class{#e;constructor(e){this.#e=c(e)}temporary(){return new ze({...this.#e,node:pt.cloneWith(this.#e.node,{temporary:!0})})}onCommit(e){return new ze({...this.#e,node:pt.cloneWith(this.#e.node,{onCommit:Xu(e)})})}ifNotExists(){return new ze({...this.#e,node:pt.cloneWith(this.#e.node,{ifNotExists:!0})})}addColumn(e,r,i=Or){let n=i(new le(ye.create(e,ii(r))));return new ze({...this.#e,node:pt.cloneWithColumn(this.#e.node,n.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new ze({...this.#e,node:pt.cloneWithConstraint(this.#e.node,Ku.create(r,e))})}addUniqueConstraint(e,r){return new ze({...this.#e,node:pt.cloneWithConstraint(this.#e.node,Rs.create(r,e))})}addCheckConstraint(e,r){return new ze({...this.#e,node:pt.cloneWithConstraint(this.#e.node,Pi.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,i,n,o=Or){let a=o(new Pt(ni.create(r.map(ie.create),Ae(i),n.map(ie.create),e)));return new ze({...this.#e,node:pt.cloneWithConstraint(this.#e.node,a.toOperationNode())})}modifyFront(e){return new ze({...this.#e,node:pt.cloneWithFrontModifier(this.#e.node,e.toOperationNode())})}modifyEnd(e){return new ze({...this.#e,node:pt.cloneWithEndModifier(this.#e.node,e.toOperationNode())})}$call(e){return e(this)}call(e){return this.$call(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(ze,"CreateTableBuilder");z(ze,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");var Xt=class{#e;constructor(e){this.#e=c(e)}on(e){return new Xt({...this.#e,node:xi.cloneWith(this.#e.node,{table:Ae(e)})})}ifExists(){return new Xt({...this.#e,node:xi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new Xt({...this.#e,node:xi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Xt,"DropIndexBuilder");z(Xt,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");var hr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new hr({...this.#e,node:$i.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new hr({...this.#e,node:$i.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(hr,"DropSchemaBuilder");z(hr,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");var pr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new pr({...this.#e,node:Yi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new pr({...this.#e,node:Yi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(pr,"DropTableBuilder");z(pr,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");var _t=c({is(t){return t.kind==="CreateViewNode"},create(t){return c({kind:"CreateViewNode",name:st.create(t)})},cloneWith(t,e){return c({...t,...e})}});var fn=class extends Qr{transformValue(e){return{...super.transformValue(e),immediate:!0}}};s(fn,"ImmediateValueTransformer");var dn=class{#e=new fn;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}};s(dn,"ImmediateValuePlugin");var yt=class{#e;constructor(e){this.#e=c(e)}temporary(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{temporary:!0})})}materialized(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{materialized:!0})})}ifNotExists(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{ifNotExists:!0})})}orReplace(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{orReplace:!0})})}columns(e){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{columns:e.map(en)})})}as(e){let r=e.withPlugin(new dn).toOperationNode();return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{as:r})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(yt,"CreateViewBuilder");z(yt,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");var Mi=c({is(t){return t.kind==="DropViewNode"},create(t){return c({kind:"DropViewNode",name:st.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Gt=class{#e;constructor(e){this.#e=c(e)}materialized(){return new Gt({...this.#e,node:Mi.cloneWith(this.#e.node,{materialized:!0})})}ifExists(){return new Gt({...this.#e,node:Mi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new Gt({...this.#e,node:Mi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Gt,"DropViewBuilder");z(Gt,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");var Ds=c({is(t){return t.kind==="CreateTypeNode"},create(t){return c({kind:"CreateTypeNode",name:t})},cloneWithEnum(t,e){return c({...t,enum:Ai.create(e.map(r=>ut.createImmediate(r)))})}});var Fr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}asEnum(e){return new Fr({...this.#e,node:Ds.cloneWithEnum(this.#e.node,e)})}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Fr,"CreateTypeBuilder");z(Fr,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");var Ps=c({is(t){return t.kind==="DropTypeNode"},create(t){return c({kind:"DropTypeNode",name:t})},cloneWith(t,e){return c({...t,...e})}});var Wr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Wr({...this.#e,node:Ps.cloneWith(this.#e.node,{ifExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Wr,"DropTypeBuilder");z(Wr,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");function Yo(t){let e=".";if(t.includes(e)){let r=t.split(e).map(kp);if(r.length===2)return st.createWithSchema(r[0],r[1]);throw new Error(`invalid schemable identifier ${t}`)}else return st.create(t)}s(Yo,"parseSchemableIdentifier");function kp(t){return t.trim()}s(kp,"trim");var mr=class{#e;constructor(e){this.#e=e}createTable(e){return new ze({queryId:ne(),executor:this.#e,node:pt.create(Ae(e))})}dropTable(e){return new pr({queryId:ne(),executor:this.#e,node:Yi.create(Ae(e))})}createIndex(e){return new ct({queryId:ne(),executor:this.#e,node:Vt.create(e)})}dropIndex(e){return new Xt({queryId:ne(),executor:this.#e,node:xi.create(e)})}createSchema(e){return new Mr({queryId:ne(),executor:this.#e,node:ps.create(e)})}dropSchema(e){return new hr({queryId:ne(),executor:this.#e,node:$i.create(e)})}alterTable(e){return new Li({queryId:ne(),executor:this.#e,node:he.create(e)})}createView(e){return new yt({queryId:ne(),executor:this.#e,node:_t.create(e)})}dropView(e){return new Gt({queryId:ne(),executor:this.#e,node:Mi.create(e)})}createType(e){return new Fr({queryId:ne(),executor:this.#e,node:Ds.create(Yo(e))})}dropType(e){return new Wr({queryId:ne(),executor:this.#e,node:Ps.create(Yo(e))})}withPlugin(e){return new mr(this.#e.withPlugin(e))}withoutPlugins(){return new mr(this.#e.withoutPlugins())}withSchema(e){return new mr(this.#e.withPluginAtFront(new Dt(e)))}};s(mr,"SchemaModule");var hn=class{ref(e){return new tn(e)}};s(hn,"DynamicModule");var pn=class{#e;constructor(e){this.#e=e}async provideConnection(e){let r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}};s(pn,"DefaultConnectionProvider");var kt=class extends Zr{#e;#t;#r;constructor(e,r,i,n=[]){super(n),this.#e=e,this.#t=r,this.#r=i}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new kt(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new kt(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new kt(this.#e,this.#t,this.#r,[])}};s(kt,"DefaultQueryExecutor");function Qo(){return typeof performance<"u"&&dt(performance.now)?performance.now():Date.now()}s(Qo,"performanceNow");var mn=class{#e;#t;#r;#i;#n=new WeakSet;constructor(e,r){this.#e=e,this.#t=r}async init(){this.#r||(this.#r=this.#e.init().catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){await this.init();let e=await this.#e.acquireConnection();return this.#n.has(e)||(this.#s()&&this.#o(e),this.#n.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#s(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#o(e){let r=e.executeQuery;e.executeQuery=async i=>{let n=Qo();try{return await r.call(e,i)}catch(o){throw this.#u(o),o}finally{this.#c(i,n)}}}#u(e){this.#t.error(()=>({level:"error",error:e}))}#c(e,r){this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#l(r)}))}#l(e){return Qo()-e}};s(mn,"RuntimeDriver");var Fi=class{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t;let r=this.#r(e);return this.#t=r.then(()=>{this.#t=void 0}).catch(()=>{this.#t=void 0}),r}async#r(e){return await e(this.#e)}};s(Fi,"SingleConnectionProvider");var Gu=["read uncommitted","read committed","repeatable read","serializable"];var aP=c(["query","error"]),yn=class{#e;#t;constructor(e){dt(e)?(this.#t=e,this.#e=c({query:!0,error:!0})):(this.#t=qp,this.#e=c({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}query(e){this.#e.query&&this.#t(e())}error(e){this.#e.error&&this.#t(e())}};s(yn,"Log");function qp(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${t}`))}s(qp,"defaultLogger");var qt=class extends mt{#e;constructor(e){let r,i;if(Lp(e))r={executor:e.executor},i={...e};else{let n=e.dialect,o=n.createDriver(),a=n.createQueryCompiler(),u=n.createAdapter(),l=new yn(e.log??[]),h=new mn(o,l),y=new pn(h),v=new kt(a,u,y,e.plugins??[]);r={executor:v},i={config:e,executor:v,dialect:n,driver:h}}super(r),this.#e=c(i)}get schema(){return new mr(this.#e.executor)}get dynamic(){return new hn}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}get fn(){return new ti}transaction(){return new si({...this.#e})}connection(){return new vn({...this.#e})}withPlugin(e){return new qt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new qt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new qt({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}};s(qt,"Kysely");var Br=class extends qt{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new Br({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Br({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new Br({...this.#e})}};s(Br,"Transaction");function Lp(t){return ht(t)&&ht(t.config)&&ht(t.driver)&&ht(t.executor)&&ht(t.dialect)}s(Lp,"isKyselyProps");var vn=class{#e;constructor(e){this.#e=c(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{let i=this.#e.executor.withConnectionProvider(new Fi(r)),n=new qt({...this.#e,executor:i});return await e(n)})}};s(vn,"ConnectionBuilder");z(vn,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");var si=class{#e;constructor(e){this.#e=c(e)}setIsolationLevel(e){return new si({...this.#e,isolationLevel:e})}async execute(e){let{isolationLevel:r,...i}=this.#e,n={isolationLevel:r};return Mp(n),this.#e.executor.provideConnection(async o=>{let a=this.#e.executor.withConnectionProvider(new Fi(o)),u=new Br({...i,executor:a});try{await this.#e.driver.beginTransaction(o,n);let l=await e(u);return await this.#e.driver.commitTransaction(o),l}catch(l){throw await this.#e.driver.rollbackTransaction(o),l}})}};s(si,"TransactionBuilder");z(si,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function Mp(t){if(t.isolationLevel&&!Gu.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}s(Mp,"validateTransactionSettings");var it=Object.assign((t,...e)=>new Pe({queryId:ne(),rawNode:pe.create(t,e?.map(Ht)??[])}),{ref(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(nr(t))})},value(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(Ht(t))})},table(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(Ae(t))})},id(...t){let e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",new Pe({queryId:ne(),rawNode:pe.create(e,t.map(Q.create))})},literal(t){return new Pe({queryId:ne(),rawNode:pe.createWithChild(ut.createImmediate(t))})},raw(t){return new Pe({queryId:ne(),rawNode:pe.createWithSql(t)})},join(t,e=it`, `){let r=new Array(2*t.length-1),i=e.toOperationNode();for(let n=0;n<t.length;++n)r[2*n]=Ht(t[n]),n!==t.length-1&&(r[2*n+1]=i);return new Pe({queryId:ne(),rawNode:pe.createWithChildren(r)})}});var gn=class{nodeStack=[];get parentNode(){return this.nodeStack[this.nodeStack.length-2]}#e=c({AliasNode:this.visitAlias.bind(this),ColumnNode:this.visitColumn.bind(this),IdentifierNode:this.visitIdentifier.bind(this),SchemableIdentifierNode:this.visitSchemableIdentifier.bind(this),RawNode:this.visitRaw.bind(this),ReferenceNode:this.visitReference.bind(this),SelectQueryNode:this.visitSelectQuery.bind(this),SelectionNode:this.visitSelection.bind(this),TableNode:this.visitTable.bind(this),FromNode:this.visitFrom.bind(this),SelectAllNode:this.visitSelectAll.bind(this),AndNode:this.visitAnd.bind(this),OrNode:this.visitOr.bind(this),ValueNode:this.visitValue.bind(this),ValueListNode:this.visitValueList.bind(this),PrimitiveValueListNode:this.visitPrimitiveValueList.bind(this),ParensNode:this.visitParens.bind(this),JoinNode:this.visitJoin.bind(this),OperatorNode:this.visitOperator.bind(this),WhereNode:this.visitWhere.bind(this),InsertQueryNode:this.visitInsertQuery.bind(this),DeleteQueryNode:this.visitDeleteQuery.bind(this),ReturningNode:this.visitReturning.bind(this),CreateTableNode:this.visitCreateTable.bind(this),AddColumnNode:this.visitAddColumn.bind(this),ColumnDefinitionNode:this.visitColumnDefinition.bind(this),DropTableNode:this.visitDropTable.bind(this),DataTypeNode:this.visitDataType.bind(this),OrderByNode:this.visitOrderBy.bind(this),OrderByItemNode:this.visitOrderByItem.bind(this),GroupByNode:this.visitGroupBy.bind(this),GroupByItemNode:this.visitGroupByItem.bind(this),UpdateQueryNode:this.visitUpdateQuery.bind(this),ColumnUpdateNode:this.visitColumnUpdate.bind(this),LimitNode:this.visitLimit.bind(this),OffsetNode:this.visitOffset.bind(this),OnConflictNode:this.visitOnConflict.bind(this),OnDuplicateKeyNode:this.visitOnDuplicateKey.bind(this),CreateIndexNode:this.visitCreateIndex.bind(this),DropIndexNode:this.visitDropIndex.bind(this),ListNode:this.visitList.bind(this),PrimaryKeyConstraintNode:this.visitPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.visitUniqueConstraint.bind(this),ReferencesNode:this.visitReferences.bind(this),CheckConstraintNode:this.visitCheckConstraint.bind(this),WithNode:this.visitWith.bind(this),CommonTableExpressionNode:this.visitCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.visitCommonTableExpressionName.bind(this),HavingNode:this.visitHaving.bind(this),CreateSchemaNode:this.visitCreateSchema.bind(this),DropSchemaNode:this.visitDropSchema.bind(this),AlterTableNode:this.visitAlterTable.bind(this),DropColumnNode:this.visitDropColumn.bind(this),RenameColumnNode:this.visitRenameColumn.bind(this),AlterColumnNode:this.visitAlterColumn.bind(this),ModifyColumnNode:this.visitModifyColumn.bind(this),AddConstraintNode:this.visitAddConstraint.bind(this),DropConstraintNode:this.visitDropConstraint.bind(this),ForeignKeyConstraintNode:this.visitForeignKeyConstraint.bind(this),CreateViewNode:this.visitCreateView.bind(this),DropViewNode:this.visitDropView.bind(this),GeneratedNode:this.visitGenerated.bind(this),DefaultValueNode:this.visitDefaultValue.bind(this),OnNode:this.visitOn.bind(this),ValuesNode:this.visitValues.bind(this),SelectModifierNode:this.visitSelectModifier.bind(this),CreateTypeNode:this.visitCreateType.bind(this),DropTypeNode:this.visitDropType.bind(this),ExplainNode:this.visitExplain.bind(this),DefaultInsertValueNode:this.visitDefaultInsertValue.bind(this),AggregateFunctionNode:this.visitAggregateFunction.bind(this),OverNode:this.visitOver.bind(this),PartitionByNode:this.visitPartitionBy.bind(this),PartitionByItemNode:this.visitPartitionByItem.bind(this),SetOperationNode:this.visitSetOperation.bind(this),BinaryOperationNode:this.visitBinaryOperation.bind(this),UnaryOperationNode:this.visitUnaryOperation.bind(this),UsingNode:this.visitUsing.bind(this)});visitNode=e=>{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}};s(gn,"OperationNodeVisitor");var oi=class extends gn{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),c({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){let r=this.parentNode!==void 0&&!et.is(this.parentNode)&&!_t.is(this.parentNode)&&!Cs.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select "),e.distinctOn&&(this.compileDistinctOn(e.distinctOn),this.append(" ")),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.selections&&(this.compileList(e.selections),this.append(" ")),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){let i=e.length-1;for(let n=0;n<=i;n++)this.visitNode(e[n]),n<i&&this.append(r)}visitWhere(e){this.append("where "),this.visitNode(e.where)}visitHaving(e){this.append("having "),this.visitNode(e.having)}visitInsertQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append(e.replace?"replace":"insert"),e.ignore&&this.append(" ignore"),this.append(" into "),this.visitNode(e.into),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.values&&(this.append(" "),this.visitNode(e.values)),e.onConflict&&(this.append(" "),this.visitNode(e.onConflict)),e.onDuplicateKey&&(this.append(" "),this.visitNode(e.onDuplicateKey)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitValues(e){this.append("values "),this.compileList(e.values)}visitDeleteQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("delete "),this.visitNode(e.from),e.using&&(this.append(" "),this.visitNode(e.using)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitReturning(e){this.append("returning "),this.compileList(e.selections)}visitAlias(e){this.visitNode(e.node),this.append(" as "),this.visitNode(e.alias)}visitReference(e){this.visitNode(e.table),this.append("."),this.visitNode(e.column)}visitSelectAll(e){this.append("*")}visitIdentifier(e){this.append(this.getLeftIdentifierWrapper()),this.compileUnwrappedIdentifier(e),this.append(this.getRightIdentifierWrapper())}compileUnwrappedIdentifier(e){if(!Ze(e.name))throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");this.append(this.sanitizeIdentifier(e.name))}visitAnd(e){this.visitNode(e.left),this.append(" and "),this.visitNode(e.right)}visitOr(e){this.visitNode(e.left),this.append(" or "),this.visitNode(e.right)}visitValue(e){e.immediate?this.appendImmediateValue(e.value):this.appendValue(e.value)}visitValueList(e){this.append("("),this.compileList(e.values),this.append(")")}visitPrimitiveValueList(e){this.append("(");let{values:r}=e;for(let i=0;i<r.length;++i)this.appendValue(r[i]),i!==r.length-1&&this.append(", ");this.append(")")}visitParens(e){this.append("("),this.visitNode(e.node),this.append(")")}visitJoin(e){this.append(Wp[e.joinType]),this.append(" "),this.visitNode(e.table),e.on&&(this.append(" "),this.visitNode(e.on))}visitOn(e){this.append("on "),this.visitNode(e.on)}visitRaw(e){let{sqlFragments:r,parameters:i}=e;for(let n=0;n<r.length;++n)this.append(r[n]),i.length>n&&this.visitNode(i[n])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.frontModifiers&&e.frontModifiers.length>0&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.expression&&(this.append(" ("),this.visitNode(e.expression),this.append(")"))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.columnAlterations&&this.compileList(e.columnAlterations)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(Fp[e.modifier])}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.visitNode(e.column),this.append(")"),e.filter&&(this.append(" filter("),this.visitNode(e.filter),this.append(")")),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}visitBinaryOperation(e){this.visitNode(e.leftOperand),this.append(" "),this.visitNode(e.operator),this.append(" "),this.visitNode(e.rightOperand)}visitUnaryOperation(e){this.visitNode(e.operator),this.append(" "),this.visitNode(e.operand)}visitUsing(e){this.append("using "),this.compileList(e.tables)}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){let r=this.getLeftIdentifierWrapper(),i=this.getRightIdentifierWrapper(),n="";for(let o of e)n+=o,o===r?n+=r:o===i&&(n+=i);return n}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(Ze(e))this.append(`'${e}'`);else if(uu(e)||ds(e))this.append(e.toString());else if(hs(e))this.append("null");else if(cu(e))this.appendImmediateValue(e.toISOString());else if(lu(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}};s(oi,"DefaultQueryCompiler");var Fp=c({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),Wp=c({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"});var ai=class{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}};s(ai,"DialectAdapterBase");var Nn=class{transformQuery(e){return e.node}async transformResult(e){return e.result}};s(Nn,"NoopPlugin");var xn="kysely_migration",Bi="kysely_migration_lock",Zo="migration_lock",ea=c({__noMigrations__:!0}),wn=class{#e;constructor(e){this.#e=c(e)}async getMigrations(){let e=await this.#a(this.#i)?await this.#e.db.withPlugin(this.#s).selectFrom(this.#i).select(["name","timestamp"]).execute():[];return(await this.#h()).map(({name:i,...n})=>{let o=e.find(a=>a.name===i);return{name:i,migration:n,executedAt:o?new Date(o.timestamp):void 0}})}async migrateToLatest(){return this.#t(({migrations:e})=>e.length-1)}async migrateTo(e){return this.#t(({migrations:r})=>{if(e===ea)return-1;let i=r.findIndex(n=>n.name===e);if(i===-1)throw new Error(`migration "${e}" doesn't exist`);return i})}async migrateUp(){return this.#t(({currentIndex:e,migrations:r})=>Math.min(e+1,r.length-1))}async migrateDown(){return this.#t(({currentIndex:e})=>Math.max(e-1,-1))}async#t(e){try{return await this.#o(),await this.#m(e)}catch(r){return r instanceof Wi?r.resultSet:{error:r}}}get#r(){return this.#e.migrationTableSchema}get#i(){return this.#e.migrationTableName??xn}get#n(){return this.#e.migrationLockTableName??Bi}get#s(){return this.#r?new Dt(this.#r):new Nn}async#o(){await this.#u(),await this.#c(),await this.#l(),await this.#p()}async#u(){if(this.#r&&!await this.#f())try{await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute()}catch(e){if(!await this.#f())throw e}}async#c(){if(!await this.#a(this.#i))try{this.#r&&await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute(),await this.#e.db.schema.withPlugin(this.#s).createTable(this.#i).ifNotExists().addColumn("name","varchar(255)",e=>e.notNull().primaryKey()).addColumn("timestamp","varchar(255)",e=>e.notNull()).execute()}catch(e){if(!await this.#a(this.#i))throw e}}async#l(){if(!await this.#a(this.#n))try{await this.#e.db.schema.withPlugin(this.#s).createTable(this.#n).ifNotExists().addColumn("id","varchar(255)",e=>e.notNull().primaryKey()).addColumn("is_locked","integer",e=>e.notNull().defaultTo(0)).execute()}catch(e){if(!await this.#a(this.#n))throw e}}async#p(){if(!await this.#d())try{await this.#e.db.withPlugin(this.#s).insertInto(this.#n).values({id:Zo,is_locked:0}).execute()}catch(e){if(!await this.#d())throw e}}async#f(){return(await this.#e.db.introspection.getSchemas()).some(r=>r.name===this.#r)}async#a(e){let r=this.#r;return(await this.#e.db.introspection.getTables({withInternalKyselyTables:!0})).some(n=>n.name===e&&(!r||n.schema===r))}async#d(){return!!await this.#e.db.withPlugin(this.#s).selectFrom(this.#n).where("id","=",Zo).select("id").executeTakeFirst()}async#m(e){let r=this.#e.db.getExecutor().adapter,i=c({lockTable:this.#e.migrationLockTableName??Bi,lockRowId:Zo,lockTableSchema:this.#e.migrationTableSchema}),n=s(async o=>{try{await r.acquireMigrationLock(o,i);let a=await this.#y(o);if(a.migrations.length===0)return{results:[]};let u=e(a);return u===void 0?{results:[]}:u<a.currentIndex?await this.#N(o,a,u):u>a.currentIndex?await this.#w(o,a,u):{results:[]}}finally{await r.releaseMigrationLock(o,i)}},"run");return r.supportsTransactionalDdl?this.#e.db.transaction().execute(n):this.#e.db.connection().execute(n)}async#y(e){let r=await this.#h(),i=await this.#v(e);return this.#g(r,i),c({migrations:r,currentIndex:r.findIndex(n=>n.name===fu(i))})}async#h(){let e=await this.#e.provider.getMigrations();return Object.keys(e).sort().map(r=>({...e[r],name:r}))}async#v(e){return(await e.withPlugin(this.#s).selectFrom(this.#i).select("name").orderBy("name").execute()).map(i=>i.name)}#g(e,r){for(let i of r)if(!e.some(n=>n.name===i))throw new Error(`corrupted migrations: previously executed migration ${i} is missing`);for(let i=0;i<r.length;++i)if(e[i].name!==r[i])throw new Error(`corrupted migrations: expected previously executed migration ${r[i]} to be at index ${i} but ${e[i].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`)}async#N(e,r,i){let n=[];for(let o=r.currentIndex;o>i;--o)n.push({migrationName:r.migrations[o].name,direction:"Down",status:"NotExecuted"});for(let o=0;o<n.length;++o){let a=r.migrations.find(u=>u.name===n[o].migrationName);try{a.down&&(await a.down(e),await e.withPlugin(this.#s).deleteFrom(this.#i).where("name","=",a.name).execute(),n[o]={migrationName:a.name,direction:"Down",status:"Success"})}catch(u){throw n[o]={migrationName:a.name,direction:"Down",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}async#w(e,r,i){let n=[];for(let o=r.currentIndex+1;o<=i;++o)n.push({migrationName:r.migrations[o].name,direction:"Up",status:"NotExecuted"});for(let o=0;o<n.length;++o){let a=r.migrations.find(u=>u.name===n[o].migrationName);try{await a.up(e),await e.withPlugin(this.#s).insertInto(this.#i).values({name:a.name,timestamp:new Date().toISOString()}).execute(),n[o]={migrationName:a.name,direction:"Up",status:"Success"}}catch(u){throw n[o]={migrationName:a.name,direction:"Up",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}};s(wn,"Migrator");var Wi=class extends Error{#e;constructor(e){super(),this.#e=e}get resultSet(){return this.#e}};s(Wi,"MigrationResultSetError");var Bp=/"/g,En=class extends oi{sanitizeIdentifier(e){return e.replace(Bp,'""')}};s(En,"PostgresQueryCompiler");var Cn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("pg_catalog.pg_namespace").select("nspname").$castTo().execute()).map(r=>({name:r.nspname}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("pg_catalog.pg_attribute as a").innerJoin("pg_catalog.pg_class as c","a.attrelid","c.oid").innerJoin("pg_catalog.pg_namespace as ns","c.relnamespace","ns.oid").innerJoin("pg_catalog.pg_type as typ","a.atttypid","typ.oid").innerJoin("pg_catalog.pg_namespace as dtns","typ.typnamespace","dtns.oid").select(["a.attname as column","a.attnotnull as not_null","a.atthasdef as has_default","c.relname as table","ns.nspname as schema","typ.typname as type","dtns.nspname as type_schema",this.#e.selectFrom("pg_class").select(it`true`.as("auto_incrementing")).whereRef("relnamespace","=","c.relnamespace").where("relkind","=","S").where("relname","=",it`c.relname || '_' || a.attname || '_seq'`).as("auto_incrementing")]).where("c.relkind","=","r").where("ns.nspname","!~","^pg_").where("ns.nspname","!=","information_schema").where("a.attnum",">=",0).where("a.attisdropped","!=",!0).orderBy("ns.nspname").orderBy("c.relname").orderBy("a.attnum").$castTo();e.withInternalKyselyTables||(r=r.where("c.relname","!=",xn).where("c.relname","!=",Bi));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(o=>o.name===i.table&&o.schema===i.schema);return n||(n=c({name:i.table,schema:i.schema,columns:[]}),r.push(n)),n.columns.push(c({name:i.column,dataType:i.type,dataTypeSchema:i.type_schema,isNullable:!i.not_null,isAutoIncrementing:!!i.auto_incrementing,hasDefaultValue:i.has_default})),r},[])}};s(Cn,"PostgresIntrospector");var Up=BigInt("3853314791062309107"),Sn=class extends ai{get supportsTransactionalDdl(){return!0}get supportsReturning(){return!0}async acquireMigrationLock(e){await it`select pg_advisory_xact_lock(${it.literal(Up)})`.execute(e)}async releaseMigrationLock(){}};s(Sn,"PostgresAdapter");var Vp=/`/g,Tn=class extends oi{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getExplainOptionAssignment(){return"="}getExplainOptionsDelimiter(){return" "}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return"`"}getRightIdentifierWrapper(){return"`"}sanitizeIdentifier(e){return e.replace(Vp,"``")}};s(Tn,"MysqlQueryCompiler");var bn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("information_schema.schemata").select("schema_name").$castTo().execute()).map(r=>({name:r.SCHEMA_NAME}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("information_schema.columns").select(["COLUMN_NAME","COLUMN_DEFAULT","TABLE_NAME","TABLE_SCHEMA","IS_NULLABLE","DATA_TYPE","EXTRA"]).where("table_schema","=",it`database()`).orderBy("table_name").orderBy("ordinal_position").$castTo();e.withInternalKyselyTables||(r=r.where("table_name","!=",xn).where("table_name","!=",Bi));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(o=>o.name===i.TABLE_NAME);return n||(n=c({name:i.TABLE_NAME,schema:i.TABLE_SCHEMA,columns:[]}),r.push(n)),n.columns.push(c({name:i.COLUMN_NAME,dataType:i.DATA_TYPE,isNullable:i.IS_NULLABLE==="YES",isAutoIncrementing:i.EXTRA.toLowerCase().includes("auto_increment"),hasDefaultValue:i.COLUMN_DEFAULT!==null})),r},[])}};s(bn,"MysqlIntrospector");var Ju="ea586330-2c93-47c8-908d-981d9d270f9d",zp=60*60,An=class extends ai{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}async acquireMigrationLock(e){await it`select get_lock(${it.literal(Ju)}, ${it.literal(zp)})`.execute(e)}async releaseMigrationLock(e){await it`select release_lock(${it.literal(Ju)})`.execute(e)}};s(An,"MysqlAdapter");var In=class{#e;constructor(e){this.#e=e}async init(){}async acquireConnection(){return new _s(this.#e)}async beginTransaction(e){await e.beginTransaction()}async commitTransaction(e){await e.commitTransaction()}async rollbackTransaction(e){await e.rollbackTransaction()}async releaseConnection(e){}async destroy(){}};s(In,"DataApiDriver");var _s=class{#e;#t;constructor(e){this.#e=e}async beginTransaction(){let e=await this.#e.client.beginTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,database:this.#e.database});this.#t=e.transactionId}async commitTransaction(){if(!this.#t)throw new Error("Cannot commit a transaction before creating it");await this.#e.client.commitTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t})}async rollbackTransaction(){if(!this.#t)throw new Error("Cannot rollback a transaction before creating it");await this.#e.client.rollbackTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t})}async executeQuery(e){let r=await this.#e.client.executeStatement({transactionId:this.#t,secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,sql:e.sql,parameters:e.parameters,database:this.#e.database,includeResultMetadata:!0});if(!r.columnMetadata){let o=BigInt(r.numberOfRecordsUpdated||0);return{numAffectedRows:o,numUpdatedOrDeletedRows:o,insertId:r.generatedFields&&r.generatedFields.length>0?BigInt(r.generatedFields[0].longValue):void 0,rows:[]}}return{rows:r.records?.filter(o=>o.length!==0).map(o=>Object.fromEntries(o.map((a,u)=>[r.columnMetadata[u].label||r.columnMetadata[u].name,a.stringValue??a.blobValue??a.longValue??a.arrayValue??a.doubleValue??(a.isNull?null:a.booleanValue)])))||[]}}async*streamQuery(e,r){throw new Error("Data API does not support streaming")}};s(_s,"DataApiConnection");var On=class extends En{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...$u(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};s(On,"PostgresDataApiQueryCompiler");var Rn=class extends Tn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...$u(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};s(Rn,"MysqlDataApiQueryCompiler");function $u(t){switch(typeof t){case"bigint":return{value:{doubleValue:Number(t)}};case"boolean":return{value:{booleanValue:t}};case"number":return Number.isInteger(t)?{value:{longValue:t}}:{value:{doubleValue:t}};case"object":if(t==null)return{value:{isNull:!0}};if(Buffer.isBuffer(t))return{value:{blobValue:t}};if(t instanceof Date)return{typeHint:"TIMESTAMP",value:{stringValue:Yu(t.toISOString())}};if(t?.value&&Kp(t.value))return t.typeHint&&t.value.stringValue&&typeof t.value.stringValue=="string"&&(t.value.stringValue=Hp(t.typeHint,t.value.stringValue)),t;break;case"string":return{value:{stringValue:t}}}throw new Ui("Could not serialize value")}s($u,"serialize");function Hp(t,e){switch(t){case"DATE":return ta(e).slice(0,10);case"TIME":return e.match(/^\d{4}-\d{2}-\d{2}/)?ta(e).slice(11,23):jp(e);case"TIMESTAMP":return Yu(ta(e))}return e}s(Hp,"fixStringValue");function jp(t){let e=(t||"00:00:00").split(":");for(;e.length<3;)e.push("00");return e.join(":").slice(0,12)}s(jp,"fixTimeString");function Yu(t){return t.replace("T"," ").slice(0,23)}s(Yu,"fixISOString");function ta(t){return new Date(Date.parse(t)).toISOString()}s(ta,"parseToISOString");function Kp(t){for(let e of Gp)if(t[e])return!0;if(t.arrayValue){for(let e of Xp)if(t.arrayValue?.[e])return!0}return!1}s(Kp,"isValueObject");var Ui=class extends Error{constructor(e){super(e),this.name=Ui.name}};s(Ui,"QueryCompilerError");var Xp=["booleanValues","doubleValues","longValues","stringValues"],Gp=["blobValue","booleanValue","doubleValue","isNull","longValue","stringValue"];var Dn=class{#e;constructor(e){this.#e=e}createAdapter(){if(this.#e.mode==="postgres")return new Sn;if(this.#e.mode==="mysql")return new An;throw new Error("Unknown mode "+this.#e.mode)}createDriver(){return new In(this.#e.driver)}createQueryCompiler(){if(this.#e.mode==="postgres")return new On;if(this.#e.mode==="mysql")return new Rn;throw new Error("Unknown mode "+this.#e.mode)}createIntrospector(e){if(this.#e.mode==="postgres")return new Cn(e);if(this.#e.mode==="mysql")return new bn(e);throw new Error("Unknown mode "+this.#e.mode)}};s(Dn,"DataApiDialect");var rp=hp(tp(),1);import ON from"url";async function YF(t){let e=new qt({dialect:new Dn({mode:process.env.RDS_ENGINE_MODE,driver:{client:new rp.default,database:t?.database||process.env.RDS_DATABASE,secretArn:process.env.RDS_SECRET,resourceArn:process.env.RDS_ARN}})}),r=new wn({db:e,provider:new Ao(IN.resolve(process.env.RDS_MIGRATIONS_PATH))});if(!t.type||t.type==="latest"){let i=await r.migrateToLatest(),n=i.error||i.results?.find(o=>o.status==="Error");if(n)throw n;return i}if(t.type==="to"){if(!t.data.name)return await r.migrateTo(ea);let i=await r.migrateTo(t.data.name),n=i.error||i.results?.find(o=>o.status==="Error");if(n)throw n;return i}if(t.type==="list")return await r.getMigrations()}s(YF,"handler");var Ao=class{#e;constructor(e){this.#e=e}async getMigrations(){let e=await import("fs/promises"),r=await import("path"),i={},n=await e.readdir(this.#e);for(let o of n)if(o.endsWith(".js")||o.endsWith(".cjs")||o.endsWith(".mjs")){let[a]=r.basename(o).split("."),u=r.join(this.#e,o);if(process.env.LAMBDA_TASK_ROOT){let h=await import(u);i[a]=h;continue}let l=u.replace(/(mjs|cjs|js)/g,`${Date.now()}.$1`);try{await e.copyFile(u,l);let h=await import(ON.pathToFileURL(l).href);i[a]=h}catch(h){console.error(h)}await e.rm(l)}return i}};s(Ao,"DynamicFileMigrationProvider");export{YF as handler};
|
|
30
30
|
/*! Bundled license information:
|
|
31
31
|
|
|
32
32
|
sax/lib/sax.js:
|