@moicky/dynamodb 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- (()=>{var e={2311:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>In,AttributeAction:()=>_r,AttributeValue:()=>zo,BackupInUseException:()=>Or,BackupNotFoundException:()=>Lr,BackupStatus:()=>xr,BackupType:()=>Cr,BackupTypeFilter:()=>Fr,BatchExecuteStatementCommand:()=>Np,BatchGetItemCommand:()=>Ap,BatchStatementErrorCodeEnum:()=>Br,BatchWriteItemCommand:()=>kp,BillingMode:()=>Tr,ComparisonOperator:()=>Hr,ConditionalCheckFailedException:()=>Kr,ConditionalOperator:()=>Wr,ContinuousBackupsStatus:()=>Qr,ContinuousBackupsUnavailableException:()=>Yr,ContributorInsightsAction:()=>Zr,ContributorInsightsStatus:()=>eo,CreateBackupCommand:()=>Dp,CreateGlobalTableCommand:()=>Rp,CreateTableCommand:()=>Op,DeleteBackupCommand:()=>Lp,DeleteItemCommand:()=>Fp,DeleteTableCommand:()=>zp,DescribeBackupCommand:()=>Bp,DescribeContinuousBackupsCommand:()=>Up,DescribeContributorInsightsCommand:()=>Mp,DescribeEndpointsCommand:()=>Ga,DescribeExportCommand:()=>$p,DescribeGlobalTableCommand:()=>jp,DescribeGlobalTableSettingsCommand:()=>qp,DescribeImportCommand:()=>Vp,DescribeKinesisStreamingDestinationCommand:()=>Gp,DescribeLimitsCommand:()=>Hp,DescribeTableCommand:()=>Kp,DescribeTableReplicaAutoScalingCommand:()=>Wp,DescribeTimeToLiveCommand:()=>Jp,DestinationStatus:()=>_o,DisableKinesisStreamingDestinationCommand:()=>Qp,DuplicateItemException:()=>Io,DynamoDB:()=>Pm,DynamoDBClient:()=>Pp,DynamoDBServiceException:()=>Sr,EnableKinesisStreamingDestinationCommand:()=>Xp,ExecuteStatementCommand:()=>Yp,ExecuteTransactionCommand:()=>Zp,ExportConflictException:()=>To,ExportFormat:()=>ho,ExportNotFoundException:()=>go,ExportStatus:()=>yo,ExportTableToPointInTimeCommand:()=>em,GetItemCommand:()=>tm,GlobalTableAlreadyExistsException:()=>so,GlobalTableNotFoundException:()=>wo,GlobalTableStatus:()=>oo,IdempotentParameterMismatchException:()=>xo,ImportConflictException:()=>Ao,ImportNotFoundException:()=>So,ImportStatus:()=>Eo,ImportTableCommand:()=>nm,IndexNotFoundException:()=>Fo,IndexStatus:()=>co,InputCompressionType:()=>bo,InputFormat:()=>vo,InternalServerError:()=>Ur,InvalidEndpointException:()=>$r,InvalidExportTimeException:()=>Po,InvalidRestoreTimeException:()=>Ro,ItemCollectionSizeLimitExceededException:()=>Gr,KeyType:()=>Pr,LimitExceededException:()=>to,ListBackupsCommand:()=>rm,ListContributorInsightsCommand:()=>om,ListExportsCommand:()=>im,ListGlobalTablesCommand:()=>am,ListImportsCommand:()=>sm,ListTablesCommand:()=>cm,ListTagsOfResourceCommand:()=>dm,PointInTimeRecoveryStatus:()=>Xr,PointInTimeRecoveryUnavailableException:()=>No,ProjectionType:()=>Nr,ProvisionedThroughputExceededException:()=>jr,PutItemCommand:()=>lm,QueryCommand:()=>um,ReplicaAlreadyExistsException:()=>Oo,ReplicaNotFoundException:()=>Lo,ReplicaStatus:()=>io,RequestLimitExceeded:()=>Mr,ResourceInUseException:()=>uo,ResourceNotFoundException:()=>qr,RestoreTableFromBackupCommand:()=>pm,RestoreTableToPointInTimeCommand:()=>mm,ReturnConsumedCapacity:()=>zr,ReturnItemCollectionMetrics:()=>Vr,ReturnValue:()=>po,ReturnValuesOnConditionCheckFailure:()=>Jr,S3SseAlgorithm:()=>fo,SSEStatus:()=>kr,SSEType:()=>Ar,ScalarAttributeType:()=>Ir,ScanCommand:()=>hm,Select:()=>ko,StreamViewType:()=>Dr,TableAlreadyExistsException:()=>Do,TableClass:()=>ao,TableInUseException:()=>no,TableNotFoundException:()=>ro,TableStatus:()=>lo,TagResourceCommand:()=>ym,TimeToLiveStatus:()=>Rr,TransactGetItemsCommand:()=>fm,TransactWriteItemsCommand:()=>gm,TransactionCanceledException:()=>Bo,TransactionConflictException:()=>mo,TransactionInProgressException:()=>Co,UntagResourceCommand:()=>wm,UpdateContinuousBackupsCommand:()=>Em,UpdateContributorInsightsCommand:()=>bm,UpdateGlobalTableCommand:()=>vm,UpdateGlobalTableSettingsCommand:()=>Sm,UpdateItemCommand:()=>_m,UpdateTableCommand:()=>Im,UpdateTableReplicaAutoScalingCommand:()=>xm,UpdateTimeToLiveCommand:()=>Cm,__Client:()=>_n,paginateListContributorInsights:()=>Am,paginateListExports:()=>Dm,paginateListImports:()=>Om,paginateListTables:()=>Fm,paginateQuery:()=>Bm,paginateScan:()=>Mm,waitForTableExists:()=>Xm,waitForTableNotExists:()=>eh,waitUntilTableExists:()=>Ym,waitUntilTableNotExists:()=>th});var r={};n.r(r),n.d(r,{getUserAgentPrefix:()=>Nt,isVirtualHostableS3Bucket:()=>zt,parseArn:()=>Bt,partition:()=>Ct,setPartitionInfo:()=>Tt,useDefaultPartitionInfo:()=>Pt});var o,i={};n.r(i),n.d(i,{aws:()=>r,booleanEquals:()=>Ut,getAttr:()=>Mt,isSet:()=>$t,isValidHostLabel:()=>Ft,not:()=>jt,parseURL:()=>Wt,stringEquals:()=>Jt,substring:()=>Qt,uriEncode:()=>Xt}),function(e){e.ENV="env",e.CONFIG="shared config entry"}(o||(o={}));const a=(e,t,n)=>{if(t in e){if("true"===e[t])return!0;if("false"===e[t])return!1;throw new Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}},s={environmentVariableSelector:e=>a(e,"AWS_USE_DUALSTACK_ENDPOINT",o.ENV),configFileSelector:e=>a(e,"use_dualstack_endpoint",o.CONFIG),default:!1},c={environmentVariableSelector:e=>a(e,"AWS_USE_FIPS_ENDPOINT",o.ENV),configFileSelector:e=>a(e,"use_fips_endpoint",o.CONFIG),default:!1},d={environmentVariableSelector:e=>e.AWS_REGION,configFileSelector:e=>e.region,default:()=>{throw new Error("Region is missing")}},l={preferredFile:"credentials"},u=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),p=e=>u(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,m=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if("string"==typeof t)return p(t);const e=await t();return p(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!u(e)||("function"!=typeof n?Promise.resolve(!!n):n())}}};var h,y;(y=h||(h={}))[y.HEADER=0]="HEADER",y[y.TRAILER=1]="TRAILER";class f{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new f({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class g{constructor(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const w="content-length",E={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},b=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(f.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map((e=>e.toLowerCase())).indexOf(w))try{const t=n(e);r.headers={...r.headers,[w]:String(t)}}catch(e){}}return e({...t,request:r})}),E)}}),v={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},S={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function _(e,t,n){return{applyToStack:r=>{r.add(((e,t)=>(n,r)=>async r=>{const{response:o}=await n(r);try{return{response:o,output:await t(o,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:o}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";e.message+="\n "+t}throw e}})(e,n),v),r.add(((e,t)=>(n,r)=>async o=>{const i=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!i)throw new Error("No valid endpoint provider available.");const a=await t(o.input,{...e,endpoint:i});return n({...o,request:a})})(e,t),S)}}}const I=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,x=/(\d+\.){3}\d+/,C=/\.\./,T=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"endpoint"===e||"endpoint"===t?async()=>{const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:o}=e;return`${t}//${n}${r?":"+r:""}${o}`}}return e}:r},P=async(e,t,n)=>{const r={},o=t?.getEndpointParameterInstructions?.()||{};for(const[t,i]of Object.entries(o))switch(i.type){case"staticContextParams":r[t]=i.value;break;case"contextParams":r[t]=e[i.name];break;case"clientContextParams":case"builtInParams":r[t]=await T(i.name,t,n)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}return 0===Object.keys(o).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),(e=>{const[t,n,r,o,i,a]=e.split(":"),s="arn"===t&&e.split(":").length>=6,c=5===[t,n,r,i,a].filter(Boolean).length;if(s&&!c)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return!!("arn"===t&&n&&r&&i&&a)})(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else n=t,(!I.test(n)||x.test(n)||C.test(n)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);var n;return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},N={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:S.name},A=(e,t)=>({applyToStack:n=>{n.addRelativeTo((({config:e,instructions:t})=>(n,r)=>async o=>{const i=await(async(e,t,n,r)=>{const o=await P(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(o,r)})(o.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=i,r.authSchemes=i.properties?.authSchemes;const a=r.authSchemes?.[0];return a&&(r.signing_region=a.signingRegion,r.signing_service=a.signingName),n({...o})})({config:e,instructions:t}),N)}}),k=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},D=e=>{if("string"==typeof e)return D(new URL(e));const{hostname:t,pathname:n,port:r,protocol:o,search:i}=e;let a;return i&&(a=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(i)),{hostname:t,port:r?parseInt(r):void 0,protocol:o,path:n,query:a}},R=e=>{const t=e.tls??!0,{endpoint:n}=e,r=null!=n?async()=>(e=>"object"==typeof e?"url"in e?D(e.url):e:D(e))(await k(n)()):void 0,o=!!n;return{...e,endpoint:r,tls:t,isCustomEndpoint:o,useDualstackEndpoint:k(e.useDualstackEndpoint??!1),useFipsEndpoint:k(e.useFipsEndpoint??!1)}},O=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],L="endpoint_discovery_enabled",F=e=>["false","0"].indexOf(e)>=0,z={environmentVariableSelector:e=>{for(let t=0;t<O.length;t++){const n=O[t];if(n in e){const t=e[n];if(""===t)throw Error(`Environment variable ${n} can't be empty of undefined, got "${t}"`);return!F(t)}}},configFileSelector:e=>{if(L in e){const t=e[L];if(void 0===t)throw Error(`Shared config entry ${L} can't be undefined, got "${t}"`);return!F(t)}},default:void 0};var B=n(6675),U=n.n(B);class M{constructor(e){this.cache=new(U())(e)}getEndpoint(e){const t=this.get(e);if(!t||0===t.length)return;const n=t.map((e=>e.Address));return n[Math.floor(Math.random()*n.length)]}get(e){if(!this.has(e))return;const t=this.cache.get(e);if(!t)return;const n=Date.now(),r=t.filter((e=>n<e.Expires));if(0!==r.length)return r;this.delete(e)}set(e,t){const n=Date.now();this.cache.set(e,t.map((({Address:e,CachePeriodInMinutes:t})=>({Address:e,Expires:n+60*t*1e3}))))}delete(e){this.cache.set(e,[])}has(e){if(!this.cache.has(e))return!1;const t=this.cache.peek(e);return!!t&&t.length>0}clear(){this.cache.clear()}}const $={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},j=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!f.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:o=""}=e.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]="";else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),$)}}),q={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},V=e=>({applyToStack:e=>{e.add(((e,t)=>async n=>{try{const r=await e(n),{clientName:o,commandName:i,logger:a,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:d}=s,l=c??t.inputFilterSensitiveLog,u=d??t.outputFilterSensitiveLog,{$metadata:p,...m}=r.output;return a?.info?.({clientName:o,commandName:i,input:l(n.input),output:u(m),metadata:p}),r}catch(e){const{clientName:r,commandName:o,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:s}=a,c=s??t.inputFilterSensitiveLog;throw i?.error?.({clientName:r,commandName:o,input:c(n.input),error:e,metadata:e.$metadata}),e}}),q)}}),G="X-Amzn-Trace-Id",H={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},K=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{const{request:r}=n;if(!f.isInstance(r)||"node"!==e.runtime||r.headers.hasOwnProperty(G))return t(n);const o=process.env.AWS_LAMBDA_FUNCTION_NAME,i=process.env._X_AMZN_TRACE_ID,a=e=>"string"==typeof e&&e.length>0;return a(o)&&a(i)&&(r.headers[G]=i),t({...n,request:r})})(e),H)}});var W,J;(J=W||(W={})).STANDARD="standard",J.ADAPTIVE="adaptive";const Q=W.STANDARD,X=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Y=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Z=[500,502,503,504],ee=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],te=e=>429===e.$metadata?.httpStatusCode||X.includes(e.name)||1==e.$retryable?.throttling,ne=e=>Y.includes(e.name)||ee.includes(e?.code||"")||Z.includes(e.$metadata?.httpStatusCode||0);class re{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise((e=>setTimeout(e,t)))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),te(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class oe{constructor(e){this.maxAttempts=e,this.mode=W.STANDARD,this.retryToken=((e,t,n,r)=>{const o=e,i=r?.retryCost??5,a=r?.timeoutRetryCost??10,s=r?.retryBackoffStrategy??(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})();let c,d=e,l=Math.min(2e4,t),u=n??0;const p=e=>"TRANSIENT"===e?a:i,m=e=>p(e)<=d;return{getRetryCount:()=>u,getRetryDelay:()=>l,getLastRetryCost:()=>c,hasRetryTokens:m,getRetryTokenCount:e=>{const t=e.errorType;if(!m(t))throw new Error("No retry token available");const n=p(t),r="THROTTLING"===t?500:100;s.setDelayBase(r);const o=s.computeNextBackoffDelay(u);if(e.retryAfterHint){const t=e.retryAfterHint.getTime()-Date.now();l=Math.max(t||0,o)}else l=o;return u++,c=n,d-=n,n},releaseRetryTokens:e=>{d+=e??1,d=Math.min(d,o)}}})(500,100),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return this.retryToken}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n))return e.getRetryTokenCount(t),e;throw new Error("No retry token available")}recordSuccess(e){this.retryToken.releaseRetryTokens(e.getLastRetryCost())}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()<n&&e.hasRetryTokens(t.errorType)&&this.isRetryableError(t.errorType)}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class ie{constructor(e,t){this.maxAttemptsProvider=e,this.mode=W.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new re,this.standardRetryStrategy=new oe(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const ae="AWS_MAX_ATTEMPTS",se="max_attempts",ce={environmentVariableSelector:e=>{const t=e[ae];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${ae} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[se];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${se} mast be a number, got "${t}"`);return n},default:3},de=e=>{const{retryStrategy:t}=e,n=k(e.maxAttempts??3);return{...e,maxAttempts:n,retryStrategy:async()=>t||(await k(e.retryMode)()===W.ADAPTIVE?new ie(n):new oe(n))}},le={environmentVariableSelector:e=>e.AWS_RETRY_MODE,configFileSelector:e=>e.retry_mode,default:Q},ue=require("crypto");var pe=n.n(ue);const me=new Uint8Array(256);let he=me.length;function ye(){return he>me.length-16&&(pe().randomFillSync(me),he=0),me.slice(he,he+=16)}const fe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ge=[];for(let e=0;e<256;++e)ge.push((e+256).toString(16).substr(1));const we=function(e,t=0){const n=(ge[e[t+0]]+ge[e[t+1]]+ge[e[t+2]]+ge[e[t+3]]+"-"+ge[e[t+4]]+ge[e[t+5]]+"-"+ge[e[t+6]]+ge[e[t+7]]+"-"+ge[e[t+8]]+ge[e[t+9]]+"-"+ge[e[t+10]]+ge[e[t+11]]+ge[e[t+12]]+ge[e[t+13]]+ge[e[t+14]]+ge[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&fe.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},Ee=function(e,t,n){const r=(e=e||{}).random||(e.rng||ye)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return we(r)},be=e=>{const t={errorType:ve(e)},n=Ie(e.$response);return n&&(t.retryAfterHint=n),t},ve=e=>te(e)?"THROTTLING":ne(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!ne(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",Se={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},_e=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let o=await e.retryStrategy();const i=await e.maxAttempts();if(!(e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess)(o))return o?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",o.mode]]),o.retry(t,r);{let e=await o.acquireInitialRetryToken(n.partition_id),s=new Error,c=0,d=0;const{request:l}=r;for(f.isInstance(l)&&(l.headers["amz-sdk-invocation-id"]=Ee());;)try{f.isInstance(l)&&(l.headers["amz-sdk-request"]=`attempt=${c+1}; max=${i}`);const{response:n,output:a}=await t(r);return o.recordSuccess(e),a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=d,{response:n,output:a}}catch(t){const n=be(t);s=(a=t)instanceof Error?a:a instanceof Object?Object.assign(new Error,a):"string"==typeof a?new Error(a):new Error(`AWS SDK error wrapper for ${a}`);try{e=await o.refreshRetryTokenForRetry(e,n)}catch(e){throw s.$metadata||(s.$metadata={}),s.$metadata.attempts=c+1,s.$metadata.totalRetryDelay=d,s}c=e.getRetryCount();const r=e.getRetryDelay();d+=r,await new Promise((e=>setTimeout(e,r)))}}var a})(e),Se)}}),Ie=e=>{if(!g.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(1e3*r)};class xe extends Error{constructor(e,t=!0){super(e),this.tryNextLink=t,this.name="ProviderError",Object.setPrototypeOf(this,xe.prototype)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}class Ce extends xe{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="CredentialsProviderError",Object.setPrototypeOf(this,Ce.prototype)}}class Te extends xe{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="TokenProviderError",Object.setPrototypeOf(this,Te.prototype)}}function Pe(...e){return()=>{let t=Promise.reject(new xe("No providers in chain"));for(const n of e)t=t.catch((e=>{if(e?.tryNextLink)return n();throw e}));return t}}const Ne=(e,t,n)=>{let r,o,i,a=!1;const s=async()=>{o||(o=e());try{r=await o,i=!0,a=!1}finally{o=void 0}return r};return void 0===t?async e=>(i&&!e?.forceRefresh||(r=await s()),r):async e=>(i&&!e?.forceRefresh||(r=await s()),a?r:n&&!n(r)?(a=!0,r):t(r)?(await s(),r):r)},Ae={},ke={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),Ae[e]=t,ke[t]=e}function De(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Ae[e[n]];return t}const Re=e=>"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e),Oe=require("buffer"),Le=(e,t=0,n=e.byteLength-t)=>{if(!Re(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Oe.Buffer.from(e,t,n)},Fe=(e,t)=>{if("string"!=typeof e)throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Oe.Buffer.from(e,t):Oe.Buffer.from(e)},ze=e=>{const t=Fe(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Be=e=>"string"==typeof e?ze(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),Ue=e=>Le(e.buffer,e.byteOffset,e.byteLength).toString("utf8"),Me="X-Amz-Date",$e="X-Amz-Signature",je="X-Amz-Security-Token",qe="authorization",Ve=Me.toLowerCase(),Ge=[qe,Ve,"date"],He=$e.toLowerCase(),Ke="x-amz-content-sha256",We=je.toLowerCase(),Je={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Qe=/^proxy-/,Xe=/^sec-/,Ye="AWS4-HMAC-SHA256",Ze="AWS4-HMAC-SHA256-PAYLOAD",et="aws4_request",tt={},nt=[],rt=(e,t,n)=>`${e}/${t}/${n}/${et}`,ot=(e,t,n)=>{const r=new e(t);return r.update(Be(n)),r.digest()},it=({headers:e},t,n)=>{const r={};for(const o of Object.keys(e).sort()){if(null==e[o])continue;const i=o.toLowerCase();(i in Je||t?.has(i)||Qe.test(i)||Xe.test(i))&&(!n||n&&!n.has(i))||(r[i]=e[o].trim().replace(/\s+/g," "))}return r},at=e=>encodeURIComponent(e).replace(/[!'()*]/g,st),st=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,ct=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===Ke)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||Re(t)){const e=new n;return e.update(Be(t)),De(await e.digest())}return"UNSIGNED-PAYLOAD"},dt=({headers:e,query:t,...n})=>({...n,headers:{...e},query:t?lt(t):void 0}),lt=e=>Object.keys(e).reduce(((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}}),{}),ut=e=>{e="function"==typeof e.clone?e.clone():dt(e);for(const t of Object.keys(e.headers))Ge.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};class pt{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:o,uriEscapePath:i=!0}){this.service=r,this.sha256=o,this.uriEscapePath=i,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=k(n),this.credentialProvider=k(t)}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:o,unhoistableHeaders:i,signableHeaders:a,signingRegion:s,signingService:c}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=s??await this.regionProvider(),{longDate:u,shortDate:p}=mt(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const m=rt(p,l,c??this.service),h=((e,t={})=>{const{headers:n,query:r={}}="function"==typeof e.clone?e.clone():dt(e);for(const e of Object.keys(n)){const o=e.toLowerCase();"x-amz-"!==o.slice(0,6)||t.unhoistableHeaders?.has(o)||(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(ut(e),{unhoistableHeaders:i});d.sessionToken&&(h.query[je]=d.sessionToken),h.query["X-Amz-Algorithm"]=Ye,h.query["X-Amz-Credential"]=`${d.accessKeyId}/${m}`,h.query[Me]=u,h.query["X-Amz-Expires"]=r.toString(10);const y=it(h,o,a);return h.query["X-Amz-SignedHeaders"]=ht(y),h.query[$e]=await this.getSignature(u,m,this.getSigningKey(d,l,p,c),this.createCanonicalRequest(h,y,await ct(e,this.sha256))),h}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:o,signingService:i}){const a=o??await this.regionProvider(),{shortDate:s,longDate:c}=mt(n),d=rt(s,a,i??this.service),l=await ct({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);const p=De(await u.digest()),m=[Ze,c,d,r,p,l].join("\n");return this.signString(m,{signingDate:n,signingRegion:a,signingService:i})}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const i=n??await this.regionProvider(),{shortDate:a}=mt(t),s=new this.sha256(await this.getSigningKey(o,i,a,r));return s.update(Be(e)),De(await s.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:o,signingService:i}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=o??await this.regionProvider(),c=ut(e),{longDate:d,shortDate:l}=mt(t),u=rt(l,s,i??this.service);c.headers[Ve]=d,a.sessionToken&&(c.headers[We]=a.sessionToken);const p=await ct(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(Ke,c.headers)&&this.applyChecksum&&(c.headers[Ke]=p);const m=it(c,r,n),h=await this.getSignature(d,u,this.getSigningKey(a,s,l,i),this.createCanonicalRequest(c,m,p));return c.headers[qe]=`${Ye} Credential=${a.accessKeyId}/${u}, SignedHeaders=${ht(m)}, Signature=${h}`,c}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e).sort()){if(r.toLowerCase()===He)continue;t.push(r);const o=e[r];"string"==typeof o?n[r]=`${at(r)}=${at(o)}`:Array.isArray(o)&&(n[r]=o.slice(0).sort().reduce(((e,t)=>e.concat([`${at(r)}=${at(t)}`])),[]).join("&"))}return t.map((e=>n[e])).filter((e=>e)).join("&")})(e)}\n${r.map((e=>`${e}:${t[e]}`)).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n){const r=new this.sha256;r.update(Be(n));const o=await r.digest();return`${Ye}\n${e}\n${t}\n${De(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return encodeURIComponent(n).replace(/%2F/g,"/")}return e}async getSignature(e,t,n,r){const o=await this.createStringToSign(e,t,r),i=new this.sha256(await n);return i.update(Be(o)),De(await i.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,o)=>{const i=`${n}:${r}:${o}:${De(await ot(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(i in tt)return tt[i];for(nt.push(i);nt.length>50;)delete tt[nt.shift()];let a=`AWS4${t.secretAccessKey}`;for(const t of[n,r,o,et])a=await ot(e,a,t);return tt[i]=a})(this.sha256,e,n,t,r||this.service)}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}}const mt=e=>{const t=(n=e,(e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e)(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}},ht=e=>Object.keys(e).sort().join(";"),yt=e=>{const t=e.credentials?ft(e.credentials):e.credentialDefaultProvider(e),{signingEscapePath:n=!0,systemClockOffset:r=e.systemClockOffset||0,sha256:o}=e;let i;return i=e.signer?k(e.signer):e.regionInfoProvider?()=>k(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([r,i])=>{const{signingRegion:a,signingService:s}=r;e.signingRegion=e.signingRegion||a||i,e.signingName=e.signingName||s||e.serviceId;const c={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||pt)(c)})):async r=>{const i=(r=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await k(e.region)(),properties:{}},r)).signingRegion,a=r.signingName;e.signingRegion=e.signingRegion||i,e.signingName=e.signingName||a||e.serviceId;const s={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||pt)(s)},{...e,systemClockOffset:r,signingEscapePath:n,credentials:t,signer:i}},ft=e=>"function"==typeof e?Ne(e,(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)):k(e),gt=e=>new Date(Date.now()+e),wt=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(gt(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},Et=e=>g.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,bt={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},vt=e=>({applyToStack:t=>{t.addRelativeTo((e=>(t,n)=>async function(r){if(!f.isInstance(r.request))return t(r);const o=n.endpointV2?.properties?.authSchemes?.[0],i="sigv4a"===o?.name?o?.signingRegionSet?.join(","):void 0,a=await e.signer(o),s=await t({...r,request:await a.sign(r.request,{signingDate:gt(e.systemClockOffset),signingRegion:i||n.signing_region,signingService:n.signing_service})}).catch((t=>{const n=t.ServerTime??Et(t.$response);throw n&&(e.systemClockOffset=wt(n,e.systemClockOffset)),t})),c=Et(s.response);return c&&(e.systemClockOffset=wt(c,e.systemClockOffset)),s})(e),bt)}});function St(e){return{...e,customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent}}const _t=JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{}}],"version":"1.1"}');let It=_t,xt="";const Ct=e=>{const{partitions:t}=It;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,o]of Object.entries(t))if(n===e)return{...r,...o}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find((e=>"aws"===e.id));if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},Tt=(e,t="")=>{It=e,xt=t},Pt=()=>{Tt(_t,"")},Nt=()=>xt,At="endpoints";function kt(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${kt(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(kt).join(", ")})`:JSON.stringify(e,null,2)}class Dt extends Error{constructor(e){super(e),this.name="EndpointError"}}const Rt=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Ot=e=>Rt.test(e)||e.startsWith("[")&&e.endsWith("]"),Lt=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Ft=(e,t=!1)=>{if(!t)return Lt.test(e);const n=e.split(".");for(const e of n)if(!Ft(e))return!1;return!0},zt=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!zt(t))return!1;return!0}return!(!Ft(e)||e.length<3||e.length>63||e!==e.toLowerCase()||Ot(e))},Bt=e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,o,i,a,...s]=t;return"arn"!==n||""===r||""===o||""===s[0]?null:{partition:r,service:o,region:i,accountId:a,resourceId:s[0].includes("/")?s[0].split("/"):s}},Ut=(e,t)=>e===t,Mt=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new Dt(`Path: '${e}' does not end with ']'`);const o=r.slice(t+1,-1);if(Number.isNaN(parseInt(o)))throw new Dt(`Invalid array index: '${o}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(o)}else n.push(r)}return n})(t).reduce(((n,r)=>{if("object"!=typeof n)throw new Dt(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]}),e),$t=e=>null!=e,jt=e=>!e;var qt,Vt,Gt,Ht;!function(e){e.HEADER="header",e.QUERY="query"}(qt||(qt={})),function(e){e.AAAA="AAAA",e.A="A"}(Vt||(Vt={})),function(e){e.HTTP="http",e.HTTPS="https"}(Gt||(Gt={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(Ht||(Ht={}));const Kt={[Gt.HTTP]:80,[Gt.HTTPS]:443},Wt=e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:o="",query:i={}}=e,a=new URL(`${r}//${t}${n?`:${n}`:""}${o}`);return a.search=Object.entries(i).map((([e,t])=>`${e}=${t}`)).join("&"),a}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:o,pathname:i,protocol:a,search:s}=t;if(s)return null;const c=a.slice(0,-1);if(!Object.values(Gt).includes(c))return null;const d=Ot(o);return{scheme:c,authority:`${r}${n.includes(`${r}:${Kt[c]}`)||"string"==typeof e&&e.includes(`${r}:${Kt[c]}`)?`:${Kt[c]}`:""}`,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}},Jt=(e,t)=>e===t,Qt=(e,t,n,r)=>t>=n||e.length<n?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),Xt=e=>encodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Yt=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let o=0;for(;o<e.length;){const t=e.indexOf("{",o);if(-1===t){n.push(e.slice(o));break}n.push(e.slice(o,t));const i=e.indexOf("}",t);if(-1===i){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[i+1]&&(n.push(e.slice(t+1,i)),o=i+2);const a=e.substring(t+1,i);if(a.includes("#")){const[e,t]=a.split("#");n.push(Mt(r[e],t))}else n.push(r[a]);o=i+1}return n.join("")},Zt=(e,t,n)=>{if("string"==typeof e)return Yt(e,n);if(e.fn)return en(e,n);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,n);throw new Dt(`'${t}': ${String(e)} is not a string, function or reference.`)},en=({fn:e,argv:t},n)=>{const r=t.map((e=>["boolean","number"].includes(typeof e)?e:Zt(e,"arg",n)));return e.split(".").reduce(((e,t)=>e[t]),i)(...r)},tn=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Dt(`'${e}' is already defined in Reference Record.`);const r=en(t,n);return n.logger?.debug?.(At,`evaluateCondition: ${kt(t)} = ${kt(r)}`),{result:""===r||!!r,...null!=e&&{toAssign:{name:e,value:r}}}},nn=(e=[],t)=>{const n={};for(const r of e){const{result:e,toAssign:o}=tn(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};o&&(n[o.name]=o.value,t.logger?.debug?.(At,`assign: ${o.name} := ${kt(o.value)}`))}return{result:!0,referenceRecord:n}},rn=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:r.map((e=>{const r=Zt(e,"Header value entry",t);if("string"!=typeof r)throw new Dt(`Header '${n}' value '${r}' is not a string`);return r}))})),{}),on=(e,t)=>{if(Array.isArray(e))return e.map((e=>on(e,t)));switch(typeof e){case"string":return Yt(e,t);case"object":if(null===e)throw new Dt(`Unexpected endpoint property: ${e}`);return an(e,t);case"boolean":return e;default:throw new Dt("Unexpected endpoint property type: "+typeof e)}},an=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:on(r,t)})),{}),sn=(e,t)=>{const n=Zt(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new Dt("Endpoint URL must be a string, got "+typeof n)},cn=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:o,referenceRecord:i}=nn(n,t);if(!o)return;const a={...t,referenceRecord:{...t.referenceRecord,...i}},{url:s,properties:c,headers:d}=r;return t.logger?.debug?.(At,`Resolving endpoint from template: ${kt(r)}`),{...null!=d&&{headers:rn(d,a)},...null!=c&&{properties:an(c,a)},url:sn(s,a)}},dn=(e,t)=>{const{conditions:n,error:r}=e,{result:o,referenceRecord:i}=nn(n,t);if(o)throw new Dt(Zt(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...i}}))},ln=(e,t)=>{const{conditions:n,rules:r}=e,{result:o,referenceRecord:i}=nn(n,t);if(o)return un(r,{...t,referenceRecord:{...t.referenceRecord,...i}})},un=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=cn(n,t);if(e)return e}else if("error"===n.type)dn(n,t);else{if("tree"!==n.type)throw new Dt(`Unknown endpoint rule: ${n}`);{const e=ln(n,t);if(e)return e}}throw new Dt("Rules evaluation failed")},pn=(e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:o,rules:i}=e;t.logger?.debug?.(`${At} Initial EndpointParams: ${kt(n)}`);const a=Object.entries(o).filter((([,e])=>null!=e.default)).map((([e,t])=>[e,t.default]));if(a.length>0)for(const[e,t]of a)n[e]=n[e]??t;const s=Object.entries(o).filter((([,e])=>e.required)).map((([e])=>e));for(const e of s)if(null==n[e])throw new Dt(`Missing required parameter: '${e}'`);const c=un(i,{endpointParams:n,logger:r,referenceRecord:{}});if(t.endpointParams?.Endpoint)try{const e=new URL(t.endpointParams.Endpoint),{protocol:n,port:r}=e;c.url.protocol=n,c.url.port=r}catch(e){}return t.logger?.debug?.(`${At} Resolved endpoint: ${kt(c)}`),c},mn="user-agent",hn="x-amz-user-agent",yn=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,fn=([e,t])=>{const n=e.indexOf("/"),r=e.substring(0,n);let o=e.substring(n+1);return"api"===r&&(o=o.toLowerCase()),[r,o,t].filter((e=>e&&e.length>0)).map((e=>e?.replace(yn,"_"))).join("/")},gn={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},wn=e=>({applyToStack:t=>{var n;t.add((n=e,(e,t)=>async r=>{const{request:o}=r;if(!f.isInstance(o))return e(r);const{headers:i}=o,a=t?.userAgent?.map(fn)||[],s=(await n.defaultUserAgentProvider()).map(fn),c=n?.customUserAgent?.map(fn)||[],d=Nt(),l=(d?[d]:[]).concat([...s,...a,...c]).join(" "),u=[...s.filter((e=>e.startsWith("aws-sdk-"))),...c].join(" ");return"browser"!==n.runtime?(u&&(i[hn]=i[hn]?`${i[mn]} ${u}`:u),i[mn]=l):i[hn]=l,e({...r,request:o})}),gn)}});class En{trace(){}debug(){}info(){}warn(){}error(){}}const bn=()=>{let e=[],t=[];const n=new Set,r=n=>(e.forEach((e=>{n.add(e.middleware,{...e})})),t.forEach((e=>{n.addRelativeTo(e.middleware,{...e})})),n),o=e=>{const t=[];return e.before.forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t.push(e),e.after.reverse().forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t},i=(n=!1)=>{const r=[],i=[],a={};e.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),r.push(t)})),t.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),i.push(t)})),i.forEach((e=>{if(e.toMiddleware){const t=a[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${e.name||"anonymous"} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}));const s=(c=r,c.sort(((e,t)=>vn[t.step]-vn[e.step]||Sn[t.priority||"normal"]-Sn[e.priority||"normal"]))).map(o).reduce(((e,t)=>(e.push(...t),e)),[]);var c;return s},a={add:(t,r={})=>{const{name:o,override:i}=r,a={step:"initialize",priority:"normal",middleware:t,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const t=e.findIndex((e=>e.name===o)),n=e[t];if(n.step!==a.step||n.priority!==a.priority)throw new Error(`"${o}" middleware with ${n.priority} priority in ${n.step} step cannot be overridden by same-name middleware with ${a.priority} priority in ${a.step} step.`);e.splice(t,1)}n.add(o)}e.push(a)},addRelativeTo:(e,r)=>{const{name:o,override:i}=r,a={middleware:e,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const e=t.findIndex((e=>e.name===o)),n=t[e];if(n.toMiddleware!==a.toMiddleware||n.relation!==a.relation)throw new Error(`"${o}" middleware ${n.relation} "${n.toMiddleware}" middleware cannot be overridden by same-name middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(e,1)}n.add(o)}t.push(a)},clone:()=>r(bn()),use:e=>{e.applyToStack(a)},remove:r=>"string"==typeof r?(r=>{let o=!1;const i=e=>!e.name||e.name!==r||(o=!0,n.delete(r),!1);return e=e.filter(i),t=t.filter(i),o})(r):(r=>{let o=!1;const i=e=>e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1);return e=e.filter(i),t=t.filter(i),o})(r),removeByTag:r=>{let o=!1;const i=e=>{const{tags:t,name:i}=e;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:e=>{const t=r(bn());return t.use(e),t},applyToStack:r,identify:()=>i(!0).map((e=>e.name+": "+(e.tags||[]).join(","))),resolve:(e,t)=>{for(const n of i().map((e=>e.middleware)).reverse())e=n(e,t);return e}};return a},vn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Sn={high:3,normal:2,low:1};class _n{constructor(e){this.middlewareStack=bn(),this.config=e}send(e,t,n){const r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((e=>e.output));i(e).then((e=>o(null,e.output)),(e=>o(e))).catch((()=>{}))}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}class In{constructor(){this.middlewareStack=bn()}}const xn="***SensitiveInformation***",Cn=e=>{if(null!=e){if("number"==typeof e){if(0!==e&&1!==e||qn.warn(jn(`Expected boolean, got ${typeof e}: ${e}`)),0===e)return!1;if(1===e)return!0}if("string"==typeof e){const t=e.toLowerCase();if("false"!==t&&"true"!==t||qn.warn(jn(`Expected boolean, got ${typeof e}: ${e}`)),"false"===t)return!1;if("true"===t)return!0}if("boolean"==typeof e)return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},Tn=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&qn.warn(jn(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Pn=Math.ceil(2**127*(2-2**-23)),Nn=e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},An=e=>kn(e,32),kn=(e,t)=>{const n=Nn(e);if(void 0!==n&&Dn(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},Dn=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},Rn=(e,t)=>{if(null==e){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},On=e=>{if(null==e)return;if("object"==typeof e&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},Ln=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return qn.warn(jn(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},Fn=e=>{if(null==e)return;const t=On(e),n=Object.entries(t).filter((([,e])=>null!=e)).map((([e])=>e));if(0===n.length)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},zn=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Bn=e=>{const t=e.match(zn);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},Un=e=>"string"==typeof e?Mn(e):Tn(e),Mn=e=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}},$n=e=>An("string"==typeof e?Bn(e):e),jn=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((e=>!e.includes("stackTraceWarning"))).join("\n"),qn={warn:console.warn},Vn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Gn=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Hn=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Gn.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,o,i,a,s,c,d,l]=t,u=(e=>(e=>kn(e,16))("string"==typeof e?Bn(e):e))(tr(r)),p=Yn(o,"month",1,12),m=Yn(i,"day",1,31),h=Wn(u,p,m,{hours:a,minutes:s,seconds:c,fractionalMilliseconds:d});return"Z"!=l.toUpperCase()&&h.setTime(h.getTime()-er(l)),h},Kn=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else{if("string"!=typeof e)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=(e=>Tn("string"==typeof e?Bn(e):e))(e)}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},Wn=(e,t,n,r)=>{const o=t-1;return Qn(e,o,n),new Date(Date.UTC(e,o,n,Yn(r.hours,"hour",0,23),Yn(r.minutes,"minute",0,59),Yn(r.seconds,"seconds",0,60),Zn(r.fractionalMilliseconds)))},Jn=[31,28,31,30,31,30,31,31,30,31,30,31],Qn=(e,t,n)=>{let r=Jn[t];if(1===t&&Xn(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${Vn[t]} in ${e}: ${n}`)},Xn=e=>e%4==0&&(e%100!=0||e%400==0),Yn=(e,t,n,r)=>{const o=(e=>(e=>kn(e,8))("string"==typeof e?Bn(e):e))(tr(e));if(o<n||o>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return o},Zn=e=>null==e?0:1e3*(e=>(e=>{const t=Tn(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Pn)throw new TypeError(`Expected 32-bit float, got ${e}`);return t})("string"==typeof e?Bn(e):e))("0."+e),er=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},tr=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)};class nr extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,nr.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const rr=(e,t={})=>{Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)}));const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},or=e=>({output:t,parsedBody:n,errorCode:r})=>{(({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{const o=ir(e),i=o.httpStatusCode?o.httpStatusCode+"":void 0,a=new n({name:t?.code||t?.Code||r||i||"UnknownError",$fault:"client",$metadata:o});throw rr(a,t)})({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},ir=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ar=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};let sr=!1;const cr=e=>{e&&!sr&&parseInt(e.substring(1,e.indexOf(".")))<14&&(sr=!0)};function dr(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}const lr=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=lr(e[n]));return e},ur=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};function pr(e,t,n){let r,o,i;if(void 0===t&&void 0===n)r={},i=e;else{if(r=e,"function"==typeof t)return o=t,i=n,hr(r,o,i);i=t}for(const e of Object.keys(i))Array.isArray(i[e])?yr(r,null,i,e):r[e]=i[e];return r}ur.prototype=Object.create(String.prototype,{constructor:{value:ur,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(ur,String);const mr=(e,t)=>{const n={};for(const r in t)yr(n,e,t,r);return n},hr=(e,t,n)=>pr(e,Object.entries(n).reduce(((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e)),{})),yr=(e,t,n,r)=>{if(null!==t){let o=n[r];"function"==typeof o&&(o=[,o]);const[i=fr,a=gr,s=r]=o;return void(("function"==typeof i&&i(t[s])||"function"!=typeof i&&i)&&(e[r]=a(t[s])))}let[o,i]=n[r];if("function"==typeof i){let t;const n=void 0===o&&null!=(t=i()),a="function"==typeof o&&!!o(void 0)||"function"!=typeof o&&!!o;n?e[r]=t:a&&(e[r]=i())}else{const t=void 0===o&&null!=i,n="function"==typeof o&&!!o(i)||"function"!=typeof o&&!!o;(t||n)&&(e[r]=i)}},fr=e=>null!=e,gr=e=>e,wr=e=>{if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},Er=e=>{if(null==e)return{};if(Array.isArray(e))return e.filter((e=>null!=e));if("object"==typeof e){const t={};for(const n of Object.keys(e))null!=e[n]&&(t[n]=Er(e[n]));return t}return e};var br;!function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(br||(br={}));class vr{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new vr({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class Sr extends nr{constructor(e){super(e),Object.setPrototypeOf(this,Sr.prototype)}}const _r={ADD:"ADD",DELETE:"DELETE",PUT:"PUT"},Ir={B:"B",N:"N",S:"S"},xr={AVAILABLE:"AVAILABLE",CREATING:"CREATING",DELETED:"DELETED"},Cr={AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},Tr={PAY_PER_REQUEST:"PAY_PER_REQUEST",PROVISIONED:"PROVISIONED"},Pr={HASH:"HASH",RANGE:"RANGE"},Nr={ALL:"ALL",INCLUDE:"INCLUDE",KEYS_ONLY:"KEYS_ONLY"},Ar={AES256:"AES256",KMS:"KMS"},kr={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",UPDATING:"UPDATING"},Dr={KEYS_ONLY:"KEYS_ONLY",NEW_AND_OLD_IMAGES:"NEW_AND_OLD_IMAGES",NEW_IMAGE:"NEW_IMAGE",OLD_IMAGE:"OLD_IMAGE"},Rr={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING"};class Or extends Sr{constructor(e){super({name:"BackupInUseException",$fault:"client",...e}),this.name="BackupInUseException",this.$fault="client",Object.setPrototypeOf(this,Or.prototype)}}class Lr extends Sr{constructor(e){super({name:"BackupNotFoundException",$fault:"client",...e}),this.name="BackupNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Lr.prototype)}}const Fr={ALL:"ALL",AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},zr={INDEXES:"INDEXES",NONE:"NONE",TOTAL:"TOTAL"},Br={AccessDenied:"AccessDenied",ConditionalCheckFailed:"ConditionalCheckFailed",DuplicateItem:"DuplicateItem",InternalServerError:"InternalServerError",ItemCollectionSizeLimitExceeded:"ItemCollectionSizeLimitExceeded",ProvisionedThroughputExceeded:"ProvisionedThroughputExceeded",RequestLimitExceeded:"RequestLimitExceeded",ResourceNotFound:"ResourceNotFound",ThrottlingError:"ThrottlingError",TransactionConflict:"TransactionConflict",ValidationError:"ValidationError"};class Ur extends Sr{constructor(e){super({name:"InternalServerError",$fault:"server",...e}),this.name="InternalServerError",this.$fault="server",Object.setPrototypeOf(this,Ur.prototype)}}class Mr extends Sr{constructor(e){super({name:"RequestLimitExceeded",$fault:"client",...e}),this.name="RequestLimitExceeded",this.$fault="client",Object.setPrototypeOf(this,Mr.prototype)}}class $r extends Sr{constructor(e){super({name:"InvalidEndpointException",$fault:"client",...e}),this.name="InvalidEndpointException",this.$fault="client",Object.setPrototypeOf(this,$r.prototype),this.Message=e.Message}}class jr extends Sr{constructor(e){super({name:"ProvisionedThroughputExceededException",$fault:"client",...e}),this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,jr.prototype)}}class qr extends Sr{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,qr.prototype)}}const Vr={NONE:"NONE",SIZE:"SIZE"};class Gr extends Sr{constructor(e){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...e}),this.name="ItemCollectionSizeLimitExceededException",this.$fault="client",Object.setPrototypeOf(this,Gr.prototype)}}const Hr={BEGINS_WITH:"BEGINS_WITH",BETWEEN:"BETWEEN",CONTAINS:"CONTAINS",EQ:"EQ",GE:"GE",GT:"GT",IN:"IN",LE:"LE",LT:"LT",NE:"NE",NOT_CONTAINS:"NOT_CONTAINS",NOT_NULL:"NOT_NULL",NULL:"NULL"};class Kr extends Sr{constructor(e){super({name:"ConditionalCheckFailedException",$fault:"client",...e}),this.name="ConditionalCheckFailedException",this.$fault="client",Object.setPrototypeOf(this,Kr.prototype)}}const Wr={AND:"AND",OR:"OR"},Jr={ALL_OLD:"ALL_OLD",NONE:"NONE"},Qr={DISABLED:"DISABLED",ENABLED:"ENABLED"},Xr={DISABLED:"DISABLED",ENABLED:"ENABLED"};class Yr extends Sr{constructor(e){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...e}),this.name="ContinuousBackupsUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Yr.prototype)}}const Zr={DISABLE:"DISABLE",ENABLE:"ENABLE"},eo={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",FAILED:"FAILED"};class to extends Sr{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,to.prototype)}}class no extends Sr{constructor(e){super({name:"TableInUseException",$fault:"client",...e}),this.name="TableInUseException",this.$fault="client",Object.setPrototypeOf(this,no.prototype)}}class ro extends Sr{constructor(e){super({name:"TableNotFoundException",$fault:"client",...e}),this.name="TableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,ro.prototype)}}const oo={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},io={ACTIVE:"ACTIVE",CREATING:"CREATING",CREATION_FAILED:"CREATION_FAILED",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",REGION_DISABLED:"REGION_DISABLED",UPDATING:"UPDATING"},ao={STANDARD:"STANDARD",STANDARD_INFREQUENT_ACCESS:"STANDARD_INFREQUENT_ACCESS"};class so extends Sr{constructor(e){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...e}),this.name="GlobalTableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,so.prototype)}}const co={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},lo={ACTIVE:"ACTIVE",ARCHIVED:"ARCHIVED",ARCHIVING:"ARCHIVING",CREATING:"CREATING",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",UPDATING:"UPDATING"};class uo extends Sr{constructor(e){super({name:"ResourceInUseException",$fault:"client",...e}),this.name="ResourceInUseException",this.$fault="client",Object.setPrototypeOf(this,uo.prototype)}}const po={ALL_NEW:"ALL_NEW",ALL_OLD:"ALL_OLD",NONE:"NONE",UPDATED_NEW:"UPDATED_NEW",UPDATED_OLD:"UPDATED_OLD"};class mo extends Sr{constructor(e){super({name:"TransactionConflictException",$fault:"client",...e}),this.name="TransactionConflictException",this.$fault="client",Object.setPrototypeOf(this,mo.prototype)}}const ho={DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"},yo={COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},fo={AES256:"AES256",KMS:"KMS"};class go extends Sr{constructor(e){super({name:"ExportNotFoundException",$fault:"client",...e}),this.name="ExportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,go.prototype)}}class wo extends Sr{constructor(e){super({name:"GlobalTableNotFoundException",$fault:"client",...e}),this.name="GlobalTableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,wo.prototype)}}const Eo={CANCELLED:"CANCELLED",CANCELLING:"CANCELLING",COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},bo={GZIP:"GZIP",NONE:"NONE",ZSTD:"ZSTD"},vo={CSV:"CSV",DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"};class So extends Sr{constructor(e){super({name:"ImportNotFoundException",$fault:"client",...e}),this.name="ImportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,So.prototype)}}const _o={ACTIVE:"ACTIVE",DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLE_FAILED:"ENABLE_FAILED",ENABLING:"ENABLING"};class Io extends Sr{constructor(e){super({name:"DuplicateItemException",$fault:"client",...e}),this.name="DuplicateItemException",this.$fault="client",Object.setPrototypeOf(this,Io.prototype)}}class xo extends Sr{constructor(e){super({name:"IdempotentParameterMismatchException",$fault:"client",...e}),this.name="IdempotentParameterMismatchException",this.$fault="client",Object.setPrototypeOf(this,xo.prototype),this.Message=e.Message}}class Co extends Sr{constructor(e){super({name:"TransactionInProgressException",$fault:"client",...e}),this.name="TransactionInProgressException",this.$fault="client",Object.setPrototypeOf(this,Co.prototype),this.Message=e.Message}}class To extends Sr{constructor(e){super({name:"ExportConflictException",$fault:"client",...e}),this.name="ExportConflictException",this.$fault="client",Object.setPrototypeOf(this,To.prototype)}}class Po extends Sr{constructor(e){super({name:"InvalidExportTimeException",$fault:"client",...e}),this.name="InvalidExportTimeException",this.$fault="client",Object.setPrototypeOf(this,Po.prototype)}}class No extends Sr{constructor(e){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...e}),this.name="PointInTimeRecoveryUnavailableException",this.$fault="client",Object.setPrototypeOf(this,No.prototype)}}class Ao extends Sr{constructor(e){super({name:"ImportConflictException",$fault:"client",...e}),this.name="ImportConflictException",this.$fault="client",Object.setPrototypeOf(this,Ao.prototype)}}const ko={ALL_ATTRIBUTES:"ALL_ATTRIBUTES",ALL_PROJECTED_ATTRIBUTES:"ALL_PROJECTED_ATTRIBUTES",COUNT:"COUNT",SPECIFIC_ATTRIBUTES:"SPECIFIC_ATTRIBUTES"};class Do extends Sr{constructor(e){super({name:"TableAlreadyExistsException",$fault:"client",...e}),this.name="TableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Do.prototype)}}class Ro extends Sr{constructor(e){super({name:"InvalidRestoreTimeException",$fault:"client",...e}),this.name="InvalidRestoreTimeException",this.$fault="client",Object.setPrototypeOf(this,Ro.prototype)}}class Oo extends Sr{constructor(e){super({name:"ReplicaAlreadyExistsException",$fault:"client",...e}),this.name="ReplicaAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Oo.prototype)}}class Lo extends Sr{constructor(e){super({name:"ReplicaNotFoundException",$fault:"client",...e}),this.name="ReplicaNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Lo.prototype)}}class Fo extends Sr{constructor(e){super({name:"IndexNotFoundException",$fault:"client",...e}),this.name="IndexNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Fo.prototype)}}var zo;!function(e){e.visit=(e,t)=>void 0!==e.S?t.S(e.S):void 0!==e.N?t.N(e.N):void 0!==e.B?t.B(e.B):void 0!==e.SS?t.SS(e.SS):void 0!==e.NS?t.NS(e.NS):void 0!==e.BS?t.BS(e.BS):void 0!==e.M?t.M(e.M):void 0!==e.L?t.L(e.L):void 0!==e.NULL?t.NULL(e.NULL):void 0!==e.BOOL?t.BOOL(e.BOOL):t._(e.$unknown[0],e.$unknown[1])}(zo||(zo={}));class Bo extends Sr{constructor(e){super({name:"TransactionCanceledException",$fault:"client",...e}),this.name="TransactionCanceledException",this.$fault="client",Object.setPrototypeOf(this,Bo.prototype),this.Message=e.Message,this.CancellationReasons=e.CancellationReasons}}const Uo=async(e,t)=>{const n=e.body,r=Er(n),o=new Or({$metadata:za(e),...r});return rr(o,n)},Mo=async(e,t)=>{const n=e.body,r=Er(n),o=new Lr({$metadata:za(e),...r});return rr(o,n)},$o=async(e,t)=>{const n=e.body,r=Er(n),o=new Kr({$metadata:za(e),...r});return rr(o,n)},jo=async(e,t)=>{const n=e.body,r=Er(n),o=new Yr({$metadata:za(e),...r});return rr(o,n)},qo=async(e,t)=>{const n=e.body,r=Er(n),o=new Io({$metadata:za(e),...r});return rr(o,n)},Vo=async(e,t)=>{const n=e.body,r=Er(n),o=new To({$metadata:za(e),...r});return rr(o,n)},Go=async(e,t)=>{const n=e.body,r=Er(n),o=new go({$metadata:za(e),...r});return rr(o,n)},Ho=async(e,t)=>{const n=e.body,r=Er(n),o=new so({$metadata:za(e),...r});return rr(o,n)},Ko=async(e,t)=>{const n=e.body,r=Er(n),o=new wo({$metadata:za(e),...r});return rr(o,n)},Wo=async(e,t)=>{const n=e.body,r=Er(n),o=new xo({$metadata:za(e),...r});return rr(o,n)},Jo=async(e,t)=>{const n=e.body,r=Er(n),o=new Ao({$metadata:za(e),...r});return rr(o,n)},Qo=async(e,t)=>{const n=e.body,r=Er(n),o=new So({$metadata:za(e),...r});return rr(o,n)},Xo=async(e,t)=>{const n=e.body,r=Er(n),o=new Fo({$metadata:za(e),...r});return rr(o,n)},Yo=async(e,t)=>{const n=e.body,r=Er(n),o=new Ur({$metadata:za(e),...r});return rr(o,n)},Zo=async(e,t)=>{const n=e.body,r=Er(n),o=new $r({$metadata:za(e),...r});return rr(o,n)},ei=async(e,t)=>{const n=e.body,r=Er(n),o=new Po({$metadata:za(e),...r});return rr(o,n)},ti=async(e,t)=>{const n=e.body,r=Er(n),o=new Ro({$metadata:za(e),...r});return rr(o,n)},ni=async(e,t)=>{const n=e.body,r=Er(n),o=new Gr({$metadata:za(e),...r});return rr(o,n)},ri=async(e,t)=>{const n=e.body,r=Er(n),o=new to({$metadata:za(e),...r});return rr(o,n)},oi=async(e,t)=>{const n=e.body,r=Er(n),o=new No({$metadata:za(e),...r});return rr(o,n)},ii=async(e,t)=>{const n=e.body,r=Er(n),o=new jr({$metadata:za(e),...r});return rr(o,n)},ai=async(e,t)=>{const n=e.body,r=Er(n),o=new Oo({$metadata:za(e),...r});return rr(o,n)},si=async(e,t)=>{const n=e.body,r=Er(n),o=new Lo({$metadata:za(e),...r});return rr(o,n)},ci=async(e,t)=>{const n=e.body,r=Er(n),o=new Mr({$metadata:za(e),...r});return rr(o,n)},di=async(e,t)=>{const n=e.body,r=Er(n),o=new uo({$metadata:za(e),...r});return rr(o,n)},li=async(e,t)=>{const n=e.body,r=Er(n),o=new qr({$metadata:za(e),...r});return rr(o,n)},ui=async(e,t)=>{const n=e.body,r=Er(n),o=new Do({$metadata:za(e),...r});return rr(o,n)},pi=async(e,t)=>{const n=e.body,r=Er(n),o=new no({$metadata:za(e),...r});return rr(o,n)},mi=async(e,t)=>{const n=e.body,r=Er(n),o=new ro({$metadata:za(e),...r});return rr(o,n)},hi=async(e,t)=>{const n=e.body,r=Oa(n,t),o=new Bo({$metadata:za(e),...r});return rr(o,n)},yi=async(e,t)=>{const n=e.body,r=Er(n),o=new mo({$metadata:za(e),...r});return rr(o,n)},fi=async(e,t)=>{const n=e.body,r=Er(n),o=new Co({$metadata:za(e),...r});return rr(o,n)},gi=(e,t)=>zo.visit(e,{B:e=>({B:t.base64Encoder(e)}),BOOL:e=>({BOOL:e}),BS:e=>({BS:_i(e,t)}),L:e=>({L:ki(e,t)}),M:e=>({M:Di(e,t)}),N:e=>({N:e}),NS:e=>({NS:Er(e)}),NULL:e=>({NULL:e}),S:e=>({S:e}),SS:e=>({SS:Er(e)}),_:(e,t)=>({name:t})}),wi=(e,t)=>e.filter((e=>null!=e)).map((e=>gi(e,t))),Ei=(e,t)=>mr(e,{AutoScalingDisabled:[],AutoScalingRoleArn:[],MaximumUnits:[],MinimumUnits:[],ScalingPolicyUpdate:e=>((e,t)=>mr(e,{PolicyName:[],TargetTrackingScalingPolicyConfiguration:e=>bi(e,t)}))(e,t)}),bi=(e,t)=>mr(e,{DisableScaleIn:[],ScaleInCooldown:[],ScaleOutCooldown:[],TargetValue:wr}),vi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ai(r,t)),e)),{}),Si=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Gi(r,t)),e)),{}),_i=(e,t)=>e.filter((e=>null!=e)).map((e=>t.base64Encoder(e))),Ii=(e,t)=>mr(e,{AttributeValueList:e=>wi(e,t),ComparisonOperator:[]}),xi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ci(r,t)),e)),{}),Ci=(e,t)=>mr(e,{AttributeValueList:e=>wi(e,t),ComparisonOperator:[],Exists:[],Value:e=>gi(e,t)}),Ti=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=gi(r,t)),e)),{}),Pi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ii(r,t)),e)),{}),Ni=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=gi(r,t)),e)),{}),Ai=(e,t)=>mr(e,{AttributesToGet:Er,ConsistentRead:[],ExpressionAttributeNames:Er,Keys:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>Ni(e,t))))(e,t),ProjectionExpression:[]}),ki=(e,t)=>e.filter((e=>null!=e)).map((e=>gi(e,t))),Di=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=gi(r,t)),e)),{}),Ri=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Parameters:e=>Li(e,t),Statement:[]}))(e,t))),Oi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{ConsistentRead:[],Parameters:e=>Li(e,t),Statement:[]}))(e,t))),Li=(e,t)=>e.filter((e=>null!=e)).map((e=>gi(e,t))),Fi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=gi(r,t)),e)),{}),zi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingUpdate:e=>Ei(e,t)}))(e,t))),Bi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{RegionName:[],ReplicaGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingSettingsUpdate:e=>Ei(e,t),ProvisionedReadCapacityUnits:[]}))(e,t))))(e,t),ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate:e=>Ei(e,t),ReplicaProvisionedReadCapacityUnits:[],ReplicaTableClass:[]}))(e,t))),Ui=(e,t)=>mr(e,{ReturnConsumedCapacity:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Get:e=>((e,t)=>mr(e,{ExpressionAttributeNames:Er,Key:e=>Ni(e,t),ProjectionExpression:[],TableName:[]}))(e,t)}))(e,t))))(e,t)}),Mi=(e,t)=>mr(e,{ClientRequestToken:[!0,e=>e??Ee()],ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{ConditionCheck:e=>((e,t)=>mr(e,{ConditionExpression:[],ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Key:e=>Ni(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Delete:e=>((e,t)=>mr(e,{ConditionExpression:[],ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Key:e=>Ni(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Put:e=>((e,t)=>mr(e,{ConditionExpression:[],ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Item:e=>Fi(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Update:e=>$i(e,t)}))(e,t))))(e,t)}),$i=(e,t)=>mr(e,{ConditionExpression:[],ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Key:e=>Ni(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[],UpdateExpression:[]}),ji=(e,t)=>mr(e,{GlobalTableBillingMode:[],GlobalTableGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>Ei(e,t),ProvisionedWriteCapacityUnits:[]}))(e,t))))(e,t),GlobalTableName:[],GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>Ei(e,t),GlobalTableProvisionedWriteCapacityUnits:[],ReplicaSettingsUpdate:e=>Bi(e,t)}),qi=(e,t)=>mr(e,{AttributeUpdates:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>mr(e,{Action:[],Value:e=>gi(e,t)}))(r,t)),e)),{}))(e,t),ConditionExpression:[],ConditionalOperator:[],Expected:e=>xi(e,t),ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Key:e=>Ni(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[],UpdateExpression:[]}),Vi=(e,t)=>mr(e,{GlobalSecondaryIndexUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingUpdate:e=>Ei(e,t)}))(e,t))))(e,t),ProvisionedWriteCapacityAutoScalingUpdate:e=>Ei(e,t),ReplicaUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{RegionName:[],ReplicaGlobalSecondaryIndexUpdates:e=>zi(e,t),ReplicaProvisionedReadCapacityAutoScalingUpdate:e=>Ei(e,t)}))(e,t))))(e,t),TableName:[]}),Gi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{DeleteRequest:e=>((e,t)=>mr(e,{Key:e=>Ni(e,t)}))(e,t),PutRequest:e=>((e,t)=>mr(e,{Item:e=>Fi(e,t)}))(e,t)}))(e,t))),Hi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ki(Fn(r),t)),e)),{}),Ki=(e,t)=>null!=e.B?{B:t.base64Decoder(e.B)}:void 0!==Cn(e.BOOL)?{BOOL:Cn(e.BOOL)}:null!=e.BS?{BS:na(e.BS,t)}:null!=e.L?{L:ga(e.L,t)}:null!=e.M?{M:ba(e.M,t)}:void 0!==Ln(e.N)?{N:Ln(e.N)}:null!=e.NS?{NS:Er(e.NS)}:void 0!==Cn(e.NULL)?{NULL:Cn(e.NULL)}:void 0!==Ln(e.S)?{S:Ln(e.S)}:null!=e.SS?{SS:Er(e.SS)}:{$unknown:Object.entries(e)[0]},Wi=(e,t)=>mr(e,{AutoScalingDisabled:Cn,AutoScalingRoleArn:Ln,MaximumUnits:Nn,MinimumUnits:Nn,ScalingPolicies:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{PolicyName:Ln,TargetTrackingScalingPolicyConfiguration:e=>Ji(e,t)}))(e,t)));return n})(e,t)}),Ji=(e,t)=>mr(e,{DisableScaleIn:Cn,ScaleInCooldown:An,ScaleOutCooldown:An,TargetValue:Un}),Qi=(e,t)=>mr(e,{BackupDetails:e=>Xi(e,t),SourceTableDetails:e=>Pa(e,t),SourceTableFeatureDetails:e=>Na(e,t)}),Xi=(e,t)=>mr(e,{BackupArn:Ln,BackupCreationDateTime:e=>Rn(Kn(Tn(e))),BackupExpiryDateTime:e=>Rn(Kn(Tn(e))),BackupName:Ln,BackupSizeBytes:Nn,BackupStatus:Ln,BackupType:Ln}),Yi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=fa(r,t)),e)),{}),Zi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ma(r,t)),e)),{}),ea=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Fa(r,t)),e)),{}),ta=(e,t)=>mr(e,{BillingMode:Ln,LastUpdateToPayPerRequestDateTime:e=>Rn(Kn(Tn(e)))}),na=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>t.base64Decoder(e)));return n},ra=(e,t)=>mr(e,{CapacityUnits:Un,ReadCapacityUnits:Un,WriteCapacityUnits:Un}),oa=(e,t)=>mr(e,{CapacityUnits:Un,GlobalSecondaryIndexes:e=>Ta(e,t),LocalSecondaryIndexes:e=>Ta(e,t),ReadCapacityUnits:Un,Table:e=>ra(e),TableName:Ln,WriteCapacityUnits:Un}),ia=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>oa(e,t)));return n},aa=(e,t)=>mr(e,{ContinuousBackupsStatus:Ln,PointInTimeRecoveryDescription:e=>Sa(e,t)}),sa=(e,t)=>mr(e,{BilledSizeBytes:Nn,ClientToken:Ln,EndTime:e=>Rn(Kn(Tn(e))),ExportArn:Ln,ExportFormat:Ln,ExportManifest:Ln,ExportStatus:Ln,ExportTime:e=>Rn(Kn(Tn(e))),FailureCode:Ln,FailureMessage:Ln,ItemCount:Nn,S3Bucket:Ln,S3BucketOwner:Ln,S3Prefix:Ln,S3SseAlgorithm:Ln,S3SseKmsKeyId:Ln,StartTime:e=>Rn(Kn(Tn(e))),TableArn:Ln,TableId:Ln}),ca=(e,t)=>mr(e,{CreationDateTime:e=>Rn(Kn(Tn(e))),GlobalTableArn:Ln,GlobalTableName:Ln,GlobalTableStatus:Ln,ReplicationGroup:e=>Ia(e,t)}),da=(e,t)=>mr(e,{ClientToken:Ln,CloudWatchLogGroupArn:Ln,EndTime:e=>Rn(Kn(Tn(e))),ErrorCount:Nn,FailureCode:Ln,FailureMessage:Ln,ImportArn:Ln,ImportStatus:Ln,ImportedItemCount:Nn,InputCompressionType:Ln,InputFormat:Ln,InputFormatOptions:Er,ProcessedItemCount:Nn,ProcessedSizeBytes:Nn,S3BucketSource:Er,StartTime:e=>Rn(Kn(Tn(e))),TableArn:Ln,TableCreationParameters:Er,TableId:Ln}),la=(e,t)=>mr(e,{ItemCollectionKey:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ki(Fn(r),t)),e)),{}))(e,t),SizeEstimateRangeGB:e=>pa(e,t)}),ua=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>la(e,t)));return n})(r,t)),e)),{}),pa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Un(e)));return n},ma=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Hi(e,t)));return n},ha=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Item:e=>Hi(e,t)}))(e,t)));return n},ya=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ki(Fn(r),t)),e)),{}),fa=(e,t)=>mr(e,{AttributesToGet:Er,ConsistentRead:Cn,ExpressionAttributeNames:Er,Keys:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>ya(e,t)));return n})(e,t),ProjectionExpression:Ln}),ga=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Ki(Fn(e),t)));return n},wa=(e,t)=>mr(e,{BackupSummaries:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{BackupArn:Ln,BackupCreationDateTime:e=>Rn(Kn(Tn(e))),BackupExpiryDateTime:e=>Rn(Kn(Tn(e))),BackupName:Ln,BackupSizeBytes:Nn,BackupStatus:Ln,BackupType:Ln,TableArn:Ln,TableId:Ln,TableName:Ln}))(e)));return n})(e),LastEvaluatedBackupArn:Ln}),Ea=(e,t)=>mr(e,{ImportSummaryList:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{CloudWatchLogGroupArn:Ln,EndTime:e=>Rn(Kn(Tn(e))),ImportArn:Ln,ImportStatus:Ln,InputFormat:Ln,S3BucketSource:Er,StartTime:e=>Rn(Kn(Tn(e))),TableArn:Ln}))(e)));return n})(e),NextToken:Ln}),ba=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ki(Fn(r),t)),e)),{}),va=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Error:Er,Item:e=>Hi(e,t),TableName:Ln}))(e,t)));return n},Sa=(e,t)=>mr(e,{EarliestRestorableDateTime:e=>Rn(Kn(Tn(e))),LatestRestorableDateTime:e=>Rn(Kn(Tn(e))),PointInTimeRecoveryStatus:Ln}),_a=(e,t)=>mr(e,{LastDecreaseDateTime:e=>Rn(Kn(Tn(e))),LastIncreaseDateTime:e=>Rn(Kn(Tn(e))),NumberOfDecreasesToday:Nn,ReadCapacityUnits:Nn,WriteCapacityUnits:Nn}),Ia=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{GlobalSecondaryIndexes:Er,KMSMasterKeyId:Ln,ProvisionedThroughputOverride:Er,RegionName:Ln,ReplicaInaccessibleDateTime:e=>Rn(Kn(Tn(e))),ReplicaStatus:Ln,ReplicaStatusDescription:Ln,ReplicaStatusPercentProgress:Ln,ReplicaTableClassSummary:e=>Da(e,t)}))(e,t)));return n},xa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:Ln,IndexStatus:Ln,ProvisionedReadCapacityAutoScalingSettings:e=>Wi(e,t),ProvisionedWriteCapacityAutoScalingSettings:e=>Wi(e,t)}))(e,t)));return n},Ca=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{RegionName:Ln,ReplicaBillingModeSummary:e=>ta(e),ReplicaGlobalSecondaryIndexSettings:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{IndexName:Ln,IndexStatus:Ln,ProvisionedReadCapacityAutoScalingSettings:e=>Wi(e,t),ProvisionedReadCapacityUnits:Nn,ProvisionedWriteCapacityAutoScalingSettings:e=>Wi(e,t),ProvisionedWriteCapacityUnits:Nn}))(e,t)));return n})(e,t),ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Wi(e,t),ReplicaProvisionedReadCapacityUnits:Nn,ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Wi(e,t),ReplicaProvisionedWriteCapacityUnits:Nn,ReplicaStatus:Ln,ReplicaTableClassSummary:e=>Da(e,t)}))(e,t)));return n},Ta=(e,t)=>Object.entries(e).reduce(((e,[t,n])=>(null===n||(e[t]=ra(n)),e)),{}),Pa=(e,t)=>mr(e,{BillingMode:Ln,ItemCount:Nn,KeySchema:Er,ProvisionedThroughput:Er,TableArn:Ln,TableCreationDateTime:e=>Rn(Kn(Tn(e))),TableId:Ln,TableName:Ln,TableSizeBytes:Nn}),Na=(e,t)=>mr(e,{GlobalSecondaryIndexes:Er,LocalSecondaryIndexes:Er,SSEDescription:e=>Aa(e,t),StreamDescription:Er,TimeToLiveDescription:Er}),Aa=(e,t)=>mr(e,{InaccessibleEncryptionDateTime:e=>Rn(Kn(Tn(e))),KMSMasterKeyArn:Ln,SSEType:Ln,Status:Ln}),ka=(e,t)=>mr(e,{Replicas:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{GlobalSecondaryIndexes:e=>xa(e,t),RegionName:Ln,ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Wi(e,t),ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Wi(e,t),ReplicaStatus:Ln}))(e,t)));return n})(e,t),TableName:Ln,TableStatus:Ln}),Da=(e,t)=>mr(e,{LastUpdateDateTime:e=>Rn(Kn(Tn(e))),TableClass:Ln}),Ra=(e,t)=>mr(e,{ArchivalSummary:e=>((e,t)=>mr(e,{ArchivalBackupArn:Ln,ArchivalDateTime:e=>Rn(Kn(Tn(e))),ArchivalReason:Ln}))(e),AttributeDefinitions:Er,BillingModeSummary:e=>ta(e),CreationDateTime:e=>Rn(Kn(Tn(e))),DeletionProtectionEnabled:Cn,GlobalSecondaryIndexes:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Backfilling:Cn,IndexArn:Ln,IndexName:Ln,IndexSizeBytes:Nn,IndexStatus:Ln,ItemCount:Nn,KeySchema:Er,Projection:Er,ProvisionedThroughput:e=>_a(e,t)}))(e,t)));return n})(e,t),GlobalTableVersion:Ln,ItemCount:Nn,KeySchema:Er,LatestStreamArn:Ln,LatestStreamLabel:Ln,LocalSecondaryIndexes:Er,ProvisionedThroughput:e=>_a(e,t),Replicas:e=>Ia(e,t),RestoreSummary:e=>((e,t)=>mr(e,{RestoreDateTime:e=>Rn(Kn(Tn(e))),RestoreInProgress:Cn,SourceBackupArn:Ln,SourceTableArn:Ln}))(e),SSEDescription:e=>Aa(e,t),StreamSpecification:Er,TableArn:Ln,TableClassSummary:e=>Da(e,t),TableId:Ln,TableName:Ln,TableSizeBytes:Nn,TableStatus:Ln}),Oa=(e,t)=>mr(e,{CancellationReasons:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>mr(e,{Code:Ln,Item:e=>Hi(e,t),Message:Ln}))(e,t)));return n})(e,t),Message:Ln}),La=(e,t)=>mr(e,{DeleteRequest:e=>((e,t)=>mr(e,{Key:e=>ya(e,t)}))(e,t),PutRequest:e=>((e,t)=>mr(e,{Item:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ki(Fn(r),t)),e)),{}))(e,t)}))(e,t)}),Fa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>La(e,t)));return n},za=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ba=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),Ua=or(Sr),Ma=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new vr(d)};function $a(e){return{"content-type":"application/x-amz-json-1.0","x-amz-target":`DynamoDB_20120810.${e}`}}const ja=(e,t)=>((e,t)=>Ba(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),qa=async(e,t)=>{const n=await ja(e,t);return n.message=n.message??n.Message,n},Va=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Ga extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Ga.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeEndpointsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeEndpoints");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body),o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Ha extends nr{constructor(e){super(e),Object.setPrototypeOf(this,Ha.prototype)}}class Ka extends Ha{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Ka.prototype)}}class Wa extends Ha{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Wa.prototype)}}class Ja extends Ha{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Ja.prototype)}}class Qa extends Ha{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Qa.prototype)}}class Xa extends Ha{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Xa.prototype)}}class Ya extends Ha{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Ya.prototype)}}class Za extends Ha{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Za.prototype)}}const es=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:xn}}),ts=e=>({...e,...e.Credentials&&{Credentials:es(e.Credentials)}}),ns=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:xn}}),rs=e=>({...e,...e.Credentials&&{Credentials:es(e.Credentials)}});var os=n(6932);const is=async(e,t)=>{const n=e.body,r=vs(n.Error,t),o=new Ka({$metadata:Ps(e),...r});return rr(o,n)},as=async(e,t)=>{const n=e.body,r=Ss(n.Error,t),o=new Za({$metadata:Ps(e),...r});return rr(o,n)},ss=async(e,t)=>{const n=e.body,r=_s(n.Error,t),o=new Xa({$metadata:Ps(e),...r});return rr(o,n)},cs=async(e,t)=>{const n=e.body,r=Is(n.Error,t),o=new Ya({$metadata:Ps(e),...r});return rr(o,n)},ds=async(e,t)=>{const n=e.body,r=xs(n.Error,t),o=new Wa({$metadata:Ps(e),...r});return rr(o,n)},ls=async(e,t)=>{const n=e.body,r=Cs(n.Error,t),o=new Ja({$metadata:Ps(e),...r});return rr(o,n)},us=async(e,t)=>{const n=e.body,r=Ts(n.Error,t),o=new Qa({$metadata:Ps(e),...r});return rr(o,n)},ps=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.PolicyArns){const r=hs(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}if(null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),null!=e.Tags){const r=ws(e.Tags,t);0===e.Tags?.length&&(n.Tags=[]),Object.entries(r).forEach((([e,t])=>{n[`Tags.${e}`]=t}))}if(null!=e.TransitiveTagKeys){const r=gs(e.TransitiveTagKeys,t);0===e.TransitiveTagKeys?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach((([e,t])=>{n[`TransitiveTagKeys.${e}`]=t}))}return null!=e.ExternalId&&(n.ExternalId=e.ExternalId),null!=e.SerialNumber&&(n.SerialNumber=e.SerialNumber),null!=e.TokenCode&&(n.TokenCode=e.TokenCode),null!=e.SourceIdentity&&(n.SourceIdentity=e.SourceIdentity),n},ms=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.WebIdentityToken&&(n.WebIdentityToken=e.WebIdentityToken),null!=e.ProviderId&&(n.ProviderId=e.ProviderId),null!=e.PolicyArns){const r=hs(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}return null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),n},hs=(e,t)=>{const n={};let r=1;for(const o of e){if(null===o)continue;const e=ys(o,t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},ys=(e,t)=>{const n={};return null!=e.arn&&(n.arn=e.arn),n},fs=(e,t)=>{const n={};return null!=e.Key&&(n.Key=e.Key),null!=e.Value&&(n.Value=e.Value),n},gs=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},ws=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=fs(t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},Es=(e,t)=>{const n={};return void 0!==e.AssumedRoleId&&(n.AssumedRoleId=Ln(e.AssumedRoleId)),void 0!==e.Arn&&(n.Arn=Ln(e.Arn)),n},bs=(e,t)=>{const n={};return void 0!==e.AccessKeyId&&(n.AccessKeyId=Ln(e.AccessKeyId)),void 0!==e.SecretAccessKey&&(n.SecretAccessKey=Ln(e.SecretAccessKey)),void 0!==e.SessionToken&&(n.SessionToken=Ln(e.SessionToken)),void 0!==e.Expiration&&(n.Expiration=Rn(Hn(e.Expiration))),n},vs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},Ss=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},_s=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},Is=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},xs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},Cs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},Ts=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Ln(e.message)),n},Ps=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ns=or(Ha),As=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new vr(d)},ks={"content-type":"application/x-www-form-urlencoded"},Ds=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>{if(e.length){const t=new os.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});t.addEntity("#xD","\r"),t.addEntity("#10","\n");const n=t.parse(e),r="#text",o=Object.keys(n)[0],i=n[o];return i[r]&&(i[o]=i[r],delete i[r]),lr(i)}return{}})),Rs=async(e,t)=>{const n=await Ds(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},Os=e=>Object.entries(e).map((([e,t])=>dr(e)+"="+dr(t))).join("&"),Ls=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Fs extends In{static getEndpointParameterInstructions(){return{UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Fs.getEndpointParameterInstructions())),this.middlewareStack.use(vt(t));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:ts},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ks;let r;return r=Os({...ps(e,t),Action:"AssumeRole",Version:"2011-06-15"}),As(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Rs(e.body,t)},r=Ls(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await is(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ds(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await ls(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await us(n,t);default:const o=n.body;return Ns({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=bs(e.Credentials,t)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=Es(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=$n(e.PackedPolicySize)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Ln(e.SourceIdentity)),n})((await Ds(e.body,t)).AssumeRoleResult,t),{$metadata:Ps(e),...n}})(e,t)}}class zs extends In{static getEndpointParameterInstructions(){return{UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,zs.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleWithWebIdentityCommand",inputFilterSensitiveLog:ns,outputFilterSensitiveLog:rs},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ks;let r;return r=Os({...ms(e,t),Action:"AssumeRoleWithWebIdentity",Version:"2011-06-15"}),As(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Rs(e.body,t)},r=Ls(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await is(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await as(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await ss(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await cs(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ds(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await ls(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await us(n,t);default:const o=n.body;return Ns({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=bs(e.Credentials,t)),void 0!==e.SubjectFromWebIdentityToken&&(n.SubjectFromWebIdentityToken=Ln(e.SubjectFromWebIdentityToken)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=Es(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=$n(e.PackedPolicySize)),void 0!==e.Provider&&(n.Provider=Ln(e.Provider)),void 0!==e.Audience&&(n.Audience=Ln(e.Audience)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Ln(e.SourceIdentity)),n})((await Ds(e.body,t)).AssumeRoleWithWebIdentityResult,t),{$metadata:Ps(e),...n}})(e,t)}}const Bs="us-east-1",Us=e=>"function"!=typeof e?void 0===e?Bs:e:async()=>{try{return await e()}catch(e){return Bs}},Ms=(e,t)=>{let n,r;return async(o,i)=>{if(r=o,!n){const{logger:o,region:i,requestHandler:a}=e;n=new t({logger:o,credentialDefaultProvider:()=>async()=>r,region:Us(i||e.region),...a?{requestHandler:a}:{}})}const{Credentials:a}=await n.send(new Fs(i));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration}}},$s=(e,t)=>{let n;return async r=>{if(!n){const{logger:r,region:o,requestHandler:i}=e;n=new t({logger:r,region:Us(o||e.region),...i?{requestHandler:i}:{}})}const{Credentials:o}=await n.send(new zs(r));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration}}},js=()=>async()=>{const e=process.env.AWS_ACCESS_KEY_ID,t=process.env.AWS_SECRET_ACCESS_KEY,n=process.env.AWS_SESSION_TOKEN,r=process.env.AWS_CREDENTIAL_EXPIRATION;if(e&&t)return{accessKeyId:e,secretAccessKey:t,...n&&{sessionToken:n},...r&&{expiration:new Date(r)}};throw new Ce("Unable to find environment variable credentials.")};var qs=n(2037),Vs=n(1017);const Gs=()=>{const{HOME:e,USERPROFILE:t,HOMEPATH:n,HOMEDRIVE:r=`C:${Vs.sep}`}=process.env;return e||t||(n?`${r}${n}`:(0,qs.homedir)())},Hs="AWS_PROFILE",Ks=e=>e.profile||process.env[Hs]||"default",Ws=e=>{const t=(0,ue.createHash)("sha1").update(e).digest("hex");return(0,Vs.join)(Gs(),".aws","sso","cache",`${t}.json`)};var Js=n(7147);const{readFile:Qs}=Js.promises,Xs=async e=>{const t=Ws(e),n=await Qs(t,"utf8");return JSON.parse(n)},Ys=()=>process.env.AWS_CONFIG_FILE||(0,Vs.join)(Gs(),".aws","config"),Zs=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||(0,Vs.join)(Gs(),".aws","credentials"),ec=/^profile\s(["'])?([^\1]+)\1$/,tc=e=>Object.entries(e).filter((([e])=>ec.test(e))).reduce(((e,[t,n])=>({...e,[ec.exec(t)[2]]:n})),{...e.default&&{default:e.default}}),nc=["__proto__","profile __proto__"],rc=e=>{const t={};let n;for(let r of e.split(/\r?\n/))if(r=r.split(/(^|\s)[;#]/)[0].trim(),"["===r[0]&&"]"===r[r.length-1]){if(n=r.substring(1,r.length-1),nc.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(n){const e=r.indexOf("="),o=0,i=r.length-1;if(-1!==e&&e!==o&&e!==i){const[o,i]=[r.substring(0,e).trim(),r.substring(e+1).trim()];t[n]=t[n]||{},t[n][o]=i}}return t},{readFile:oc}=Js.promises,ic={},ac=(e,t)=>(ic[e]&&!t?.ignoreCache||(ic[e]=oc(e,"utf8")),ic[e]),sc=()=>({}),cc=async(e={})=>{const{filepath:t=Zs(),configFilepath:n=Ys()}=e,r=await Promise.all([ac(n,{ignoreCache:e.ignoreCache}).then(rc).then(tc).catch(sc),ac(t,{ignoreCache:e.ignoreCache}).then(rc).catch(sc)]);return{configFile:r[0],credentialsFile:r[1]}},dc=/^sso-session\s(["'])?([^\1]+)\1$/,lc=e=>Object.entries(e).filter((([e])=>dc.test(e))).reduce(((e,[t,n])=>({...e,[dc.exec(t)[2]]:n})),{}),uc=()=>({}),pc=async(e={})=>ac(e.configFilepath??Ys()).then(rc).then(lc).catch(uc),mc=async e=>{const t=await cc(e);return((...e)=>{const t={};for(const n of e)for(const[e,r]of Object.entries(n))void 0!==t[e]?Object.assign(t[e],r):t[e]=r;return t})(t.configFile,t.credentialsFile)},hc=require("url"),yc=require("http");function fc(e){return new Promise(((t,n)=>{const r=(0,yc.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",(e=>{n(Object.assign(new xe("Unable to connect to instance metadata service"),e)),r.destroy()})),r.on("timeout",(()=>{n(new xe("TimeoutError from instance metadata service")),r.destroy()})),r.on("response",(e=>{const{statusCode:o=400}=e;(o<200||300<=o)&&(n(Object.assign(new xe("Error response received from instance metadata service"),{statusCode:o})),r.destroy());const i=[];e.on("data",(e=>{i.push(e)})),e.on("end",(()=>{t(Oe.Buffer.concat(i)),r.destroy()}))})),r.end()}))}const gc=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,wc=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)}),Ec=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),bc=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n},vc="AWS_CONTAINER_CREDENTIALS_FULL_URI",Sc="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",_c="AWS_CONTAINER_AUTHORIZATION_TOKEN",Ic=(e={})=>{const{timeout:t,maxRetries:n}=Ec(e);return()=>bc((async()=>{const e=await Pc(),n=JSON.parse(await xc(t,e));if(!gc(n))throw new Ce("Invalid response received from instance metadata service.");return wc(n)}),n)},xc=async(e,t)=>(process.env[_c]&&(t.headers={...t.headers,Authorization:process.env[_c]}),(await fc({...t,timeout:e})).toString()),Cc={localhost:!0,"127.0.0.1":!0},Tc={"http:":!0,"https:":!0},Pc=async()=>{if(process.env[Sc])return{hostname:"169.254.170.2",path:process.env[Sc]};if(process.env[vc]){const e=(0,hc.parse)(process.env[vc]);if(!e.hostname||!(e.hostname in Cc))throw new Ce(`${e.hostname} is not a valid container metadata service hostname`,!1);if(!e.protocol||!(e.protocol in Tc))throw new Ce(`${e.protocol} is not a valid container metadata service protocol`,!1);return{...e,port:e.port?parseInt(e.port,10):void 0}}throw new Ce(`The container metadata credential provider cannot be used unless the ${Sc} or ${vc} environment variable is set`,!1)},Nc=({environmentVariableSelector:e,configFileSelector:t,default:n},r={})=>{return Ne(Pe((o=e,async()=>{try{const e=o(process.env);if(void 0===e)throw new Error;return e}catch(e){throw new Ce(e.message||`Cannot load config from environment variables with getter: ${o}`)}}),((e,{preferredFile:t="config",...n}={})=>async()=>{const r=Ks(n),{configFile:o,credentialsFile:i}=await cc(n),a=i[r]||{},s=o[r]||{},c="config"===t?{...a,...s}:{...s,...a};try{const t=e(c);if(void 0===t)throw new Error;return t}catch(t){throw new Ce(t.message||`Cannot load config for profile ${r} in SDK configuration files with getter: ${e}`)}})(t,r),(e=>{return"function"==typeof e?async()=>await e():(t=e,()=>Promise.resolve(t));var t})(n)));var o};var Ac;!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(Ac||(Ac={}));const kc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var Dc;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(Dc||(Dc={}));const Rc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:Dc.IPv4},Oc=async()=>D(await Lc()||await Fc()),Lc=async()=>Nc(kc)(),Fc=async()=>{const e=await Nc(Rc)();switch(e){case Dc.IPv4:return Ac.IPv4;case Dc.IPv6:return Ac.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(Dc)}`)}},zc=(e,t)=>{const n=300+Math.floor(300*Math.random()),r=new Date(Date.now()+1e3*n);t.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html");const o=e.originalExpiration??e.expiration;return{...e,...o?{originalExpiration:o}:{},expiration:r}},Bc="/latest/meta-data/iam/security-credentials/",Uc=(e={})=>((e,t={})=>{const n=t?.logger||console;let r;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=zc(t,n))}catch(e){if(!r)throw e;n.warn("Credential renew failed: ",e),t=zc(r,n)}return r=t,t}})(Mc(e),{logger:e.logger}),Mc=e=>{let t=!1;const{timeout:n,maxRetries:r}=Ec(e),o=async(e,n)=>{const r=(await bc((async()=>{let e;try{e=await jc(n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)).trim();return bc((async()=>{let e;try{e=await qc(r,n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)};return async()=>{const e=await Oc();if(t)return o(r,{...e,timeout:n});{let i;try{i=(await $c({...e,timeout:n})).toString()}catch(i){if(400===i?.statusCode)throw Object.assign(i,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===i.message||[403,404,405].includes(i.statusCode))&&(t=!0),o(r,{...e,timeout:n})}return o(r,{...e,headers:{"x-aws-ec2-metadata-token":i},timeout:n})}}},$c=async e=>fc({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),jc=async e=>(await fc({...e,path:Bc})).toString(),qc=async(e,t)=>{const n=JSON.parse((await fc({...t,path:Bc+e})).toString());if(!gc(n))throw new Ce("Invalid response received from instance metadata service.");return wc(n)},Vc=require("child_process"),Gc=require("util"),Hc=(e={})=>async()=>{const t=await mc(e);return(async(e,t)=>{const n=t[e];if(!t[e])throw new Ce(`Profile ${e} could not be found in shared credentials file.`);{const t=n.credential_process;if(void 0===t)throw new Ce(`Profile ${e} did not contain credential_process.`);{const n=(0,Gc.promisify)(Vc.exec);try{const{stdout:r}=await n(t);let o;try{o=JSON.parse(r.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,t)=>{if(1!==t.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===t.AccessKeyId||void 0===t.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){const n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)}}})(e,o)}catch(e){throw new Ce(e.message)}}}})(Ks(e),t)},Kc=e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name);class Wc{constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(Be(Jc(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,ue.createHmac)(this.algorithmIdentifier,Jc(this.secret)):(0,ue.createHash)(this.algorithmIdentifier)}}function Jc(e,t){return Oe.Buffer.isBuffer(e)?e:"string"==typeof e?Fe(e,t):ArrayBuffer.isView(e)?Le(e.buffer,e.byteOffset,e.byteLength):Le(e)}const Qc=require("https"),Xc=["ECONNRESET","EPIPE","ETIMEDOUT"],Yc=e=>{const t={};for(const n of Object.keys(e)){const r=e[n];t[n]=Array.isArray(r)?r.join(","):r}return t},Zc=require("stream");class ed{constructor(e){this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise(((t,n)=>{"function"==typeof e?e().then((e=>{t(this.resolveDefaultConfig(e))})).catch(n):t(this.resolveDefaultConfig(e))}))}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:n,socketTimeout:r,httpAgent:o,httpsAgent:i}=e||{};return{connectionTimeout:n,requestTimeout:t??r,httpAgent:o||new yc.Agent({keepAlive:!0,maxSockets:50}),httpsAgent:i||new Qc.Agent({keepAlive:!0,maxSockets:50})}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){return this.config||(this.config=await this.configProvider),new Promise(((n,r)=>{let o;const i=async e=>{await o,r(e)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",void i(e)}const a="https:"===e.protocol,s=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=at(n),Array.isArray(r))for(let e=0,o=r.length;e<o;e++)t.push(`${n}=${at(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${at(r)}`),t.push(e)}}return t.join("&")}(e.query||{}),c={headers:e.headers,host:e.hostname,method:e.method,path:s?`${e.path}?${s}`:e.path,port:e.port,agent:a?this.config.httpsAgent:this.config.httpAgent},d=(a?Qc.request:yc.request)(c,(e=>{(async e=>{await o,n(e)})({response:new g({statusCode:e.statusCode||-1,headers:Yc(e.headers),body:e})})}));d.on("error",(e=>{Xc.includes(e.code)?i(Object.assign(e,{name:"TimeoutError"})):i(e)})),((e,t,n=0)=>{n&&e.on("socket",(r=>{if(r.connecting){const o=setTimeout((()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${n} ms`),{name:"TimeoutError"}))}),n);r.on("connect",(()=>{clearTimeout(o)}))}}))})(d,i,this.config.connectionTimeout),((e,t,n=0)=>{e.setTimeout(n,(()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${n} ms`),{name:"TimeoutError"}))}))})(d,i,this.config.requestTimeout),t&&(t.onabort=()=>{d.abort();const e=new Error("Request aborted");e.name="AbortError",i(e)});const l=c.agent;"object"==typeof l&&"keepAlive"in l&&((e,{keepAlive:t,keepAliveMsecs:n})=>{!0===t&&e.on("socket",(e=>{e.setKeepAlive(t,n||0)}))})(d,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs}),o=async function(e,t,n=1e3){const r=t.headers??{};"100-continue"===(r.Expect||r.expect)&&await Promise.race([new Promise((e=>{setTimeout(e,Math.max(1e3,n))})),new Promise((t=>{e.on("continue",(()=>{t()}))}))]),function(e,t){t instanceof Zc.Readable?t.pipe(e):t?e.end(Buffer.from(t)):e.end()}(e,t.body)}(d,e,this.config.requestTimeout)}))}}require("http2"),Symbol.iterator;class td extends Zc.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}_write(e,t,n){this.bufferedBytes.push(e),n()}}const nd=e=>new Promise(((t,n)=>{const r=new td;e.pipe(r),e.on("error",(e=>{r.end(),n(e)})),r.on("error",n),r.on("finish",(function(){const e=new Uint8Array(Buffer.concat(this.bufferedBytes));t(e)}))})),rd=e=>{if(!e)return 0;if("string"==typeof e)return Buffer.from(e).length;if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;if("string"==typeof e.path||Buffer.isBuffer(e.path))return(0,Js.lstatSync)(e.path).size;if("number"==typeof e.fd)return(0,Js.fstatSync)(e.fd).size;throw new Error(`Body Length computation failed for ${e}`)};var od=n(7282);const id=({serviceId:e,clientVersion:t})=>{const r=[["aws-sdk-js",t],[`os/${(0,qs.platform)()}`,(0,qs.release)()],["lang/js"],["md/nodejs",`${od.versions.node}`]],o=(()=>{try{return n(8687)?["md/crt-avail"]:null}catch(e){return null}})();o&&r.push(o),e&&r.push([`api/${e}`,t]),od.env.AWS_EXECUTION_ENV&&r.push([`exec-env/${od.env.AWS_EXECUTION_ENV}`]);const i=Nc({environmentVariableSelector:e=>e.AWS_SDK_UA_APP_ID,configFileSelector:e=>e["sdk-ua-app-id"],default:void 0})();let a;return async()=>{if(!a){const e=await i;a=e?[...r,[`app/${e}`]]:[...r]}return a}},ad=/^[A-Za-z0-9+/]*={0,2}$/,sd=e=>{if(3*e.length%4!=0)throw new TypeError("Incorrect padding on base64 string.");if(!ad.exec(e))throw new TypeError("Invalid base64 string.");const t=Fe(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},cd=e=>Le(e.buffer,e.byteOffset,e.byteLength).toString("base64"),dd="required",ld="fn",ud="argv",pd="ref",md="PartitionResult",hd="tree",yd="error",fd="endpoint",gd={[dd]:!1,type:"String"},wd={[dd]:!0,default:!1,type:"Boolean"},Ed={[pd]:"Endpoint"},bd={[ld]:"booleanEquals",[ud]:[{[pd]:"UseFIPS"},!0]},vd={[ld]:"booleanEquals",[ud]:[{[pd]:"UseDualStack"},!0]},Sd={},_d={[ld]:"booleanEquals",[ud]:[!0,{[ld]:"getAttr",[ud]:[{[pd]:md},"supportsFIPS"]}]},Id={[ld]:"booleanEquals",[ud]:[!0,{[ld]:"getAttr",[ud]:[{[pd]:md},"supportsDualStack"]}]},xd=[Ed],Cd=[bd],Td=[vd],Pd={version:"1.0",parameters:{Region:gd,UseDualStack:wd,UseFIPS:wd,Endpoint:gd},rules:[{conditions:[{[ld]:"aws.partition",[ud]:[{[pd]:"Region"}],assign:md}],type:hd,rules:[{conditions:[{[ld]:"isSet",[ud]:xd},{[ld]:"parseURL",[ud]:xd,assign:"url"}],type:hd,rules:[{conditions:Cd,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:yd},{type:hd,rules:[{conditions:Td,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:yd},{endpoint:{url:Ed,properties:Sd,headers:Sd},type:fd}]}]},{conditions:[bd,vd],type:hd,rules:[{conditions:[_d,Id],type:hd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Sd,headers:Sd},type:fd}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:yd}]},{conditions:Cd,type:hd,rules:[{conditions:[_d],type:hd,rules:[{type:hd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Sd,headers:Sd},type:fd}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:yd}]},{conditions:Td,type:hd,rules:[{conditions:[Id],type:hd,rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Sd,headers:Sd},type:fd}]},{error:"DualStack is enabled but this partition does not support DualStack",type:yd}]},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:Sd,headers:Sd},type:fd}]}]},Nd=(e,t={})=>pn(Pd,{endpointParams:e,logger:t.logger}),Ad="AWS_REGION",kd="AWS_DEFAULT_REGION",Dd=["in-region","cross-region","mobile","standard","legacy"],Rd={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:"legacy"},Od=({region:e=Nc(d),defaultsMode:t=Nc(Rd)}={})=>Ne((async()=>{const n="function"==typeof t?await t():t;switch(n?.toLowerCase()){case"auto":return Ld(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Dd.join(", ")}, got ${n}`)}})),Ld=async e=>{if(e){const t="function"==typeof e?await e():e,n=await Fd();return n?t===n?"in-region":"cross-region":"standard"}return"standard"},Fd=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env[Ad]||process.env[kd]))return process.env[Ad]??process.env[kd];if(!process.env.AWS_EC2_METADATA_DISABLED)try{const e=await Oc();return(await fc({...e,path:"/latest/meta-data/placement/region"})).toString()}catch(e){}};class zd extends _n{constructor(e){const t=(n=(e=>{cr(process.version);const t=Od(e),n=()=>t().then(ar),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??sd,base64Encoder:e?.base64Encoder??cd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Nd,logger:e?.logger??new En,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??D,utf8Decoder:e?.utf8Decoder??ze,utf8Encoder:e?.utf8Encoder??Ue}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??rd,defaultUserAgentProvider:e?.defaultUserAgentProvider??id({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Nc(ce),region:e?.region??Nc(d,l),requestHandler:e?.requestHandler??new ed(n),retryMode:e?.retryMode??Nc({...le,default:async()=>(await n()).retryMode||Q}),sha256:e?.sha256??Wc.bind(null,"sha256"),streamCollector:e?.streamCollector??nd,useDualstackEndpoint:e?.useDualstackEndpoint??Nc(s),useFipsEndpoint:e?.useFipsEndpoint??Nc(c)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const r=m(t),o=R(r),i=St(de(o));super(i),this.config=i,this.middlewareStack.use(_e(this.config)),this.middlewareStack.use(b(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(V(this.config)),this.middlewareStack.use(K(this.config)),this.middlewareStack.use(wn(this.config))}destroy(){super.destroy()}}class Bd extends nr{constructor(e){super(e),Object.setPrototypeOf(this,Bd.prototype)}}class Ud extends Bd{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,Ud.prototype)}}class Md extends Bd{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Md.prototype)}}class $d extends Bd{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,$d.prototype)}}class jd extends Bd{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,jd.prototype)}}const qd=e=>({...e,...e.accessToken&&{accessToken:xn}}),Vd=e=>({...e,...e.secretAccessKey&&{secretAccessKey:xn},...e.sessionToken&&{sessionToken:xn}}),Gd=e=>({...e,...e.roleCredentials&&{roleCredentials:Vd(e.roleCredentials)}}),Hd=or(Bd),Kd=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{message:Ln});Object.assign(n,o);const i=new Ud({$metadata:Xd(e),...n});return rr(i,e.body)},Wd=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{message:Ln});Object.assign(n,o);const i=new Md({$metadata:Xd(e),...n});return rr(i,e.body)},Jd=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{message:Ln});Object.assign(n,o);const i=new $d({$metadata:Xd(e),...n});return rr(i,e.body)},Qd=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{message:Ln});Object.assign(n,o);const i=new jd({$metadata:Xd(e),...n});return rr(i,e.body)},Xd=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Yd=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),Zd=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),el=async(e,t)=>{const n=await Zd(e,t);return n.message=n.message??n.Message,n},tl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class nl extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,nl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOClient",commandName:"GetRoleCredentialsCommand",inputFilterSensitiveLog:qd,outputFilterSensitiveLog:Gd},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=pr({},Yd,{"x-amz-sso_bearer_token":e.accessToken}),s=`${i?.endsWith("/")?i.slice(0,-1):i||""}/federation/credentials`,c=pr({role_name:[,Rn(e.roleName,"roleName")],account_id:[,Rn(e.accountId,"accountId")]});return new vr({protocol:r,hostname:n,port:o,method:"GET",headers:a,path:s,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await el(e.body,t)},r=tl(e,n.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await Kd(n,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await Wd(n,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Jd(n,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await Qd(n,t);default:const o=n.body;return Hd({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=pr({$metadata:Xd(e)}),r=Rn(On(await Zd(e.body,t)),"body"),o=mr(r,{roleCredentials:Er});return Object.assign(n,o),n})(e,t)}}const rl="To refresh this SSO session run 'aws sso login' with the corresponding profile.";class ol extends nr{constructor(e){super(e),Object.setPrototypeOf(this,ol.prototype)}}class il extends ol{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,il.prototype),this.error=e.error,this.error_description=e.error_description}}class al extends ol{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,al.prototype),this.error=e.error,this.error_description=e.error_description}}class sl extends ol{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,sl.prototype),this.error=e.error,this.error_description=e.error_description}}class cl extends ol{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,cl.prototype),this.error=e.error,this.error_description=e.error_description}}class dl extends ol{constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,dl.prototype),this.error=e.error,this.error_description=e.error_description}}class ll extends ol{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,ll.prototype),this.error=e.error,this.error_description=e.error_description}}class ul extends ol{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,ul.prototype),this.error=e.error,this.error_description=e.error_description}}class pl extends ol{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,pl.prototype),this.error=e.error,this.error_description=e.error_description}}class ml extends ol{constructor(e){super({name:"SlowDownException",$fault:"client",...e}),this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,ml.prototype),this.error=e.error,this.error_description=e.error_description}}class hl extends ol{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,hl.prototype),this.error=e.error,this.error_description=e.error_description}}class yl extends ol{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,yl.prototype),this.error=e.error,this.error_description=e.error_description}}const fl=or(ol),gl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new il({$metadata:Pl(e),...n});return rr(i,e.body)},wl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new al({$metadata:Pl(e),...n});return rr(i,e.body)},El=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new sl({$metadata:Pl(e),...n});return rr(i,e.body)},bl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new cl({$metadata:Pl(e),...n});return rr(i,e.body)},vl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new dl({$metadata:Pl(e),...n});return rr(i,e.body)},Sl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new ll({$metadata:Pl(e),...n});return rr(i,e.body)},_l=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new ul({$metadata:Pl(e),...n});return rr(i,e.body)},Il=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new pl({$metadata:Pl(e),...n});return rr(i,e.body)},xl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new ml({$metadata:Pl(e),...n});return rr(i,e.body)},Cl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new hl({$metadata:Pl(e),...n});return rr(i,e.body)},Tl=async(e,t)=>{const n=pr({}),r=e.body,o=mr(r,{error:Ln,error_description:Ln});Object.assign(n,o);const i=new yl({$metadata:Pl(e),...n});return rr(i,e.body)},Pl=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Nl=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),Al=async(e,t)=>{const n=await Nl(e,t);return n.message=n.message??n.Message,n},kl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Dl extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Dl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOOIDCClient",commandName:"CreateTokenCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=`${i?.endsWith("/")?i.slice(0,-1):i||""}/token`;let s;return s=JSON.stringify(mr(e,{clientId:[],clientSecret:[],code:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>Er(e)})),new vr({protocol:r,hostname:n,port:o,method:"POST",headers:{"content-type":"application/json"},path:a,body:s})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Al(e.body,t)},r=kl(e,n.body);switch(r){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await gl(n,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await wl(n,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await El(n,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await bl(n,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await vl(n,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Sl(n,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await _l(n,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await Il(n,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await xl(n,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Cl(n,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Tl(n,t);default:const o=n.body;return fl({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=pr({$metadata:Pl(e)}),r=Rn(On(await Nl(e.body,t)),"body"),o=mr(r,{accessToken:Ln,expiresIn:An,idToken:Ln,refreshToken:Ln,tokenType:Ln});return Object.assign(n,o),n})(e,t)}}const Rl="required",Ol="fn",Ll="argv",Fl="ref",zl="PartitionResult",Bl="tree",Ul="error",Ml="endpoint",$l={[Rl]:!1,type:"String"},jl={[Rl]:!0,default:!1,type:"Boolean"},ql={[Fl]:"Endpoint"},Vl={[Ol]:"booleanEquals",[Ll]:[{[Fl]:"UseFIPS"},!0]},Gl={[Ol]:"booleanEquals",[Ll]:[{[Fl]:"UseDualStack"},!0]},Hl={},Kl={[Ol]:"booleanEquals",[Ll]:[!0,{[Ol]:"getAttr",[Ll]:[{[Fl]:zl},"supportsFIPS"]}]},Wl={[Ol]:"booleanEquals",[Ll]:[!0,{[Ol]:"getAttr",[Ll]:[{[Fl]:zl},"supportsDualStack"]}]},Jl=[ql],Ql=[Vl],Xl=[Gl],Yl={version:"1.0",parameters:{Region:$l,UseDualStack:jl,UseFIPS:jl,Endpoint:$l},rules:[{conditions:[{[Ol]:"aws.partition",[Ll]:[{[Fl]:"Region"}],assign:zl}],type:Bl,rules:[{conditions:[{[Ol]:"isSet",[Ll]:Jl},{[Ol]:"parseURL",[Ll]:Jl,assign:"url"}],type:Bl,rules:[{conditions:Ql,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:Ul},{type:Bl,rules:[{conditions:Xl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:Ul},{endpoint:{url:ql,properties:Hl,headers:Hl},type:Ml}]}]},{conditions:[Vl,Gl],type:Bl,rules:[{conditions:[Kl,Wl],type:Bl,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Hl,headers:Hl},type:Ml}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:Ul}]},{conditions:Ql,type:Bl,rules:[{conditions:[Kl],type:Bl,rules:[{type:Bl,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Hl,headers:Hl},type:Ml}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:Ul}]},{conditions:Xl,type:Bl,rules:[{conditions:[Wl],type:Bl,rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Hl,headers:Hl},type:Ml}]},{error:"DualStack is enabled but this partition does not support DualStack",type:Ul}]},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:Hl,headers:Hl},type:Ml}]}]},Zl=(e,t={})=>pn(Yl,{endpointParams:e,logger:t.logger});class eu extends _n{constructor(e){const t=(n=(e=>{cr(process.version);const t=Od(e),n=()=>t().then(ar),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??sd,base64Encoder:e?.base64Encoder??cd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Zl,logger:e?.logger??new En,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??D,utf8Decoder:e?.utf8Decoder??ze,utf8Encoder:e?.utf8Encoder??Ue}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??rd,defaultUserAgentProvider:e?.defaultUserAgentProvider??id({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Nc(ce),region:e?.region??Nc(d,l),requestHandler:e?.requestHandler??new ed(n),retryMode:e?.retryMode??Nc({...le,default:async()=>(await n()).retryMode||Q}),sha256:e?.sha256??Wc.bind(null,"sha256"),streamCollector:e?.streamCollector??nd,useDualstackEndpoint:e?.useDualstackEndpoint??Nc(s),useFipsEndpoint:e?.useFipsEndpoint??Nc(c)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssooidc"});var n;const r=m(t),o=R(r),i=St(de(o));super(i),this.config=i,this.middlewareStack.use(_e(this.config)),this.middlewareStack.use(b(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(V(this.config)),this.middlewareStack.use(K(this.config)),this.middlewareStack.use(wn(this.config))}destroy(){super.destroy()}}const tu={},nu=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new Te(`Token is expired. ${rl}`,!1)},ru=(e,t,n=!1)=>{if(void 0===t)throw new Te(`Value not present for '${e}' in SSO Token${n?". Cannot refresh":""}. ${rl}`,!1)},{writeFile:ou}=Js.promises,iu=new Date(0),au=(e={})=>async()=>{const t=await mc(e),n=Ks(e),r=t[n];if(!r)throw new Te(`Profile '${n}' could not be found in shared credentials file.`,!1);if(!r.sso_session)throw new Te(`Profile '${n}' is missing required property 'sso_session'.`);const o=r.sso_session,i=(await pc(e))[o];if(!i)throw new Te(`Sso session '${o}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!i[e])throw new Te(`Sso session '${o}' is missing required property '${e}'.`,!1);i.sso_start_url;const a=i.sso_region;let s;try{s=await Xs(o)}catch(e){throw new Te(`The SSO session token associated with profile=${n} was not found or is invalid. ${rl}`,!1)}ru("accessToken",s.accessToken),ru("expiresAt",s.expiresAt);const{accessToken:c,expiresAt:d}=s,l={token:c,expiration:new Date(d)};if(l.expiration.getTime()-Date.now()>3e5)return l;if(Date.now()-iu.getTime()<3e4)return nu(l),l;ru("clientId",s.clientId,!0),ru("clientSecret",s.clientSecret,!0),ru("refreshToken",s.refreshToken,!0);try{iu.setTime(Date.now());const e=await((e,t)=>{const n=(e=>{if(tu[e])return tu[e];const t=new eu({region:e});return tu[e]=t,t})(t);return n.send(new Dl({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(s,a);ru("accessToken",e.accessToken),ru("expiresIn",e.expiresIn);const t=new Date(Date.now()+1e3*e.expiresIn);try{await((e,t)=>{const n=Ws(e),r=JSON.stringify(t,null,2);return ou(n,r)})(o,{...s,accessToken:e.accessToken,expiresAt:t.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:t}}catch(e){return nu(l),l}},su=!1,cu=async({ssoStartUrl:e,ssoSession:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:a})=>{let s;const c="To refresh this SSO session run aws sso login with the corresponding profile.";if(t)try{const e=await au({profile:a})();s={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new Ce(e.message,su)}else try{s=await Xs(e)}catch(e){throw new Ce(`The SSO session associated with this profile is invalid. ${c}`,su)}if(new Date(s.expiresAt).getTime()-Date.now()<=9e5)throw new Ce(`The SSO session associated with this profile has expired. ${c}`,su);const{accessToken:d}=s,l=i||new zd({region:r});let u;try{u=await l.send(new nl({accountId:n,roleName:o,accessToken:d}))}catch(e){throw Ce.from(e,su)}const{roleCredentials:{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:y}={}}=u;if(!(p&&m&&h&&y))throw new Ce("SSO returns an invalid temporary credential.",su);return{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:new Date(y)}},du=e=>{const{sso_start_url:t,sso_account_id:n,sso_region:r,sso_role_name:o}=e;if(!(t&&n&&r&&o))throw new Ce(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,!1);return e},lu=(e={})=>async()=>{const{ssoStartUrl:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,ssoSession:a}=e,s=Ks(e);if(t||n||r||o||a){if(t&&n&&r&&o)return cu({ssoStartUrl:t,ssoSession:a,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:s});throw new Ce('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"')}{const n=(await mc(e))[s];if(!n)throw new Ce(`Profile ${s} was not found.`);if(!Kc(n))throw new Ce(`Profile ${s} is not configured with SSO credentials.`);if(n?.sso_session){const o=(await pc(e))[n.sso_session],i=` configurations in profile ${s} and sso-session ${n.sso_session}`;if(r&&r!==o.sso_region)throw new Ce("Conflicting SSO region"+i,!1);if(t&&t!==o.sso_start_url)throw new Ce("Conflicting SSO start_url"+i,!1);n.sso_region=o.sso_region,n.sso_start_url=o.sso_start_url}const{sso_start_url:o,sso_account_id:a,sso_region:c,sso_role_name:d,sso_session:l}=du(n);return cu({ssoStartUrl:o,ssoSession:l,ssoAccountId:a,ssoRegion:c,ssoRoleName:d,ssoClient:i,profile:s})}},uu=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1,pu=e=>Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token}),mu=(e={})=>async()=>hu(e),hu=e=>{const t=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,n=e?.roleArn??process.env.AWS_ROLE_ARN,r=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!t||!n)throw new Ce("Web identity configuration not specified");return(e=>()=>{const{roleArn:t,roleSessionName:n,webIdentityToken:r,providerId:o,policyArns:i,policy:a,durationSeconds:s,roleAssumerWithWebIdentity:c}=e;if(!c)throw new Ce(`Role Arn '${t}' needs to be assumed with web identity, but no role assumption callback was provided.`,!1);return c({RoleArn:t,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:o,PolicyArns:i,Policy:a,DurationSeconds:s})})({...e,webIdentityToken:(0,Js.readFileSync)(t,{encoding:"ascii"}),roleArn:n,roleSessionName:r})()},yu=async(e,t,n,r={})=>{const o=t[e];if(Object.keys(r).length>0&&uu(o))return pu(o);if(i=o,Boolean(i)&&"object"==typeof i&&"string"==typeof i.role_arn&&["undefined","string"].indexOf(typeof i.role_session_name)>-1&&["undefined","string"].indexOf(typeof i.external_id)>-1&&["undefined","string"].indexOf(typeof i.mfa_serial)>-1&&((e=>"string"==typeof e.source_profile&&void 0===e.credential_source)(i)||(e=>"string"==typeof e.credential_source&&void 0===e.source_profile)(i)))return(async(e,t,n,r={})=>{const o=t[e];if(!n.roleAssumer)throw new Ce(`Profile ${e} requires a role to be assumed, but no role assumption callback was provided.`,!1);const{source_profile:i}=o;if(i&&i in r)throw new Ce(`Detected a cycle attempting to resolve credentials for profile ${Ks(n)}. Profiles visited: `+Object.keys(r).join(", "),!1);const a=i?yu(i,t,n,{...r,[i]:!0}):((e,t)=>{const n={EcsContainer:Ic,Ec2InstanceMetadata:Uc,Environment:js};if(e in n)return n[e]();throw new Ce(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`)})(o.credential_source,e)(),s={RoleArn:o.role_arn,RoleSessionName:o.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:o.external_id},{mfa_serial:c}=o;if(c){if(!n.mfaCodeProvider)throw new Ce(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,!1);s.SerialNumber=c,s.TokenCode=await n.mfaCodeProvider(c)}const d=await a;return n.roleAssumer(d,s)})(e,t,n,r);var i;if(uu(o))return pu(o);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.web_identity_token_file&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1)(o))return(async(e,t)=>mu({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity})())(o,n);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(o))return(async(e,t)=>Hc({...e,profile:t})())(n,e);if(Kc(o))return(e=>{const{sso_start_url:t,sso_account_id:n,sso_session:r,sso_region:o,sso_role_name:i}=du(e);return lu({ssoStartUrl:t,ssoAccountId:n,ssoSession:r,ssoRegion:o,ssoRoleName:i})()})(o);throw new Ce(`Profile ${e} could not be found or parsed in shared credentials file.`)},fu=(e={})=>Ne(Pe(...e.profile||process.env[Hs]?[]:[js()],lu(e),((e={})=>async()=>{const t=await mc(e);return yu(Ks(e),t,e)})(e),Hc(e),mu(e),(e=>process.env[Sc]||process.env[vc]?Ic(e):process.env.AWS_EC2_METADATA_DISABLED?async()=>{throw new Ce("EC2 Instance Metadata Service access disabled")}:Uc(e))(e),(async()=>{throw new Ce("Could not load credentials from any providers",!1)})),(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)),gu="required",wu="type",Eu="fn",bu="argv",vu="ref",Su="booleanEquals",_u="tree",Iu="stringEquals",xu="sigv4",Cu="us-east-1",Tu="endpoint",Pu="https://sts.{Region}.{PartitionResult#dnsSuffix}",Nu="error",Au="getAttr",ku={[gu]:!1,[wu]:"String"},Du={[gu]:!0,default:!1,[wu]:"Boolean"},Ru={[vu]:"Endpoint"},Ou={[Eu]:"isSet",[bu]:[{[vu]:"Region"}]},Lu={[vu]:"Region"},Fu={[Eu]:"aws.partition",[bu]:[Lu],assign:"PartitionResult"},zu={[vu]:"UseFIPS"},Bu={[vu]:"UseDualStack"},Uu={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:xu,signingName:"sts",signingRegion:Cu}]},headers:{}},Mu={},$u={conditions:[{[Eu]:Iu,[bu]:[Lu,"aws-global"]}],[Tu]:Uu,[wu]:Tu},ju={[Eu]:Su,[bu]:[zu,!0]},qu={[Eu]:Su,[bu]:[Bu,!0]},Vu={[Eu]:Su,[bu]:[!0,{[Eu]:Au,[bu]:[{[vu]:"PartitionResult"},"supportsFIPS"]}]},Gu={[vu]:"PartitionResult"},Hu={[Eu]:Su,[bu]:[!0,{[Eu]:Au,[bu]:[Gu,"supportsDualStack"]}]},Ku=[{[Eu]:"isSet",[bu]:[Ru]}],Wu=[ju],Ju=[qu],Qu={version:"1.0",parameters:{Region:ku,UseDualStack:Du,UseFIPS:Du,Endpoint:ku,UseGlobalEndpoint:Du},rules:[{conditions:[{[Eu]:Su,[bu]:[{[vu]:"UseGlobalEndpoint"},!0]},{[Eu]:"not",[bu]:Ku},Ou,Fu,{[Eu]:Su,[bu]:[zu,!1]},{[Eu]:Su,[bu]:[Bu,!1]}],[wu]:_u,rules:[{conditions:[{[Eu]:Iu,[bu]:[Lu,"ap-northeast-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"ap-south-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"ap-southeast-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"ap-southeast-2"]}],endpoint:Uu,[wu]:Tu},$u,{conditions:[{[Eu]:Iu,[bu]:[Lu,"ca-central-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"eu-central-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"eu-north-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"eu-west-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"eu-west-2"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"eu-west-3"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"sa-east-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,Cu]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"us-east-2"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"us-west-1"]}],endpoint:Uu,[wu]:Tu},{conditions:[{[Eu]:Iu,[bu]:[Lu,"us-west-2"]}],endpoint:Uu,[wu]:Tu},{endpoint:{url:Pu,properties:{authSchemes:[{name:xu,signingName:"sts",signingRegion:"{Region}"}]},headers:Mu},[wu]:Tu}]},{conditions:Ku,[wu]:_u,rules:[{conditions:Wu,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[wu]:Nu},{[wu]:_u,rules:[{conditions:Ju,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[wu]:Nu},{endpoint:{url:Ru,properties:Mu,headers:Mu},[wu]:Tu}]}]},{[wu]:_u,rules:[{conditions:[Ou],[wu]:_u,rules:[{conditions:[Fu],[wu]:_u,rules:[{conditions:[ju,qu],[wu]:_u,rules:[{conditions:[Vu,Hu],[wu]:_u,rules:[{[wu]:_u,rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[wu]:Tu}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[wu]:Nu}]},{conditions:Wu,[wu]:_u,rules:[{conditions:[Vu],[wu]:_u,rules:[{[wu]:_u,rules:[{conditions:[{[Eu]:Iu,[bu]:["aws-us-gov",{[Eu]:Au,[bu]:[Gu,"name"]}]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Mu,headers:Mu},[wu]:Tu},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Mu,headers:Mu},[wu]:Tu}]}]},{error:"FIPS is enabled but this partition does not support FIPS",[wu]:Nu}]},{conditions:Ju,[wu]:_u,rules:[{conditions:[Hu],[wu]:_u,rules:[{[wu]:_u,rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[wu]:Tu}]}]},{error:"DualStack is enabled but this partition does not support DualStack",[wu]:Nu}]},{[wu]:_u,rules:[$u,{endpoint:{url:Pu,properties:Mu,headers:Mu},[wu]:Tu}]}]}]},{error:"Invalid Configuration: Missing Region",[wu]:Nu}]}]},Xu=(e,t={})=>pn(Qu,{endpointParams:e,logger:t.logger});class Yu extends _n{constructor(e){const t=(n=(e=>{cr(process.version);const t=Od(e),n=()=>t().then(ar),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??sd,base64Encoder:e?.base64Encoder??cd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Xu,logger:e?.logger??new En,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??D,utf8Decoder:e?.utf8Decoder??ze,utf8Encoder:e?.utf8Encoder??Ue}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??rd,credentialDefaultProvider:e?.credentialDefaultProvider??(o=fu,e=>o({roleAssumer:Ms(e,e.stsClientCtor),roleAssumerWithWebIdentity:$s(e,e.stsClientCtor),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??id({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Nc(ce),region:e?.region??Nc(d,l),requestHandler:e?.requestHandler??new ed(n),retryMode:e?.retryMode??Nc({...le,default:async()=>(await n()).retryMode||Q}),sha256:e?.sha256??Wc.bind(null,"sha256"),streamCollector:e?.streamCollector??nd,useDualstackEndpoint:e?.useDualstackEndpoint??Nc(s),useFipsEndpoint:e?.useFipsEndpoint??Nc(c)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"});var n;const r=m(t),o=R(r),i=St(((e,{stsClientCtor:t})=>yt({...e,stsClientCtor:t}))(de(o),{stsClientCtor:Yu}));super(i),this.config=i,this.middlewareStack.use(_e(this.config)),this.middlewareStack.use(b(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(V(this.config)),this.middlewareStack.use(K(this.config)),this.middlewareStack.use(wn(this.config))}destroy(){super.destroy()}}const Zu=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,ep=(e={},t)=>Ms(e,Zu(Yu,t)),tp=(e={},t)=>$s(e,Zu(Yu,t)),np="required",rp="fn",op="argv",ip="ref",ap="isSet",sp="tree",cp="error",dp="endpoint",lp="PartitionResult",up="getAttr",pp="stringEquals",mp={[np]:!1,type:"String"},hp={[np]:!0,default:!1,type:"Boolean"},yp={[ip]:"Endpoint"},fp={[rp]:"booleanEquals",[op]:[{[ip]:"UseFIPS"},!0]},gp={[rp]:"booleanEquals",[op]:[{[ip]:"UseDualStack"},!0]},wp={},Ep={[ip]:"Region"},bp={[rp]:"booleanEquals",[op]:[!0,{[rp]:up,[op]:[{[ip]:lp},"supportsFIPS"]}]},vp={[ip]:lp},Sp={[rp]:"booleanEquals",[op]:[!0,{[rp]:up,[op]:[vp,"supportsDualStack"]}]},_p=[fp],Ip=[gp],xp=[Ep],Cp={version:"1.0",parameters:{Region:mp,UseDualStack:hp,UseFIPS:hp,Endpoint:mp},rules:[{conditions:[{[rp]:ap,[op]:[yp]}],type:sp,rules:[{conditions:_p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:cp},{type:sp,rules:[{conditions:Ip,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:cp},{endpoint:{url:yp,properties:wp,headers:wp},type:dp}]}]},{type:sp,rules:[{conditions:[{[rp]:ap,[op]:xp}],type:sp,rules:[{conditions:[{[rp]:"aws.partition",[op]:xp,assign:lp}],type:sp,rules:[{conditions:[fp,gp],type:sp,rules:[{conditions:[bp,Sp],type:sp,rules:[{type:sp,rules:[{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wp,headers:wp},type:dp}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:cp}]},{conditions:_p,type:sp,rules:[{conditions:[bp],type:sp,rules:[{type:sp,rules:[{conditions:[{[rp]:pp,[op]:["aws-us-gov",{[rp]:up,[op]:[vp,"name"]}]}],endpoint:{url:"https://dynamodb.{Region}.amazonaws.com",properties:wp,headers:wp},type:dp},{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",properties:wp,headers:wp},type:dp}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:cp}]},{conditions:Ip,type:sp,rules:[{conditions:[Sp],type:sp,rules:[{type:sp,rules:[{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wp,headers:wp},type:dp}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:cp}]},{type:sp,rules:[{conditions:[{[rp]:pp,[op]:[Ep,"local"]}],endpoint:{url:"http://localhost:8000",properties:{authSchemes:[{name:"sigv4",signingName:"dynamodb",signingRegion:"us-east-1"}]},headers:wp},type:dp},{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dnsSuffix}",properties:wp,headers:wp},type:dp}]}]}]},{error:"Invalid Configuration: Missing Region",type:cp}]}]},Tp=(e,t={})=>pn(Cp,{endpointParams:e,logger:t.logger});class Pp extends _n{constructor(e){const t=(n=(e=>{cr(process.version);const t=Od(e),n=()=>t().then(ar),r=(e=>({apiVersion:"2012-08-10",base64Decoder:e?.base64Decoder??sd,base64Encoder:e?.base64Encoder??cd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Tp,logger:e?.logger??new En,serviceId:e?.serviceId??"DynamoDB",urlParser:e?.urlParser??D,utf8Decoder:e?.utf8Decoder??ze,utf8Encoder:e?.utf8Encoder??Ue}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??rd,credentialDefaultProvider:e?.credentialDefaultProvider??(o=fu,e=>o({roleAssumer:ep(e),roleAssumerWithWebIdentity:tp(e),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??id({serviceId:r.serviceId,clientVersion:"3.338.0"}),endpointDiscoveryEnabledProvider:e?.endpointDiscoveryEnabledProvider??Nc(z),maxAttempts:e?.maxAttempts??Nc(ce),region:e?.region??Nc(d,l),requestHandler:e?.requestHandler??new ed(n),retryMode:e?.retryMode??Nc({...le,default:async()=>(await n()).retryMode||Q}),sha256:e?.sha256??Wc.bind(null,"sha256"),streamCollector:e?.streamCollector??nd,useDualstackEndpoint:e?.useDualstackEndpoint??Nc(s),useFipsEndpoint:e?.useFipsEndpoint??Nc(c)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"dynamodb"});var n;const r=m(t),o=R(r),i=de(o),a=((e,{endpointDiscoveryCommandCtor:t})=>({...e,endpointDiscoveryCommandCtor:t,endpointCache:new M(e.endpointCacheSize??1e3),endpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled?()=>Promise.resolve(e.endpointDiscoveryEnabled):e.endpointDiscoveryEnabledProvider,isClientEndpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled}))(St(yt(i)),{endpointDiscoveryCommandCtor:Ga});super(a),this.config=a,this.middlewareStack.use(_e(this.config)),this.middlewareStack.use(b(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(V(this.config)),this.middlewareStack.use(K(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(wn(this.config))}destroy(){super.destroy()}}class Np extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Np.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("BatchExecuteStatement");let r;return r=JSON.stringify(((e,t)=>mr(e,{ReturnConsumedCapacity:[],Statements:e=>Oi(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),Responses:e=>va(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Ap extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Ap.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchGetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("BatchGetItem");let r;return r=JSON.stringify(((e,t)=>mr(e,{RequestItems:e=>vi(e,t),ReturnConsumedCapacity:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),Responses:e=>Zi(e,t),UnprocessedKeys:e=>Yi(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class kp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchWriteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("BatchWriteItem");let r;return r=JSON.stringify(((e,t)=>mr(e,{RequestItems:e=>Si(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ni(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t),UnprocessedItems:e=>ea(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Dp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Dp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("CreateBackup");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await Uo(n,t);case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await pi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{BackupDetails:e=>Xi(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Rp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Rp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("CreateGlobalTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"GlobalTableAlreadyExistsException":case"com.amazonaws.dynamodb#GlobalTableAlreadyExistsException":throw await Ho(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{GlobalTableDescription:e=>ca(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Op extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Op.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("CreateTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableDescription:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Lp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Lp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DeleteBackup");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await Uo(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{BackupDescription:e=>Qi(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Fp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Fp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DeleteItem");let r;return r=JSON.stringify(((e,t)=>mr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>xi(e,t),ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Key:e=>Ni(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await $o(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ni(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await yi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{Attributes:e=>Hi(e,t),ConsumedCapacity:e=>oa(e,t),ItemCollectionMetrics:e=>la(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class zp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DeleteTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableDescription:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Bp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Bp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeBackup");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{BackupDescription:e=>Qi(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Up extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Up.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeContinuousBackups");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ContinuousBackupsDescription:e=>aa(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Mp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Mp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeContributorInsights");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ContributorInsightsRuleList:Er,ContributorInsightsStatus:Ln,FailureException:Er,IndexName:Ln,LastUpdateDateTime:e=>Rn(Kn(Tn(e))),TableName:Ln}))(await ja(e.body,t)),{$metadata:za(e),...n}})(e,t)}}class $p extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,$p.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeExportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeExport");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ExportNotFoundException":case"com.amazonaws.dynamodb#ExportNotFoundException":throw await Go(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ExportDescription:e=>sa(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class jp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeGlobalTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Ko(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{GlobalTableDescription:e=>ca(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class qp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeGlobalTableSettings");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Ko(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{GlobalTableName:Ln,ReplicaSettings:e=>Ca(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Vp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Vp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeImportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeImport");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ImportNotFoundException":case"com.amazonaws.dynamodb#ImportNotFoundException":throw await Qo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ImportTableDescription:e=>da(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Gp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Gp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeKinesisStreamingDestination");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Hp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Hp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeLimitsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeLimits");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Kp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{Table:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Wp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Wp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeTableReplicaAutoScaling");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableAutoScalingDescription:e=>ka(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Jp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DescribeTimeToLive");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Qp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DisableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("DisableKinesisStreamingDestination");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Xp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Xp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"EnableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("EnableKinesisStreamingDestination");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class Yp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Yp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ExecuteStatement");let r;return r=JSON.stringify(((e,t)=>mr(e,{ConsistentRead:[],Limit:[],NextToken:[],Parameters:e=>Li(e,t),ReturnConsumedCapacity:[],Statement:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await $o(n,t);case"DuplicateItemException":case"com.amazonaws.dynamodb#DuplicateItemException":throw await qo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ni(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await yi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>oa(e,t),Items:e=>ma(e,t),LastEvaluatedKey:e=>ya(e,t),NextToken:Ln}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Zp extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteTransactionCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ExecuteTransaction");let r;return r=JSON.stringify(((e,t)=>mr(e,{ClientRequestToken:[!0,e=>e??Ee()],ReturnConsumedCapacity:[],TransactStatements:e=>Ri(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await hi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await fi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),Responses:e=>ha(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class em extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExportTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ExportTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>mr(e,{ClientToken:[!0,e=>e??Ee()],ExportFormat:[],ExportTime:e=>Math.round(e.getTime()/1e3),S3Bucket:[],S3BucketOwner:[],S3Prefix:[],S3SseAlgorithm:[],S3SseKmsKeyId:[],TableArn:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ExportConflictException":case"com.amazonaws.dynamodb#ExportConflictException":throw await Vo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidExportTimeException":case"com.amazonaws.dynamodb#InvalidExportTimeException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await oi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ExportDescription:e=>sa(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class tm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,tm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"GetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("GetItem");let r;return r=JSON.stringify(((e,t)=>mr(e,{AttributesToGet:Er,ConsistentRead:[],ExpressionAttributeNames:Er,Key:e=>Ni(e,t),ProjectionExpression:[],ReturnConsumedCapacity:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>oa(e,t),Item:e=>Hi(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class nm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,nm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ImportTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ImportTable");let r;return r=JSON.stringify(((e,t)=>mr(e,{ClientToken:[!0,e=>e??Ee()],InputCompressionType:[],InputFormat:[],InputFormatOptions:Er,S3BucketSource:Er,TableCreationParameters:Er}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ImportConflictException":case"com.amazonaws.dynamodb#ImportConflictException":throw await Jo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ImportTableDescription:e=>da(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class rm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,rm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListBackups");let r;return r=JSON.stringify(((e,t)=>mr(e,{BackupType:[],ExclusiveStartBackupArn:[],Limit:[],TableName:[],TimeRangeLowerBound:e=>Math.round(e.getTime()/1e3),TimeRangeUpperBound:e=>Math.round(e.getTime()/1e3)}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=wa(n),{$metadata:za(e),...r}})(e,t)}}class om extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,om.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListContributorInsights");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class im extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListExportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListExports");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class am extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,am.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListGlobalTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListGlobalTables");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class sm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListImportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListImports");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Ea(n),{$metadata:za(e),...r}})(e,t)}}class cm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListTables");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class dm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,dm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTagsOfResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("ListTagsOfResource");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class lm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,lm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"PutItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("PutItem");let r;return r=JSON.stringify(((e,t)=>mr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>xi(e,t),ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),Item:e=>Fi(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await $o(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ni(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await yi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{Attributes:e=>Hi(e,t),ConsumedCapacity:e=>oa(e,t),ItemCollectionMetrics:e=>la(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class um extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,um.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"QueryCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("Query");let r;return r=JSON.stringify(((e,t)=>mr(e,{AttributesToGet:Er,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ni(e,t),ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),FilterExpression:[],IndexName:[],KeyConditionExpression:[],KeyConditions:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ii(r,t)),e)),{}))(e,t),Limit:[],ProjectionExpression:[],QueryFilter:e=>Pi(e,t),ReturnConsumedCapacity:[],ScanIndexForward:[],Select:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>oa(e,t),Count:An,Items:e=>ma(e,t),LastEvaluatedKey:e=>ya(e,t),ScannedCount:An}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class pm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,pm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableFromBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("RestoreTableFromBackup");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await Uo(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await ui(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await pi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableDescription:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class mm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,mm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("RestoreTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>mr(e,{BillingModeOverride:[],GlobalSecondaryIndexOverride:Er,LocalSecondaryIndexOverride:Er,ProvisionedThroughputOverride:Er,RestoreDateTime:e=>Math.round(e.getTime()/1e3),SSESpecificationOverride:Er,SourceTableArn:[],SourceTableName:[],TargetTableName:[],UseLatestRestorableTime:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"InvalidRestoreTimeException":case"com.amazonaws.dynamodb#InvalidRestoreTimeException":throw await ti(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await oi(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await ui(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await pi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableDescription:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class hm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,hm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ScanCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("Scan");let r;return r=JSON.stringify(((e,t)=>mr(e,{AttributesToGet:Er,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ni(e,t),ExpressionAttributeNames:Er,ExpressionAttributeValues:e=>Ti(e,t),FilterExpression:[],IndexName:[],Limit:[],ProjectionExpression:[],ReturnConsumedCapacity:[],ScanFilter:e=>Pi(e,t),Segment:[],Select:[],TableName:[],TotalSegments:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>oa(e,t),Count:An,Items:e=>ma(e,t),LastEvaluatedKey:e=>ya(e,t),ScannedCount:An}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class ym extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,ym.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("TagResource");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ba(e.body,t),{$metadata:za(e)}))(e,t)}}class fm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,fm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactGetItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("TransactGetItems");let r;return r=JSON.stringify(Ui(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await hi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),Responses:e=>ha(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class gm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,gm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactWriteItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("TransactWriteItems");let r;return r=JSON.stringify(Mi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await hi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await fi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class wm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,wm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UntagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UntagResource");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ba(e.body,t),{$metadata:za(e)}))(e,t)}}class Em extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateContinuousBackups");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{ContinuousBackupsDescription:e=>aa(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class bm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,bm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateContributorInsights");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}class vm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,vm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateGlobalTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Ko(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ReplicaAlreadyExistsException":case"com.amazonaws.dynamodb#ReplicaAlreadyExistsException":throw await ai(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await si(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await mi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{GlobalTableDescription:e=>ca(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Sm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateGlobalTableSettings");let r;return r=JSON.stringify(ji(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Ko(n,t);case"IndexNotFoundException":case"com.amazonaws.dynamodb#IndexNotFoundException":throw await Xo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await si(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{GlobalTableName:Ln,ReplicaSettings:e=>Ca(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class _m extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,_m.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateItem");let r;return r=JSON.stringify(qi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await $o(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ni(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ii(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await ci(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await yi(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{Attributes:e=>Hi(e,t),ConsumedCapacity:e=>oa(e,t),ItemCollectionMetrics:e=>la(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Im extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateTable");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableDescription:e=>Ra(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class xm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,xm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateTableReplicaAutoScaling");let r;return r=JSON.stringify(Vi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>mr(e,{TableAutoScalingDescription:e=>ka(e,t)}))(await ja(e.body,t),t),{$metadata:za(e),...n}})(e,t)}}class Cm extends In{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(_(t,this.serialize,this.deserialize)),this.middlewareStack.use(A(t,Cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=$a("UpdateTimeToLive");let r;return r=JSON.stringify(Er(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await qa(e.body,t)},r=Va(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Yo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await ri(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await li(n,t);default:const o=n.body;return Ua({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await ja(e.body,t);let r={};return r=Er(n),{$metadata:za(e),...r}})(e,t)}}const Tm={BatchExecuteStatementCommand:Np,BatchGetItemCommand:Ap,BatchWriteItemCommand:kp,CreateBackupCommand:Dp,CreateGlobalTableCommand:Rp,CreateTableCommand:Op,DeleteBackupCommand:Lp,DeleteItemCommand:Fp,DeleteTableCommand:zp,DescribeBackupCommand:Bp,DescribeContinuousBackupsCommand:Up,DescribeContributorInsightsCommand:Mp,DescribeEndpointsCommand:Ga,DescribeExportCommand:$p,DescribeGlobalTableCommand:jp,DescribeGlobalTableSettingsCommand:qp,DescribeImportCommand:Vp,DescribeKinesisStreamingDestinationCommand:Gp,DescribeLimitsCommand:Hp,DescribeTableCommand:Kp,DescribeTableReplicaAutoScalingCommand:Wp,DescribeTimeToLiveCommand:Jp,DisableKinesisStreamingDestinationCommand:Qp,EnableKinesisStreamingDestinationCommand:Xp,ExecuteStatementCommand:Yp,ExecuteTransactionCommand:Zp,ExportTableToPointInTimeCommand:em,GetItemCommand:tm,ImportTableCommand:nm,ListBackupsCommand:rm,ListContributorInsightsCommand:om,ListExportsCommand:im,ListGlobalTablesCommand:am,ListImportsCommand:sm,ListTablesCommand:cm,ListTagsOfResourceCommand:dm,PutItemCommand:lm,QueryCommand:um,RestoreTableFromBackupCommand:pm,RestoreTableToPointInTimeCommand:mm,ScanCommand:hm,TagResourceCommand:ym,TransactGetItemsCommand:fm,TransactWriteItemsCommand:gm,UntagResourceCommand:wm,UpdateContinuousBackupsCommand:Em,UpdateContributorInsightsCommand:bm,UpdateGlobalTableCommand:vm,UpdateGlobalTableSettingsCommand:Sm,UpdateItemCommand:_m,UpdateTableCommand:Im,UpdateTableReplicaAutoScalingCommand:xm,UpdateTimeToLiveCommand:Cm};class Pm extends Pp{}((e,t)=>{for(const n of Object.keys(e)){const r=e[n],o=async function(e,t,n){const o=new r(e);if("function"==typeof t)this.send(o,t);else{if("function"!=typeof n)return this.send(o,t);if("object"!=typeof t)throw new Error("Expected http options but got "+typeof t);this.send(o,t||{},n)}},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,"");t.prototype[i]=o}})(Tm,Pm);const Nm=async(e,t,...n)=>await e.send(new om(t),...n);async function*Am(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Nm(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const km=async(e,t,...n)=>await e.send(new im(t),...n);async function*Dm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await km(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Rm=async(e,t,...n)=>await e.send(new sm(t),...n);async function*Om(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.PageSize=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Rm(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Lm=async(e,t,...n)=>await e.send(new cm(t),...n);async function*Fm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartTableName=o,t.Limit=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Lm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedTableName,i=!(!o||e.stopOnSameToken&&o===a)}}const zm=async(e,t,...n)=>await e.send(new um(t),...n);async function*Bm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await zm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const Um=async(e,t,...n)=>await e.send(new hm(t),...n);async function*Mm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Pp))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Um(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const $m=e=>new Promise((t=>setTimeout(t,1e3*e))),jm={minDelay:2,maxDelay:120};var qm;!function(e){e.ABORTED="ABORTED",e.FAILURE="FAILURE",e.SUCCESS="SUCCESS",e.RETRY="RETRY",e.TIMEOUT="TIMEOUT"}(qm||(qm={}));const Vm=e=>{if(e.state===qm.ABORTED){const t=new Error(`${JSON.stringify({...e,reason:"Request was aborted"})}`);throw t.name="AbortError",t}if(e.state===qm.TIMEOUT){const t=new Error(`${JSON.stringify({...e,reason:"Waiter has timed out"})}`);throw t.name="TimeoutError",t}if(e.state!==qm.SUCCESS)throw new Error(`${JSON.stringify({result:e})}`);return e},Gm=(e,t,n,r)=>r>n?t:Hm(e,e*2**(r-1)),Hm=(e,t)=>e+Math.random()*(t-e),Km=async({minDelay:e,maxDelay:t,maxWaitTime:n,abortController:r,client:o,abortSignal:i},a,s)=>{const{state:c,reason:d}=await s(o,a);if(c!==qm.RETRY)return{state:c,reason:d};let l=1;const u=Date.now()+1e3*n,p=Math.log(t/e)/Math.log(2)+1;for(;;){if(r?.signal?.aborted||i?.aborted)return{state:qm.ABORTED};const n=Gm(e,t,p,l);if(Date.now()+1e3*n>u)return{state:qm.TIMEOUT};await $m(n);const{state:c,reason:d}=await s(o,a);if(c!==qm.RETRY)return{state:c,reason:d};l+=1}},Wm=async e=>new Promise((t=>{e.onabort=()=>t({state:qm.ABORTED})})),Jm=async(e,t,n)=>{const r={...jm,...e};(e=>{if(e.maxWaitTime<1)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(e.minDelay<1)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(e.maxDelay<1)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(e.maxWaitTime<=e.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);if(e.maxDelay<e.minDelay)throw new Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)})(r);const o=[Km(r,t,n)];return e.abortController&&o.push(Wm(e.abortController.signal)),e.abortSignal&&o.push(Wm(e.abortSignal)),Promise.race(o)},Qm=async(e,t)=>{let n;try{const r=await e.send(new Kp(t));n=r;try{if("ACTIVE"===r.Table.TableStatus)return{state:qm.SUCCESS,reason:n}}catch(e){}}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:qm.RETRY,reason:n}}return{state:qm.RETRY,reason:n}},Xm=async(e,t)=>Jm({minDelay:20,maxDelay:120,...e},t,Qm),Ym=async(e,t)=>{const n=await Jm({minDelay:20,maxDelay:120,...e},t,Qm);return Vm(n)},Zm=async(e,t)=>{let n;try{n=await e.send(new Kp(t))}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:qm.SUCCESS,reason:n}}return{state:qm.RETRY,reason:n}},eh=async(e,t)=>Jm({minDelay:20,maxDelay:120,...e},t,Zm),th=async(e,t)=>{const n=await Jm({minDelay:20,maxDelay:120,...e},t,Zm);return Vm(n)}},5074:(e,t,n)=>{"use strict";n.r(t),n.d(t,{convertToAttr:()=>r,convertToNative:()=>y,marshall:()=>v,unmarshall:()=>S});const r=(e,t)=>{if(void 0===e)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(null===e&&"object"==typeof e)return c();if(Array.isArray(e))return o(e,t);if("Set"===e?.constructor?.name)return i(e,t);if("Map"===e?.constructor?.name)return a(e,t);if("Object"===e?.constructor?.name||!e.constructor&&"object"==typeof e)return s(e,t);if(h(e))return 0===e.length&&t?.convertEmptyValues?c():d(e);if("boolean"==typeof e||"Boolean"===e?.constructor?.name)return{BOOL:e.valueOf()};if("number"==typeof e||"Number"===e?.constructor?.name)return m(e);if("bigint"==typeof e)return u(e);if("string"==typeof e||"String"===e?.constructor?.name)return 0===e.length&&t?.convertEmptyValues?c():l(e);if(t?.convertClassInstanceToMap&&"object"==typeof e)return s(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},o=(e,t)=>({L:e.filter((e=>!t?.removeUndefinedValues||t?.removeUndefinedValues&&void 0!==e)).map((e=>r(e,t)))}),i=(e,t)=>{const n=t?.removeUndefinedValues?new Set([...e].filter((e=>void 0!==e))):e;if(!t?.removeUndefinedValues&&n.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(0===n.size){if(t?.convertEmptyValues)return c();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}const r=n.values().next().value;if("number"==typeof r)return{NS:Array.from(n).map(m).map((e=>e.N))};if("bigint"==typeof r)return{NS:Array.from(n).map(u).map((e=>e.N))};if("string"==typeof r)return{SS:Array.from(n).map(l).map((e=>e.S))};if(h(r))return{BS:Array.from(n).map(d).map((e=>e.B))};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},a=(e,t)=>({M:(e=>{const n={};for(const[o,i]of e)"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t));return n})(e)}),s=(e,t)=>({M:(e=>{const n={};for(const o in e){const i=e[o];"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t))}return n})(e)}),c=()=>({NULL:!0}),d=e=>({B:e}),l=e=>({S:e.toString()}),u=e=>({N:e.toString()}),p=e=>{throw new Error(`${e} ${"function"==typeof BigInt?"Use BigInt.":"Pass string value instead."} `)},m=e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map((e=>e.toString())).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?p(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&p(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},h=e=>!!e?.constructor&&["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(e.constructor.name),y=(e,t)=>{for(const[n,r]of Object.entries(e))if(void 0!==r)switch(n){case"NULL":return null;case"BOOL":return Boolean(r);case"N":return f(r,t);case"B":return w(r);case"S":return g(r);case"L":return E(r,t);case"M":return b(r,t);case"NS":return new Set(r.map((e=>f(e,t))));case"BS":return new Set(r.map(w));case"SS":return new Set(r.map(g));default:throw new Error(`Unsupported type passed: ${n}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},f=(e,t)=>{if(t?.wrapNumbers)return{value:e};const n=Number(e),r=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&!r.includes(n)){if("function"!=typeof BigInt)throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);try{return BigInt(e)}catch(t){throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}}return n},g=e=>e,w=e=>e,E=(e,t)=>e.map((e=>y(e,t))),b=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(e[n]=y(r,t),e)),{});function v(e,t){const n=r(e,t),[o,i]=Object.entries(n)[0];switch(o){case"M":case"L":return i;default:return n}}const S=(e,t)=>y({M:e},t)},4378:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.extractRegionFromEndpoint=t.buildMqtt5FinalUsername=t.populate_username_string_with_custom_authorizer=t.is_string_and_not_empty=t.add_to_username_parameter=void 0;const a=i(n(6843));function s(e,t,n){let r=e;return-1!=r.indexOf("?")?r+="&":r+="?",-1!=t.indexOf(n)?r+t:r+n+t}function c(e){return null!=e&&"string"==typeof e&&""!=e}function d(e,t,n){t&&n.push([e,t])}t.add_to_username_parameter=s,t.is_string_and_not_empty=c,t.populate_username_string_with_custom_authorizer=function(e,t,n,r,o,i,a){let d="";if(e&&(d+=e),0==c(t)?c(o)&&o&&(d+=o):d+=t,c(n)&&n&&(d=s(d,n,"x-amz-customauthorizer-name=")),c(r)&&r&&(d=s(d,r,"x-amz-customauthorizer-signature="),(c(i)&&i||c(a)&&a)&&console.log("Warning: Signed custom authorizers with signature will not work without a token key name and token value. Your connection may be rejected/stalled on the IoT Core side due to this. Please set the token key name and token value to connect to a signed custom authorizer.")),c(r)||c(a)||c(i)){if(!a||!i)throw new Error("Token-based custom authentication requires all token-related properties to be set");d=s(d,a,i+"=")}return d},t.buildMqtt5FinalUsername=function(e){let t="",n=[];if(e){let r=!1;if((e.tokenValue||e.tokenKeyName||e.tokenSignature)&&(r=!0,!e.tokenValue||!e.tokenKeyName||!e.tokenSignature))throw new Error("Token-based custom authentication requires all token-related properties to be set");let o=e.username,i=(null!=o?o:"").split("?"),a=i.slice(1);if(t=i[0],a.length>1)throw new Error("Custom auth username property value is invalid");1==a.length&&a[0].split("&").forEach(((e,t,r)=>{var o;let i=e.split("=");n.push([i[0],null!==(o=i[1])&&void 0!==o?o:""])})),d("x-amz-customauthorizer-name",e.authorizerName,n),r&&(d(e.tokenKeyName,e.tokenValue,n),d("x-amz-customauthorizer-signature",e.tokenSignature,n))}return n.push(["SDK","NodeJSv2"]),n.push(["Version",a.crt_version()]),(null!=t?t:"")+"?"+n.map((e=>`${e[0]}=${e[1]}`)).join("&")},t.extractRegionFromEndpoint=function(e){const t=e.match(/^[\w\-]+\.[\w\-]+\.([\w+\-]+)\./);if(t)return t[1];throw new Error("AWS region could not be extracted from endpoint. Use 'region' property on WebsocketConfig to set manually.")}},7482:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.newCancellablePromiseFromNextEvent=t.CancelController=t.EVENT_NAME=void 0;const a=n(2361),s=i(n(7113));t.EVENT_NAME="cancelled",t.CancelController=class{constructor(e){this.cancelled=!1,e&&e.emitterFactory?this.emitter=e.emitterFactory():this.emitter=new a.EventEmitter}cancel(){this.cancelled||(this.cancelled=!0,this.emitter.emit(t.EVENT_NAME),this.emitter.removeAllListeners(t.EVENT_NAME))}hasBeenCancelled(){return this.cancelled}addListener(e){if(!this.cancelled)return this.emitter.on(t.EVENT_NAME,e),()=>{this.emitter.removeListener(t.EVENT_NAME,e)};e()}},t.newCancellablePromiseFromNextEvent=function(e){let t,n,r=s.newLiftedPromise();return t=t=>{try{e.eventDataTransformer?r.resolve(e.eventDataTransformer(t)):r.resolve(t)}catch(e){r.reject(e)}},e.emitter.addListener(e.eventName,t),e.cancelController&&(n=e.cancelController.addListener((()=>{r.reject(e.cancelMessage)}))),s.makeSelfCleaningPromise(r.promise,(()=>{t&&e.emitter.removeListener(e.eventName,t),n&&n()}))}},9651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedEventEmitter=void 0;const r=n(2361);class o{constructor(e,t){this.event=e,this.args=t}}class i extends r.EventEmitter{constructor(){super(),this.corked=!1}cork(){this.corked=!0}uncork(){for(this.corked=!1;this.eventQueue;){const e=this.eventQueue;super.emit(e.event,...e.args),this.eventQueue=this.eventQueue.next}}emit(e,...t){if(this.corked){let n=this.lastQueuedEvent;return this.lastQueuedEvent=new o(e,t),n?n.next=this.lastQueuedEvent:this.eventQueue=this.lastQueuedEvent,this.listeners(e).length>0}return super.emit(e,...t)}}t.BufferedEventEmitter=i},3804:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.CommonHttpProxyOptions=t.HttpProxyAuthenticationType=t.HttpVersion=void 0,(r=t.HttpVersion||(t.HttpVersion={}))[r.Unknown=0]="Unknown",r[r.Http1_0=1]="Http1_0",r[r.Http1_1=2]="Http1_1",r[r.Http2=3]="Http2",function(e){e[e.None=0]="None",e[e.Basic=1]="Basic"}(n=t.HttpProxyAuthenticationType||(t.HttpProxyAuthenticationType={})),t.CommonHttpProxyOptions=class{constructor(e,t,r=n.None,o,i){this.host_name=e,this.port=t,this.auth_method=r,this.auth_username=o,this.auth_password=i}}},9712:(e,t)=>{"use strict";var n,r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.SocketDomain=t.SocketType=t.TlsVersion=void 0,(o=t.TlsVersion||(t.TlsVersion={}))[o.SSLv3=0]="SSLv3",o[o.TLSv1=1]="TLSv1",o[o.TLSv1_1=2]="TLSv1_1",o[o.TLSv1_2=3]="TLSv1_2",o[o.TLSv1_3=4]="TLSv1_3",o[o.Default=128]="Default",(r=t.SocketType||(t.SocketType={}))[r.STREAM=0]="STREAM",r[r.DGRAM=1]="DGRAM",(n=t.SocketDomain||(t.SocketDomain={}))[n.IPV4=0]="IPV4",n[n.IPV6=1]="IPV6",n[n.LOCAL=2]="LOCAL"},5641:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RECONNECT_MIN_SEC=t.DEFAULT_RECONNECT_MAX_SEC=t.MqttWill=t.QoS=void 0,(n=t.QoS||(t.QoS={}))[n.AtMostOnce=0]="AtMostOnce",n[n.AtLeastOnce=1]="AtLeastOnce",n[n.ExactlyOnce=2]="ExactlyOnce",t.MqttWill=class{constructor(e,t,n,r=!1){this.topic=e,this.qos=t,this.payload=n,this.retain=r}},t.DEFAULT_RECONNECT_MAX_SEC=128,t.DEFAULT_RECONNECT_MIN_SEC=1},5018:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.RetryJitterType=t.ClientSessionBehavior=void 0,(r=t.ClientSessionBehavior||(t.ClientSessionBehavior={}))[r.Default=0]="Default",r[r.Clean=1]="Clean",r[r.RejoinPostSuccess=2]="RejoinPostSuccess",r[r.RejoinAlways=3]="RejoinAlways",(n=t.RetryJitterType||(t.RetryJitterType={}))[n.Default=0]="Default",n[n.None=1]="None",n[n.Full=2]="Full",n[n.Decorrelated=3]="Decorrelated"},202:(e,t)=>{"use strict";var n,r,o,i,a,s,c,d,l;Object.defineProperty(t,"__esModule",{value:!0}),t.PacketType=t.RetainHandlingType=t.QoS=t.PayloadFormatIndicator=t.isSuccessfulPubackReasonCode=t.PubackReasonCode=t.isSuccessfulUnsubackReasonCode=t.UnsubackReasonCode=t.isSuccessfulSubackReasonCode=t.SubackReasonCode=t.isSuccessfulDisconnectReasonCode=t.DisconnectReasonCode=t.isSuccessfulConnectReasonCode=t.ConnectReasonCode=void 0,(l=t.ConnectReasonCode||(t.ConnectReasonCode={}))[l.Success=0]="Success",l[l.UnspecifiedError=128]="UnspecifiedError",l[l.MalformedPacket=129]="MalformedPacket",l[l.ProtocolError=130]="ProtocolError",l[l.ImplementationSpecificError=131]="ImplementationSpecificError",l[l.UnsupportedProtocolVersion=132]="UnsupportedProtocolVersion",l[l.ClientIdentifierNotValid=133]="ClientIdentifierNotValid",l[l.BadUsernameOrPassword=134]="BadUsernameOrPassword",l[l.NotAuthorized=135]="NotAuthorized",l[l.ServerUnavailable=136]="ServerUnavailable",l[l.ServerBusy=137]="ServerBusy",l[l.Banned=138]="Banned",l[l.BadAuthenticationMethod=140]="BadAuthenticationMethod",l[l.TopicNameInvalid=144]="TopicNameInvalid",l[l.PacketTooLarge=149]="PacketTooLarge",l[l.QuotaExceeded=151]="QuotaExceeded",l[l.PayloadFormatInvalid=153]="PayloadFormatInvalid",l[l.RetainNotSupported=154]="RetainNotSupported",l[l.QosNotSupported=155]="QosNotSupported",l[l.UseAnotherServer=156]="UseAnotherServer",l[l.ServerMoved=157]="ServerMoved",l[l.ConnectionRateExceeded=159]="ConnectionRateExceeded",t.isSuccessfulConnectReasonCode=function(e){return e<128},(d=t.DisconnectReasonCode||(t.DisconnectReasonCode={}))[d.NormalDisconnection=0]="NormalDisconnection",d[d.DisconnectWithWillMessage=4]="DisconnectWithWillMessage",d[d.UnspecifiedError=128]="UnspecifiedError",d[d.MalformedPacket=129]="MalformedPacket",d[d.ProtocolError=130]="ProtocolError",d[d.ImplementationSpecificError=131]="ImplementationSpecificError",d[d.NotAuthorized=135]="NotAuthorized",d[d.ServerBusy=137]="ServerBusy",d[d.ServerShuttingDown=139]="ServerShuttingDown",d[d.KeepAliveTimeout=141]="KeepAliveTimeout",d[d.SessionTakenOver=142]="SessionTakenOver",d[d.TopicFilterInvalid=143]="TopicFilterInvalid",d[d.TopicNameInvalid=144]="TopicNameInvalid",d[d.ReceiveMaximumExceeded=147]="ReceiveMaximumExceeded",d[d.TopicAliasInvalid=148]="TopicAliasInvalid",d[d.PacketTooLarge=149]="PacketTooLarge",d[d.MessageRateTooHigh=150]="MessageRateTooHigh",d[d.QuotaExceeded=151]="QuotaExceeded",d[d.AdministrativeAction=152]="AdministrativeAction",d[d.PayloadFormatInvalid=153]="PayloadFormatInvalid",d[d.RetainNotSupported=154]="RetainNotSupported",d[d.QosNotSupported=155]="QosNotSupported",d[d.UseAnotherServer=156]="UseAnotherServer",d[d.ServerMoved=157]="ServerMoved",d[d.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",d[d.ConnectionRateExceeded=159]="ConnectionRateExceeded",d[d.MaximumConnectTime=160]="MaximumConnectTime",d[d.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",d[d.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulDisconnectReasonCode=function(e){return e<128},(c=t.SubackReasonCode||(t.SubackReasonCode={}))[c.GrantedQoS0=0]="GrantedQoS0",c[c.GrantedQoS1=1]="GrantedQoS1",c[c.GrantedQoS2=2]="GrantedQoS2",c[c.UnspecifiedError=128]="UnspecifiedError",c[c.ImplementationSpecificError=131]="ImplementationSpecificError",c[c.NotAuthorized=135]="NotAuthorized",c[c.TopicFilterInvalid=143]="TopicFilterInvalid",c[c.PacketIdentifierInUse=145]="PacketIdentifierInUse",c[c.QuotaExceeded=151]="QuotaExceeded",c[c.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",c[c.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",c[c.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulSubackReasonCode=function(e){return e<128},(s=t.UnsubackReasonCode||(t.UnsubackReasonCode={}))[s.Success=0]="Success",s[s.NoSubscriptionExisted=17]="NoSubscriptionExisted",s[s.UnspecifiedError=128]="UnspecifiedError",s[s.ImplementationSpecificError=131]="ImplementationSpecificError",s[s.NotAuthorized=135]="NotAuthorized",s[s.TopicFilterInvalid=143]="TopicFilterInvalid",s[s.PacketIdentifierInUse=145]="PacketIdentifierInUse",t.isSuccessfulUnsubackReasonCode=function(e){return e<128},(a=t.PubackReasonCode||(t.PubackReasonCode={}))[a.Success=0]="Success",a[a.NoMatchingSubscribers=16]="NoMatchingSubscribers",a[a.UnspecifiedError=128]="UnspecifiedError",a[a.ImplementationSpecificError=131]="ImplementationSpecificError",a[a.NotAuthorized=135]="NotAuthorized",a[a.TopicNameInvalid=144]="TopicNameInvalid",a[a.PacketIdentifierInUse=145]="PacketIdentifierInUse",a[a.QuotaExceeded=151]="QuotaExceeded",a[a.PayloadFormatInvalid=153]="PayloadFormatInvalid",t.isSuccessfulPubackReasonCode=function(e){return e<128},(i=t.PayloadFormatIndicator||(t.PayloadFormatIndicator={}))[i.Bytes=0]="Bytes",i[i.Utf8=1]="Utf8",(o=t.QoS||(t.QoS={}))[o.AtMostOnce=0]="AtMostOnce",o[o.AtLeastOnce=1]="AtLeastOnce",o[o.ExactlyOnce=2]="ExactlyOnce",(r=t.RetainHandlingType||(t.RetainHandlingType={}))[r.SendOnSubscribe=0]="SendOnSubscribe",r[r.SendOnSubscribeIfNew=1]="SendOnSubscribeIfNew",r[r.DontSend=2]="DontSend",(n=t.PacketType||(t.PacketType={}))[n.Connect=1]="Connect",n[n.Connack=2]="Connack",n[n.Publish=3]="Publish",n[n.Puback=4]="Puback",n[n.Pubrec=5]="Pubrec",n[n.Pubrel=6]="Pubrel",n[n.Pubcomp=7]="Pubcomp",n[n.Subscribe=8]="Subscribe",n[n.Suback=9]="Suback",n[n.Unsubscribe=10]="Unsubscribe",n[n.Unsuback=11]="Unsuback",n[n.Pingreq=12]="Pingreq",n[n.Pingresp=13]="Pingresp",n[n.Disconnect=14]="Disconnect",n[n.Auth=15]="Auth"},4231:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_KEEP_ALIVE=t.normalize_payload=void 0,t.normalize_payload=function(e){if(e instanceof Buffer)return e;if("string"==typeof e)return e;if(ArrayBuffer.isView(e)){const t=e;return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}if(e instanceof ArrayBuffer)return Buffer.from(e);if("object"==typeof e)return JSON.stringify(e);if(!e)return"";throw new TypeError("payload parameter must be a string, object, or DataView.")},t.DEFAULT_KEEP_ALIVE=1200},6843:(e,t,n)=>{"use strict";function r(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function o(){try{return n(5062)}catch(e){return{name:"aws-crt-nodejs",version:"UNKNOWN"}}}Object.defineProperty(t,"__esModule",{value:!0}),t.crt_version=t.package_info=t.is_browser=t.is_nodejs=void 0,t.is_nodejs=r,t.is_browser=function(){return!r()},t.package_info=o,t.crt_version=function(){return o().version}},7113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newLiftedPromise=t.makeSelfCleaningPromise=void 0,t.makeSelfCleaningPromise=function(e,t){return t?e.finally((()=>{t()})):e},t.newLiftedPromise=function(e){let t,n,r=new Promise(((e,r)=>{t=e,n=r}));if(!t||!n)throw new Error("Failed to bind resolve and reject when making lifted promise");return e&&e(t,n),{promise:r,resolve:t,reject:n}}},4103:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0,t.using=function(e,t){return n(this,void 0,void 0,(function*(){try{yield t(e)}finally{e.close()}}))}},8687:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=t.resource_safety=t.promise=t.platform=t.mqtt5=t.mqtt=t.iot=t.io=t.http=t.eventstream=t.crt=t.crypto=t.checksums=t.cancel=t.auth=void 0;const a=i(n(7482));t.cancel=a;const s=i(n(6843));t.platform=s;const c=i(n(7113));t.promise=c;const d=i(n(4103));t.resource_safety=d;const l=i(n(7822));t.auth=l;const u=i(n(5988));t.checksums=u;const p=i(n(7227));t.crt=p;const m=i(n(5145));t.crypto=m;const h=i(n(7259));t.eventstream=h;const y=i(n(8415));t.http=y;const f=i(n(3787));t.io=f;const g=i(n(9793));t.iot=g;const w=i(n(799));t.mqtt=w;const E=i(n(2385));t.mqtt5=E;const b=n(2875);Object.defineProperty(t,"CrtError",{enumerable:!0,get:function(){return b.CrtError}})},7822:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.aws_verify_sigv4a_signing=t.aws_sign_request=t.AwsSignedBodyHeaderType=t.AwsSignedBodyValue=t.AwsSignatureType=t.AwsSigningAlgorithm=t.AwsCredentialsProvider=void 0;const i=o(n(1221)),a=n(2875),s=n(3787);class c extends i.default.AwsCredentialsProvider{static newDefault(e=void 0){return super.newDefault(null!=e?e.native_handle():null)}static newStatic(e,t,n){return super.newStatic(e,t,n)}static newCognito(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newCognito: Cognito config not defined");return super.newCognito(e,null!=e.tlsContext?e.tlsContext.native_handle():(new s.ClientTlsContext).native_handle(),null!=e.bootstrap?e.bootstrap.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}static newX509(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newX509: X509 config not defined");return super.newX509(e,e.tlsContext.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}}var d,l,u,p;t.AwsCredentialsProvider=c,(p=t.AwsSigningAlgorithm||(t.AwsSigningAlgorithm={}))[p.SigV4=0]="SigV4",p[p.SigV4Asymmetric=1]="SigV4Asymmetric",(u=t.AwsSignatureType||(t.AwsSignatureType={}))[u.HttpRequestViaHeaders=0]="HttpRequestViaHeaders",u[u.HttpRequestViaQueryParams=1]="HttpRequestViaQueryParams",u[u.HttpRequestChunk=2]="HttpRequestChunk",u[u.HttpRequestEvent=3]="HttpRequestEvent",(l=t.AwsSignedBodyValue||(t.AwsSignedBodyValue={})).EmptySha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",l.UnsignedPayload="UNSIGNED-PAYLOAD",l.StreamingAws4HmacSha256Payload="STREAMING-AWS4-HMAC-SHA256-PAYLOAD",l.StreamingAws4HmacSha256Events="STREAMING-AWS4-HMAC-SHA256-EVENTS",(d=t.AwsSignedBodyHeaderType||(t.AwsSignedBodyHeaderType={}))[d.None=0]="None",d[d.XAmzContentSha256=1]="XAmzContentSha256",t.aws_sign_request=function(e,t){return r(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{try{i.default.aws_sign_request(e,t,(t=>{0==t?n(e):r(new a.CrtError(t))}))}catch(e){r(e)}}))}))},t.aws_verify_sigv4a_signing=function(e,t,n,r,o,a){return i.default.aws_verify_sigv4a_signing(e,t,n,r,o,a)}},8583:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqttConnectionConfigBuilder=void 0;const s=n(5641),c=i(n(3787)),d=n(3787),l=i(n(6843)),u=n(2875),p=n(7822),m=i(n(4378));class h{constructor(e){this.tls_ctx_options=e,this.params={client_id:"",host_name:"",socket_options:new c.SocketOptions,port:8883,use_websocket:!1,clean_session:!1,keep_alive:void 0,will:void 0,username:"",password:void 0,tls_ctx:void 0,reconnect_min_sec:s.DEFAULT_RECONNECT_MIN_SEC,reconnect_max_sec:s.DEFAULT_RECONNECT_MAX_SEC},this.is_using_custom_authorizer=!1}static new_mtls_builder_from_path(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls_from_path(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_builder(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_pkcs11_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs11(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_pkcs12_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(e.pkcs12_file,e.pkcs12_password));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_windows_cert_store_path_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_default_builder(){let e=new c.TlsContextOptions;return new h(e)}static new_websocket_builder(...e){return this.new_with_websockets(...e)}static configure_websocket_handshake(e,t){if(t){if(null==e||null==e)throw new u.CrtError("AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined");e.params.websocket_handshake_transform=(e,n)=>a(this,void 0,void 0,(function*(){var r,o,i;const a=null!==(o=null===(r=t.create_signing_config)||void 0===r?void 0:r.call(t))&&void 0!==o?o:{algorithm:p.AwsSigningAlgorithm.SigV4,signature_type:p.AwsSignatureType.HttpRequestViaQueryParams,provider:t.credentials_provider,region:t.region,service:null!==(i=t.service)&&void 0!==i?i:"iotdevicegateway",signed_body_value:p.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};try{yield(0,p.aws_sign_request)(e,a),n()}catch(e){e instanceof u.CrtError?n(e.error_code):n(3)}}))}return e}static new_with_websockets(e){let t=null==e?void 0:e.tls_ctx_options;t||(t=new d.TlsContextOptions,t.alpn_list=[]);let n=new h(t);return n.params.use_websocket=!0,n.params.proxy_options=null==e?void 0:e.proxy_options,n.tls_ctx_options&&(n.params.port=443),this.configure_websocket_handshake(n,e),n}static new_builder_for_websocket(){return this.new_with_websockets()}with_certificate_authority_from_path(e,t){return this.tls_ctx_options.override_default_trust_store_from_path(e,t),this}with_certificate_authority(e){return this.tls_ctx_options.override_default_trust_store(e),this}with_endpoint(e){return this.params.host_name=e,this}with_port(e){return this.params.port=e,this}with_client_id(e){return this.params.client_id=e,this}with_clean_session(e){return this.params.clean_session=e,this}with_keep_alive_seconds(e){return this.params.keep_alive=e,this}with_timeout_ms(e){return this.with_ping_timeout_ms(e),this}with_ping_timeout_ms(e){return this.params.ping_timeout=e,this}with_protocol_operation_timeout_ms(e){return this.params.protocol_operation_timeout=e,this}with_will(e){return this.params.will=e,this}with_socket_options(e){return this.params.socket_options=e,this}with_credentials(e,t,n,r){return h.configure_websocket_handshake(this,{credentials_provider:p.AwsCredentialsProvider.newStatic(t,n,r),region:e,service:"iotdevicegateway"})}with_http_proxy_options(e){return this.params.proxy_options=e,this}with_custom_authorizer(e,t,n,r,o,i){this.is_using_custom_authorizer=!0;let a=m.populate_username_string_with_custom_authorizer("",e,t,n,this.params.username,o,i);return this.params.username=a,this.params.password=r,this.params.use_websocket||(this.tls_ctx_options.alpn_list=["mqtt"]),this.params.port=443,this}with_username(e){return this.params.username=e,this}with_password(e){return this.params.password=e,this}with_reconnect_max_sec(e){return this.params.reconnect_max_sec=e,this}with_reconnect_min_sec(e){return this.params.reconnect_min_sec=e,this}build(){var e,t,n;if(void 0===this.params.client_id||void 0===this.params.host_name)throw"client_id and endpoint are required";return 0==this.is_using_custom_authorizer&&m.is_string_and_not_empty(this.params.username)&&(-1==(null===(e=this.params.username)||void 0===e?void 0:e.indexOf("x-amz-customauthorizer-name="))&&-1==(null===(t=this.params.username)||void 0===t?void 0:t.indexOf("x-amz-customauthorizer-signature="))||(this.is_using_custom_authorizer=!0)),1==this.is_using_custom_authorizer&&443!=this.params.port&&console.log("Warning: Attempting to connect to authorizer with unsupported port. Port is not 443..."),void 0===this.params.tls_ctx&&(this.params.tls_ctx=new c.ClientTlsContext(this.tls_ctx_options)),0==m.is_string_and_not_empty(this.params.username)?this.params.username="?SDK=NodeJSv2&Version=":-1!=(null===(n=this.params.username)||void 0===n?void 0:n.indexOf("?"))?this.params.username+="&SDK=NodeJSv2&Version=":this.params.username+="?SDK=NodeJSv2&Version=",this.params.username+=l.crt_version(),this.params}}t.AwsIotMqttConnectionConfigBuilder=h},1838:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqtt5ClientConfigBuilder=void 0;const s=i(n(2385)),c=i(n(3787)),d=i(n(7822)),l=n(2875),u=i(n(4378)),p=i(n(4231));class m{constructor(e,t,n){this.tlsContextOptions=n,this.config={hostName:e,port:t,connectProperties:{keepAliveIntervalSeconds:p.DEFAULT_KEEP_ALIVE},extendedValidationAndFlowControlOptions:s.ClientExtendedValidationAndFlowControl.AwsIotCoreDefaults}}static newDirectMqttBuilderWithMtlsFromPath(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_from_path(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromMemory(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromPkcs11(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs11(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromPkcs12(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(t.pkcs12_file,t.pkcs12_password));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.tlsContextOptions.alpn_list=["mqtt"],n}static newWebsocketMqttBuilderWithSigv4Auth(e,t){let n=new c.TlsContextOptions;n.alpn_list=[];let r=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,n),o=null==t?void 0:t.credentialsProvider;return o||(o=d.AwsCredentialsProvider.newDefault()),r.config.websocketHandshakeTransform=(n,r)=>a(this,void 0,void 0,(function*(){var i;try{const a={algorithm:d.AwsSigningAlgorithm.SigV4,signature_type:d.AwsSignatureType.HttpRequestViaQueryParams,provider:o,region:null!==(i=null==t?void 0:t.region)&&void 0!==i?i:u.extractRegionFromEndpoint(e),service:"iotdevicegateway",signed_body_value:d.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};yield d.aws_sign_request(n,a),r()}catch(e){e instanceof l.CrtError?r(e.error_code):r(3)}})),r}static newWebsocketMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.config.websocketHandshakeTransform=(e,t)=>a(this,void 0,void 0,(function*(){t(0)})),n}withCertificateAuthorityFromPath(e,t){return this.tlsContextOptions.override_default_trust_store_from_path(e,t),this}withCertificateAuthority(e){return this.tlsContextOptions.override_default_trust_store(e),this}withPort(e){return this.config.port=e,this}withConnectProperties(e){return this.config.connectProperties=e,this}withSessionBehavior(e){return this.config.sessionBehavior=e,this}withRetryJitterMode(e){return this.config.retryJitterMode=e,this}withMinReconnectDelayMs(e){return this.config.minReconnectDelayMs=e,this}withMaxReconnectDelayMs(e){return this.config.maxReconnectDelayMs=e,this}withMinConnectedTimeToResetReconnectDelayMs(e){return this.config.minConnectedTimeToResetReconnectDelayMs=e,this}withConnackTimeoutMs(e){return this.config.connackTimeoutMs=e,this}withOfflineQueueBehavior(e){return this.config.offlineQueueBehavior=e,this}withPingTimeoutMs(e){return this.config.pingTimeoutMs=e,this}withAckTimeoutSeconds(e){return this.config.ackTimeoutSeconds=e,this}withSocketOptions(e){return this.config.socketOptions=e,this}withHttpProxyOptions(e){return this.config.httpProxyOptions=e,this}withExtendedValidationAndFlowControlOptions(e){return this.config.extendedValidationAndFlowControlOptions=e,this}build(){var e,t;return void 0===this.config.tlsCtx&&(this.config.tlsCtx=new c.ClientTlsContext(this.tlsContextOptions)),this.config.connectProperties&&(this.config.connectProperties.username=u.buildMqtt5FinalUsername(this.customAuthConfig),(null===(e=this.customAuthConfig)||void 0===e?void 0:e.password)&&(this.config.connectProperties.password=null===(t=this.customAuthConfig)||void 0===t?void 0:t.password)),this.config}}t.AwsIotMqtt5ClientConfigBuilder=m,m.DEFAULT_WEBSOCKET_MQTT_PORT=443,m.DEFAULT_DIRECT_MQTT_PORT=8883},1221:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(1017)),s=n(2037),c=n(7147),d=n(7282),l="Please upgrade to node >=10.16.0, or use the provided browser implementation.";if(!("napi"in d.versions))throw new Error("The current runtime is not reporting an NAPI version. "+l);if(parseInt(d.versions.napi)<4)throw new Error("The AWS CRT native implementation requires that NAPI version 4 be present. "+l);const u=`${s.platform}-${s.arch}`;let p=a.resolve(__dirname,"..","..");const m=a.join(p,"dist");(0,c.existsSync)(m)&&(p=m);const h=a.resolve(p,"bin"),y=[a.join(h,u,"aws-crt-nodejs")];let f;for(const e of y)if((0,c.existsSync)(e+".node")){f=n(1309)(e);break}if(null==f)throw new Error("AWS CRT binary not present in any of the following locations:\n\t"+y.join("\n\t"));t.default=f},5988:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=t.crc32=void 0;const o=r(n(1221));t.crc32=function(e,t){return o.default.checksums_crc32(e,t)},t.crc32c=function(e,t){return o.default.checksums_crc32c(e,t)}},7227:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.native_memory_dump=t.native_memory=void 0;const o=r(n(1221));t.native_memory=function(){return o.default.native_memory()},t.native_memory_dump=function(){return o.default.native_memory_dump()}},5145:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha256=t.Sha256Hmac=t.hash_sha1=t.Sha1Hash=t.hash_sha256=t.Sha256Hash=t.hash_md5=t.Md5Hash=void 0;const o=r(n(1221)),i=n(8763);class a extends i.NativeResource{update(e){o.default.hash_update(this.native_handle(),e)}finalize(e){return o.default.hash_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Md5Hash=class extends a{constructor(){super(o.default.hash_md5_new())}},t.hash_md5=function(e,t){return o.default.hash_md5_compute(e,t)},t.Sha256Hash=class extends a{constructor(){super(o.default.hash_sha256_new())}},t.hash_sha256=function(e,t){return o.default.hash_sha256_compute(e,t)},t.Sha1Hash=class extends a{constructor(){super(o.default.hash_sha1_new())}},t.hash_sha1=function(e,t){return o.default.hash_sha1_compute(e,t)};class s extends i.NativeResource{update(e){o.default.hmac_update(this.native_handle(),e)}finalize(e){return o.default.hmac_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Sha256Hmac=class extends s{constructor(e){super(o.default.hmac_sha256_new(e))}},t.hmac_sha256=function(e,t,n){return o.default.hmac_sha256_compute(e,t,n)}},2875:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=void 0;const o=r(n(1221));class i extends Error{constructor(e){super(function(e){return"number"==typeof e?o.default.error_code_to_string(e):e instanceof i?e.message:e.toString()}(e)),this.error=e,this.error_code=function(e){return"number"==typeof e?e:e instanceof i?e.error_code:void 0}(e),this.error_name=function(e){return"number"==typeof e?o.default.error_code_to_name(e):e instanceof i?e.error_name:void 0}(e)}}t.CrtError=i},7259:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientStream=t.ClientConnection=t.MessageType=t.MessageFlags=t.Header=t.HeaderType=void 0;const c=n(8763),d=n(9651),l=n(2875),u=i(n(3787)),p=i(n(6731)),m=i(n(7113)),h=s(n(1221));var y,f,g,w,E;!function(e){e[e.BooleanTrue=0]="BooleanTrue",e[e.BooleanFalse=1]="BooleanFalse",e[e.Byte=2]="Byte",e[e.Int16=3]="Int16",e[e.Int32=4]="Int32",e[e.Int64=5]="Int64",e[e.ByteBuffer=6]="ByteBuffer",e[e.String=7]="String",e[e.Timestamp=8]="Timestamp",e[e.UUID=9]="UUID"}(y=t.HeaderType||(t.HeaderType={}));class b{constructor(e,t,n){this.name=e,this.type=t,this.value=n}static validateHeaderName(e){if(0==e.length||e.length>127)throw new l.CrtError(`Event stream header name (${e}) is not valid`)}static newBoolean(e,t){return b.validateHeaderName(e),new b(e,t?y.BooleanTrue:y.BooleanFalse)}static newByte(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT8&&t<=p.MAX_INT8&&Number.isSafeInteger(t))return new b(e,y.Byte,t);throw new l.CrtError(`Illegal value for eventstream byte-valued header: ${t}`)}static newInt16(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT16&&t<=p.MAX_INT16&&Number.isSafeInteger(t))return new b(e,y.Int16,t);throw new l.CrtError(`Illegal value for eventstream int16-valued header: ${t}`)}static newInt32(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT32&&t<=p.MAX_INT32&&Number.isSafeInteger(t))return new b(e,y.Int32,t);throw new l.CrtError(`Illegal value for eventstream int32-valued header: ${t}`)}static newInt64FromNumber(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t))return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(BigInt(t)));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newInt64FromBigint(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT64&&t<=p.MAX_INT64)return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(t));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newByteBuffer(e,t){return b.validateHeaderName(e),new b(e,y.ByteBuffer,t)}static newString(e,t){return b.validateHeaderName(e),new b(e,y.String,t)}static newTimeStampFromSecondsSinceEpoch(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t)&&t>=0)return new b(e,y.Timestamp,t);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newTimeStampFromDate(e,t){b.validateHeaderName(e);const n=t.getTime();if(Number.isSafeInteger(n))return new b(e,y.Timestamp,n);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newUUID(e,t){if(b.validateHeaderName(e),16==t.byteLength)return new b(e,y.UUID,t);throw new l.CrtError(`Illegal value for eventstream uuid-valued header: ${t}`)}toValue(e){if(e!=this.type)throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (${e})`);return this.value}asBoolean(){switch(this.type){case y.BooleanFalse:return!1;case y.BooleanTrue:return!0;default:throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`)}}asByte(){return this.toValue(y.Byte)}asInt16(){return this.toValue(y.Int16)}asInt32(){return this.toValue(y.Int32)}asInt64(){return p.unmarshalInt64BigintFromBuffer(this.toValue(y.Int64))}asByteBuffer(){return this.toValue(y.ByteBuffer)}asString(){return this.toValue(y.String)}asTimestamp(){return this.toValue(y.Timestamp)}asUUID(){return this.toValue(y.UUID)}}function v(e){let t={type:e.type,flags:e.flags,payload:e.payload};var n;return e.headers&&(t.headers=(n=e.headers,Array.from(n,(e=>new b(e.name,e.type,e.value))))),t}t.Header=b,(E=t.MessageFlags||(t.MessageFlags={}))[E.None=0]="None",E[E.ConnectionAccepted=1]="ConnectionAccepted",E[E.TerminateStream=2]="TerminateStream",(w=t.MessageType||(t.MessageType={}))[w.ApplicationMessage=0]="ApplicationMessage",w[w.ApplicationError=1]="ApplicationError",w[w.Ping=2]="Ping",w[w.PingResponse=3]="PingResponse",w[w.Connect=4]="Connect",w[w.ConnectAck=5]="ConnectAck",w[w.ProtocolError=6]="ProtocolError",w[w.InternalError=7]="InternalError",function(e){e[e.None=0]="None",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Disconnected=3]="Disconnected",e[e.Closed=4]="Closed"}(f||(f={}));class S extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){if(void 0===e)throw new l.CrtError("Invalid configuration passed to eventstream ClientConnection constructor");super(),this.state=f.None,this._super(h.default.event_stream_client_connection_new(this,e,((e,t)=>{S._s_on_disconnect(e,t)}),((e,t)=>{S._s_on_protocol_message(e,t)}),e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null))}close(){this.state!=f.Closed&&(this.state=f.Closed,h.default.event_stream_client_connection_close(this.native_handle()))}connect(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{if(e)if(this.state==f.None){if(this.state=f.Connecting,e.cancelController){let n=()=>{r(new l.CrtError("Event stream connection connect() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(n),!t)return}try{h.default.event_stream_client_connection_connect(this.native_handle(),(function(e,t){return S._s_on_connection_setup(n,r,e,t)}))}catch(e){this.state=f.Disconnected,r(e)}}else r(new l.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));else r(new l.CrtError("Invalid options passed to event stream ClientConnection.connect"))}));return m.makeSelfCleaningPromise(n,t)}))}sendProtocolMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to event stream ClientConnection.sendProtocolMessage"));if(!this.isConnected())return void r(new l.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream connection sendProtocolMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return S._s_on_connection_send_protocol_message_completion(n,r,e)}h.default.event_stream_client_connection_send_protocol_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isConnected(){return this.state==f.Connected}newStream(){if(!this.isConnected())throw new l.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);return new _(this)}on(e,t){return super.on(e,t),this}static _s_on_connection_setup(e,t,n,r){0==r&&n.state==f.Connecting?(n.state=f.Connected,e()):(n.state!=f.Closed&&(n.state=f.Disconnected),t(u.error_code_to_string(r)))}static _s_on_disconnect(e,t){e.state!=f.Closed&&(e.state=f.Disconnected),process.nextTick((()=>{e.emit("disconnection",{errorCode:t})}))}static _s_on_protocol_message(e,t){process.nextTick((()=>{e.emit("protocolMessage",{message:v(t)})}))}static _s_on_connection_send_protocol_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}}t.ClientConnection=S,S.DISCONNECTION="disconnection",S.PROTOCOL_MESSAGE="protocolMessage",function(e){e[e.None=0]="None",e[e.Activating=1]="Activating",e[e.Activated=2]="Activated",e[e.Ended=3]="Ended",e[e.Closed=4]="Closed"}(g||(g={}));class _ extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(h.default.event_stream_client_stream_new(this,e.native_handle(),(e=>{_._s_on_stream_ended(e)}),((e,t)=>{_._s_on_stream_message(e,t)}))),this.state=g.None}close(){this.state!=g.Closed&&(this.state=g.Closed,h.default.event_stream_client_stream_close(this.native_handle()))}activate(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(this.state!=g.None)return void r(new l.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));if(void 0===e)return this.state=g.Ended,void r(new l.CrtError("Invalid options passed to ClientStream.activate"));if(this.state=g.Activating,e.cancelController){let i=()=>{r(new l.CrtError("Event stream activate() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e,t){return _._s_on_stream_activated(n,r,e,t)}h.default.event_stream_client_stream_activate(this.native_handle(),e,o)}catch(a){this.state=g.Ended,r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}sendMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to ClientStream.sendMessage"));if(this.state!=g.Activated)return void r(new l.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream sendMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return _._s_on_stream_send_message_completion(n,r,e)}h.default.event_stream_client_stream_send_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isActive(){return this.state==g.Activated}on(e,t){return super.on(e,t),this}static _s_on_stream_activated(e,t,n,r){0==r&&n.state==g.Activating?(n.state=g.Activated,e()):(n.state!=g.Closed&&(n.state=g.Ended),t(u.error_code_to_string(r)))}static _s_on_stream_send_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}static _s_on_stream_ended(e){process.nextTick((()=>{e.emit(_.ENDED,{})}))}static _s_on_stream_message(e,t){process.nextTick((()=>{e.emit(_.MESSAGE,{message:v(t)})}))}}t.ClientStream=_,_.ENDED="ended",_.MESSAGE="message"},6731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unmarshalInt64BigintFromBuffer=t.marshalInt64BigintAsBuffer=t.MIN_INT64=t.MAX_INT64=t.MIN_INT32=t.MAX_INT32=t.MIN_INT16=t.MAX_INT16=t.MIN_INT8=t.MAX_INT8=void 0;const r=n(2875);t.MAX_INT8=127,t.MIN_INT8=-128,t.MAX_INT16=32767,t.MIN_INT16=-32768,t.MAX_INT32=2147483647,t.MIN_INT32=-2147483648,t.MAX_INT64=BigInt("9223372036854775807"),t.MIN_INT64=BigInt("-9223372036854775808");const o=BigInt("256");t.marshalInt64BigintAsBuffer=function(e){if(e<t.MIN_INT64||e>t.MAX_INT64)throw new r.CrtError("marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes");let n=new Uint8Array(8);if(e<0){e=-e-BigInt(1);for(let t=0;t<8;++t)n[t]=255-Number(e%o),e/=o}else for(let t=0;t<8;++t)n[t]=Number(e%o),e/=o;return n},t.unmarshalInt64BigintFromBuffer=function(e){let t=BigInt(0),n=new Uint8Array(e);if(8!=n.length)throw new r.CrtError("unmarshalInt64BigintFromBuffer expects a byte buffer of length 8");let i=BigInt(1);if(0!=(128&n[7])){for(let e=0;e<n.length;++e)t+=BigInt(255-n[e])*i,i*=o;t+=BigInt(1),t=-t}else for(let e=0;e<n.length;++e)t+=BigInt(n[e])*i,i*=o;return t}},8415:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClientConnectionManager=t.HttpClientStream=t.HttpStream=t.HttpClientConnection=t.HttpProxyOptions=t.HttpProxyConnectionType=t.HttpConnection=t.HttpRequest=t.HttpHeaders=t.HttpProxyAuthenticationType=void 0;const o=r(n(1221)),i=n(8763),a=n(2875),s=n(3804);var c=n(3804);Object.defineProperty(t,"HttpProxyAuthenticationType",{enumerable:!0,get:function(){return c.HttpProxyAuthenticationType}});const d=n(9651);t.HttpHeaders=o.default.HttpHeaders;const l=o.default.HttpRequest;t.HttpRequest=class extends l{constructor(e,t,n,r){super(e,t,n,null==r?void 0:r.native_handle())}};class u extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(e)}close(){o.default.http_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}}var p;t.HttpConnection=u,u.CONNECT="connect",u.ERROR="error",u.CLOSE="close",function(e){e[e.Legacy=0]="Legacy",e[e.Forwarding=1]="Forwarding",e[e.Tunneling=2]="Tunneling"}(p=t.HttpProxyConnectionType||(t.HttpProxyConnectionType={}));class m extends s.CommonHttpProxyOptions{constructor(e,t,n=s.HttpProxyAuthenticationType.None,r,o,i,a){super(e,t,n,r,o),this.tls_opts=i,this.connection_type=a}create_native_handle(){return o.default.http_proxy_options_new(this.host_name,this.port,this.auth_method,this.auth_username,this.auth_password,this.tls_opts?this.tls_opts.native_handle():void 0,this.connection_type?this.connection_type:p.Legacy)}}t.HttpProxyOptions=m;class h extends u{constructor(e,t,n,r,i,s,c){if(null==r||null==r)throw new a.CrtError("HttpClientConnection constructor: socket_options not defined");super(c||o.default.http_connection_new(null!=e?e.native_handle():null,((e,t)=>{this._on_setup(e,t)}),((e,t)=>{this._on_shutdown(e,t)}),t,n,r.native_handle(),i?i.native_handle():void 0,s?s.create_native_handle():void 0)),this.bootstrap=e,this.socket_options=r,this.tls_opts=i}_on_setup(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("connect")}_on_shutdown(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("close")}request(e){let t;const n=o.default.http_stream_new(this.native_handle(),e,(e=>{t._on_complete(e)}),((e,n)=>{t._on_response(e,n)}),(e=>{t._on_body(e)}));return t=new f(n,this,e)}}t.HttpClientConnection=h;class y extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e,t){super(),this.connection=t,this._super(e),this.cork()}activate(){o.default.http_stream_activate(this.native_handle())}close(){o.default.http_stream_close(this.native_handle())}_on_body(e){this.emit("data",e)}_on_complete(e){if(e)return this.emit("error",new a.CrtError(e)),void this.close();this.on("end",(()=>{this.close()})),this.emit("end")}}t.HttpStream=y;class f extends y{constructor(e,t,n){super(e,t),this.request=n}status_code(){return this.response_status_code}on(e,t){return super.on(e,t),"response"==e&&process.nextTick((()=>{this.uncork()})),this}_on_response(e,n){this.response_status_code=e;let r=new t.HttpHeaders(n);this.emit("response",e,r)}}t.HttpClientStream=f,f.RESPONSE="response",f.DATA="data",f.ERROR="error",f.END="end",f.HEADERS="headers";class g extends i.NativeResource{constructor(e,t,n,r,i,s,c,d){if(null==s||null==s)throw new a.CrtError("HttpClientConnectionManager constructor: socket_options not defined");super(o.default.http_connection_manager_new(null!=e?e.native_handle():null,t,n,r,i,s.native_handle(),c?c.native_handle():void 0,d?d.create_native_handle():void 0,void 0)),this.bootstrap=e,this.host=t,this.port=n,this.max_connections=r,this.initial_window_size=i,this.socket_options=s,this.tls_opts=c,this.proxy_options=d,this.connections=new Map}acquire(){return new Promise(((e,t)=>{o.default.http_connection_manager_acquire(this.native_handle(),((n,r)=>{if(r)return void t(new a.CrtError(r));let o=this.connections.get(n);o||(o=new h(this.bootstrap,this.host,this.port,this.socket_options,this.tls_opts,this.proxy_options,n),this.connections.set(n,o),o.on("close",(()=>{this.connections.delete(n)}))),e(o)}))}))}release(e){if(null==e||null==e)throw new a.CrtError("HttpClientConnectionManager release: connection not defined");o.default.http_connection_manager_release(this.native_handle(),e.native_handle())}close(){o.default.http_connection_manager_close(this.native_handle())}}t.HttpClientConnectionManager=g},3787:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pkcs11Lib=t.TlsConnectionOptions=t.ServerTlsContext=t.ClientTlsContext=t.TlsContext=t.TlsContextOptions=t.SocketOptions=t.ClientBootstrap=t.InputStream=t.is_alpn_available=t.enable_logging=t.LogLevel=t.error_code_to_name=t.error_code_to_string=t.SocketDomain=t.SocketType=t.TlsVersion=void 0;const o=r(n(1221)),i=n(8763),a=n(9712);var s=n(9712);Object.defineProperty(t,"TlsVersion",{enumerable:!0,get:function(){return s.TlsVersion}}),Object.defineProperty(t,"SocketType",{enumerable:!0,get:function(){return s.SocketType}}),Object.defineProperty(t,"SocketDomain",{enumerable:!0,get:function(){return s.SocketDomain}});const c=n(2875);var d;t.error_code_to_string=function(e){return o.default.error_code_to_string(e)},t.error_code_to_name=function(e){return o.default.error_code_to_name(e)},(d=t.LogLevel||(t.LogLevel={}))[d.NONE=0]="NONE",d[d.FATAL=1]="FATAL",d[d.ERROR=2]="ERROR",d[d.WARN=3]="WARN",d[d.INFO=4]="INFO",d[d.DEBUG=5]="DEBUG",d[d.TRACE=6]="TRACE",t.enable_logging=function(e){o.default.io_logging_enable(e)},t.is_alpn_available=function(){return o.default.is_alpn_available()};class l extends i.NativeResource{constructor(e){super(o.default.io_input_stream_new(16384)),this.source=e,this.source.on("data",(e=>{e=Buffer.isBuffer(e)?e:Buffer.from(e.toString()),o.default.io_input_stream_append(this.native_handle(),e)})),this.source.on("end",(()=>{o.default.io_input_stream_append(this.native_handle(),void 0)}))}}t.InputStream=l;class u extends i.NativeResource{constructor(){super(o.default.io_client_bootstrap_new())}}t.ClientBootstrap=u;class p extends i.NativeResource{constructor(e=a.SocketType.STREAM,t=a.SocketDomain.IPV6,n=5e3,r=!1,i=0,s=0,c=0){super(o.default.io_socket_options_new(e,t,n,i,s,c,r))}}t.SocketOptions=p;class m{constructor(){this.min_tls_version=a.TlsVersion.Default,this.alpn_list=[],this.verify_peer=!0}override_default_trust_store_from_path(e,t){this.ca_dirpath=e,this.ca_filepath=t}override_default_trust_store(e){this.certificate_authority=e}static create_client_with_mtls(e,t){let n=new m;return n.certificate=e,n.private_key=t,n.verify_peer=!0,n}static create_client_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs12_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs_from_path(e,t){return this.create_client_with_mtls_pkcs12_from_path(e,t)}static create_client_with_mtls_pkcs11(e){let t=new m;return t.pkcs11_options=e,t.verify_peer=!0,t}static create_client_with_mtls_windows_cert_store_path(e){let t=new m;return t.windows_cert_store_path=e,t.verify_peer=!0,t}static create_server_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!1,n}static create_server_with_mtls_pkcs_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!1,n}}t.TlsContextOptions=m;class h extends i.NativeResource{constructor(e){if(null==e||null==e)throw new c.CrtError("TlsContext constructor: ctx_opt not defined");super(o.default.io_tls_ctx_new(e.min_tls_version,e.ca_filepath,e.ca_dirpath,e.certificate_authority,e.alpn_list&&e.alpn_list.length>0?e.alpn_list.join(";"):void 0,e.certificate_filepath,e.certificate,e.private_key_filepath,e.private_key,e.pkcs12_filepath,e.pkcs12_password,e.pkcs11_options,e.windows_cert_store_path,e.verify_peer))}}t.TlsContext=h,t.ClientTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!0),super(e)}},t.ServerTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!1),super(e)}};class y extends i.NativeResource{constructor(e,t,n=[]){if(null==e||null==e)throw new c.CrtError("TlsConnectionOptions constructor: tls_ctx not defined");super(o.default.io_tls_connection_options_new(e.native_handle(),t,n&&n.length>0?n.join(";"):void 0)),this.tls_ctx=e,this.server_name=t,this.alpn_list=n}}t.TlsConnectionOptions=y;class f extends i.NativeResource{constructor(e,t=f.InitializeFinalizeBehavior.DEFAULT){super(o.default.io_pkcs11_lib_new(e,t))}close(){o.default.io_pkcs11_lib_close(this.native_handle())}}t.Pkcs11Lib=f,function(e){let t;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.OMIT=1]="OMIT",e[e.STRICT=2]="STRICT"}(t=e.InitializeFinalizeBehavior||(e.InitializeFinalizeBehavior={}))}(f=t.Pkcs11Lib||(t.Pkcs11Lib={}))},9793:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(8583),t),o(n(1838),t)},799:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MqttClientConnection=t.MqttClient=t.MqttWill=t.QoS=t.HttpProxyOptions=void 0;const c=s(n(1221)),d=n(8763),l=n(9651),u=i(n(4231)),p=n(2875),m=i(n(3787));var h=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return h.HttpProxyOptions}});const y=n(5641);var f=n(5641);Object.defineProperty(t,"QoS",{enumerable:!0,get:function(){return f.QoS}}),Object.defineProperty(t,"MqttWill",{enumerable:!0,get:function(){return f.MqttWill}});class g extends d.NativeResource{constructor(e=void 0){super(c.default.mqtt_client_new(null!=e?e.native_handle():null)),this.bootstrap=e}new_connection(e){return new w(this,e)}}t.MqttClient=g;class w extends((0,d.NativeResourceMixin)(l.BufferedEventEmitter)){constructor(e,t){if(super(),this.client=e,this.config=t,null==t||null==t)throw new p.CrtError("MqttClientConnection constructor: config not defined");const n=t.will?{topic:t.will.topic,qos:t.will.qos,payload:u.normalize_payload(t.will.payload),retain:t.will.retain}:void 0;var r=y.DEFAULT_RECONNECT_MIN_SEC,o=y.DEFAULT_RECONNECT_MAX_SEC;if(t.reconnect_min_sec&&(r=t.reconnect_min_sec,o=Math.max(r,o)),t.reconnect_max_sec&&(o=t.reconnect_max_sec,r=Math.min(r,o)),null==e||null==e)throw new p.CrtError("MqttClientConnection constructor: client not defined");if(null==t.socket_options||null==t.socket_options)throw new p.CrtError("MqttClientConnection constructor: socket_options in configuration not defined");this._super(c.default.mqtt_client_connection_new(e.native_handle(),(e=>{this._on_connection_interrupted(e)}),((e,t)=>{this._on_connection_resumed(e,t)}),t.tls_ctx?t.tls_ctx.native_handle():null,n,t.username,t.password,t.use_websocket,t.proxy_options?t.proxy_options.create_native_handle():void 0,t.websocket_handshake_transform,r,o)),this.tls_ctx=t.tls_ctx,c.default.mqtt_client_connection_on_message(this.native_handle(),this._on_any_publish.bind(this)),this.on("error",(e=>{}))}close(){c.default.mqtt_client_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}connect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{if(t=this._reject(t),null==this.config.socket_options||null==this.config.socket_options)throw new p.CrtError("MqttClientConnection connect: socket_options in configuration not defined");try{c.default.mqtt_client_connection_connect(this.native_handle(),this.config.client_id,this.config.host_name,this.config.port,this.config.socket_options.native_handle(),this.config.keep_alive,this.config.ping_timeout,this.config.protocol_operation_timeout,this.config.clean_session,this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}reconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_reconnect(this.native_handle(),this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}publish(e,t,n,r=!1){return a(this,void 0,void 0,(function*(){return new Promise(((o,i)=>{i=this._reject(i);try{c.default.mqtt_client_connection_publish(this.native_handle(),e,u.normalize_payload(t),n,r,this._on_puback_callback.bind(this,o,i))}catch(e){i(e)}}))}))}subscribe(e,t,n){return a(this,void 0,void 0,(function*(){return new Promise(((r,o)=>{o=this._reject(o);try{c.default.mqtt_client_connection_subscribe(this.native_handle(),e,t,n,this._on_suback_callback.bind(this,r,o))}catch(e){o(e)}}))}))}unsubscribe(e){return a(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{n=this._reject(n);try{c.default.mqtt_client_connection_unsubscribe(this.native_handle(),e,this._on_unsuback_callback.bind(this,t,n))}catch(e){n(e)}}))}))}disconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_disconnect(this.native_handle(),this._on_disconnect_callback.bind(this,e))}catch(e){t(e)}}))}))}getQueueStatistics(){return c.default.mqtt_client_connection_get_queue_statistics(this.native_handle())}_reject(e){return t=>{e(t),process.nextTick((()=>{this.emit("error",new p.CrtError(t))}))}}_on_connection_interrupted(e){this.emit("interrupt",new p.CrtError(e))}_on_connection_resumed(e,t){this.emit("resume",e,t)}_on_any_publish(e,t,n,r,o){this.emit("message",e,t,n,r,o)}_on_connect_callback(e,t,n,r,o){0==n&&0==r?(e(o),this.emit("connect",o)):t(0!=n?"Failed to connect: "+m.error_code_to_string(n):"Server rejected connection.")}_on_puback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to publish: "+m.error_code_to_string(r))}_on_suback_callback(e,t,n,r,o,i){0==i?e({packet_id:n,topic:r,qos:o,error_code:i}):t("Failed to subscribe: "+m.error_code_to_string(i))}_on_unsuback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to unsubscribe: "+m.error_code_to_string(r))}_on_disconnect_callback(e){e(),this.emit("disconnect"),this.close()}}t.MqttClientConnection=w,w.CONNECT="connect",w.DISCONNECT="disconnect",w.ERROR="error",w.INTERRUPT="interrupt",w.RESUME="resume",w.MESSAGE="message"},2385:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Mqtt5Client=t.ClientExtendedValidationAndFlowControl=t.ClientOperationQueueBehavior=t.HttpProxyOptions=void 0;const d=c(n(1221)),l=n(8763),u=n(9651),p=i(n(3787)),m=i(n(4231)),h=n(2875);var y,f,g=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return g.HttpProxyOptions}}),a(n(5018),t),a(n(202),t),(f=t.ClientOperationQueueBehavior||(t.ClientOperationQueueBehavior={}))[f.Default=0]="Default",f[f.FailNonQos1PublishOnDisconnect=1]="FailNonQos1PublishOnDisconnect",f[f.FailQos0PublishOnDisconnect=2]="FailQos0PublishOnDisconnect",f[f.FailAllOnDisconnect=3]="FailAllOnDisconnect",(y=t.ClientExtendedValidationAndFlowControl||(t.ClientExtendedValidationAndFlowControl={}))[y.None=0]="None",y[y.AwsIotCoreDefaults=1]="AwsIotCoreDefaults";class w extends((0,l.NativeResourceMixin)(u.BufferedEventEmitter)){constructor(e){super(),this._super(d.default.mqtt5_client_new(this,e,(e=>{w._s_on_stopped(e)}),(e=>{w._s_on_attempting_connect(e)}),((e,t,n)=>{w._s_on_connection_success(e,t,n)}),((e,t,n)=>{w._s_on_connection_failure(e,new h.CrtError(t),n)}),((e,t,n)=>{w._s_on_disconnection(e,new h.CrtError(t),n)}),((e,t)=>{w._s_on_message_received(e,t)}),e.clientBootstrap?e.clientBootstrap.native_handle():null,e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null))}close(){d.default.mqtt5_client_close(this.native_handle())}start(){d.default.mqtt5_client_start(this.native_handle())}stop(e){d.default.mqtt5_client_stop(this.native_handle(),e)}subscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_subscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_suback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}unsubscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_unsubscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_unsuback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}publish(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{e&&e.payload&&(e.payload=m.normalize_payload(e.payload));try{d.default.mqtt5_client_publish(this.native_handle(),e,(function(e,r,o){return w._s_on_puback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}getQueueStatistics(){return d.default.mqtt5_client_get_queue_statistics(this.native_handle())}on(e,t){return super.on(e,t),this}static _s_on_stopped(e){process.nextTick((()=>{e.emit(w.STOPPED,{})}))}static _s_on_attempting_connect(e){process.nextTick((()=>{e.emit(w.ATTEMPTING_CONNECT,{})}))}static _s_on_connection_success(e,t,n){let r={connack:t,settings:n};process.nextTick((()=>{e.emit(w.CONNECTION_SUCCESS,r)}))}static _s_on_connection_failure(e,t,n){let r={error:t};null!=n&&(r.connack=n),process.nextTick((()=>{e.emit(w.CONNECTION_FAILURE,r)}))}static _s_on_disconnection(e,t,n){let r={error:t};null!=n&&(r.disconnect=n),process.nextTick((()=>{e.emit(w.DISCONNECTION,r)}))}static _s_on_suback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_unsuback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_puback_callback(e,t,n,r,o){0==r?e(o):t(p.error_code_to_string(r))}static _s_on_message_received(e,t){let n={message:t};process.nextTick((()=>{e.emit(w.MESSAGE_RECEIVED,n)}))}}t.Mqtt5Client=w,w.ERROR="error",w.MESSAGE_RECEIVED="messageReceived",w.ATTEMPTING_CONNECT="attemptingConnect",w.CONNECTION_SUCCESS="connectionSuccess",w.CONNECTION_FAILURE="connectionFailure",w.DISCONNECTION="disconnection",w.STOPPED="stopped"},8763:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeResourceMixin=t.NativeResource=void 0,t.NativeResource=class{constructor(e){this.handle=e}native_handle(){return this.handle}},t.NativeResourceMixin=function(e){return class extends e{constructor(...e){const t=e.shift();super(...e),this._handle=t}_super(e){this._handle=e}native_handle(){return this._handle}}}},1309:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1309,e.exports=t},5371:(e,t,n)=>{n(9738).config(Object.assign({},n(2547),n(2962)(process.argv)))},2962:e=>{const t=/^dotenv_config_(encoding|path|debug|override)=(.+)$/;e.exports=function(e){return e.reduce((function(e,n){const r=n.match(t);return r&&(e[r[1]]=r[2]),e}),{})}},2547:e=>{const t={};null!=process.env.DOTENV_CONFIG_ENCODING&&(t.encoding=process.env.DOTENV_CONFIG_ENCODING),null!=process.env.DOTENV_CONFIG_PATH&&(t.path=process.env.DOTENV_CONFIG_PATH),null!=process.env.DOTENV_CONFIG_DEBUG&&(t.debug=process.env.DOTENV_CONFIG_DEBUG),null!=process.env.DOTENV_CONFIG_OVERRIDE&&(t.override=process.env.DOTENV_CONFIG_OVERRIDE),e.exports=t},9738:(e,t,n)=>{const r=n(7147),o=n(1017),i=n(2037),a=n(9968).version,s=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function c(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}const d={config:function(e){let t=o.resolve(process.cwd(),".env"),n="utf8";const a=Boolean(e&&e.debug),s=Boolean(e&&e.override);var l;e&&(null!=e.path&&(t="~"===(l=e.path)[0]?o.join(i.homedir(),l.slice(1)):l),null!=e.encoding&&(n=e.encoding));try{const e=d.parse(r.readFileSync(t,{encoding:n}));return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(process.env,t)?(!0===s&&(process.env[t]=e[t]),a&&c(!0===s?`"${t}" is already defined in \`process.env\` and WAS overwritten`:`"${t}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[t]=e[t]})),{parsed:e}}catch(e){return a&&c(`Failed to load ${t} ${e.message}`),{error:e}}},parse:function(e){const t={};let n,r=e.toString();for(r=r.replace(/\r\n?/gm,"\n");null!=(n=s.exec(r));){const e=n[1];let r=n[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===o&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[e]=r}return t}};e.exports.config=d.config,e.exports.parse=d.parse,e.exports=d},6932:(e,t,n)=>{"use strict";const r=n(8501),o=n(8844),i=n(1192);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},7849:(e,t)=>{"use strict";const 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",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),o=r.length;for(let i=0;i<o;i++)e[r[i]]="strict"===n?[t[r[i]]]:t[r[i]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==o.exec(e))},t.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const o=[];o.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)o.push(r[e]);n.push(o),r=t.exec(e)}return n},t.nameRegexp=r},8501:(e,t,n)=>{"use strict";const r=n(7849),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function a(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const r=e.substr(n,t-n);if(t>5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",f(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},o,t);const n=[];let c=!1,d=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=a(e,o),o.err)return o}else{if("<"!==e[o]){if(i(e[o]))continue;return h("InvalidChar","char '"+e[o]+"' is not expected.",f(e,o))}{let y=o;if(o++,"!"===e[o]){o=s(e,o);continue}{let g=!1;"/"===e[o]&&(g=!0,o++);let w="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)w+=e[o];if(w=w.trim(),"/"===w[w.length-1]&&(w=w.substring(0,w.length-1),o--),u=w,!r.isName(u)){let t;return t=0===w.trim().length?"Invalid space after '<'.":"Tag '"+w+"' is an invalid name.",h("InvalidTag",t,f(e,o))}const E=l(e,o);if(!1===E)return h("InvalidAttr","Attributes for '"+w+"' have open quote.",f(e,o));let b=E.value;if(o=E.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,n+r.err.line));c=!0}else if(g){if(!E.tagClosed)return h("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",f(e,o));if(b.trim().length>0)return h("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",f(e,y));{const t=n.pop();if(w!==t.tagName){let n=f(e,t.tagStartPos);return h("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+w+"'.",f(e,y))}0==n.length&&(d=!0)}}else{const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,o-b.length+r.err.line));if(!0===d)return h("InvalidXml","Multiple possible root nodes found.",f(e,o));-1!==t.unpairedTags.indexOf(w)||n.push({tagName:w,tagStartPos:y}),c=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=s(e,o);continue}if("?"!==e[o+1])break;if(o=a(e,++o),o.err)return o}else if("&"===e[o]){const t=m(e,o);if(-1==t)return h("InvalidChar","char '&' is not expected.",f(e,o));o=t}else if(!0===d&&!i(e[o]))return h("InvalidXml","Extra text at the end",f(e,o));"<"===e[o]&&o--}}}var u;return c?1==n.length?h("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",f(e,n[0].tagStartPos)):!(n.length>0)||h("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};const c='"',d="'";function l(e,t){let n="",r="",o=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===d)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){o=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:o}}const u=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){const n=r.getAllMatches(e,u),o={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return h("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",g(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return h("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",g(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return h("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",g(n[e]));const r=n[e][2];if(!y(r))return h("InvalidAttr","Attribute '"+r+"' is an invalid name.",g(n[e]));if(o.hasOwnProperty(r))return h("InvalidAttr","Attribute '"+r+"' is repeated.",g(n[e]));o[r]=1}return!0}function m(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function h(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function y(e){return r.isName(e)}function f(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function g(e){return e.startIndex+e[1].length}},1192:(e,t,n)=>{"use strict";const r=n(2592),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[]};function i(e){this.options=Object.assign({},o,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=a,this.options.format?(this.indentate=s,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n){const r=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}function s(e){return this.options.indentBy.repeat(e)}function c(e){return!!e.startsWith(this.options.attributeNamePrefix)&&e.substr(this.attrPrefixLen)}i.prototype.build=function(e){return this.options.preserveOrder?r(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},i.prototype.j2x=function(e,t){let n="",r="";for(let o in e)if(void 0===e[o]);else if(null===e[o])"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)r+=this.buildTextValNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);if(i)n+=this.buildAttrPairStr(i,""+e[o]);else if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,""+e[o]);r+=this.replaceEntitiesValue(t)}else r+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const n=e[o].length;for(let i=0;i<n;i++){const n=e[o][i];void 0===n||(null===n?"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar:r+="object"==typeof n?this.processTextOrObjNode(n,o,t):this.buildTextValNode(n,o,"",t))}}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const t=Object.keys(e[o]),r=t.length;for(let i=0;i<r;i++)n+=this.buildAttrPairStr(t[i],""+e[o][t[i]])}else r+=this.processTextOrObjNode(e[o],o,t);return{attrStr:n,val:r}},i.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},i.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let o="</"+t+this.tagEndChar,i="";return"?"===t[0]&&(i="?",o=""),n&&-1===e.indexOf("<")?this.indentate(r)+"<"+t+n+i+">"+e+o:!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===i.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+i+this.tagEndChar+e+this.indentate(r)+o}},i.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},i.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,e);return o=this.replaceEntitiesValue(o),""===o?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+o+"</"+t+this.tagEndChar}},i.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=i},2592:e=>{function t(e,a,s,c){let d="",l=!1;for(let u=0;u<e.length;u++){const p=e[u],m=n(p);let h="";if(h=0===s.length?m:`${s}.${m}`,m===a.textNodeName){let e=p[m];o(h,a)||(e=a.tagValueProcessor(m,e),e=i(e,a)),l&&(d+=c),d+=e,l=!1;continue}if(m===a.cdataPropName){l&&(d+=c),d+=`<![CDATA[${p[m][0][a.textNodeName]}]]>`,l=!1;continue}if(m===a.commentPropName){d+=c+`\x3c!--${p[m][0][a.textNodeName]}--\x3e`,l=!0;continue}if("?"===m[0]){const e=r(p[":@"],a),t="?xml"===m?"":c;let n=p[m][0][a.textNodeName];n=0!==n.length?" "+n:"",d+=t+`<${m}${n}${e}?>`,l=!0;continue}let y=c;""!==y&&(y+=a.indentBy);const f=c+`<${m}${r(p[":@"],a)}`,g=t(p[m],a,h,y);-1!==a.unpairedTags.indexOf(m)?a.suppressUnpairedNode?d+=f+">":d+=f+"/>":g&&0!==g.length||!a.suppressEmptyNode?g&&g.endsWith(">")?d+=f+`>${g}${c}</${m}>`:(d+=f+">",g&&""!==c&&(g.includes("/>")||g.includes("</"))?d+=c+a.indentBy+g+c:d+=g,d+=`</${m}>`):d+=f+"/>",l=!0}return d}function n(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function r(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){let o=t.attributeValueProcessor(r,e[r]);o=i(o,t),!0===o&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function o(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function i(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}e.exports=function(e,n){let r="";return n.format&&n.indentBy.length>0&&(r="\n"),t(e,n,"",r)}},4780:e=>{const t=RegExp("^\\s([a-zA-z0-0]+)[ \t](['\"])([^&]+)\\2");function n(e,n){const r=t.exec(e);r&&(n[r[1]]={regx:RegExp(`&${r[1]};`,"g"),val:r[3]})}e.exports=function(e,t){const r={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let o=1,i=!1,a=!1,s=!1,c="";for(;t<e.length;t++)if("<"!==e[t]||s)if(">"===e[t]){if(s?"-"===e[t-1]&&"-"===e[t-2]&&(s=!1,o--):(a&&(n(c,r),a=!1),o--),0===o)break}else"["===e[t]?i=!0:c+=e[t];else{if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7])t+=7,a=!0;else if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9])t+=9;else{if("!"!==e[t+1]||"-"!==e[t+2]||"-"!==e[t+3])throw new Error("Invalid DOCTYPE");s=!0}o++,c=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:t}}},6745:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},1078:(e,t,n)=>{"use strict";const r=n(7849),o=n(6311),i=n(4780),a=n(4153);function s(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function c(e,t,n,r,o,i,a){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){a||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,o,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?E(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function d(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);const l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function u(e,t){if(!this.options.ignoreAttributes&&"string"==typeof e){const n=r.getAllMatches(e,l),o=n.length,i={};for(let e=0;e<o;e++){const r=this.resolveNameSpace(n[e][1]);let o=n[e][4],a=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[a]=null==e?o:typeof e!=typeof o||e!==o?e:E(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[a]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const p=function(e){e=e.replace(/\r\n?/g,"\n");const t=new o("!xml");let n=t,r="",a="";for(let s=0;s<e.length;s++)if("<"===e[s])if("/"===e[s+1]){const t=f(e,">",s,"Closing Tag is not closed.");let o=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,a)),a=a.substr(0,a.lastIndexOf(".")),n=this.tagsNodeStack.pop(),r="",s=t}else if("?"===e[s+1]){let t=g(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,a),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new o(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,a)),n.addChild(e)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=f(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,a),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=t}else if("!D"===e.substr(s+1,2)){const t=i(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=f(e,"]]>",s,"CDATA is not closed.")-2,o=e.substring(s+9,t);if(r=this.saveTextToParentTag(r,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let e=this.parseTextData(o,n.tagname,a,!0,!1,!0);null==e&&(e=""),n.add(this.options.textNodeName,e)}s=t+2}else{let i=g(e,s,this.options.removeNSPrefix),c=i.tagName,d=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,a,!1)),c!==t.tagname&&(a+=a?"."+c:c);const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,a,c)){let t="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)s=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))s=i.closeIndex;else{const n=this.readStopNodeData(e,c,u+1);if(!n)throw new Error(`Unexpected end of ${c}`);s=n.i,t=n.tagContent}const r=new o(c);c!==d&&l&&(r[":@"]=this.buildAttributesMap(d,a)),t&&(t=this.parseTextData(t,c,a,!0,l,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),r.add(this.options.textNodeName,t),n.addChild(r)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),d=c):d=d.substr(0,d.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new o(c);c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),a=a.substr(0,a.lastIndexOf(".")),n.addChild(e)}else{const e=new o(c);this.tagsNodeStack.push(n),c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),n.addChild(e),n=e}r="",s=u}}else r+=e[s];return t.child},m=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function h(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function y(e,t,n){const r="*."+n;for(const n in e){const o=e[n];if(r===o||t===o)return!0}return!1}function f(e,t,n,r){const o=e.indexOf(t,n);if(-1===o)throw new Error(r);return o+t.length-1}function g(e,t,n,r=">"){const o=function(e,t,n=">"){let r,o="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:o,index:i};if(e[i+1]===n[1])return{data:o,index:i}}else"\t"===t&&(t=" ");o+=t}}(e,t+1,r);if(!o)return;let i=o.data;const a=o.index,s=i.search(/\s/);let c=i,d=!0;if(-1!==s&&(c=i.substr(0,s).replace(/\s\s*$/,""),i=i.substr(s+1)),n){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),d=c!==o.data.substr(e+1))}return{tagName:c,tagExp:i,closeIndex:a,attrExpPresent:d}}function w(e,t,n){const r=n;let o=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=f(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(o--,0===o))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=f(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=f(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=f(e,"]]>",n,"StopNode is not closed.")-2;else{const r=g(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&o++,n=r.closeIndex)}}function E(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&a(e,n)}return r.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=s,this.parseXml=p,this.parseTextData=c,this.resolveNameSpace=d,this.buildAttributesMap=u,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=w,this.saveTextToParentTag=h}}},8844:(e,t,n)=>{const{buildOptions:r}=n(6745),o=n(1078),{prettify:i}=n(6997),a=n(8501);e.exports=class{constructor(e){this.externalEntities={},this.options=r(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=a.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new o(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:i(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},6997:(e,t)=>{"use strict";function n(e,t,a){let s;const c={};for(let d=0;d<e.length;d++){const l=e[d],u=r(l);let p="";if(p=void 0===a?u:a+"."+u,u===t.textNodeName)void 0===s?s=l[u]:s+=""+l[u];else{if(void 0===u)continue;if(l[u]){let e=n(l[u],t,p);const r=i(e,t);l[":@"]?o(e,l[":@"],p,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[u]&&c.hasOwnProperty(u)?(Array.isArray(c[u])||(c[u]=[c[u]]),c[u].push(e)):t.isArray(u,p,r)?c[u]=[e]:c[u]=e}}}return"string"==typeof s?s.length>0&&(c[t.textNodeName]=s):void 0!==s&&(c[t.textNodeName]=s),c}function r(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function o(e,t,n,r){if(t){const o=Object.keys(t),i=o.length;for(let a=0;a<i;a++){const i=o[a];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function i(e,t){const n=Object.keys(e).length;return!!(0===n||1===n&&e[t.textNodeName])}t.prettify=function(e,t){return n(e,t)}},6311:e=>{"use strict";e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},6675:(e,t,n)=>{var r=n(4993),o=n(113),i=n(3801),a=n(650);function s(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,"number"!=typeof this.capacity||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");var r=i.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K="function"==typeof e?new e(n):new Array(n),this.V="function"==typeof t?new t(n):new Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},s.prototype.set=function(e,t){var n=this.items[e];if(void 0!==n)return this.splayOnTop(n),void(this.V[n]=t);this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},s.prototype.setpop=function(e,t){var n=null,r=null,o=this.items[e];return void 0!==o?(this.splayOnTop(o),n=this.V[o],this.V[o]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?o=this.size++:(o=this.tail,this.tail=this.backward[o],n=this.V[o],r=this.K[o],delete this.items[this.K[o]]),this.items[e]=o,this.K[o]=e,this.V[o]=t,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,r?{evicted:!0,key:r,value:n}:null)},s.prototype.has=function(e){return e in this.items},s.prototype.get=function(e){var t=this.items[e];if(void 0!==t)return this.splayOnTop(t),this.V[t]},s.prototype.peek=function(e){var t=this.items[e];if(void 0!==t)return this.V[t]},s.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,o=this.head,i=this.K,a=this.V,s=this.forward;n<r;)e.call(t,a[o],i[o],this),o=s[o],n++},s.prototype.keys=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.values=function(){var e=0,t=this.size,n=this.head,o=this.V,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.entries=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.V,a=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n],s=i[n];return++e<t&&(n=a[n]),{done:!1,value:[r,s]}}))},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.entries),s.prototype.inspect=function(){for(var e,t=new Map,n=this.entries();!(e=n.next()).done;)t.set(e.value[0],e.value[1]);return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(e,t,n,r){if(arguments.length<2){if("number"!=typeof(r=a.guessLength(e)))throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2===arguments.length&&(r=t,t=null,n=null);var i=new s(t,n,r);return o(e,(function(e,t){i.set(t,e)})),i},e.exports=s},650:(e,t,n)=>{var r=n(113),o=n(3801);function i(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}t.isArrayLike=function(e){return Array.isArray(e)||o.isTypedArray(e)},t.guessLength=i,t.toArray=function(e){var t=i(e),n="number"==typeof t?new Array(t):[],o=0;return r(e,(function(e){n[o++]=e})),n},t.toArrayWithIndices=function(e){var t=i(e),n="number"==typeof t?o.getPointerArray(t):Array,a="number"==typeof t?new Array(t):[],s="number"==typeof t?new n(t):[],c=0;return r(e,(function(e){a[c]=e,s[c]=c++})),[a,s]}},3801:(e,t)=>{var n=Math.pow(2,8)-1,r=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,a=Math.pow(2,15)-1,s=Math.pow(2,31)-1;t.getPointerArray=function(e){var t=e-1;return t<=n?Uint8Array:t<=r?Uint16Array:t<=o?Uint32Array:Float64Array},t.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=s?Int32Array:Float64Array},t.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var c={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,n){var r,o,i,a,s,d=null,l=0;for(a=0,s=e.length;a<s;a++)i=n?n(e[a]):e[a],o=t.getNumberType(i),(r=c[o.name])>l&&(l=r,d=o);return d},t.isTypedArray=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)},t.concat=function(){var e,t,n,r=0;for(e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;var o=new arguments[0].constructor(r);for(e=0,t=0;e<n;e++)o.set(arguments[e],t),t+=arguments[e].length;return o},t.indices=function(e){for(var n=new(t.getPointerArray(e))(e),r=0;r<e;r++)n[r]=r;return n}},113:e=>{var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],a);else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,a),a++;else e.forEach(r)}r.forEachWithNullKeys=function(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],null);else if(e instanceof Set)e.forEach((function(e){r(e,null)}));else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,null),a++;else e.forEach(r)},e.exports=r},4993:e=>{function t(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}t.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t((function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}}))},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},4153:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,o={}){if(o=Object.assign({},r,o),!e||"string"!=typeof e)return e;let i=e.trim();if(void 0!==o.skipLike&&o.skipLike.test(i))return e;if(o.hex&&t.test(i))return Number.parseInt(i,16);{const t=n.exec(i);if(t){const n=t[1],r=t[2];let s=(a=t[3])&&-1!==a.indexOf(".")?("."===(a=a.replace(/0+$/,""))?a="0":"."===a[0]?a="0"+a:"."===a[a.length-1]&&(a=a.substr(0,a.length-1)),a):a;const c=t[4]||t[6];if(!o.leadingZeros&&r.length>0&&n&&"."!==i[2])return e;if(!o.leadingZeros&&r.length>0&&!n&&"."!==i[1])return e;{const t=Number(i),a=""+t;return-1!==a.search(/[eE]/)||c?o.eNotation?t:e:-1!==i.indexOf(".")?"0"===a&&""===s||a===s||n&&a==="-"+s?t:e:r?s===a||n+s===a?t:e:i===a||i===n+a?t:e}}return e}var a}},3607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9031),t),o(n(9615),t),o(n(6278),t)},9615:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableName=t.client=void 0;const r=n(2311);n(5371),t.client=new r.DynamoDBClient({region:process.env.AWS_REGION||"eu-central-1"}),t.TableName=process.env.DYNAMODB_TABLE},6278:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributesFromExpression=t.getAttributeNames=t.getAttributeValues=t.splitEvery=t.stripKey=void 0;const r=n(5074);t.stripKey=function(e){return(0,r.marshall)({PK:e.PK,SK:e.SK})},t.splitEvery=function(e,t=25){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},t.getAttributeValues=function(e,t){return(0,r.marshall)((t||Object.keys(e)).reduce(((t,n)=>(t[`:${n}`]=e[n],t)),{}))},t.getAttributeNames=function(e,t){return(t||Object.keys(e)).reduce(((e,t)=>(e[`#${t}`]=t,e)),{})},t.getAttributesFromExpression=function(e,t="#"){return e.match(new RegExp(`${t}\\w+`,"g"))?.map((e=>e.slice(1)))||[]}},3581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteItems=t.deleteItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.deleteItem=async function(e,t={}){return o.client.send(new r.DeleteItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),...t}))},t.deleteItems=async function e(t,n={},a=0){const s=Object.values(t.reduce(((e,t)=>{const n=(0,i.stripKey)(t),r=JSON.stringify(n);return e[r]||(e[r]=n),e}),{}));return new Promise((async(t,c)=>{const d=(0,i.splitEvery)(s);if(!(a>3)){for(const t of d)await o.client.send(new r.BatchWriteItemCommand({RequestItems:{[o.TableName]:t.map((e=>({DeleteRequest:{Key:e}})))},...n})).then((t=>{if(t?.UnprocessedItems?.[o.TableName]?.length)return a+1>3?c(t):e(t.UnprocessedItems[o.TableName],n,a+1)})).catch(c);t()}}))}},5362:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllItems=t.getItems=t.getItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.getItem=async function(e,t={}){return i.client.send(new r.GetItemCommand({TableName:i.TableName,Key:(0,a.stripKey)(e),...t})).then((e=>e?.Item&&(0,o.unmarshall)(e.Item)))},t.getItems=async function e(t,n={},s=0){if(s>3)return[];const c=Object.values(t.reduce(((e,t)=>{const n=(0,a.stripKey)(t),r=JSON.stringify(n);return e[r]||(e[r]=n),e}),{})),d=(0,a.splitEvery)(c,100),l=[];if(s>2)return l;await Promise.all(d.map((async t=>{await i.client.send(new r.BatchGetItemCommand({RequestItems:{[i.TableName]:{Keys:t,...n}}})).then((t=>{const r=t?.UnprocessedKeys?.[i.TableName],a=t?.Responses?.[i.TableName]||[];return r?e(r.Keys,n,s+1).then((e=>a.concat(e))):a.map((e=>e&&(0,o.unmarshall)(e)))})).then((e=>l.push(...e)))})));const u=l.filter((e=>e)).reduce(((e,t)=>(e[JSON.stringify((0,a.stripKey)(t))]=t,e)),{});return t.map((e=>u[JSON.stringify((0,a.stripKey)(e))]||void 0))},t.getAllItems=async function(e={}){return i.client.send(new r.ScanCommand({TableName:i.TableName,...e})).then((e=>e.Items.map((e=>e&&(0,o.unmarshall)(e)))))}},9031:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(3581),t),o(n(5362),t),o(n(3391),t),o(n(1853),t),o(n(5585),t),o(n(5666),t)},3391:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNewId=t.itemExists=void 0;const r=n(5362),o=n(5585);t.itemExists=async function(e,t={}){return null!=await(0,r.getItem)(e,t)},t.getNewId=async function({PK:e,SK:t,length:n=8}){if(!e)throw new Error("Cannot generate new ID: PK");let r="0";if(t){const n=t+(t.endsWith("/")?"":"/"),i=(await(0,o.queryItems)("#PK = :PK and begins_with(#SK, :SK)",{PK:e,SK:n},{Limit:1,ScanIndexForward:!1}))?.[0],a=i?.SK?.split("/")||[];r=a?.[n.split("/").length-1]||"0"}else{const t=(await(0,o.queryItems)("#PK = :PK",{PK:e},{Limit:1,ScanIndexForward:!1}))?.[0],n=t?.SK?.split("/")||[];r=n?.[n.length-1]||"0"}const i=(parseInt(r)+1+"").padStart(n||0,"0");return t?`${t}${t.endsWith("/")?"":"/"}${i}`:i}},1853:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.putItems=t.putItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.putItem=async function(e,t={}){return Object.keys(e).includes("createdAt")||(e.createdAt=Date.now()),i.client.send(new r.PutItemCommand({TableName:i.TableName,Item:(0,o.marshall)(e),...t}))},t.putItems=async function(e,t={}){return new Promise((async(n,s)=>{const c=(0,a.splitEvery)(e),d=Date.now();for(const e of c)e.forEach((e=>{Object.keys(e).includes("createdAt")||(e.createdAt=d)})),await i.client.send(new r.BatchWriteItemCommand({RequestItems:{[i.TableName]:e.map((e=>({PutRequest:{Item:(0,o.marshall)(e)}})))},...t})).catch(s);n()}))}},5585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryAllItems=t.queryItems=t.query=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);async function s(e,t,n={}){return i.client.send(new r.QueryCommand({TableName:i.TableName,KeyConditionExpression:e,ExpressionAttributeValues:(0,a.getAttributeValues)(t,[...(0,a.getAttributesFromExpression)(e,":"),...(0,a.getAttributesFromExpression)(n?.FilterExpression||"",":")]),ExpressionAttributeNames:(0,a.getAttributeNames)(t,[...(0,a.getAttributesFromExpression)(e),...(0,a.getAttributesFromExpression)(n?.FilterExpression||"")]),...n}))}t.query=s,t.queryItems=async function(e,t,n={}){return s(e,t,n).then((e=>(e?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)))))},t.queryAllItems=async function(e,t,n={}){let r=await s(e,t,n);for(;r.LastEvaluatedKey;)if(r.LastEvaluatedKey){let o=await s(e,t,{...n,ExclusiveStartKey:r.LastEvaluatedKey});o?.Items&&r?.Items&&r.Items.push(...o.Items),r&&(r.LastEvaluatedKey=o.LastEvaluatedKey)}return(r?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)))}},5666:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeAttributes=t.updateItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.updateItem=async function(e,t,n={}){Object.keys(t).includes("updatedAt")||(t.updatedAt=Date.now());const a="SET "+Object.keys(t).map((e=>`#${e} = :${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:a,ExpressionAttributeValues:(0,i.getAttributeValues)(t),ExpressionAttributeNames:(0,i.getAttributeNames)(t),...n}))},t.removeAttributes=async function(e,t){const n="REMOVE "+t.map((e=>`#${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:n,ExpressionAttributeNames:(0,i.getAttributeNames)(t.reduce(((e,t)=>(e[t]=t,e)),{}))}))}},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},5062:e=>{"use strict";e.exports=JSON.parse('{"name":"aws-crt","version":"1.15.16","description":"NodeJS/browser bindings to the aws-c-* libraries","homepage":"https://github.com/awslabs/aws-crt-nodejs","repository":{"type":"git","url":"git+https://github.com/awslabs/aws-crt-nodejs.git"},"contributors":["AWS Common Runtime Team <aws-sdk-common-runtime@amazon.com>"],"license":"Apache-2.0","main":"./dist/index.js","browser":"./dist.browser/browser.js","types":"./dist/index.d.ts","scripts":{"tsc":"node ./scripts/tsc.js","test":"npm run test:native","test:node":"npm run test:native","test:native":"npx jest --runInBand --verbose --config test/native/jest.config.js --forceExit","test:browser":"npx jest --runInBand --verbose --config test/browser/jest.config.js --forceExit","test:browser:ci":"npm run install:puppeteer && npm run test:browser","install:puppeteer":"npm install --save-dev jest-puppeteer puppeteer @types/puppeteer","prepare":"node ./scripts/tsc.js && node ./scripts/install.js","install":"node ./scripts/install.js"},"devDependencies":{"@types/crypto-js":"^3.1.43","@types/jest":"^27.0.1","@types/node":"^10.17.54","@types/prettier":"2.6.0","@types/puppeteer":"^5.4.7","@types/uuid":"^3.4.8","@types/ws":"^7.4.7","aws-sdk":"^2.848.0","cmake-js":"^6.3.2","https-proxy-agent":"^5.0.1","jest":"^27.2.1","jest-puppeteer":"^5.0.4","jest-runtime":"^27.2.1","puppeteer":"^3.3.0","tar":"^6.1.11","ts-jest":"^27.0.5","typedoc":"^0.22.18","typedoc-plugin-merge-modules":"^3.1.0","typescript":"^4.7.4","uuid":"^8.3.2","yargs":"^17.2.1"},"dependencies":{"@aws-sdk/util-utf8-browser":"^3.109.0","@httptoolkit/websocket-stream":"^6.0.0","axios":"^0.24.0","buffer":"^6.0.3","cmake-js":"^6.3.2","crypto-js":"^4.0.0","mqtt":"^4.3.7","process":"^0.11.10","tar":"^6.1.11"}}')},9968:e=>{"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.0.3","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"require":"./lib/main.js","types":"./lib/main.d.ts","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^17.0.9","decache":"^4.6.1","dtslint":"^3.7.0","sinon":"^12.0.1","standard":"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2","tap":"^15.1.6","tar":"^6.1.11","typescript":"^4.5.4"},"engines":{"node":">=12"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=n(3607);module.exports=r})();