@beesolve/analytics-processor 0.2.5 → 0.2.6
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,2 +1,2 @@
|
|
|
1
1
|
/* CommonJS polyfills */import { fileURLToPath } from 'node:url';import { createRequire } from 'node:module';const __filename = fileURLToPath(import.meta.url);const __dirname = fileURLToPath(new URL('.', import.meta.url));const require = createRequire(import.meta.url);/* end of CommonJS polyfills */
|
|
2
|
-
import{a as vr}from"./chunk-U7KUF4SE.mjs";import"./chunk-VYXCTSUL.mjs";import{a as cr,c as lr,h as pr,i as fr,j as dr,k as yr,l as hr}from"./chunk-2C6L2MOS.mjs";import{b as Fn}from"./chunk-LB33VBGK.mjs";import{a as mr}from"./chunk-YY2HYMK3.mjs";import{A as oe,B as Wn,C as Ut,D as qn,E as zn,F as Hn,G as Xn,L as Jn,O as Qn,R as Zn,S as Yn,T as er,V as Ce,W as tr,a as De,aa as nr,b as hn,d as vn,f as xn,g as bn,h as In,ha as rr,i as gn,ja as ir,k as En,l as _n,n as Sn,na as sr,r as Nn,s as On,sa as or,u as Ln,w as Un,xa as ar,y as Mn,ya as ur,z as Bn}from"./chunk-C3D3OF2Y.mjs";import{i as Kn,j as Vn,k as jn}from"./chunk-YMGL4RSC.mjs";import{n as N,o as kn,p as wn,s as Cn,t as Rn,u as Pn,v as $n}from"./chunk-KRS5YV2Z.mjs";import{B as Gn,b as yn,d as Ot,e as Lt,g as ke,h as Tn,i as we,j as An,z as Dn}from"./chunk-3UGRDNDZ.mjs";import{e as fn,k as se,l as dn}from"./chunk-OC3UN3OS.mjs";import{a as r,b as ie,c as Os}from"./chunk-CFZ5JWD3.mjs";var Fr=ie((cp,Gr)=>{function B(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}r(B,"Iterator");B.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e};typeof Symbol<"u"&&(B.prototype[Symbol.iterator]=function(){return this});B.of=function(){var e=arguments,t=e.length,n=0;return new B(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})};B.empty=function(){var e=new B(null);return e.done=!0,e};B.is=function(e){return e instanceof B?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"};Gr.exports=B});var qt=ie((pp,Wr)=>{var Kr=typeof ArrayBuffer<"u",Vr=typeof Symbol<"u";function jr(e,t){var n,i,s,o,a;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if(typeof t!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||Kr&&ArrayBuffer.isView(e)||typeof e=="string"||e.toString()==="[object Arguments]"){for(s=0,o=e.length;s<o;s++)t(e[s],s);return}if(typeof e.forEach=="function"){e.forEach(t);return}if(Vr&&Symbol.iterator in e&&typeof e.next!="function"&&(e=e[Symbol.iterator]()),typeof e.next=="function"){for(n=e,s=0;a=n.next(),a.done!==!0;)t(a.value,s),s++;return}for(i in e)e.hasOwnProperty(i)&&t(e[i],i)}r(jr,"forEach");jr.forEachWithNullKeys=function(e,t){var n,i,s,o,a;if(!e)throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");if(typeof t!="function")throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");if(Array.isArray(e)||Kr&&ArrayBuffer.isView(e)||typeof e=="string"||e.toString()==="[object Arguments]"){for(s=0,o=e.length;s<o;s++)t(e[s],null);return}if(e instanceof Set){e.forEach(function(c){t(c,null)});return}if(typeof e.forEach=="function"){e.forEach(t);return}if(Vr&&Symbol.iterator in e&&typeof e.next!="function"&&(e=e[Symbol.iterator]()),typeof e.next=="function"){for(n=e,s=0;a=n.next(),a.done!==!0;)t(a.value,null),s++;return}for(i in e)e.hasOwnProperty(i)&&t(e[i],i)};Wr.exports=jr});var zt=ie(O=>{var eo=Math.pow(2,8)-1,to=Math.pow(2,16)-1,no=Math.pow(2,32)-1,ro=Math.pow(2,7)-1,io=Math.pow(2,15)-1,so=Math.pow(2,31)-1;O.getPointerArray=function(e){var t=e-1;return t<=eo?Uint8Array:t<=to?Uint16Array:t<=no?Uint32Array:Float64Array};O.getSignedPointerArray=function(e){var t=e-1;return t<=ro?Int8Array:t<=io?Int16Array:t<=so?Int32Array:Float64Array};O.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var oo={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};O.getMinimalRepresentation=function(e,t){var n=null,i=0,s,o,a,c,d;for(c=0,d=e.length;c<d;c++)a=t?t(e[c]):e[c],o=O.getNumberType(a),s=oo[o.name],s>i&&(i=s,n=o);return n};O.isTypedArray=function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)};O.concat=function(){var e=0,t,n,i;for(t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=new arguments[0].constructor(e);for(t=0,n=0;t<i;t++)s.set(arguments[t],n),n+=arguments[t].length;return s};O.indices=function(e){for(var t=O.getPointerArray(e),n=new t(e),i=0;i<e;i++)n[i]=i;return n}});var Hr=ie(me=>{var qr=qt(),zr=zt();function ao(e){return Array.isArray(e)||zr.isTypedArray(e)}r(ao,"isArrayLike");function Ht(e){if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size}r(Ht,"guessLength");function uo(e){var t=Ht(e),n=typeof t=="number"?new Array(t):[],i=0;return qr(e,function(s){n[i++]=s}),n}r(uo,"toArray");function co(e){var t=Ht(e),n=typeof t=="number"?zr.getPointerArray(t):Array,i=typeof t=="number"?new Array(t):[],s=typeof t=="number"?new n(t):[],o=0;return qr(e,function(a){i[o]=a,s[o]=o++}),[i,s]}r(co,"toArrayWithIndices");me.isArrayLike=ao;me.guessLength=Ht;me.toArray=uo;me.toArrayWithIndices=co});var Jr=ie((hp,Xr)=>{var Xt=Fr(),lo=qt(),po=zt(),mo=Hr();function I(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");var i=po.getPointerArray(n);this.forward=new i(n),this.backward=new i(n),this.K=typeof e=="function"?new e(n):new Array(n),this.V=typeof t=="function"?new t(n):new Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}r(I,"LRUCache");I.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}};I.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],i=this.forward[e];return this.tail===e?this.tail=n:this.backward[i]=n,this.forward[n]=i,this.backward[t]=e,this.head=e,this.forward[e]=t,this};I.prototype.set=function(e,t){var n=this.items[e];if(typeof n<"u"){this.splayOnTop(n),this.V[n]=t;return}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};I.prototype.setpop=function(e,t){var n=null,i=null,s=this.items[e];return typeof s<"u"?(this.splayOnTop(s),n=this.V[s],this.V[s]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?s=this.size++:(s=this.tail,this.tail=this.backward[s],n=this.V[s],i=this.K[s],delete this.items[this.K[s]]),this.items[e]=s,this.K[s]=e,this.V[s]=t,this.forward[s]=this.head,this.backward[this.head]=s,this.head=s,i?{evicted:!0,key:i,value:n}:null)};I.prototype.has=function(e){return e in this.items};I.prototype.get=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.splayOnTop(t),this.V[t]};I.prototype.peek=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.V[t]};I.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,i=this.size,s=this.head,o=this.K,a=this.V,c=this.forward;n<i;)e.call(t,a[s],o[s],this),s=c[s],n++};I.prototype.keys=function(){var e=0,t=this.size,n=this.head,i=this.K,s=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var o=i[n];return e++,e<t&&(n=s[n]),{done:!1,value:o}})};I.prototype.values=function(){var e=0,t=this.size,n=this.head,i=this.V,s=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var o=i[n];return e++,e<t&&(n=s[n]),{done:!1,value:o}})};I.prototype.entries=function(){var e=0,t=this.size,n=this.head,i=this.K,s=this.V,o=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var a=i[n],c=s[n];return e++,e<t&&(n=o[n]),{done:!1,value:[a,c]}})};typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.entries);I.prototype.inspect=function(){for(var e=new Map,t=this.entries(),n;n=t.next(),!n.done;)e.set(n.value[0],n.value[1]);return Object.defineProperty(e,"constructor",{value:I,enumerable:!1}),e};typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect);I.from=function(e,t,n,i){if(arguments.length<2){if(i=mo.guessLength(e),typeof i!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(i=t,t=null,n=null);var s=new I(t,n,i);return lo(e,function(o,a){s.set(a,o)}),s};Xr.exports=I});var Re,Ls={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Mt(e){return!e&&!Re?Ls:{lang:e?.lang??Re?.lang,message:e?.message,abortEarly:e?.abortEarly??Re?.abortEarly,abortPipeEarly:e?.abortPipeEarly??Re?.abortPipeEarly}}r(Mt,"getGlobalConfig");var Us;function Ms(e){return Us?.get(e)}r(Ms,"getGlobalMessage");var Bs;function Gs(e){return Bs?.get(e)}r(Gs,"getSchemaMessage");var Fs;function Ks(e,t){return Fs?.get(e)?.get(t)}r(Ks,"getSpecificMessage");function xr(e){let t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}r(xr,"_stringify");function ae(e,t,n,i,s){let o=s&&"input"in s?s.input:n.value,a=s?.expected??e.expects??null,c=s?.received??xr(o),d={kind:e.kind,type:e.type,input:o,expected:a,received:c,message:`Invalid ${t}: ${a?`Expected ${a} but r`:"R"}eceived ${c}`,requirement:e.requirement,path:s?.path,issues:s?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},g=e.kind==="schema",E=s?.message??e.message??Ks(e.reference,d.lang)??(g?Gs(d.lang):null)??i.message??Ms(d.lang);E!==void 0&&(d.message=typeof E=="function"?E(d):E),g&&(n.typed=!1),n.issues?n.issues.push(d):n.issues=[d]}r(ae,"_addIssue");function Vs(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}r(Vs,"_joinExpects");function ue(e){return e["~standard"]={version:1,vendor:"valibot",validate:r(t=>e["~run"]({value:t},Mt()),"validate")},e}r(ue,"_standardSchema");function js(e){if(e.path){let t="";for(let n of e.path)if(typeof n.key=="string"||typeof n.key=="number")t?t+=`.${n.key}`:t+=n.key;else return null;return t}return null}r(js,"getDotPath");var Ws=class extends Error{static{r(this,"ValiError")}constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};var gl=new RegExp("^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$","u");function qs(e,t,n){return typeof e.fallback=="function"?e.fallback(t,n):e.fallback}r(qs,"getFallback");function Pe(e){let t={};for(let n of e)if(n.path){let i=js(n);i?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,i)?t.nested[i].push(n.message):t.nested[i]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t}r(Pe,"flatten");function br(e,t,n){return typeof e.default=="function"?e.default(t,n):e.default}r(br,"getDefault");function b(e){return ue({kind:"schema",type:"number",reference:b,expects:"number",async:!1,message:e,"~run"(t,n){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:ae(this,"type",t,n),t}})}r(b,"number");function M(e,t){return ue({kind:"schema",type:"object",reference:M,expects:"Object",async:!1,entries:e,message:t,"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in this.entries){let a=this.entries[o];if(o in s||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let c=o in s?s[o]:br(a),d=a["~run"]({value:c},i);if(d.issues){let g={type:"object",origin:"value",input:s,key:o,value:c};for(let E of d.issues)E.path?E.path.unshift(g):E.path=[g],n.issues?.push(E);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}d.typed||(n.typed=!1),n.value[o]=d.value}else if(a.fallback!==void 0)n.value[o]=qs(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ae(this,"key",n,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),i.abortEarly))break}}else ae(this,"type",n,i);return n}})}r(M,"object");function C(e,t){return ue({kind:"schema",type:"optional",reference:C,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=br(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}})}r(C,"optional");function V(e,t){return ue({kind:"schema",type:"picklist",reference:V,expects:Vs(e.map(xr),"|"),async:!1,options:e,message:t,"~run"(n,i){return this.options.includes(n.value)?n.typed=!0:ae(this,"type",n,i),n}})}r(V,"picklist");function _(e){return ue({kind:"schema",type:"string",reference:_,expects:"string",async:!1,message:e,"~run"(t,n){return typeof t.value=="string"?t.typed=!0:ae(this,"type",t,n),t}})}r(_,"string");function Ir(e,t,n){let i=e["~run"]({value:t},Mt(n));if(i.issues)throw new Ws(i.issues);return i.value}r(Ir,"parse");function $e(e,t,n){let i=e["~run"]({value:t},Mt(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}r($e,"safeParse");var z=class e{static{r(this,"NumberValue")}value;constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let n=typeof t.valueOf()=="number"?t.valueOf():0;if(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER||Math.abs(n)===1/0||Number.isNaN(n))throw new Error(`NumberValue should not be initialized with an imprecise number=${n}. Use a string instead.`)}static from(t){return new e(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}};var ce=r((e,t)=>{if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return Oe();if(Array.isArray(e))return zs(e,t);if(e?.constructor?.name==="Set")return Hs(e,t);if(e?.constructor?.name==="Map")return Xs(e,t);if(e?.constructor?.name==="Object"||!e.constructor&&typeof e=="object")return gr(e,t);if(Dr(e))return e.length===0&&t?.convertEmptyValues?Oe():_r(e);if(typeof e=="boolean"||e?.constructor?.name==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||e?.constructor?.name==="Number")return Ar(e,t);if(e instanceof z)return e.toAttributeValue();if(typeof e=="bigint")return Tr(e);if(typeof e=="string"||e?.constructor?.name==="String")return e.length===0&&t?.convertEmptyValues?Oe():Sr(e);if(t?.convertClassInstanceToMap&&typeof e=="object")return gr(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),zs=r((e,t)=>({L:e.filter(n=>typeof n!="function"&&(!t?.removeUndefinedValues||t?.removeUndefinedValues&&n!==void 0)).map(n=>ce(n,t))}),"convertToListAttr"),Hs=r((e,t)=>{let n=t?.removeUndefinedValues?new Set([...e].filter(s=>s!==void 0)):e;if(!t?.removeUndefinedValues&&n.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(n.size===0){if(t?.convertEmptyValues)return Oe();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let i=n.values().next().value;if(i instanceof z)return{NS:Array.from(n).map(s=>s.toString())};if(typeof i=="number")return{NS:Array.from(n).map(s=>Ar(s,t)).map(s=>s.N)};if(typeof i=="bigint")return{NS:Array.from(n).map(Tr).map(s=>s.N)};if(typeof i=="string")return{SS:Array.from(n).map(Sr).map(s=>s.S)};if(Dr(i))return{BS:Array.from(n).map(_r).map(s=>s.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),Xs=r((e,t)=>({M:(n=>{let i={};for(let[s,o]of n)typeof o!="function"&&(o!==void 0||!t?.removeUndefinedValues)&&(i[s]=ce(o,t));return i})(e)}),"convertToMapAttrFromIterable"),gr=r((e,t)=>({M:(n=>{let i={};for(let s in n){let o=n[s];typeof o!="function"&&(o!==void 0||!t?.removeUndefinedValues)&&(i[s]=ce(o,t))}return i})(e)}),"convertToMapAttrFromEnumerableProps"),Oe=r(()=>({NULL:!0}),"convertToNullAttr"),_r=r(e=>({B:e}),"convertToBinaryAttr"),Sr=r(e=>({S:e.toString()}),"convertToStringAttr"),Tr=r(e=>({N:e.toString()}),"convertToBigIntAttr"),Er=r(e=>{throw new Error(`${e} Use NumberValue from @aws-sdk/lib-dynamodb.`)},"validateBigIntAndThrow"),Ar=r((e,t)=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(n=>n.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return t?.allowImpreciseNumbers||(Number(e)>Number.MAX_SAFE_INTEGER?Er(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):Number(e)<Number.MIN_SAFE_INTEGER&&Er(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`)),{N:e.toString()}},"convertToNumberAttr"),Dr=r(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e?.constructor?t.includes(e.constructor.name):!1},"isBinary");var le=r((e,t)=>{for(let[n,i]of Object.entries(e))if(i!==void 0)switch(n){case"NULL":return null;case"BOOL":return!!i;case"N":return kr(i,t);case"B":return Cr(i);case"S":return wr(i);case"L":return Js(i,t);case"M":return Qs(i,t);case"NS":return new Set(i.map(s=>kr(s,t)));case"BS":return new Set(i.map(Cr));case"SS":return new Set(i.map(wr));default:throw new Error(`Unsupported type passed: ${n}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),kr=r((e,t)=>{if(typeof t?.wrapNumbers=="function")return t?.wrapNumbers(e);if(t?.wrapNumbers)return z.from(e);let n=Number(e),i=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&!i.includes(n))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return n},"convertNumber"),wr=r(e=>e,"convertString"),Cr=r(e=>e,"convertBinary"),Js=r((e,t)=>e.map(n=>le(n,t)),"convertList"),Qs=r((e,t)=>Object.entries(e).reduce((n,[i,s])=>(n[i]=le(s,t),n),{}),"convertMap");function Bt(e,t){let n=ce(e,t),[i,s]=Object.entries(n)[0];switch(i){case"M":case"L":return t?.convertTopLevelContainer?n:s;default:return n}}r(Bt,"marshall");var Gt=r((e,t)=>t?.convertWithoutMapWrapper?le(e,t):le({M:e},t),"unmarshall");var Z=null,m={},A=[],Rr="*",Le=r((e,t,n)=>{if(e!==void 0){if(n==null)return t(e);{let i=Object.keys(n),s=i.length===1&&i[0]===Rr,o=i.length>=1&&!s,a=i.length===0;if(o)return Ft(e,t,n);if(a)return Zs(e,t,Z);if(s)return Object.entries(e??{}).reduce((c,[d,g])=>(typeof g!="function"&&(c[d]=Le(g,t,n[Rr])),c),Array.isArray(e)?[]:{})}}},"processObj"),Ft=r((e,t,n)=>{let i;if(Array.isArray(e))i=e.filter(s=>typeof s!="function");else{i={};for(let[s,o]of Object.entries(e))typeof o!="function"&&(i[s]=o)}for(let[s,o]of Object.entries(n)){if(typeof e[s]=="function")continue;let a=Le(e[s],t,o);a!==void 0&&typeof a!="function"&&(i[s]=a)}return i},"processKeysInObj"),Zs=r((e,t,n)=>Array.isArray(e)?e.filter(i=>typeof i!="function").map(i=>Le(i,t,n)):Object.entries(e).reduce((i,[s,o])=>{if(typeof o=="function")return i;let a=Le(o,t,n);return a!==void 0&&typeof a!="function"&&(i[s]=a),i},{}),"processAllKeysInObj"),Pr=r((e,t,n)=>Ft(e,r(s=>Bt(s,n),"marshallFunc"),t),"marshallInput"),$r=r((e,t,n)=>Ft(e,r(s=>Gt(s,n),"unmarshallFunc"),t),"unmarshallOutput");var x=class extends hn{static{r(this,"DynamoDBDocumentClientCommand")}addMarshallingMiddleware(t){let{marshallOptions:n={},unmarshallOptions:i={}}=t.translateConfig||{};n.convertTopLevelContainer=n.convertTopLevelContainer??!0,i.convertWithoutMapWrapper=i.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((s,o)=>async a=>(Xn(o,"DDB_MAPPER","d"),s({...a,input:Pr(a.input,this.inputKeyNodes,n)})),{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((s,o)=>async a=>{let c=await s(a);return c.output=$r(c.output,this.outputKeyNodes,i),c},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}};var Ue="preferred",Ys=["disabled","preferred","required"];function pe(e){return Ys.includes(e)}r(pe,"validateAccountIdEndpointMode");var Kt=r(e=>{let{accountIdEndpointMode:t}=e,n=se(t??Ue);return Object.assign(e,{accountIdEndpointMode:r(async()=>{let i=await n();if(!pe(i))throw new Error(`Invalid value for accountIdEndpointMode: ${i}. Valid values are: "required", "preferred", "disabled".`);return i},"accountIdEndpointMode")})},"resolveAccountIdEndpointModeConfig");var Nr="Invalid AccountIdEndpointMode value",Or=r(e=>{throw new Error(e)},"_throw"),Lr="AWS_ACCOUNT_ID_ENDPOINT_MODE",Ur="account_id_endpoint_mode",Vt={environmentVariableSelector:r(e=>{let t=e[Lr];return t&&!pe(t)&&Or(Nr),t},"environmentVariableSelector"),configFileSelector:r(e=>{let t=e[Ur];return t&&!pe(t)&&Or(Nr),t},"configFileSelector"),default:Ue};var Mr=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],jt="endpoint_discovery_enabled",Br=r(e=>["false","0"].indexOf(e)>=0,"isFalsy"),Wt={environmentVariableSelector:r(e=>{for(let t=0;t<Mr.length;t++){let n=Mr[t];if(n in e){let i=e[n];if(i==="")throw Error(`Environment variable ${n} can't be empty of undefined, got "${i}"`);return!Br(i)}}},"environmentVariableSelector"),configFileSelector:r(e=>{if(jt in e){let t=e[jt];if(t===void 0)throw Error(`Shared config entry ${jt} can't be undefined, got "${t}"`);return!Br(t)}},"configFileSelector"),default:void 0};var Qr=Os(Jr());var fe=class{static{r(this,"EndpointCache")}cache;constructor(t){this.cache=new Qr.default(t)}getEndpoint(t){let n=this.get(t);if(!n||n.length===0)return;let i=n.map(s=>s.Address);return i[Math.floor(Math.random()*i.length)]}get(t){if(!this.has(t))return;let n=this.cache.get(t);if(!n)return;let i=Date.now(),s=n.filter(o=>i<o.Expires);if(s.length===0){this.delete(t);return}return s}set(t,n){let i=Date.now();this.cache.set(t,n.map(({Address:s,CachePeriodInMinutes:o})=>({Address:s,Expires:i+o*60*1e3})))}delete(t){this.cache.set(t,[])}has(t){if(!this.cache.has(t))return!1;let n=this.cache.peek(t);return n?n.length>0:!1}clear(){this.cache.clear()}};var Jt=r((e,{endpointDiscoveryCommandCtor:t})=>{let{endpointCacheSize:n,endpointDiscoveryEnabled:i,endpointDiscoveryEnabledProvider:s}=e;return Object.assign(e,{endpointDiscoveryCommandCtor:t,endpointCache:new fe(n??1e3),endpointDiscoveryEnabled:i!==void 0?()=>Promise.resolve(i):s,isClientEndpointDiscoveryEnabled:i!==void 0})},"resolveEndpointDiscoveryConfig");var Zr=r(async(e,t,n)=>({operation:fn(t).operation,region:await se(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),"defaultDynamoDBHttpAuthSchemeParametersProvider");function fo(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"dynamodb",region:e.region},propertiesExtractor:r((t,n)=>({signingProperties:{config:t,context:n}}),"propertiesExtractor")}}r(fo,"createAwsAuthSigv4HttpAuthOption");var Yr=r(e=>{let t=[];switch(e.operation){default:t.push(fo(e))}return t},"defaultDynamoDBHttpAuthSchemeProvider"),ei=r(e=>{let t=pr(e);return Object.assign(t,{authSchemePreference:se(e.authSchemePreference??[])})},"resolveHttpAuthSchemeConfig");var ti=r(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"dynamodb"}),"resolveClientEndpointParameters"),ni={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},AccountId:{type:"builtInParams",name:"accountId"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"},AccountIdEndpointMode:{type:"builtInParams",name:"accountIdEndpointMode"}};var D=_n(ni,"DynamoDB_20120810","DynamoDBClient",Bn),ri={};var j={ResourceArn:{type:"contextParams",name:"TableName"}};var ii={ResourceArnList:{type:"operationContextParams",get:r(e=>e?.TransactItems?.map(t=>[t?.ConditionCheck?.TableName,t?.Put?.TableName,t?.Delete?.TableName,t?.Update?.TableName].filter(n=>n)).flat(),"get")}},k=r((e,t,n,i)=>[],"_mw0");var p=class e extends vn{static{r(this,"DynamoDBServiceException")}static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.dynamodb#DynamoDBServiceException";constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var Me=class e extends p{static{r(this,"BackupInUseException")}static shapeId="com.amazonaws.dynamodb#BackupInUseException";name="BackupInUseException";$fault="client";constructor(t){super({name:"BackupInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Be=class e extends p{static{r(this,"BackupNotFoundException")}static shapeId="com.amazonaws.dynamodb#BackupNotFoundException";name="BackupNotFoundException";$fault="client";constructor(t){super({name:"BackupNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ge=class e extends p{static{r(this,"InternalServerError")}static shapeId="com.amazonaws.dynamodb#InternalServerError";name="InternalServerError";$fault="server";constructor(t){super({name:"InternalServerError",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},Fe=class e extends p{static{r(this,"RequestLimitExceeded")}static shapeId="com.amazonaws.dynamodb#RequestLimitExceeded";name="RequestLimitExceeded";$fault="client";ThrottlingReasons;constructor(t){super({name:"RequestLimitExceeded",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.ThrottlingReasons=t.ThrottlingReasons}},Ke=class e extends p{static{r(this,"ThrottlingException")}static shapeId="com.amazonaws.dynamodb#ThrottlingException";name="ThrottlingException";$fault="client";throttlingReasons;constructor(t){super({name:"ThrottlingException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.throttlingReasons=t.throttlingReasons}},Ve=class e extends p{static{r(this,"InvalidEndpointException")}static shapeId="com.amazonaws.dynamodb#InvalidEndpointException";name="InvalidEndpointException";$fault="client";Message;constructor(t){super({name:"InvalidEndpointException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},je=class e extends p{static{r(this,"ProvisionedThroughputExceededException")}static shapeId="com.amazonaws.dynamodb#ProvisionedThroughputExceededException";name="ProvisionedThroughputExceededException";$fault="client";ThrottlingReasons;constructor(t){super({name:"ProvisionedThroughputExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.ThrottlingReasons=t.ThrottlingReasons}},We=class e extends p{static{r(this,"ResourceNotFoundException")}static shapeId="com.amazonaws.dynamodb#ResourceNotFoundException";name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},qe=class e extends p{static{r(this,"ItemCollectionSizeLimitExceededException")}static shapeId="com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException";name="ItemCollectionSizeLimitExceededException";$fault="client";constructor(t){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ze=class e extends p{static{r(this,"ReplicatedWriteConflictException")}static shapeId="com.amazonaws.dynamodb#ReplicatedWriteConflictException";name="ReplicatedWriteConflictException";$fault="client";$retryable={};constructor(t){super({name:"ReplicatedWriteConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},He=class e extends p{static{r(this,"ContinuousBackupsUnavailableException")}static shapeId="com.amazonaws.dynamodb#ContinuousBackupsUnavailableException";name="ContinuousBackupsUnavailableException";$fault="client";constructor(t){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Xe=class e extends p{static{r(this,"LimitExceededException")}static shapeId="com.amazonaws.dynamodb#LimitExceededException";name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Je=class e extends p{static{r(this,"TableInUseException")}static shapeId="com.amazonaws.dynamodb#TableInUseException";name="TableInUseException";$fault="client";constructor(t){super({name:"TableInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Qe=class e extends p{static{r(this,"TableNotFoundException")}static shapeId="com.amazonaws.dynamodb#TableNotFoundException";name="TableNotFoundException";$fault="client";constructor(t){super({name:"TableNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ze=class e extends p{static{r(this,"GlobalTableAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#GlobalTableAlreadyExistsException";name="GlobalTableAlreadyExistsException";$fault="client";constructor(t){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ye=class e extends p{static{r(this,"ResourceInUseException")}static shapeId="com.amazonaws.dynamodb#ResourceInUseException";name="ResourceInUseException";$fault="client";constructor(t){super({name:"ResourceInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},et=class e extends p{static{r(this,"TransactionConflictException")}static shapeId="com.amazonaws.dynamodb#TransactionConflictException";name="TransactionConflictException";$fault="client";constructor(t){super({name:"TransactionConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},tt=class e extends p{static{r(this,"PolicyNotFoundException")}static shapeId="com.amazonaws.dynamodb#PolicyNotFoundException";name="PolicyNotFoundException";$fault="client";constructor(t){super({name:"PolicyNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},nt=class e extends p{static{r(this,"ExportNotFoundException")}static shapeId="com.amazonaws.dynamodb#ExportNotFoundException";name="ExportNotFoundException";$fault="client";constructor(t){super({name:"ExportNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},rt=class e extends p{static{r(this,"GlobalTableNotFoundException")}static shapeId="com.amazonaws.dynamodb#GlobalTableNotFoundException";name="GlobalTableNotFoundException";$fault="client";constructor(t){super({name:"GlobalTableNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},it=class e extends p{static{r(this,"ImportNotFoundException")}static shapeId="com.amazonaws.dynamodb#ImportNotFoundException";name="ImportNotFoundException";$fault="client";constructor(t){super({name:"ImportNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},st=class e extends p{static{r(this,"DuplicateItemException")}static shapeId="com.amazonaws.dynamodb#DuplicateItemException";name="DuplicateItemException";$fault="client";constructor(t){super({name:"DuplicateItemException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ot=class e extends p{static{r(this,"IdempotentParameterMismatchException")}static shapeId="com.amazonaws.dynamodb#IdempotentParameterMismatchException";name="IdempotentParameterMismatchException";$fault="client";Message;constructor(t){super({name:"IdempotentParameterMismatchException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},at=class e extends p{static{r(this,"TransactionInProgressException")}static shapeId="com.amazonaws.dynamodb#TransactionInProgressException";name="TransactionInProgressException";$fault="client";Message;constructor(t){super({name:"TransactionInProgressException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},ut=class e extends p{static{r(this,"ExportConflictException")}static shapeId="com.amazonaws.dynamodb#ExportConflictException";name="ExportConflictException";$fault="client";constructor(t){super({name:"ExportConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ct=class e extends p{static{r(this,"InvalidExportTimeException")}static shapeId="com.amazonaws.dynamodb#InvalidExportTimeException";name="InvalidExportTimeException";$fault="client";constructor(t){super({name:"InvalidExportTimeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},lt=class e extends p{static{r(this,"PointInTimeRecoveryUnavailableException")}static shapeId="com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException";name="PointInTimeRecoveryUnavailableException";$fault="client";constructor(t){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},pt=class e extends p{static{r(this,"ImportConflictException")}static shapeId="com.amazonaws.dynamodb#ImportConflictException";name="ImportConflictException";$fault="client";constructor(t){super({name:"ImportConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},mt=class e extends p{static{r(this,"TableAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#TableAlreadyExistsException";name="TableAlreadyExistsException";$fault="client";constructor(t){super({name:"TableAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ft=class e extends p{static{r(this,"InvalidRestoreTimeException")}static shapeId="com.amazonaws.dynamodb#InvalidRestoreTimeException";name="InvalidRestoreTimeException";$fault="client";constructor(t){super({name:"InvalidRestoreTimeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},dt=class e extends p{static{r(this,"ReplicaAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#ReplicaAlreadyExistsException";name="ReplicaAlreadyExistsException";$fault="client";constructor(t){super({name:"ReplicaAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},yt=class e extends p{static{r(this,"ReplicaNotFoundException")}static shapeId="com.amazonaws.dynamodb#ReplicaNotFoundException";name="ReplicaNotFoundException";$fault="client";constructor(t){super({name:"ReplicaNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ht=class e extends p{static{r(this,"IndexNotFoundException")}static shapeId="com.amazonaws.dynamodb#IndexNotFoundException";name="IndexNotFoundException";$fault="client";constructor(t){super({name:"IndexNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},vt=class e extends p{static{r(this,"ConditionalCheckFailedException")}static shapeId="com.amazonaws.dynamodb#ConditionalCheckFailedException";name="ConditionalCheckFailedException";$fault="client";Item;constructor(t){super({name:"ConditionalCheckFailedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Item=t.Item}},xt=class e extends p{static{r(this,"TransactionCanceledException")}static shapeId="com.amazonaws.dynamodb#TransactionCanceledException";name="TransactionCanceledException";$fault="client";Message;CancellationReasons;constructor(t){super({name:"TransactionCanceledException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message,this.CancellationReasons=t.CancellationReasons}};var yo="Action";var ho="AttributeMap";var Qt="AttributesToGet",oi="AttributeUpdates",vo="AttributeValue",Zt="AttributeValueList",xo="AttributeValueUpdate",bo="Address",Io="Attributes";var go="BackupInUseException";var Eo="BackupNotFoundException",_o="BOOL";var So="BS";var To="B",Ao="Code";var Do="ContinuousBackupsUnavailableException",Y="ConsumedCapacity",ko="ConditionalCheckFailedException",wo="ConsumedCapacityMultiple",ai="ConditionCheck";var de="ConditionExpression";var ui="ComparisonOperator",Yt="ConditionalOperator";var Co="CachePeriodInMinutes",Ro="CancellationReasons";var Po="CancellationReasonList",$o="ConfirmRemoveSelfResourceAccess",No="ClientRequestToken",Oo="CancellationReason",en="ConsistentRead";var ci="CapacityUnits";var Lo="Capacity",Uo="Condition",li="Count";var Mo="DescribeEndpoints";var Bo="DescribeEndpointsRequest",Go="DescribeEndpointsResponse";var Fo="DuplicateItemException";var pi="Delete";var Ko="ExpectedAttributeMap",W="ExpressionAttributeNames",H="ExpressionAttributeValues",Vo="ExpressionAttributeValueMap",jo="ExpectedAttributeValue";var Wo="ExportConflictException";var qo="ExportNotFoundException";var zo="ExpectedRevisionId";var mi="ExclusiveStartKey";var fi="Endpoints";var Ho="Endpoint",Xo="Expected",Jo="Exists";var Qo="FilterConditionMap";var di="FilterExpression";var Zo="GetItem",Yo="GetItemInput",ea="GetItemOutput";var ta="GlobalSecondaryIndexes";var na="GlobalTableAlreadyExistsException";var ra="GlobalTableNotFoundException";var bt="Item";var ia="ImportConflictException",sa="ItemCollectionKey",oa="ItemCollectionKeyAttributeMap",tn="ItemCollectionMetrics",aa="ItemCollectionMetricsMultiple",ua="ItemCollectionMetricsPerTable",ca="ItemCollectionSizeLimitExceededException";var la="InvalidEndpointException";var pa="InvalidExportTimeException";var ma="ItemList",yi="IndexName",fa="ImportNotFoundException",da="IndexNotFoundException",ya="IdempotentParameterMismatchException";var ha="InvalidRestoreTimeException";var va="InternalServerError";var hi="Items",ee="Key";var vi="KeyConditions",xa="KeyConditionExpression";var xi="Limit",ba="ListAttributeValue";var Ia="LimitExceededException";var bi="LastEvaluatedKey";var ga="LocalSecondaryIndexes";var Ea="L",ye="Message",_a="MapAttributeValue";var Sa="M",Ta="N";var Aa="NS";var Da="NULL";var nn="ProjectionExpression";var ka="PutItemInputAttributeMap";var wa="PointInTimeRecoveryUnavailableException";var Ca="PolicyNotFoundException";var Ra="PutResourcePolicyInput";var Pa="ProvisionedThroughputExceededException";var $a="Policy";var Ii="Put",Na="Query",Oa="QueryFilter",La="QueryInput",Ua="QueryOutput";var Ma="ResourceArn",Ba="ReplicaAlreadyExistsException";var he="ReturnConsumedCapacity",gi="ReadCapacityUnits";var Ei="ReturnItemCollectionMetrics";var Ga="ResourceInUseException";var Fa="RequestLimitExceeded";var Ka="ReplicaNotFoundException",Va="ResourceNotFoundException";var ja="ReturnValues",ve="ReturnValuesOnConditionCheckFailure",Wa="ReplicatedWriteConflictException";var _i="ScannedCount";var qa="SizeEstimateRangeGB",za="ScanFilter",Ha="ScanInput";var Xa="SecondaryIndexesCapacityMap",Ja="ScanIndexForward";var Qa="ScanOutput";var Za="SS";var Ya="S";var eu="Scan",Si="Select",tu="Segment";var nu="Table";var ru="TableAlreadyExistsException";var iu="TransactionCanceledException",su="TransactionConflictException";var ou="ThrottlingException";var au="TransactionInProgressException",uu="TableInUseException",cu="TransactItems";var G="TableName",lu="TableNotFoundException";var Ti="ThrottlingReasons";var pu="ThrottlingReasonList";var mu="ThrottlingReason";var fu="TotalSegments";var du="TransactWriteItem",yu="TransactWriteItemsInput",hu="TransactWriteItemList",vu="TransactWriteItemsOutput",xu="TransactWriteItems";var Ai="Update";var Di="UpdateExpression";var bu="UpdateItemInput",Iu="UpdateItemOutput",gu="UpdateItem";var ki="Value";var Eu="VectorCapacity",_u="VectorIndexes",Su="VectorIndexesCapacityMap";var Tu="VectorSearchRequestBytes",Au="VectorWriteRequestBytes",wi="WriteCapacityUnits";var Du="awsQueryError",h="client",y="error",Ci="httpError",ku="httpHeader",v="message",wu="reason",Cu="resource",Ri="smithy.ts.sdk.synthetic.com.amazonaws.dynamodb",Ru="server",Pu="throttlingReasons",$u="x-amz-confirm-remove-self-resource-access",u="com.amazonaws.dynamodb",Pi=new Lt(Ri),Nu=[-3,Ri,"DynamoDBServiceException",0,[],[]];Pi.registerError(Nu,p);var f=new Lt(u),Ou=[-3,u,go,{[y]:h},[v],[0]];f.registerError(Ou,Me);var Lu=[-3,u,Eo,{[y]:h},[v],[0]];f.registerError(Lu,Be);var Uu=[-3,u,ko,{[y]:h},[v,bt],[0,()=>be]];f.registerError(Uu,vt);var Mu=[-3,u,Do,{[y]:h},[v],[0]];f.registerError(Mu,He);var Bu=[-3,u,Fo,{[y]:h},[v],[0]];f.registerError(Bu,st);var Gu=[-3,u,Wo,{[y]:h},[v],[0]];f.registerError(Gu,ut);var Fu=[-3,u,qo,{[y]:h},[v],[0]];f.registerError(Fu,nt);var Ku=[-3,u,na,{[y]:h},[v],[0]];f.registerError(Ku,Ze);var Vu=[-3,u,ra,{[y]:h},[v],[0]];f.registerError(Vu,rt);var ju=[-3,u,ya,{[y]:h},[ye],[0]];f.registerError(ju,ot);var Wu=[-3,u,ia,{[y]:h},[v],[0]];f.registerError(Wu,pt);var qu=[-3,u,fa,{[y]:h},[v],[0]];f.registerError(qu,it);var zu=[-3,u,da,{[y]:h},[v],[0]];f.registerError(zu,ht);var Hu=[-3,u,va,{[y]:Ru},[v],[0]];f.registerError(Hu,Ge);var Xu=[-3,u,la,{[y]:h,[Ci]:421},[ye],[0]];f.registerError(Xu,Ve);var Ju=[-3,u,pa,{[y]:h},[v],[0]];f.registerError(Ju,ct);var Qu=[-3,u,ha,{[y]:h},[v],[0]];f.registerError(Qu,ft);var Zu=[-3,u,ca,{[y]:h},[v],[0]];f.registerError(Zu,qe);var Yu=[-3,u,Ia,{[y]:h},[v],[0]];f.registerError(Yu,Xe);var ec=[-3,u,wa,{[y]:h},[v],[0]];f.registerError(ec,lt);var tc=[-3,u,Ca,{[y]:h},[v],[0]];f.registerError(tc,tt);var nc=[-3,u,Pa,{[y]:h},[v,Ti],[0,()=>rn]];f.registerError(nc,je);var rc=[-3,u,Ba,{[y]:h},[v],[0]];f.registerError(rc,dt);var ic=[-3,u,Ka,{[y]:h},[v],[0]];f.registerError(ic,yt);var sc=[-3,u,Wa,{[y]:h},[v],[0]];f.registerError(sc,ze);var oc=[-3,u,Fa,{[y]:h},[v,Ti],[0,()=>rn]];f.registerError(oc,Fe);var ac=[-3,u,Ga,{[y]:h},[v],[0]];f.registerError(ac,Ye);var uc=[-3,u,Va,{[y]:h},[v],[0]];f.registerError(uc,We);var cc=[-3,u,ru,{[y]:h},[v],[0]];f.registerError(cc,mt);var lc=[-3,u,uu,{[y]:h},[v],[0]];f.registerError(lc,Je);var pc=[-3,u,lu,{[y]:h},[v],[0]];f.registerError(pc,Qe);var mc=[-3,u,ou,{[Du]:["Throttling",400],[y]:h,[Ci]:400},[v,Pu],[0,()=>rn]];f.registerError(mc,Ke);var fc=[-3,u,iu,{[y]:h},[ye,Ro],[0,()=>Bc]];f.registerError(fc,xt);var dc=[-3,u,su,{[y]:h},[v],[0]];f.registerError(dc,et);var yc=[-3,u,au,{[y]:h},[ye],[0]];f.registerError(yc,at);var $i=[Pi,f];var hc=[3,u,xo,0,[ki,yo],[()=>L,0]];var vc=[3,u,Oo,0,[bt,Ao,ye],[()=>be,0,0]],Ni=[3,u,Lo,0,[gi,wi,ci],[1,1,1]],Oi=[3,u,Uo,0,[ui,Zt],[0,()=>Ui],1],xc=[3,u,ai,0,[ee,G,de,W,H,ve],[()=>F,0,0,128,()=>X,0],3],xe=[3,u,Y,0,[G,ci,gi,wi,nu,ga,ta,_u],[0,1,1,1,()=>Ni,()=>si,()=>si,()=>Zc]];var bc=[3,u,pi,0,[ee,G,de,W,H,ve],[()=>F,0,0,128,()=>X,0],2];var Ic=[3,u,Bo,0,[],[]],gc=[3,u,Go,0,[fi],[()=>Fc],1];var Ec=[3,u,Ho,0,[bo,Co],[0,1],2];var _c=[3,u,jo,0,[ki,Jo,ui,Zt],[()=>L,2,0,()=>Ui]];var Sc=[3,u,Yo,0,[G,ee,Qt,en,he,nn,W],[0,()=>F,64,2,0,0,128],2],Tc=[3,u,ea,0,[bt,Y],[()=>be,()=>xe]];var Li=[3,u,tn,0,[sa,qa],[()=>zc,65]];var Ac=[3,u,Ii,0,[bt,G,de,W,H,ve],[()=>Qc,0,0,128,()=>X,0],2];var Hp=[3,u,Ra,0,[Ma,$a,zo,$o],[0,0,0,[2,{[ku]:$u}]],2];var Dc=[3,u,La,0,[G,yi,Si,Qt,xi,en,vi,Oa,Yt,Ja,mi,he,nn,di,xa,W,H],[0,0,0,64,1,2,()=>Xc,()=>Bi,0,2,()=>F,0,0,0,0,128,()=>X],1],kc=[3,u,Ua,0,[hi,li,_i,bi,Y],[()=>Mi,1,1,()=>F,()=>xe]];var wc=[3,u,Ha,0,[G,yi,Qt,xi,Si,za,Yt,mi,he,fu,tu,nn,di,W,H,en],[0,0,64,1,0,()=>Bi,0,()=>F,0,1,1,0,0,128,()=>X,2],1],Cc=[3,u,Qa,0,[hi,li,_i,bi,Y],[()=>Mi,1,1,()=>F,()=>xe]];var Rc=[3,u,mu,0,[wu,Cu],[0,0]];var Pc=[3,u,du,0,[ai,Ii,pi,Ai],[()=>xc,()=>Ac,()=>bc,()=>Oc]],$c=[3,u,yu,0,[cu,he,Ei,No],[()=>jc,0,0,[0,4]],1],Nc=[3,u,vu,0,[Y,tn],[()=>Gc,()=>Hc]];var Oc=[3,u,Ai,0,[ee,Di,G,de,W,H,ve],[()=>F,0,0,0,128,()=>X,0],3];var Lc=[3,u,bu,0,[G,ee,oi,Xo,Yt,ja,he,Ei,Di,de,W,H,ve],[0,()=>F,()=>Wc,()=>qc,0,0,0,0,0,0,128,()=>X,0],2],Uc=[3,u,Iu,0,[Io,Y,tn],[()=>be,()=>xe,()=>Li]];var Mc=[3,u,Eu,0,[Tu,Au],[1,1]];var Ui=[1,u,Zt,0,()=>L];var Bc=[1,u,Po,0,()=>vc],Gc=[1,u,wo,0,()=>xe];var Fc=[1,u,fi,0,()=>Ec];var Kc=[1,u,aa,0,()=>Li];var Mi=[1,u,ma,0,()=>be];var Vc=[1,u,ba,0,()=>L];var rn=[1,u,pu,0,()=>Rc];var jc=[1,u,hu,0,()=>Pc];var be=[2,u,ho,0,0,()=>L],Wc=[2,u,oi,0,0,()=>hc];var qc=[2,u,Ko,0,0,()=>_c];var X=[2,u,Vo,0,0,()=>L],Bi=[2,u,Qo,0,0,()=>Oi],zc=[2,u,oa,0,0,()=>L],Hc=[2,u,ua,0,0,()=>Kc],F=[2,u,ee,0,0,()=>L],Xc=[2,u,vi,0,0,()=>Oi],Jc=[2,u,_a,0,0,()=>L],Qc=[2,u,ka,0,0,()=>L],si=[2,u,Xa,0,0,()=>Ni],Zc=[2,u,Su,0,0,()=>Mc],L=[4,u,vo,0,[Ya,Ta,To,Za,Aa,So,Sa,Ea,Da,_o],[0,0,21,64,64,85,()=>Jc,()=>Vc,2,2]];var Gi=[9,u,Mo,0,()=>Ic,()=>gc];var Fi=[9,u,Zo,0,()=>Sc,()=>Tc];var Ki=[9,u,Na,0,()=>Dc,()=>kc];var Vi=[9,u,eu,0,()=>wc,()=>Cc];var ji=[9,u,xu,0,()=>$c,()=>Nc];var Wi=[9,u,gu,0,()=>Lc,()=>Uc];var It=class extends D(ri,k,"DescribeEndpoints",Gi){static{r(this,"DescribeEndpointsCommand")}};var qi={name:"@aws-sdk/client-dynamodb",version:"3.1150.0",description:"AWS SDK for JavaScript Dynamodb Client for Node.js, Browser and React Native",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dynamodb",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-dynamodb"},files:["dist-*/**"],sideEffects:!1,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service",test:"yarn g:vitest run --passWithNoTests","test:watch":"yarn g:vitest watch --passWithNoTests","test:integration":"yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch --passWithNoTests -c vitest.config.integ.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc -p tsconfig.test.json && node ./test/index-objects.spec.mjs"},dependencies:{"@aws-sdk/core":"^3.978.3","@aws-sdk/credential-provider-node":"^3.972.86","@aws-sdk/dynamodb-codec":"^3.973.48","@aws-sdk/middleware-endpoint-discovery":"^3.972.32","@aws-sdk/types":"^3.974.6","@smithy/core":"^3.35.2","@smithy/fetch-http-handler":"^5.8.0","@smithy/node-http-handler":"^4.12.1","@smithy/types":"^4.19.0",tslib:"^2.6.2"},devDependencies:{"@smithy/snapshot-testing":"^2.3.2","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~7.0.2",vitest:"^4.0.17"},engines:{node:">=20.0.0"}};var zi="com.amazonaws.dynamodb#AttributeValue",sn=class extends dr{static{r(this,"DynamoDBJsonShapeSerializer2")}writeValue(t,n,i){if(n!=null&&typeof n=="object"){let s=Ot.of(t);if(s.isStructSchema()&&s.getName(!0)===zi){this.writeAttributeValue(n);return}}super.writeValue(t,n,i)}writeAttributeValue(t){let n=this.serdeContext?.base64Encoder??we;this.writeAscii("{");let i=!0;for(let s in t){let o=t[s];if(o!=null)switch(i||this.writeAscii(","),i=!1,this.writeAsciiQuoted(s),this.writeAscii(":"),s){case"B":o instanceof Uint8Array?this.writeBase64(o):this.writeJsonString(o);break;case"BS":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++){c>0&&this.writeAscii(",");let d=a[c];d instanceof Uint8Array?this.writeBase64(d):this.writeJsonString(n(d))}}this.writeAscii("]");break;case"L":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++)c>0&&this.writeAscii(","),a[c]!=null?this.writeAttributeValue(a[c]):this.writeAscii("null")}this.writeAscii("]");break;case"M":this.writeAscii("{");{let a=o,c=!0;for(let d in a)a[d]!=null&&(c||this.writeAscii(","),c=!1,this.writeJsonString(d),this.writeAscii(":"),this.writeAttributeValue(a[d]))}this.writeAscii("}");break;case"SS":case"NS":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++)c>0&&this.writeAscii(","),this.writeJsonString(a[c])}this.writeAscii("]");break;case"S":case"N":this.writeJsonString(o);break;case"BOOL":this.writeAscii(o?"true":"false");break;case"NULL":this.writeAscii(o?"true":"false");break;default:this.writeAscii(JSON.stringify(o));break}}this.writeAscii("}")}},on=class extends fr{static{r(this,"DynamoDBJsonShapeDeserializer2")}_read(t,n){let i=Ot.of(t);return i.isStructSchema()&&i.getName(!0)===zi&&n&&typeof n=="object"?this.readAttributeValue(n):super._read(i,n)}readAttributeValue(t){let n=this.serdeContext?.base64Decoder??ke,i=t;if(typeof t.B=="string"&&(i.B=n(t.B)),Array.isArray(t.BS)&&(i.BS=t.BS.map(n)),Array.isArray(t.L)&&(i.L=t.L.map(s=>this.readAttributeValue(s))),t.M&&typeof t.M=="object"){let s=t.M;for(let o in s)s[o]=this.readAttributeValue(s[o])}return i}},Ie=class extends yr{static{r(this,"DynamoDBJsonCodec2")}constructor(){super({timestampFormat:{useTrait:!0,default:7},jsonName:!1})}createSerializer(){let t=new sn(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new on(this.settings);return t.setSerdeContext(this.serdeContext),t}};var S="ref",P="argv",T=-1,ge=!0,te=!1,ne="isSet",Ee="booleanEquals",ys="PartitionResult",R="stringEquals",$="getAttr",hs="parsedEndpoint",Hi="aws.parseArn",Xi=r(e=>"ParsedArn_ssa_"+e,"k"),Ji="service",an="dynamodb",_e="isValidHostLabel",Qi="accountId",Zi="FirstArn",Yi=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}","q"),es=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}","s"),ts=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}","t"),ns=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}","u"),gt={[S]:"Region"},cn={[S]:ys},rs={fn:$,[P]:[{[S]:hs},"authority"]},un={[S]:"AccountIdEndpointMode"},is={fn:$,[P]:[cn,"name"]},ss={fn:$,[P]:[{[S]:"ParsedArn_ssa_2"},"region"]},os={[S]:"ParsedArn_ssa_2"},as={[S]:"ResourceArnList"},us={fn:$,[P]:[{[S]:"ParsedArn_ssa_1"},"region"]},cs={[S]:"ParsedArn_ssa_1"},ls={[S]:"AccountId"},K={},w={metricValues:["O"]},ps=[gt],ms=[{[S]:"Endpoint"}],fs=[{[S]:"ResourceArn"}],ds={conditions:[[ne,ps],[ne,ms],[Ee,[{[S]:"UseFIPS"},ge]],[Ee,[{[S]:"UseDualStack"},ge]],["aws.partition",ps,ys],[R,[gt,"local"]],[Ee,[{fn:$,[P]:[cn,"supportsFIPS"]},ge]],["parseURL",ms,hs],[R,["dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",rs]],[Ee,[{fn:$,[P]:[cn,"supportsDualStack"]},ge]],[R,["search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",rs]],[ne,[un]],[R,[is,"aws"]],[R,[un,"disabled"]],[ne,fs],[Hi,fs,Xi(2)],[R,[ss,gt]],[R,[{fn:$,[P]:[os,Ji]},an]],[_e,[ss,te]],[_e,[{fn:$,[P]:[os,Qi]},te]],[ne,[as]],[$,[as,"[0]"],Zi],[Hi,[{[S]:Zi}],Xi(1)],[R,[us,gt]],[R,[{fn:$,[P]:[cs,Ji]},an]],[_e,[{fn:$,[P]:[cs,Qi]},te]],[_e,[us,te]],[ne,[ls]],[R,[un,"required"]],[_e,[ls,te]],[R,[is,"aws-us-gov"]],[Ee,[{fn:"coalesce",[P]:[{[S]:"IsSearchOperation"},te]},ge]]],results:[[T],[T,"Invalid Configuration: FIPS and custom endpoint are not supported"],[T,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[T,"Endpoint override is not supported for dual-stack endpoints. Please enable dual-stack functionality by enabling the configuration. For more details, see: https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html"],["{Endpoint}",K],[T,"Invalid Configuration: FIPS and local endpoint are not supported"],[T,"Invalid Configuration: Dualstack and local endpoint are not supported"],["http://localhost:8000",{authSchemes:[{signingRegion:"us-east-1",signingName:an,name:"sigv4"}]}],[T,"Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported"],["https://search-dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",K],["https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",K],[T,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://search-dynamodb.{Region}.{PartitionResult#dnsSuffix}",K],["https://dynamodb.{Region}.{PartitionResult#dnsSuffix}",K],["https://search-dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",K],["https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",K],[T,"FIPS is enabled but this partition does not support FIPS"],[Yi(2),w],[es(2),w],[Yi(1),w],[es(1),w],["https://{AccountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}",w],["https://{AccountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}",w],[T,"Credentials-sourced account ID parameter is invalid"],[T,"AccountIdEndpointMode is required but no AccountID was provided or able to be loaded"],[T,"Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition"],["https://search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",K],["https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",K],[T,"DualStack is enabled but this partition does not support DualStack"],[ts(2),w],[ns(2),w],[ts(1),w],[ns(1),w],["https://{AccountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}",w],["https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}",w],[T,"Invalid Configuration: Missing Region"]]},el=2,l=1e8,tl=new Int32Array([-1,1,-1,0,6,3,1,4,l+35,2,l+1,5,3,l+2,l+4,1,77,7,2,61,8,3,34,9,4,10,l+35,5,l+7,11,11,12,69,12,14,13,28,l+25,69,13,33,15,14,16,21,15,17,21,16,18,21,17,19,21,18,20,21,19,32,21,20,22,28,21,23,28,22,24,28,23,25,28,24,26,28,25,27,28,26,31,28,27,29,33,29,30,l+23,31,l+33,l+34,31,l+31,l+32,31,l+29,l+30,28,l+24,69,4,35,l+35,5,l+6,36,9,37,l+28,11,38,60,12,40,39,28,l+25,60,13,59,41,14,42,47,15,43,47,16,44,47,17,45,47,18,46,47,19,58,47,20,48,54,21,49,54,22,50,54,23,51,54,24,52,54,25,53,54,26,57,54,27,55,59,29,56,l+23,31,l+21,l+22,31,l+19,l+20,31,l+17,l+18,28,l+24,60,31,l+26,l+27,3,70,62,4,63,l+35,5,l+5,64,6,65,l+16,11,66,67,28,l+8,67,30,69,68,31,l+14,l+15,31,l+12,l+13,4,71,l+35,5,l+5,72,6,73,l+11,9,74,l+11,11,75,76,28,l+8,76,31,l+9,l+10,2,l+1,78,3,l+2,79,4,80,l+4,7,81,l+4,8,l+3,82,10,l+3,l+4]),vs=Nn.from(tl,el,ds.conditions,ds.results);var nl=new On({size:50,params:["AccountId","AccountIdEndpointMode","Endpoint","IsSearchOperation","Region","ResourceArn","ResourceArnList","UseDualStack","UseFIPS"]}),xs=r((e,t={})=>nl.get(e,()=>Un(vs,{endpointParams:e,logger:t.logger})),"defaultEndpointResolver");Ln.aws=or;var bs=r(e=>({apiVersion:"2012-08-10",base64Decoder:e?.base64Decoder??ke,base64Encoder:e?.base64Encoder??we,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??xs,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Yr,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:r(t=>t.getIdentityProvider("aws.auth#sigv4"),"identityProvider"),signer:new cr}],logger:e?.logger??new En,protocol:e?.protocol??hr,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.dynamodb",errorTypeRegistries:$i,xmlNamespace:"http://dynamodb.amazonaws.com/doc/2012-08-10/",version:"2012-08-10",serviceTarget:"DynamoDB_20120810",jsonCodec:new Ie},serviceId:e?.serviceId??"DynamoDB",sha256:e?.sha256??Fn,urlParser:e?.urlParser??dn,utf8Decoder:e?.utf8Decoder??Tn,utf8Encoder:e?.utf8Encoder??An}),"getRuntimeConfig");var Is=r(e=>{bn(process.version);let t=$n(e),n=r(()=>t().then(xn),"defaultConfigProvider"),i=bs(e);Sn(process.version);let s={profile:e?.profile,logger:i.logger};return{...i,...e,runtime:"node",defaultsMode:t,accountIdEndpointMode:e?.accountIdEndpointMode??N(Vt,s),authSchemePreference:e?.authSchemePreference??N(lr,s),bodyLengthChecker:e?.bodyLengthChecker??Dn,credentialDefaultProvider:e?.credentialDefaultProvider??vr,defaultUserAgentProvider:e?.defaultUserAgentProvider??ir({serviceId:i.serviceId,clientVersion:qi.version}),endpointDiscoveryEnabledProvider:e?.endpointDiscoveryEnabledProvider??N(Wt,s),maxAttempts:e?.maxAttempts??N(oe.v2026?{...Ut,default:4}:Ut,e),region:e?.region??N(Cn,{...Rn,...s}),requestHandler:mr.create(e?.requestHandler??n),retryMode:e?.retryMode??N({...zn,default:r(async()=>(await n()).retryMode||Wn,"default")},e),streamCollector:e?.streamCollector??Gn,useDualstackEndpoint:e?.useDualstackEndpoint??N(kn,s),useFipsEndpoint:e?.useFipsEndpoint??N(wn,s),userAgentAppId:e?.userAgentAppId??N(sr,s)}},"getRuntimeConfig");var gs=r(e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,i=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(a=>a.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){i=s},credentials(){return i}}},"getHttpAuthExtensionConfiguration"),Es=r(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig");var _s=r((e,t)=>{let n=Object.assign(ar(e),In(e),Kn(e),gs(e));return t.forEach(i=>i.configure(n)),Object.assign(e,ur(n),gn(n),Vn(n),Es(n))},"resolveRuntimeExtensions");var re=class extends De{static{r(this,"DynamoDBClient")}config;constructor(...[t]){let n=Is(t||{});super(n),this.initConfig=n;let i=ti(n),s=Kt(i),o=nr(s),a=qn(o,{defaultBaseDelay:oe.v2026?25:void 0,defaultMaxAttempts:oe.v2026?4:void 0}),c=Pn(a),d=c,g=Mn(d),E=ei(g),Nt=Jt(E,{endpointDiscoveryCommandCtor:It}),$s=_s(Nt,t?.extensions||[]);this.config=$s,this.middlewareStack.use(yn(this.config)),this.middlewareStack.use(rr(this.config)),this.middlewareStack.use(Hn(this.config)),this.middlewareStack.use(jn(this.config)),this.middlewareStack.use(Jn(this.config)),this.middlewareStack.use(Qn(this.config)),this.middlewareStack.use(Zn(this.config)),this.middlewareStack.use(Yn(this.config,{httpAuthSchemeParametersProvider:Zr,identityProviderConfigProvider:r(async Ns=>new tr({"aws.auth#sigv4":Ns.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use(er(this.config))}destroy(){super.destroy()}};var Et=class extends D(j,k,"GetItem",Fi){static{r(this,"GetItemCommand")}};var _t=class extends D(j,k,"Query",Ki){static{r(this,"QueryCommand")}};var St=class extends D(j,k,"Scan",Vi){static{r(this,"ScanCommand")}};var Tt=class extends D(ii,k,"TransactWriteItems",ji){static{r(this,"TransactWriteItemsCommand")}};var At=class extends D(j,k,"UpdateItem",Wi){static{r(this,"UpdateItemCommand")}};var J=class extends x{static{r(this,"GetCommand")}input;inputKeyNodes={Key:m};outputKeyNodes={Item:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new Et(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var Q=class extends x{static{r(this,"QueryCommand")}input;inputKeyNodes={KeyConditions:{"*":{AttributeValueList:A}},QueryFilter:{"*":{AttributeValueList:A}},ExclusiveStartKey:m,ExpressionAttributeValues:m};outputKeyNodes={Items:{"*":m},LastEvaluatedKey:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new _t(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var Se=class extends x{static{r(this,"ScanCommand")}input;inputKeyNodes={ScanFilter:{"*":{AttributeValueList:A}},ExclusiveStartKey:m,ExpressionAttributeValues:m};outputKeyNodes={Items:{"*":m},LastEvaluatedKey:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new St(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var Te=class extends x{static{r(this,"TransactWriteCommand")}input;inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:m,ExpressionAttributeValues:m},Put:{Item:m,ExpressionAttributeValues:m},Delete:{Key:m,ExpressionAttributeValues:m},Update:{Key:m,ExpressionAttributeValues:m}}}};outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:m}}}};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new Tt(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var q=class extends x{static{r(this,"UpdateCommand")}input;inputKeyNodes={Key:m,AttributeUpdates:{"*":{Value:Z}},Expected:{"*":{Value:Z,AttributeValueList:A}},ExpressionAttributeValues:m};outputKeyNodes={Attributes:m,ItemCollectionMetrics:{ItemCollectionKey:m}};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new At(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var U=class e extends De{static{r(this,"DynamoDBDocumentClient")}config;constructor(t,n){if(super(t.config),this.config=t.config,this.config.translateConfig=n,this.middlewareStack=t.middlewareStack,this.config?.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.");if(!(t.middlewareStack.identify?.()??[]).some(o=>o.includes?.("serializerMiddleware"))){let o=this.config.logger,a=o&&!o.constructor?.name.includes("NoOp")?o:console,c=new re(Object.assign({},this.config,{defaultUserAgentProvider:void 0,retryStrategy:void 0,extensions:void 0}));if(c.middlewareStack.identify?.().some(g=>g.includes?.("serializerMiddleware")))this.middlewareStack=c.middlewareStack,this.config=c.config,this.config.translateConfig=n,a.warn("@aws-sdk/lib-dynamodb - WARN: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. We have forwarded your client's configuration to a newer version of DynamoDBClient in the dependency closure to instantiate DynamoDBDocumentClient.");else throw new Error("@aws-sdk/lib-dynamodb - ERROR: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. Check @aws-sdk/lib-dynamodb package.json requirements.")}}static from(t,n){return new e(t,n)}destroy(){}};var Iy=Ce(U,Q,"ExclusiveStartKey","LastEvaluatedKey","Limit");var Ty=Ce(U,Se,"ExclusiveStartKey","LastEvaluatedKey","Limit");var Dt=["hour","day","month"],Ss=["status","country","device","path"],Ts=["v1","v2"];var dh=M({pk:_(),sk:_(),source:V(Ts),appliedAt:b(),ttl:C(b())}),kt=class{constructor(t){this.props=t}props;static{r(this,"AppliedMarkers")}isApplied=r(async t=>{let{Item:n}=await this.props.dynamo.send(new J({TableName:this.props.tableName,Key:{pk:As(t),sk:"applied"}}));return n!=null},"isApplied");buildMarkerPut=r(t=>{let n={pk:As(t),sk:"applied",source:t.source,appliedAt:Date.now()};return t.ttl!=null&&(n.ttl=t.ttl),{Put:{TableName:this.props.tableName,Item:n,ConditionExpression:"attribute_not_exists(pk) AND attribute_not_exists(sk)"}}},"buildMarkerPut")};function As(e){return`applied#${e.grain}#${e.periodKey}`}r(As,"partitionKey");function ln(e,t=100){let n=[],i=Math.ceil(e.length/t),s=0,o=t;for(let a=0;a<i;a++)n.push(e.slice(s,o)),s+=t,o+=t;return n}r(ln,"splitArrayToChunks");async function wt(e){let t=[],n;do{let{Items:i=[],LastEvaluatedKey:s}=await e.dynamo.send(new Q({...e.input,ExclusiveStartKey:n}));n=s,t.push(...i)}while(n!=null);return t}r(wt,"queryAll");var il=M({pk:_(),sk:_(),dimension:V(Ss),grain:V(Dt),periodKey:_(),value:_(),hits:b(),bytes:b(),ttl:C(b())}),Ct=class{constructor(t){this.props=t}props;static{r(this,"Breakdowns")}addMany=r(async t=>{let n=this.buildUpdates(t);for(let i of n)await this.props.dynamo.send(new q(i.Update))},"addMany");buildUpdates=r(t=>t.items.map(n=>({Update:this.buildUpdateMembers({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey,item:n,ttl:t.ttl})})),"buildUpdates");getForPeriod=r(async t=>(await wt({dynamo:this.props.dynamo,input:{TableName:this.props.tableName,KeyConditionExpression:"#pk = :pk",ExpressionAttributeNames:{"#pk":"pk"},ExpressionAttributeValues:{":pk":Ds({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey})}}})).map(i=>this.parseOne(i)),"getForPeriod");buildUpdateMembers=r(t=>{let n={"#dimension":"dimension","#grain":"grain","#periodKey":"periodKey","#value":"value","#hits":"hits","#bytes":"bytes"},i={":dimension":t.dimension,":grain":t.grain,":periodKey":t.periodKey,":value":t.item.value,":hits":t.item.hits,":bytes":t.item.bytes},s=["#dimension = :dimension","#grain = :grain","#periodKey = :periodKey","#value = :value"];return t.ttl!=null&&(n["#ttl"]="ttl",i[":ttl"]=t.ttl,s.push("#ttl = :ttl")),{TableName:this.props.tableName,Key:{pk:Ds({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey}),sk:t.item.value},UpdateExpression:`SET ${s.join(", ")} ADD #hits :hits, #bytes :bytes`,ExpressionAttributeNames:n,ExpressionAttributeValues:i}},"buildUpdateMembers");parseOne=r(t=>{let n=$e(il,t);if(!n.success)throw console.error(Pe(n.issues)),new Error("Malformed stored breakdown record");return n.output},"parseOne")};function Ds(e){return`breakdown#${e.dimension}#${e.grain}#${e.periodKey}`}r(Ds,"partitionKey");function ks(){return U.from(new re,{marshallOptions:{removeUndefinedValues:!0,convertEmptyValues:!1}})}r(ks,"toDynamoClient");function ws(e){let t={hits:0,success:0,errors:0,errors4xx:0,errors5xx:0,bytesSent:0,bytesReceived:0};return e.reduce((n,i)=>({hits:n.hits+i.hits,success:n.success+i.success,errors:n.errors+i.errors,errors4xx:n.errors4xx+i.errors4xx,errors5xx:n.errors5xx+i.errors5xx,bytesSent:n.bytesSent+i.bytesSent,bytesReceived:n.bytesReceived+i.bytesReceived}),t)}r(ws,"sumTotals");function Ae(e){let t={};for(let n of e){let i=t[n.value];i==null?t[n.value]={value:n.value,hits:n.hits,bytes:n.bytes}:t[n.value]={value:n.value,hits:i.hits+n.hits,bytes:i.bytes+n.bytes}}return Object.values(t)}r(Ae,"sumBreakdown");var sl=100;async function Cs({dayKey:e,models:t,dynamo:n}){if(await t.markers.isApplied({grain:"day",periodKey:e}))return{status:"skipped"};let s=await t.totals.queryWindow({grain:"hour",startKey:`${e}-00`,endKey:`${e}-23`}),o=ws(s),a=await ll({breakdowns:t.breakdowns,grain:"hour",periodKeys:pl(e)}),c=t.totals.buildAggregateUpdate({grain:"day",item:{timeKey:e,...o}}),d=cl({breakdowns:t.breakdowns,grain:"day",periodKey:e,byStatus:a.status,byDevice:a.device,byPath:a.path,byCountry:a.country}),g=t.markers.buildMarkerPut({grain:"day",periodKey:e,source:"v2"});return al({dynamo:n,leading:[g,c],rest:d})}r(Cs,"applyDailyRollup");function ol({leading:e,rest:t,limit:n=sl}){let i=Math.max(n-e.length,0),s=[...e,...t.slice(0,i)],o=ln(t.slice(i),n);return[s,...o]}r(ol,"chunkTransactItems");async function al({dynamo:e,leading:t,rest:n}){let i=ol({leading:t,rest:n});try{for(let s of i)s.length!==0&&await e.send(new Te({TransactItems:s}))}catch(s){if(ul(s))return{status:"skipped"};throw s}return{status:"applied"}}r(al,"sendTransacted");function ul(e){if(e==null||typeof e!="object")return!1;let t="name"in e?e.name:void 0;return t==="TransactionCanceledException"||t==="ConditionalCheckFailedException"}r(ul,"isMarkerRaceError");function cl({breakdowns:e,grain:t,periodKey:n,ttl:i,byStatus:s,byDevice:o,byPath:a,byCountry:c}){let d=[{dimension:"status",items:s},{dimension:"device",items:o},{dimension:"country",items:c},{dimension:"path",items:a}],g=[];for(let E of d)E.items.length!==0&&g.push(...e.buildUpdates({dimension:E.dimension,grain:t,periodKey:n,items:E.items,ttl:i}));return g}r(cl,"buildBreakdownUpdates");async function ll({breakdowns:e,grain:t,periodKeys:n}){let i=[],s=[],o=[],a=[];for(let c of n){let[d,g,E,Nt]=await Promise.all([e.getForPeriod({dimension:"status",grain:t,periodKey:c}),e.getForPeriod({dimension:"device",grain:t,periodKey:c}),e.getForPeriod({dimension:"path",grain:t,periodKey:c}),e.getForPeriod({dimension:"country",grain:t,periodKey:c})]);i.push(...d.map(Rt)),s.push(...g.map(Rt)),o.push(...E.map(Rt)),a.push(...Nt.map(Rt))}return{status:Ae(i),device:Ae(s),path:Ae(o),country:Ae(a)}}r(ll,"aggregateFinerBreakdowns");function pl(e){let t=[];for(let n=0;n<24;n+=1)t.push(`${e}-${n.toString().padStart(2,"0")}`);return t}r(pl,"hourWindowKeys");function Rt(e){return{value:e.value,hits:e.hits,bytes:e.bytes}}r(Rt,"toBreakdownRow");function Rs(e){return e.toString().padStart(2,"0")}r(Rs,"pad2");function ml(e){return e.toString().padStart(4,"0")}r(ml,"pad4");function fl(e){return`${ml(e.getUTCFullYear())}-${Rs(e.getUTCMonth()+1)}`}r(fl,"monthKey");function Ps(e){return`${fl(e)}-${Rs(e.getUTCDate())}`}r(Ps,"dayKey");var dl=["hits","success","errors","errors4xx","errors5xx","bytesSent","bytesReceived"],yl=["p50TimeTaken","p95TimeTaken","cacheHitRatio","uniqueIpCount"],hl=M({pk:_(),sk:_(),grain:V(Dt),timeKey:_(),hits:b(),success:b(),errors:b(),errors4xx:b(),errors5xx:b(),bytesSent:b(),bytesReceived:b(),p50TimeTaken:C(b()),p95TimeTaken:C(b()),cacheHitRatio:C(b()),uniqueIpCount:C(b()),ttl:C(b())}),Pt=class{constructor(t){this.props=t}props;static{r(this,"Totals")}addHourly=r(async t=>{let n=this.buildHourlyUpdate(t);await this.props.dynamo.send(new q(n.Update))},"addHourly");addAggregate=r(async t=>{let n=this.buildAggregateUpdate(t);await this.props.dynamo.send(new q(n.Update))},"addAggregate");buildHourlyUpdate=r(t=>({Update:this.buildUpdateMembers({grain:"hour",item:t.item,ttl:t.ttl,includeHourlyDetail:!0})}),"buildHourlyUpdate");buildAggregateUpdate=r(t=>({Update:this.buildUpdateMembers({grain:t.grain,item:t.item,includeHourlyDetail:!1})}),"buildAggregateUpdate");queryWindow=r(async t=>(await wt({dynamo:this.props.dynamo,input:{TableName:this.props.tableName,KeyConditionExpression:"#pk = :pk AND #sk BETWEEN :start AND :end",ExpressionAttributeNames:{"#pk":"pk","#sk":"sk"},ExpressionAttributeValues:{":pk":pn(t.grain),":start":t.startKey,":end":t.endKey}}})).map(i=>this.parseOne(i)),"queryWindow");getOne=r(async t=>{let{Item:n}=await this.props.dynamo.send(new J({TableName:this.props.tableName,Key:{pk:pn(t.grain),sk:t.timeKey}}));if(n!=null)return this.parseOne(n)},"getOne");buildUpdateMembers=r(t=>{let n={"#grain":"grain","#timeKey":"timeKey"},i={":grain":t.grain,":timeKey":t.item.timeKey},s=["#grain = :grain","#timeKey = :timeKey"],o=[];for(let a of dl)n[`#${a}`]=a,i[`:${a}`]=t.item[a],o.push(`#${a} :${a}`);if(t.includeHourlyDetail)for(let a of yl){let c=t.item[a];c!=null&&(n[`#${a}`]=a,i[`:${a}`]=c,s.push(`#${a} = :${a}`))}return t.ttl!=null&&(n["#ttl"]="ttl",i[":ttl"]=t.ttl,s.push("#ttl = :ttl")),{TableName:this.props.tableName,Key:{pk:pn(t.grain),sk:t.item.timeKey},UpdateExpression:`SET ${s.join(", ")} ADD ${o.join(", ")}`,ExpressionAttributeNames:n,ExpressionAttributeValues:i}},"buildUpdateMembers");parseOne=r(t=>{let n=$e(hl,t);if(!n.success)throw console.error(Pe(n.issues)),new Error("Malformed stored totals record");return n.output},"parseOne")};function pn(e){return`totals#${e}`}r(pn,"partitionKey");var vl=M({TABLE_NAME:_(),REVERSE_INDEX_NAME:_()}),mn=Ir(vl,process.env),$t=ks(),xl=new Pt({dynamo:$t,tableName:mn.TABLE_NAME}),bl=new Ct({dynamo:$t,tableName:mn.TABLE_NAME}),Il=new kt({dynamo:$t,tableName:mn.TABLE_NAME});async function iv(){let e=new Date;e.setUTCDate(e.getUTCDate()-1);let t=Ps(e),n=await Cs({dayKey:t,models:{totals:xl,breakdowns:bl,markers:Il},dynamo:$t});console.log(`dailyRollup ${t} ${n.status}`)}r(iv,"handler");export{iv as handler};
|
|
2
|
+
import{a as vr}from"./chunk-U7KUF4SE.mjs";import"./chunk-VYXCTSUL.mjs";import{a as cr,c as lr,h as pr,i as fr,j as dr,k as yr,l as hr}from"./chunk-2C6L2MOS.mjs";import{b as Fn}from"./chunk-LB33VBGK.mjs";import{a as mr}from"./chunk-YY2HYMK3.mjs";import{A as oe,B as Wn,C as Ut,D as qn,E as zn,F as Hn,G as Xn,L as Jn,O as Qn,R as Zn,S as Yn,T as er,V as Ce,W as tr,a as De,aa as nr,b as hn,d as vn,f as xn,g as bn,h as In,ha as rr,i as gn,ja as ir,k as En,l as Sn,n as _n,na as sr,r as Nn,s as On,sa as or,u as Ln,w as Un,xa as ar,y as Mn,ya as ur,z as Bn}from"./chunk-C3D3OF2Y.mjs";import{i as Kn,j as Vn,k as jn}from"./chunk-YMGL4RSC.mjs";import{n as N,o as kn,p as wn,s as Cn,t as Rn,u as Pn,v as $n}from"./chunk-KRS5YV2Z.mjs";import{B as Gn,b as yn,d as Ot,e as Lt,g as ke,h as Tn,i as we,j as An,z as Dn}from"./chunk-3UGRDNDZ.mjs";import{e as fn,k as se,l as dn}from"./chunk-OC3UN3OS.mjs";import{a as r,b as ie,c as Os}from"./chunk-CFZ5JWD3.mjs";var Fr=ie((cp,Gr)=>{function B(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}r(B,"Iterator");B.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e};typeof Symbol<"u"&&(B.prototype[Symbol.iterator]=function(){return this});B.of=function(){var e=arguments,t=e.length,n=0;return new B(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})};B.empty=function(){var e=new B(null);return e.done=!0,e};B.is=function(e){return e instanceof B?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"};Gr.exports=B});var qt=ie((pp,Wr)=>{var Kr=typeof ArrayBuffer<"u",Vr=typeof Symbol<"u";function jr(e,t){var n,i,s,o,a;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if(typeof t!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||Kr&&ArrayBuffer.isView(e)||typeof e=="string"||e.toString()==="[object Arguments]"){for(s=0,o=e.length;s<o;s++)t(e[s],s);return}if(typeof e.forEach=="function"){e.forEach(t);return}if(Vr&&Symbol.iterator in e&&typeof e.next!="function"&&(e=e[Symbol.iterator]()),typeof e.next=="function"){for(n=e,s=0;a=n.next(),a.done!==!0;)t(a.value,s),s++;return}for(i in e)e.hasOwnProperty(i)&&t(e[i],i)}r(jr,"forEach");jr.forEachWithNullKeys=function(e,t){var n,i,s,o,a;if(!e)throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");if(typeof t!="function")throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");if(Array.isArray(e)||Kr&&ArrayBuffer.isView(e)||typeof e=="string"||e.toString()==="[object Arguments]"){for(s=0,o=e.length;s<o;s++)t(e[s],null);return}if(e instanceof Set){e.forEach(function(c){t(c,null)});return}if(typeof e.forEach=="function"){e.forEach(t);return}if(Vr&&Symbol.iterator in e&&typeof e.next!="function"&&(e=e[Symbol.iterator]()),typeof e.next=="function"){for(n=e,s=0;a=n.next(),a.done!==!0;)t(a.value,null),s++;return}for(i in e)e.hasOwnProperty(i)&&t(e[i],i)};Wr.exports=jr});var zt=ie(O=>{var eo=Math.pow(2,8)-1,to=Math.pow(2,16)-1,no=Math.pow(2,32)-1,ro=Math.pow(2,7)-1,io=Math.pow(2,15)-1,so=Math.pow(2,31)-1;O.getPointerArray=function(e){var t=e-1;return t<=eo?Uint8Array:t<=to?Uint16Array:t<=no?Uint32Array:Float64Array};O.getSignedPointerArray=function(e){var t=e-1;return t<=ro?Int8Array:t<=io?Int16Array:t<=so?Int32Array:Float64Array};O.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var oo={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};O.getMinimalRepresentation=function(e,t){var n=null,i=0,s,o,a,c,d;for(c=0,d=e.length;c<d;c++)a=t?t(e[c]):e[c],o=O.getNumberType(a),s=oo[o.name],s>i&&(i=s,n=o);return n};O.isTypedArray=function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)};O.concat=function(){var e=0,t,n,i;for(t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=new arguments[0].constructor(e);for(t=0,n=0;t<i;t++)s.set(arguments[t],n),n+=arguments[t].length;return s};O.indices=function(e){for(var t=O.getPointerArray(e),n=new t(e),i=0;i<e;i++)n[i]=i;return n}});var Hr=ie(me=>{var qr=qt(),zr=zt();function ao(e){return Array.isArray(e)||zr.isTypedArray(e)}r(ao,"isArrayLike");function Ht(e){if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size}r(Ht,"guessLength");function uo(e){var t=Ht(e),n=typeof t=="number"?new Array(t):[],i=0;return qr(e,function(s){n[i++]=s}),n}r(uo,"toArray");function co(e){var t=Ht(e),n=typeof t=="number"?zr.getPointerArray(t):Array,i=typeof t=="number"?new Array(t):[],s=typeof t=="number"?new n(t):[],o=0;return qr(e,function(a){i[o]=a,s[o]=o++}),[i,s]}r(co,"toArrayWithIndices");me.isArrayLike=ao;me.guessLength=Ht;me.toArray=uo;me.toArrayWithIndices=co});var Jr=ie((hp,Xr)=>{var Xt=Fr(),lo=qt(),po=zt(),mo=Hr();function I(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");var i=po.getPointerArray(n);this.forward=new i(n),this.backward=new i(n),this.K=typeof e=="function"?new e(n):new Array(n),this.V=typeof t=="function"?new t(n):new Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}r(I,"LRUCache");I.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}};I.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],i=this.forward[e];return this.tail===e?this.tail=n:this.backward[i]=n,this.forward[n]=i,this.backward[t]=e,this.head=e,this.forward[e]=t,this};I.prototype.set=function(e,t){var n=this.items[e];if(typeof n<"u"){this.splayOnTop(n),this.V[n]=t;return}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};I.prototype.setpop=function(e,t){var n=null,i=null,s=this.items[e];return typeof s<"u"?(this.splayOnTop(s),n=this.V[s],this.V[s]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?s=this.size++:(s=this.tail,this.tail=this.backward[s],n=this.V[s],i=this.K[s],delete this.items[this.K[s]]),this.items[e]=s,this.K[s]=e,this.V[s]=t,this.forward[s]=this.head,this.backward[this.head]=s,this.head=s,i?{evicted:!0,key:i,value:n}:null)};I.prototype.has=function(e){return e in this.items};I.prototype.get=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.splayOnTop(t),this.V[t]};I.prototype.peek=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.V[t]};I.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,i=this.size,s=this.head,o=this.K,a=this.V,c=this.forward;n<i;)e.call(t,a[s],o[s],this),s=c[s],n++};I.prototype.keys=function(){var e=0,t=this.size,n=this.head,i=this.K,s=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var o=i[n];return e++,e<t&&(n=s[n]),{done:!1,value:o}})};I.prototype.values=function(){var e=0,t=this.size,n=this.head,i=this.V,s=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var o=i[n];return e++,e<t&&(n=s[n]),{done:!1,value:o}})};I.prototype.entries=function(){var e=0,t=this.size,n=this.head,i=this.K,s=this.V,o=this.forward;return new Xt(function(){if(e>=t)return{done:!0};var a=i[n],c=s[n];return e++,e<t&&(n=o[n]),{done:!1,value:[a,c]}})};typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.entries);I.prototype.inspect=function(){for(var e=new Map,t=this.entries(),n;n=t.next(),!n.done;)e.set(n.value[0],n.value[1]);return Object.defineProperty(e,"constructor",{value:I,enumerable:!1}),e};typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect);I.from=function(e,t,n,i){if(arguments.length<2){if(i=mo.guessLength(e),typeof i!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(i=t,t=null,n=null);var s=new I(t,n,i);return lo(e,function(o,a){s.set(a,o)}),s};Xr.exports=I});var Re,Ls={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Mt(e){return!e&&!Re?Ls:{lang:e?.lang??Re?.lang,message:e?.message,abortEarly:e?.abortEarly??Re?.abortEarly,abortPipeEarly:e?.abortPipeEarly??Re?.abortPipeEarly}}r(Mt,"getGlobalConfig");var Us;function Ms(e){return Us?.get(e)}r(Ms,"getGlobalMessage");var Bs;function Gs(e){return Bs?.get(e)}r(Gs,"getSchemaMessage");var Fs;function Ks(e,t){return Fs?.get(e)?.get(t)}r(Ks,"getSpecificMessage");function xr(e){let t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}r(xr,"_stringify");function ae(e,t,n,i,s){let o=s&&"input"in s?s.input:n.value,a=s?.expected??e.expects??null,c=s?.received??xr(o),d={kind:e.kind,type:e.type,input:o,expected:a,received:c,message:`Invalid ${t}: ${a?`Expected ${a} but r`:"R"}eceived ${c}`,requirement:e.requirement,path:s?.path,issues:s?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},g=e.kind==="schema",E=s?.message??e.message??Ks(e.reference,d.lang)??(g?Gs(d.lang):null)??i.message??Ms(d.lang);E!==void 0&&(d.message=typeof E=="function"?E(d):E),g&&(n.typed=!1),n.issues?n.issues.push(d):n.issues=[d]}r(ae,"_addIssue");function Vs(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}r(Vs,"_joinExpects");function ue(e){return e["~standard"]={version:1,vendor:"valibot",validate:r(t=>e["~run"]({value:t},Mt()),"validate")},e}r(ue,"_standardSchema");function js(e){if(e.path){let t="";for(let n of e.path)if(typeof n.key=="string"||typeof n.key=="number")t?t+=`.${n.key}`:t+=n.key;else return null;return t}return null}r(js,"getDotPath");var Ws=class extends Error{static{r(this,"ValiError")}constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};var gl=new RegExp("^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$","u");function qs(e,t,n){return typeof e.fallback=="function"?e.fallback(t,n):e.fallback}r(qs,"getFallback");function Pe(e){let t={};for(let n of e)if(n.path){let i=js(n);i?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,i)?t.nested[i].push(n.message):t.nested[i]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t}r(Pe,"flatten");function br(e,t,n){return typeof e.default=="function"?e.default(t,n):e.default}r(br,"getDefault");function b(e){return ue({kind:"schema",type:"number",reference:b,expects:"number",async:!1,message:e,"~run"(t,n){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:ae(this,"type",t,n),t}})}r(b,"number");function M(e,t){return ue({kind:"schema",type:"object",reference:M,expects:"Object",async:!1,entries:e,message:t,"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in this.entries){let a=this.entries[o];if(o in s||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let c=o in s?s[o]:br(a),d=a["~run"]({value:c},i);if(d.issues){let g={type:"object",origin:"value",input:s,key:o,value:c};for(let E of d.issues)E.path?E.path.unshift(g):E.path=[g],n.issues?.push(E);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}d.typed||(n.typed=!1),n.value[o]=d.value}else if(a.fallback!==void 0)n.value[o]=qs(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ae(this,"key",n,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),i.abortEarly))break}}else ae(this,"type",n,i);return n}})}r(M,"object");function C(e,t){return ue({kind:"schema",type:"optional",reference:C,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(n,i){return n.value===void 0&&(this.default!==void 0&&(n.value=br(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,i)}})}r(C,"optional");function V(e,t){return ue({kind:"schema",type:"picklist",reference:V,expects:Vs(e.map(xr),"|"),async:!1,options:e,message:t,"~run"(n,i){return this.options.includes(n.value)?n.typed=!0:ae(this,"type",n,i),n}})}r(V,"picklist");function S(e){return ue({kind:"schema",type:"string",reference:S,expects:"string",async:!1,message:e,"~run"(t,n){return typeof t.value=="string"?t.typed=!0:ae(this,"type",t,n),t}})}r(S,"string");function Ir(e,t,n){let i=e["~run"]({value:t},Mt(n));if(i.issues)throw new Ws(i.issues);return i.value}r(Ir,"parse");function $e(e,t,n){let i=e["~run"]({value:t},Mt(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}r($e,"safeParse");var z=class e{static{r(this,"NumberValue")}value;constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let n=typeof t.valueOf()=="number"?t.valueOf():0;if(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER||Math.abs(n)===1/0||Number.isNaN(n))throw new Error(`NumberValue should not be initialized with an imprecise number=${n}. Use a string instead.`)}static from(t){return new e(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}};var ce=r((e,t)=>{if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return Oe();if(Array.isArray(e))return zs(e,t);if(e?.constructor?.name==="Set")return Hs(e,t);if(e?.constructor?.name==="Map")return Xs(e,t);if(e?.constructor?.name==="Object"||!e.constructor&&typeof e=="object")return gr(e,t);if(Dr(e))return e.length===0&&t?.convertEmptyValues?Oe():Sr(e);if(typeof e=="boolean"||e?.constructor?.name==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||e?.constructor?.name==="Number")return Ar(e,t);if(e instanceof z)return e.toAttributeValue();if(typeof e=="bigint")return Tr(e);if(typeof e=="string"||e?.constructor?.name==="String")return e.length===0&&t?.convertEmptyValues?Oe():_r(e);if(t?.convertClassInstanceToMap&&typeof e=="object")return gr(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),zs=r((e,t)=>({L:e.filter(n=>typeof n!="function"&&(!t?.removeUndefinedValues||t?.removeUndefinedValues&&n!==void 0)).map(n=>ce(n,t))}),"convertToListAttr"),Hs=r((e,t)=>{let n=t?.removeUndefinedValues?new Set([...e].filter(s=>s!==void 0)):e;if(!t?.removeUndefinedValues&&n.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(n.size===0){if(t?.convertEmptyValues)return Oe();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let i=n.values().next().value;if(i instanceof z)return{NS:Array.from(n).map(s=>s.toString())};if(typeof i=="number")return{NS:Array.from(n).map(s=>Ar(s,t)).map(s=>s.N)};if(typeof i=="bigint")return{NS:Array.from(n).map(Tr).map(s=>s.N)};if(typeof i=="string")return{SS:Array.from(n).map(_r).map(s=>s.S)};if(Dr(i))return{BS:Array.from(n).map(Sr).map(s=>s.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),Xs=r((e,t)=>({M:(n=>{let i={};for(let[s,o]of n)typeof o!="function"&&(o!==void 0||!t?.removeUndefinedValues)&&(i[s]=ce(o,t));return i})(e)}),"convertToMapAttrFromIterable"),gr=r((e,t)=>({M:(n=>{let i={};for(let s in n){let o=n[s];typeof o!="function"&&(o!==void 0||!t?.removeUndefinedValues)&&(i[s]=ce(o,t))}return i})(e)}),"convertToMapAttrFromEnumerableProps"),Oe=r(()=>({NULL:!0}),"convertToNullAttr"),Sr=r(e=>({B:e}),"convertToBinaryAttr"),_r=r(e=>({S:e.toString()}),"convertToStringAttr"),Tr=r(e=>({N:e.toString()}),"convertToBigIntAttr"),Er=r(e=>{throw new Error(`${e} Use NumberValue from @aws-sdk/lib-dynamodb.`)},"validateBigIntAndThrow"),Ar=r((e,t)=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(n=>n.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return t?.allowImpreciseNumbers||(Number(e)>Number.MAX_SAFE_INTEGER?Er(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):Number(e)<Number.MIN_SAFE_INTEGER&&Er(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`)),{N:e.toString()}},"convertToNumberAttr"),Dr=r(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e?.constructor?t.includes(e.constructor.name):!1},"isBinary");var le=r((e,t)=>{for(let[n,i]of Object.entries(e))if(i!==void 0)switch(n){case"NULL":return null;case"BOOL":return!!i;case"N":return kr(i,t);case"B":return Cr(i);case"S":return wr(i);case"L":return Js(i,t);case"M":return Qs(i,t);case"NS":return new Set(i.map(s=>kr(s,t)));case"BS":return new Set(i.map(Cr));case"SS":return new Set(i.map(wr));default:throw new Error(`Unsupported type passed: ${n}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),kr=r((e,t)=>{if(typeof t?.wrapNumbers=="function")return t?.wrapNumbers(e);if(t?.wrapNumbers)return z.from(e);let n=Number(e),i=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&!i.includes(n))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return n},"convertNumber"),wr=r(e=>e,"convertString"),Cr=r(e=>e,"convertBinary"),Js=r((e,t)=>e.map(n=>le(n,t)),"convertList"),Qs=r((e,t)=>Object.entries(e).reduce((n,[i,s])=>(n[i]=le(s,t),n),{}),"convertMap");function Bt(e,t){let n=ce(e,t),[i,s]=Object.entries(n)[0];switch(i){case"M":case"L":return t?.convertTopLevelContainer?n:s;default:return n}}r(Bt,"marshall");var Gt=r((e,t)=>t?.convertWithoutMapWrapper?le(e,t):le({M:e},t),"unmarshall");var Z=null,m={},A=[],Rr="*",Le=r((e,t,n)=>{if(e!==void 0){if(n==null)return t(e);{let i=Object.keys(n),s=i.length===1&&i[0]===Rr,o=i.length>=1&&!s,a=i.length===0;if(o)return Ft(e,t,n);if(a)return Zs(e,t,Z);if(s)return Object.entries(e??{}).reduce((c,[d,g])=>(typeof g!="function"&&(c[d]=Le(g,t,n[Rr])),c),Array.isArray(e)?[]:{})}}},"processObj"),Ft=r((e,t,n)=>{let i;if(Array.isArray(e))i=e.filter(s=>typeof s!="function");else{i={};for(let[s,o]of Object.entries(e))typeof o!="function"&&(i[s]=o)}for(let[s,o]of Object.entries(n)){if(typeof e[s]=="function")continue;let a=Le(e[s],t,o);a!==void 0&&typeof a!="function"&&(i[s]=a)}return i},"processKeysInObj"),Zs=r((e,t,n)=>Array.isArray(e)?e.filter(i=>typeof i!="function").map(i=>Le(i,t,n)):Object.entries(e).reduce((i,[s,o])=>{if(typeof o=="function")return i;let a=Le(o,t,n);return a!==void 0&&typeof a!="function"&&(i[s]=a),i},{}),"processAllKeysInObj"),Pr=r((e,t,n)=>Ft(e,r(s=>Bt(s,n),"marshallFunc"),t),"marshallInput"),$r=r((e,t,n)=>Ft(e,r(s=>Gt(s,n),"unmarshallFunc"),t),"unmarshallOutput");var x=class extends hn{static{r(this,"DynamoDBDocumentClientCommand")}addMarshallingMiddleware(t){let{marshallOptions:n={},unmarshallOptions:i={}}=t.translateConfig||{};n.convertTopLevelContainer=n.convertTopLevelContainer??!0,i.convertWithoutMapWrapper=i.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((s,o)=>async a=>(Xn(o,"DDB_MAPPER","d"),s({...a,input:Pr(a.input,this.inputKeyNodes,n)})),{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((s,o)=>async a=>{let c=await s(a);return c.output=$r(c.output,this.outputKeyNodes,i),c},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}};var Ue="preferred",Ys=["disabled","preferred","required"];function pe(e){return Ys.includes(e)}r(pe,"validateAccountIdEndpointMode");var Kt=r(e=>{let{accountIdEndpointMode:t}=e,n=se(t??Ue);return Object.assign(e,{accountIdEndpointMode:r(async()=>{let i=await n();if(!pe(i))throw new Error(`Invalid value for accountIdEndpointMode: ${i}. Valid values are: "required", "preferred", "disabled".`);return i},"accountIdEndpointMode")})},"resolveAccountIdEndpointModeConfig");var Nr="Invalid AccountIdEndpointMode value",Or=r(e=>{throw new Error(e)},"_throw"),Lr="AWS_ACCOUNT_ID_ENDPOINT_MODE",Ur="account_id_endpoint_mode",Vt={environmentVariableSelector:r(e=>{let t=e[Lr];return t&&!pe(t)&&Or(Nr),t},"environmentVariableSelector"),configFileSelector:r(e=>{let t=e[Ur];return t&&!pe(t)&&Or(Nr),t},"configFileSelector"),default:Ue};var Mr=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],jt="endpoint_discovery_enabled",Br=r(e=>["false","0"].indexOf(e)>=0,"isFalsy"),Wt={environmentVariableSelector:r(e=>{for(let t=0;t<Mr.length;t++){let n=Mr[t];if(n in e){let i=e[n];if(i==="")throw Error(`Environment variable ${n} can't be empty of undefined, got "${i}"`);return!Br(i)}}},"environmentVariableSelector"),configFileSelector:r(e=>{if(jt in e){let t=e[jt];if(t===void 0)throw Error(`Shared config entry ${jt} can't be undefined, got "${t}"`);return!Br(t)}},"configFileSelector"),default:void 0};var Qr=Os(Jr());var fe=class{static{r(this,"EndpointCache")}cache;constructor(t){this.cache=new Qr.default(t)}getEndpoint(t){let n=this.get(t);if(!n||n.length===0)return;let i=n.map(s=>s.Address);return i[Math.floor(Math.random()*i.length)]}get(t){if(!this.has(t))return;let n=this.cache.get(t);if(!n)return;let i=Date.now(),s=n.filter(o=>i<o.Expires);if(s.length===0){this.delete(t);return}return s}set(t,n){let i=Date.now();this.cache.set(t,n.map(({Address:s,CachePeriodInMinutes:o})=>({Address:s,Expires:i+o*60*1e3})))}delete(t){this.cache.set(t,[])}has(t){if(!this.cache.has(t))return!1;let n=this.cache.peek(t);return n?n.length>0:!1}clear(){this.cache.clear()}};var Jt=r((e,{endpointDiscoveryCommandCtor:t})=>{let{endpointCacheSize:n,endpointDiscoveryEnabled:i,endpointDiscoveryEnabledProvider:s}=e;return Object.assign(e,{endpointDiscoveryCommandCtor:t,endpointCache:new fe(n??1e3),endpointDiscoveryEnabled:i!==void 0?()=>Promise.resolve(i):s,isClientEndpointDiscoveryEnabled:i!==void 0})},"resolveEndpointDiscoveryConfig");var Zr=r(async(e,t,n)=>({operation:fn(t).operation,region:await se(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),"defaultDynamoDBHttpAuthSchemeParametersProvider");function fo(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"dynamodb",region:e.region},propertiesExtractor:r((t,n)=>({signingProperties:{config:t,context:n}}),"propertiesExtractor")}}r(fo,"createAwsAuthSigv4HttpAuthOption");var Yr=r(e=>{let t=[];switch(e.operation){default:t.push(fo(e))}return t},"defaultDynamoDBHttpAuthSchemeProvider"),ei=r(e=>{let t=pr(e);return Object.assign(t,{authSchemePreference:se(e.authSchemePreference??[])})},"resolveHttpAuthSchemeConfig");var ti=r(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"dynamodb"}),"resolveClientEndpointParameters"),ni={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},AccountId:{type:"builtInParams",name:"accountId"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"},AccountIdEndpointMode:{type:"builtInParams",name:"accountIdEndpointMode"}};var D=Sn(ni,"DynamoDB_20120810","DynamoDBClient",Bn),ri={};var j={ResourceArn:{type:"contextParams",name:"TableName"}};var ii={ResourceArnList:{type:"operationContextParams",get:r(e=>e?.TransactItems?.map(t=>[t?.ConditionCheck?.TableName,t?.Put?.TableName,t?.Delete?.TableName,t?.Update?.TableName].filter(n=>n)).flat(),"get")}},k=r((e,t,n,i)=>[],"_mw0");var p=class e extends vn{static{r(this,"DynamoDBServiceException")}static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.dynamodb#DynamoDBServiceException";constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var Me=class e extends p{static{r(this,"BackupInUseException")}static shapeId="com.amazonaws.dynamodb#BackupInUseException";name="BackupInUseException";$fault="client";constructor(t){super({name:"BackupInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Be=class e extends p{static{r(this,"BackupNotFoundException")}static shapeId="com.amazonaws.dynamodb#BackupNotFoundException";name="BackupNotFoundException";$fault="client";constructor(t){super({name:"BackupNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ge=class e extends p{static{r(this,"InternalServerError")}static shapeId="com.amazonaws.dynamodb#InternalServerError";name="InternalServerError";$fault="server";constructor(t){super({name:"InternalServerError",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},Fe=class e extends p{static{r(this,"RequestLimitExceeded")}static shapeId="com.amazonaws.dynamodb#RequestLimitExceeded";name="RequestLimitExceeded";$fault="client";ThrottlingReasons;constructor(t){super({name:"RequestLimitExceeded",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.ThrottlingReasons=t.ThrottlingReasons}},Ke=class e extends p{static{r(this,"ThrottlingException")}static shapeId="com.amazonaws.dynamodb#ThrottlingException";name="ThrottlingException";$fault="client";throttlingReasons;constructor(t){super({name:"ThrottlingException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.throttlingReasons=t.throttlingReasons}},Ve=class e extends p{static{r(this,"InvalidEndpointException")}static shapeId="com.amazonaws.dynamodb#InvalidEndpointException";name="InvalidEndpointException";$fault="client";Message;constructor(t){super({name:"InvalidEndpointException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},je=class e extends p{static{r(this,"ProvisionedThroughputExceededException")}static shapeId="com.amazonaws.dynamodb#ProvisionedThroughputExceededException";name="ProvisionedThroughputExceededException";$fault="client";ThrottlingReasons;constructor(t){super({name:"ProvisionedThroughputExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.ThrottlingReasons=t.ThrottlingReasons}},We=class e extends p{static{r(this,"ResourceNotFoundException")}static shapeId="com.amazonaws.dynamodb#ResourceNotFoundException";name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},qe=class e extends p{static{r(this,"ItemCollectionSizeLimitExceededException")}static shapeId="com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException";name="ItemCollectionSizeLimitExceededException";$fault="client";constructor(t){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ze=class e extends p{static{r(this,"ReplicatedWriteConflictException")}static shapeId="com.amazonaws.dynamodb#ReplicatedWriteConflictException";name="ReplicatedWriteConflictException";$fault="client";$retryable={};constructor(t){super({name:"ReplicatedWriteConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},He=class e extends p{static{r(this,"ContinuousBackupsUnavailableException")}static shapeId="com.amazonaws.dynamodb#ContinuousBackupsUnavailableException";name="ContinuousBackupsUnavailableException";$fault="client";constructor(t){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Xe=class e extends p{static{r(this,"LimitExceededException")}static shapeId="com.amazonaws.dynamodb#LimitExceededException";name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Je=class e extends p{static{r(this,"TableInUseException")}static shapeId="com.amazonaws.dynamodb#TableInUseException";name="TableInUseException";$fault="client";constructor(t){super({name:"TableInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Qe=class e extends p{static{r(this,"TableNotFoundException")}static shapeId="com.amazonaws.dynamodb#TableNotFoundException";name="TableNotFoundException";$fault="client";constructor(t){super({name:"TableNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ze=class e extends p{static{r(this,"GlobalTableAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#GlobalTableAlreadyExistsException";name="GlobalTableAlreadyExistsException";$fault="client";constructor(t){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ye=class e extends p{static{r(this,"ResourceInUseException")}static shapeId="com.amazonaws.dynamodb#ResourceInUseException";name="ResourceInUseException";$fault="client";constructor(t){super({name:"ResourceInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},et=class e extends p{static{r(this,"TransactionConflictException")}static shapeId="com.amazonaws.dynamodb#TransactionConflictException";name="TransactionConflictException";$fault="client";constructor(t){super({name:"TransactionConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},tt=class e extends p{static{r(this,"PolicyNotFoundException")}static shapeId="com.amazonaws.dynamodb#PolicyNotFoundException";name="PolicyNotFoundException";$fault="client";constructor(t){super({name:"PolicyNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},nt=class e extends p{static{r(this,"ExportNotFoundException")}static shapeId="com.amazonaws.dynamodb#ExportNotFoundException";name="ExportNotFoundException";$fault="client";constructor(t){super({name:"ExportNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},rt=class e extends p{static{r(this,"GlobalTableNotFoundException")}static shapeId="com.amazonaws.dynamodb#GlobalTableNotFoundException";name="GlobalTableNotFoundException";$fault="client";constructor(t){super({name:"GlobalTableNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},it=class e extends p{static{r(this,"ImportNotFoundException")}static shapeId="com.amazonaws.dynamodb#ImportNotFoundException";name="ImportNotFoundException";$fault="client";constructor(t){super({name:"ImportNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},st=class e extends p{static{r(this,"DuplicateItemException")}static shapeId="com.amazonaws.dynamodb#DuplicateItemException";name="DuplicateItemException";$fault="client";constructor(t){super({name:"DuplicateItemException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ot=class e extends p{static{r(this,"IdempotentParameterMismatchException")}static shapeId="com.amazonaws.dynamodb#IdempotentParameterMismatchException";name="IdempotentParameterMismatchException";$fault="client";Message;constructor(t){super({name:"IdempotentParameterMismatchException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},at=class e extends p{static{r(this,"TransactionInProgressException")}static shapeId="com.amazonaws.dynamodb#TransactionInProgressException";name="TransactionInProgressException";$fault="client";Message;constructor(t){super({name:"TransactionInProgressException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message}},ut=class e extends p{static{r(this,"ExportConflictException")}static shapeId="com.amazonaws.dynamodb#ExportConflictException";name="ExportConflictException";$fault="client";constructor(t){super({name:"ExportConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ct=class e extends p{static{r(this,"InvalidExportTimeException")}static shapeId="com.amazonaws.dynamodb#InvalidExportTimeException";name="InvalidExportTimeException";$fault="client";constructor(t){super({name:"InvalidExportTimeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},lt=class e extends p{static{r(this,"PointInTimeRecoveryUnavailableException")}static shapeId="com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException";name="PointInTimeRecoveryUnavailableException";$fault="client";constructor(t){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},pt=class e extends p{static{r(this,"ImportConflictException")}static shapeId="com.amazonaws.dynamodb#ImportConflictException";name="ImportConflictException";$fault="client";constructor(t){super({name:"ImportConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},mt=class e extends p{static{r(this,"TableAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#TableAlreadyExistsException";name="TableAlreadyExistsException";$fault="client";constructor(t){super({name:"TableAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ft=class e extends p{static{r(this,"InvalidRestoreTimeException")}static shapeId="com.amazonaws.dynamodb#InvalidRestoreTimeException";name="InvalidRestoreTimeException";$fault="client";constructor(t){super({name:"InvalidRestoreTimeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},dt=class e extends p{static{r(this,"ReplicaAlreadyExistsException")}static shapeId="com.amazonaws.dynamodb#ReplicaAlreadyExistsException";name="ReplicaAlreadyExistsException";$fault="client";constructor(t){super({name:"ReplicaAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},yt=class e extends p{static{r(this,"ReplicaNotFoundException")}static shapeId="com.amazonaws.dynamodb#ReplicaNotFoundException";name="ReplicaNotFoundException";$fault="client";constructor(t){super({name:"ReplicaNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ht=class e extends p{static{r(this,"IndexNotFoundException")}static shapeId="com.amazonaws.dynamodb#IndexNotFoundException";name="IndexNotFoundException";$fault="client";constructor(t){super({name:"IndexNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},vt=class e extends p{static{r(this,"ConditionalCheckFailedException")}static shapeId="com.amazonaws.dynamodb#ConditionalCheckFailedException";name="ConditionalCheckFailedException";$fault="client";Item;constructor(t){super({name:"ConditionalCheckFailedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Item=t.Item}},xt=class e extends p{static{r(this,"TransactionCanceledException")}static shapeId="com.amazonaws.dynamodb#TransactionCanceledException";name="TransactionCanceledException";$fault="client";Message;CancellationReasons;constructor(t){super({name:"TransactionCanceledException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.Message=t.Message,this.CancellationReasons=t.CancellationReasons}};var yo="Action";var ho="AttributeMap";var Qt="AttributesToGet",oi="AttributeUpdates",vo="AttributeValue",Zt="AttributeValueList",xo="AttributeValueUpdate",bo="Address",Io="Attributes";var go="BackupInUseException";var Eo="BackupNotFoundException",So="BOOL";var _o="BS";var To="B",Ao="Code";var Do="ContinuousBackupsUnavailableException",Y="ConsumedCapacity",ko="ConditionalCheckFailedException",wo="ConsumedCapacityMultiple",ai="ConditionCheck";var de="ConditionExpression";var ui="ComparisonOperator",Yt="ConditionalOperator";var Co="CachePeriodInMinutes",Ro="CancellationReasons";var Po="CancellationReasonList",$o="ConfirmRemoveSelfResourceAccess",No="ClientRequestToken",Oo="CancellationReason",en="ConsistentRead";var ci="CapacityUnits";var Lo="Capacity",Uo="Condition",li="Count";var Mo="DescribeEndpoints";var Bo="DescribeEndpointsRequest",Go="DescribeEndpointsResponse";var Fo="DuplicateItemException";var pi="Delete";var Ko="ExpectedAttributeMap",W="ExpressionAttributeNames",H="ExpressionAttributeValues",Vo="ExpressionAttributeValueMap",jo="ExpectedAttributeValue";var Wo="ExportConflictException";var qo="ExportNotFoundException";var zo="ExpectedRevisionId";var mi="ExclusiveStartKey";var fi="Endpoints";var Ho="Endpoint",Xo="Expected",Jo="Exists";var Qo="FilterConditionMap";var di="FilterExpression";var Zo="GetItem",Yo="GetItemInput",ea="GetItemOutput";var ta="GlobalSecondaryIndexes";var na="GlobalTableAlreadyExistsException";var ra="GlobalTableNotFoundException";var bt="Item";var ia="ImportConflictException",sa="ItemCollectionKey",oa="ItemCollectionKeyAttributeMap",tn="ItemCollectionMetrics",aa="ItemCollectionMetricsMultiple",ua="ItemCollectionMetricsPerTable",ca="ItemCollectionSizeLimitExceededException";var la="InvalidEndpointException";var pa="InvalidExportTimeException";var ma="ItemList",yi="IndexName",fa="ImportNotFoundException",da="IndexNotFoundException",ya="IdempotentParameterMismatchException";var ha="InvalidRestoreTimeException";var va="InternalServerError";var hi="Items",ee="Key";var vi="KeyConditions",xa="KeyConditionExpression";var xi="Limit",ba="ListAttributeValue";var Ia="LimitExceededException";var bi="LastEvaluatedKey";var ga="LocalSecondaryIndexes";var Ea="L",ye="Message",Sa="MapAttributeValue";var _a="M",Ta="N";var Aa="NS";var Da="NULL";var nn="ProjectionExpression";var ka="PutItemInputAttributeMap";var wa="PointInTimeRecoveryUnavailableException";var Ca="PolicyNotFoundException";var Ra="PutResourcePolicyInput";var Pa="ProvisionedThroughputExceededException";var $a="Policy";var Ii="Put",Na="Query",Oa="QueryFilter",La="QueryInput",Ua="QueryOutput";var Ma="ResourceArn",Ba="ReplicaAlreadyExistsException";var he="ReturnConsumedCapacity",gi="ReadCapacityUnits";var Ei="ReturnItemCollectionMetrics";var Ga="ResourceInUseException";var Fa="RequestLimitExceeded";var Ka="ReplicaNotFoundException",Va="ResourceNotFoundException";var ja="ReturnValues",ve="ReturnValuesOnConditionCheckFailure",Wa="ReplicatedWriteConflictException";var Si="ScannedCount";var qa="SizeEstimateRangeGB",za="ScanFilter",Ha="ScanInput";var Xa="SecondaryIndexesCapacityMap",Ja="ScanIndexForward";var Qa="ScanOutput";var Za="SS";var Ya="S";var eu="Scan",_i="Select",tu="Segment";var nu="Table";var ru="TableAlreadyExistsException";var iu="TransactionCanceledException",su="TransactionConflictException";var ou="ThrottlingException";var au="TransactionInProgressException",uu="TableInUseException",cu="TransactItems";var G="TableName",lu="TableNotFoundException";var Ti="ThrottlingReasons";var pu="ThrottlingReasonList";var mu="ThrottlingReason";var fu="TotalSegments";var du="TransactWriteItem",yu="TransactWriteItemsInput",hu="TransactWriteItemList",vu="TransactWriteItemsOutput",xu="TransactWriteItems";var Ai="Update";var Di="UpdateExpression";var bu="UpdateItemInput",Iu="UpdateItemOutput",gu="UpdateItem";var ki="Value";var Eu="VectorCapacity",Su="VectorIndexes",_u="VectorIndexesCapacityMap";var Tu="VectorSearchRequestBytes",Au="VectorWriteRequestBytes",wi="WriteCapacityUnits";var Du="awsQueryError",h="client",y="error",Ci="httpError",ku="httpHeader",v="message",wu="reason",Cu="resource",Ri="smithy.ts.sdk.synthetic.com.amazonaws.dynamodb",Ru="server",Pu="throttlingReasons",$u="x-amz-confirm-remove-self-resource-access",u="com.amazonaws.dynamodb",Pi=new Lt(Ri),Nu=[-3,Ri,"DynamoDBServiceException",0,[],[]];Pi.registerError(Nu,p);var f=new Lt(u),Ou=[-3,u,go,{[y]:h},[v],[0]];f.registerError(Ou,Me);var Lu=[-3,u,Eo,{[y]:h},[v],[0]];f.registerError(Lu,Be);var Uu=[-3,u,ko,{[y]:h},[v,bt],[0,()=>be]];f.registerError(Uu,vt);var Mu=[-3,u,Do,{[y]:h},[v],[0]];f.registerError(Mu,He);var Bu=[-3,u,Fo,{[y]:h},[v],[0]];f.registerError(Bu,st);var Gu=[-3,u,Wo,{[y]:h},[v],[0]];f.registerError(Gu,ut);var Fu=[-3,u,qo,{[y]:h},[v],[0]];f.registerError(Fu,nt);var Ku=[-3,u,na,{[y]:h},[v],[0]];f.registerError(Ku,Ze);var Vu=[-3,u,ra,{[y]:h},[v],[0]];f.registerError(Vu,rt);var ju=[-3,u,ya,{[y]:h},[ye],[0]];f.registerError(ju,ot);var Wu=[-3,u,ia,{[y]:h},[v],[0]];f.registerError(Wu,pt);var qu=[-3,u,fa,{[y]:h},[v],[0]];f.registerError(qu,it);var zu=[-3,u,da,{[y]:h},[v],[0]];f.registerError(zu,ht);var Hu=[-3,u,va,{[y]:Ru},[v],[0]];f.registerError(Hu,Ge);var Xu=[-3,u,la,{[y]:h,[Ci]:421},[ye],[0]];f.registerError(Xu,Ve);var Ju=[-3,u,pa,{[y]:h},[v],[0]];f.registerError(Ju,ct);var Qu=[-3,u,ha,{[y]:h},[v],[0]];f.registerError(Qu,ft);var Zu=[-3,u,ca,{[y]:h},[v],[0]];f.registerError(Zu,qe);var Yu=[-3,u,Ia,{[y]:h},[v],[0]];f.registerError(Yu,Xe);var ec=[-3,u,wa,{[y]:h},[v],[0]];f.registerError(ec,lt);var tc=[-3,u,Ca,{[y]:h},[v],[0]];f.registerError(tc,tt);var nc=[-3,u,Pa,{[y]:h},[v,Ti],[0,()=>rn]];f.registerError(nc,je);var rc=[-3,u,Ba,{[y]:h},[v],[0]];f.registerError(rc,dt);var ic=[-3,u,Ka,{[y]:h},[v],[0]];f.registerError(ic,yt);var sc=[-3,u,Wa,{[y]:h},[v],[0]];f.registerError(sc,ze);var oc=[-3,u,Fa,{[y]:h},[v,Ti],[0,()=>rn]];f.registerError(oc,Fe);var ac=[-3,u,Ga,{[y]:h},[v],[0]];f.registerError(ac,Ye);var uc=[-3,u,Va,{[y]:h},[v],[0]];f.registerError(uc,We);var cc=[-3,u,ru,{[y]:h},[v],[0]];f.registerError(cc,mt);var lc=[-3,u,uu,{[y]:h},[v],[0]];f.registerError(lc,Je);var pc=[-3,u,lu,{[y]:h},[v],[0]];f.registerError(pc,Qe);var mc=[-3,u,ou,{[Du]:["Throttling",400],[y]:h,[Ci]:400},[v,Pu],[0,()=>rn]];f.registerError(mc,Ke);var fc=[-3,u,iu,{[y]:h},[ye,Ro],[0,()=>Bc]];f.registerError(fc,xt);var dc=[-3,u,su,{[y]:h},[v],[0]];f.registerError(dc,et);var yc=[-3,u,au,{[y]:h},[ye],[0]];f.registerError(yc,at);var $i=[Pi,f];var hc=[3,u,xo,0,[ki,yo],[()=>L,0]];var vc=[3,u,Oo,0,[bt,Ao,ye],[()=>be,0,0]],Ni=[3,u,Lo,0,[gi,wi,ci],[1,1,1]],Oi=[3,u,Uo,0,[ui,Zt],[0,()=>Ui],1],xc=[3,u,ai,0,[ee,G,de,W,H,ve],[()=>F,0,0,128,()=>X,0],3],xe=[3,u,Y,0,[G,ci,gi,wi,nu,ga,ta,Su],[0,1,1,1,()=>Ni,()=>si,()=>si,()=>Zc]];var bc=[3,u,pi,0,[ee,G,de,W,H,ve],[()=>F,0,0,128,()=>X,0],2];var Ic=[3,u,Bo,0,[],[]],gc=[3,u,Go,0,[fi],[()=>Fc],1];var Ec=[3,u,Ho,0,[bo,Co],[0,1],2];var Sc=[3,u,jo,0,[ki,Jo,ui,Zt],[()=>L,2,0,()=>Ui]];var _c=[3,u,Yo,0,[G,ee,Qt,en,he,nn,W],[0,()=>F,64,2,0,0,128],2],Tc=[3,u,ea,0,[bt,Y],[()=>be,()=>xe]];var Li=[3,u,tn,0,[sa,qa],[()=>zc,65]];var Ac=[3,u,Ii,0,[bt,G,de,W,H,ve],[()=>Qc,0,0,128,()=>X,0],2];var Hp=[3,u,Ra,0,[Ma,$a,zo,$o],[0,0,0,[2,{[ku]:$u}]],2];var Dc=[3,u,La,0,[G,yi,_i,Qt,xi,en,vi,Oa,Yt,Ja,mi,he,nn,di,xa,W,H],[0,0,0,64,1,2,()=>Xc,()=>Bi,0,2,()=>F,0,0,0,0,128,()=>X],1],kc=[3,u,Ua,0,[hi,li,Si,bi,Y],[()=>Mi,1,1,()=>F,()=>xe]];var wc=[3,u,Ha,0,[G,yi,Qt,xi,_i,za,Yt,mi,he,fu,tu,nn,di,W,H,en],[0,0,64,1,0,()=>Bi,0,()=>F,0,1,1,0,0,128,()=>X,2],1],Cc=[3,u,Qa,0,[hi,li,Si,bi,Y],[()=>Mi,1,1,()=>F,()=>xe]];var Rc=[3,u,mu,0,[wu,Cu],[0,0]];var Pc=[3,u,du,0,[ai,Ii,pi,Ai],[()=>xc,()=>Ac,()=>bc,()=>Oc]],$c=[3,u,yu,0,[cu,he,Ei,No],[()=>jc,0,0,[0,4]],1],Nc=[3,u,vu,0,[Y,tn],[()=>Gc,()=>Hc]];var Oc=[3,u,Ai,0,[ee,Di,G,de,W,H,ve],[()=>F,0,0,0,128,()=>X,0],3];var Lc=[3,u,bu,0,[G,ee,oi,Xo,Yt,ja,he,Ei,Di,de,W,H,ve],[0,()=>F,()=>Wc,()=>qc,0,0,0,0,0,0,128,()=>X,0],2],Uc=[3,u,Iu,0,[Io,Y,tn],[()=>be,()=>xe,()=>Li]];var Mc=[3,u,Eu,0,[Tu,Au],[1,1]];var Ui=[1,u,Zt,0,()=>L];var Bc=[1,u,Po,0,()=>vc],Gc=[1,u,wo,0,()=>xe];var Fc=[1,u,fi,0,()=>Ec];var Kc=[1,u,aa,0,()=>Li];var Mi=[1,u,ma,0,()=>be];var Vc=[1,u,ba,0,()=>L];var rn=[1,u,pu,0,()=>Rc];var jc=[1,u,hu,0,()=>Pc];var be=[2,u,ho,0,0,()=>L],Wc=[2,u,oi,0,0,()=>hc];var qc=[2,u,Ko,0,0,()=>Sc];var X=[2,u,Vo,0,0,()=>L],Bi=[2,u,Qo,0,0,()=>Oi],zc=[2,u,oa,0,0,()=>L],Hc=[2,u,ua,0,0,()=>Kc],F=[2,u,ee,0,0,()=>L],Xc=[2,u,vi,0,0,()=>Oi],Jc=[2,u,Sa,0,0,()=>L],Qc=[2,u,ka,0,0,()=>L],si=[2,u,Xa,0,0,()=>Ni],Zc=[2,u,_u,0,0,()=>Mc],L=[4,u,vo,0,[Ya,Ta,To,Za,Aa,_o,_a,Ea,Da,So],[0,0,21,64,64,85,()=>Jc,()=>Vc,2,2]];var Gi=[9,u,Mo,0,()=>Ic,()=>gc];var Fi=[9,u,Zo,0,()=>_c,()=>Tc];var Ki=[9,u,Na,0,()=>Dc,()=>kc];var Vi=[9,u,eu,0,()=>wc,()=>Cc];var ji=[9,u,xu,0,()=>$c,()=>Nc];var Wi=[9,u,gu,0,()=>Lc,()=>Uc];var It=class extends D(ri,k,"DescribeEndpoints",Gi){static{r(this,"DescribeEndpointsCommand")}};var qi={name:"@aws-sdk/client-dynamodb",version:"3.1150.0",description:"AWS SDK for JavaScript Dynamodb Client for Node.js, Browser and React Native",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dynamodb",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-dynamodb"},files:["dist-*/**"],sideEffects:!1,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service",test:"yarn g:vitest run --passWithNoTests","test:watch":"yarn g:vitest watch --passWithNoTests","test:integration":"yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch --passWithNoTests -c vitest.config.integ.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc -p tsconfig.test.json && node ./test/index-objects.spec.mjs"},dependencies:{"@aws-sdk/core":"^3.978.3","@aws-sdk/credential-provider-node":"^3.972.86","@aws-sdk/dynamodb-codec":"^3.973.48","@aws-sdk/middleware-endpoint-discovery":"^3.972.32","@aws-sdk/types":"^3.974.6","@smithy/core":"^3.35.2","@smithy/fetch-http-handler":"^5.8.0","@smithy/node-http-handler":"^4.12.1","@smithy/types":"^4.19.0",tslib:"^2.6.2"},devDependencies:{"@smithy/snapshot-testing":"^2.3.2","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~7.0.2",vitest:"^4.0.17"},engines:{node:">=20.0.0"}};var zi="com.amazonaws.dynamodb#AttributeValue",sn=class extends dr{static{r(this,"DynamoDBJsonShapeSerializer2")}writeValue(t,n,i){if(n!=null&&typeof n=="object"){let s=Ot.of(t);if(s.isStructSchema()&&s.getName(!0)===zi){this.writeAttributeValue(n);return}}super.writeValue(t,n,i)}writeAttributeValue(t){let n=this.serdeContext?.base64Encoder??we;this.writeAscii("{");let i=!0;for(let s in t){let o=t[s];if(o!=null)switch(i||this.writeAscii(","),i=!1,this.writeAsciiQuoted(s),this.writeAscii(":"),s){case"B":o instanceof Uint8Array?this.writeBase64(o):this.writeJsonString(o);break;case"BS":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++){c>0&&this.writeAscii(",");let d=a[c];d instanceof Uint8Array?this.writeBase64(d):this.writeJsonString(n(d))}}this.writeAscii("]");break;case"L":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++)c>0&&this.writeAscii(","),a[c]!=null?this.writeAttributeValue(a[c]):this.writeAscii("null")}this.writeAscii("]");break;case"M":this.writeAscii("{");{let a=o,c=!0;for(let d in a)a[d]!=null&&(c||this.writeAscii(","),c=!1,this.writeJsonString(d),this.writeAscii(":"),this.writeAttributeValue(a[d]))}this.writeAscii("}");break;case"SS":case"NS":this.writeAscii("[");{let a=o;for(let c=0;c<a.length;c++)c>0&&this.writeAscii(","),this.writeJsonString(a[c])}this.writeAscii("]");break;case"S":case"N":this.writeJsonString(o);break;case"BOOL":this.writeAscii(o?"true":"false");break;case"NULL":this.writeAscii(o?"true":"false");break;default:this.writeAscii(JSON.stringify(o));break}}this.writeAscii("}")}},on=class extends fr{static{r(this,"DynamoDBJsonShapeDeserializer2")}_read(t,n){let i=Ot.of(t);return i.isStructSchema()&&i.getName(!0)===zi&&n&&typeof n=="object"?this.readAttributeValue(n):super._read(i,n)}readAttributeValue(t){let n=this.serdeContext?.base64Decoder??ke,i=t;if(typeof t.B=="string"&&(i.B=n(t.B)),Array.isArray(t.BS)&&(i.BS=t.BS.map(n)),Array.isArray(t.L)&&(i.L=t.L.map(s=>this.readAttributeValue(s))),t.M&&typeof t.M=="object"){let s=t.M;for(let o in s)s[o]=this.readAttributeValue(s[o])}return i}},Ie=class extends yr{static{r(this,"DynamoDBJsonCodec2")}constructor(){super({timestampFormat:{useTrait:!0,default:7},jsonName:!1})}createSerializer(){let t=new sn(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new on(this.settings);return t.setSerdeContext(this.serdeContext),t}};var _="ref",P="argv",T=-1,ge=!0,te=!1,ne="isSet",Ee="booleanEquals",ys="PartitionResult",R="stringEquals",$="getAttr",hs="parsedEndpoint",Hi="aws.parseArn",Xi=r(e=>"ParsedArn_ssa_"+e,"k"),Ji="service",an="dynamodb",Se="isValidHostLabel",Qi="accountId",Zi="FirstArn",Yi=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}","q"),es=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}","s"),ts=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}","t"),ns=r(e=>"https://{ParsedArn_ssa_"+e+"#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}","u"),gt={[_]:"Region"},cn={[_]:ys},rs={fn:$,[P]:[{[_]:hs},"authority"]},un={[_]:"AccountIdEndpointMode"},is={fn:$,[P]:[cn,"name"]},ss={fn:$,[P]:[{[_]:"ParsedArn_ssa_2"},"region"]},os={[_]:"ParsedArn_ssa_2"},as={[_]:"ResourceArnList"},us={fn:$,[P]:[{[_]:"ParsedArn_ssa_1"},"region"]},cs={[_]:"ParsedArn_ssa_1"},ls={[_]:"AccountId"},K={},w={metricValues:["O"]},ps=[gt],ms=[{[_]:"Endpoint"}],fs=[{[_]:"ResourceArn"}],ds={conditions:[[ne,ps],[ne,ms],[Ee,[{[_]:"UseFIPS"},ge]],[Ee,[{[_]:"UseDualStack"},ge]],["aws.partition",ps,ys],[R,[gt,"local"]],[Ee,[{fn:$,[P]:[cn,"supportsFIPS"]},ge]],["parseURL",ms,hs],[R,["dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",rs]],[Ee,[{fn:$,[P]:[cn,"supportsDualStack"]},ge]],[R,["search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",rs]],[ne,[un]],[R,[is,"aws"]],[R,[un,"disabled"]],[ne,fs],[Hi,fs,Xi(2)],[R,[ss,gt]],[R,[{fn:$,[P]:[os,Ji]},an]],[Se,[ss,te]],[Se,[{fn:$,[P]:[os,Qi]},te]],[ne,[as]],[$,[as,"[0]"],Zi],[Hi,[{[_]:Zi}],Xi(1)],[R,[us,gt]],[R,[{fn:$,[P]:[cs,Ji]},an]],[Se,[{fn:$,[P]:[cs,Qi]},te]],[Se,[us,te]],[ne,[ls]],[R,[un,"required"]],[Se,[ls,te]],[R,[is,"aws-us-gov"]],[Ee,[{fn:"coalesce",[P]:[{[_]:"IsSearchOperation"},te]},ge]]],results:[[T],[T,"Invalid Configuration: FIPS and custom endpoint are not supported"],[T,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[T,"Endpoint override is not supported for dual-stack endpoints. Please enable dual-stack functionality by enabling the configuration. For more details, see: https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html"],["{Endpoint}",K],[T,"Invalid Configuration: FIPS and local endpoint are not supported"],[T,"Invalid Configuration: Dualstack and local endpoint are not supported"],["http://localhost:8000",{authSchemes:[{signingRegion:"us-east-1",signingName:an,name:"sigv4"}]}],[T,"Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported"],["https://search-dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",K],["https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",K],[T,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://search-dynamodb.{Region}.{PartitionResult#dnsSuffix}",K],["https://dynamodb.{Region}.{PartitionResult#dnsSuffix}",K],["https://search-dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",K],["https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",K],[T,"FIPS is enabled but this partition does not support FIPS"],[Yi(2),w],[es(2),w],[Yi(1),w],[es(1),w],["https://{AccountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}",w],["https://{AccountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}",w],[T,"Credentials-sourced account ID parameter is invalid"],[T,"AccountIdEndpointMode is required but no AccountID was provided or able to be loaded"],[T,"Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition"],["https://search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",K],["https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",K],[T,"DualStack is enabled but this partition does not support DualStack"],[ts(2),w],[ns(2),w],[ts(1),w],[ns(1),w],["https://{AccountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}",w],["https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}",w],[T,"Invalid Configuration: Missing Region"]]},el=2,l=1e8,tl=new Int32Array([-1,1,-1,0,6,3,1,4,l+35,2,l+1,5,3,l+2,l+4,1,77,7,2,61,8,3,34,9,4,10,l+35,5,l+7,11,11,12,69,12,14,13,28,l+25,69,13,33,15,14,16,21,15,17,21,16,18,21,17,19,21,18,20,21,19,32,21,20,22,28,21,23,28,22,24,28,23,25,28,24,26,28,25,27,28,26,31,28,27,29,33,29,30,l+23,31,l+33,l+34,31,l+31,l+32,31,l+29,l+30,28,l+24,69,4,35,l+35,5,l+6,36,9,37,l+28,11,38,60,12,40,39,28,l+25,60,13,59,41,14,42,47,15,43,47,16,44,47,17,45,47,18,46,47,19,58,47,20,48,54,21,49,54,22,50,54,23,51,54,24,52,54,25,53,54,26,57,54,27,55,59,29,56,l+23,31,l+21,l+22,31,l+19,l+20,31,l+17,l+18,28,l+24,60,31,l+26,l+27,3,70,62,4,63,l+35,5,l+5,64,6,65,l+16,11,66,67,28,l+8,67,30,69,68,31,l+14,l+15,31,l+12,l+13,4,71,l+35,5,l+5,72,6,73,l+11,9,74,l+11,11,75,76,28,l+8,76,31,l+9,l+10,2,l+1,78,3,l+2,79,4,80,l+4,7,81,l+4,8,l+3,82,10,l+3,l+4]),vs=Nn.from(tl,el,ds.conditions,ds.results);var nl=new On({size:50,params:["AccountId","AccountIdEndpointMode","Endpoint","IsSearchOperation","Region","ResourceArn","ResourceArnList","UseDualStack","UseFIPS"]}),xs=r((e,t={})=>nl.get(e,()=>Un(vs,{endpointParams:e,logger:t.logger})),"defaultEndpointResolver");Ln.aws=or;var bs=r(e=>({apiVersion:"2012-08-10",base64Decoder:e?.base64Decoder??ke,base64Encoder:e?.base64Encoder??we,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??xs,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Yr,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:r(t=>t.getIdentityProvider("aws.auth#sigv4"),"identityProvider"),signer:new cr}],logger:e?.logger??new En,protocol:e?.protocol??hr,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.dynamodb",errorTypeRegistries:$i,xmlNamespace:"http://dynamodb.amazonaws.com/doc/2012-08-10/",version:"2012-08-10",serviceTarget:"DynamoDB_20120810",jsonCodec:new Ie},serviceId:e?.serviceId??"DynamoDB",sha256:e?.sha256??Fn,urlParser:e?.urlParser??dn,utf8Decoder:e?.utf8Decoder??Tn,utf8Encoder:e?.utf8Encoder??An}),"getRuntimeConfig");var Is=r(e=>{bn(process.version);let t=$n(e),n=r(()=>t().then(xn),"defaultConfigProvider"),i=bs(e);_n(process.version);let s={profile:e?.profile,logger:i.logger};return{...i,...e,runtime:"node",defaultsMode:t,accountIdEndpointMode:e?.accountIdEndpointMode??N(Vt,s),authSchemePreference:e?.authSchemePreference??N(lr,s),bodyLengthChecker:e?.bodyLengthChecker??Dn,credentialDefaultProvider:e?.credentialDefaultProvider??vr,defaultUserAgentProvider:e?.defaultUserAgentProvider??ir({serviceId:i.serviceId,clientVersion:qi.version}),endpointDiscoveryEnabledProvider:e?.endpointDiscoveryEnabledProvider??N(Wt,s),maxAttempts:e?.maxAttempts??N(oe.v2026?{...Ut,default:4}:Ut,e),region:e?.region??N(Cn,{...Rn,...s}),requestHandler:mr.create(e?.requestHandler??n),retryMode:e?.retryMode??N({...zn,default:r(async()=>(await n()).retryMode||Wn,"default")},e),streamCollector:e?.streamCollector??Gn,useDualstackEndpoint:e?.useDualstackEndpoint??N(kn,s),useFipsEndpoint:e?.useFipsEndpoint??N(wn,s),userAgentAppId:e?.userAgentAppId??N(sr,s)}},"getRuntimeConfig");var gs=r(e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,i=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(a=>a.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){i=s},credentials(){return i}}},"getHttpAuthExtensionConfiguration"),Es=r(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig");var Ss=r((e,t)=>{let n=Object.assign(ar(e),In(e),Kn(e),gs(e));return t.forEach(i=>i.configure(n)),Object.assign(e,ur(n),gn(n),Vn(n),Es(n))},"resolveRuntimeExtensions");var re=class extends De{static{r(this,"DynamoDBClient")}config;constructor(...[t]){let n=Is(t||{});super(n),this.initConfig=n;let i=ti(n),s=Kt(i),o=nr(s),a=qn(o,{defaultBaseDelay:oe.v2026?25:void 0,defaultMaxAttempts:oe.v2026?4:void 0}),c=Pn(a),d=c,g=Mn(d),E=ei(g),Nt=Jt(E,{endpointDiscoveryCommandCtor:It}),$s=Ss(Nt,t?.extensions||[]);this.config=$s,this.middlewareStack.use(yn(this.config)),this.middlewareStack.use(rr(this.config)),this.middlewareStack.use(Hn(this.config)),this.middlewareStack.use(jn(this.config)),this.middlewareStack.use(Jn(this.config)),this.middlewareStack.use(Qn(this.config)),this.middlewareStack.use(Zn(this.config)),this.middlewareStack.use(Yn(this.config,{httpAuthSchemeParametersProvider:Zr,identityProviderConfigProvider:r(async Ns=>new tr({"aws.auth#sigv4":Ns.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use(er(this.config))}destroy(){super.destroy()}};var Et=class extends D(j,k,"GetItem",Fi){static{r(this,"GetItemCommand")}};var St=class extends D(j,k,"Query",Ki){static{r(this,"QueryCommand")}};var _t=class extends D(j,k,"Scan",Vi){static{r(this,"ScanCommand")}};var Tt=class extends D(ii,k,"TransactWriteItems",ji){static{r(this,"TransactWriteItemsCommand")}};var At=class extends D(j,k,"UpdateItem",Wi){static{r(this,"UpdateItemCommand")}};var J=class extends x{static{r(this,"GetCommand")}input;inputKeyNodes={Key:m};outputKeyNodes={Item:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new Et(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var Q=class extends x{static{r(this,"QueryCommand")}input;inputKeyNodes={KeyConditions:{"*":{AttributeValueList:A}},QueryFilter:{"*":{AttributeValueList:A}},ExclusiveStartKey:m,ExpressionAttributeValues:m};outputKeyNodes={Items:{"*":m},LastEvaluatedKey:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new St(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var _e=class extends x{static{r(this,"ScanCommand")}input;inputKeyNodes={ScanFilter:{"*":{AttributeValueList:A}},ExclusiveStartKey:m,ExpressionAttributeValues:m};outputKeyNodes={Items:{"*":m},LastEvaluatedKey:m};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new _t(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var Te=class extends x{static{r(this,"TransactWriteCommand")}input;inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:m,ExpressionAttributeValues:m},Put:{Item:m,ExpressionAttributeValues:m},Delete:{Key:m,ExpressionAttributeValues:m},Update:{Key:m,ExpressionAttributeValues:m}}}};outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:m}}}};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new Tt(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var q=class extends x{static{r(this,"UpdateCommand")}input;inputKeyNodes={Key:m,AttributeUpdates:{"*":{Value:Z}},Expected:{"*":{Value:Z,AttributeValueList:A}},ExpressionAttributeValues:m};outputKeyNodes={Attributes:m,ItemCollectionMetrics:{ItemCollectionKey:m}};clientCommand;middlewareStack;constructor(t){super(),this.input=t,this.clientCommand=new At(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,n,i){this.addMarshallingMiddleware(n);let s=t.concat(this.middlewareStack),o=this.clientCommand.resolveMiddleware(s,n,i);return async()=>o(this.clientCommand)}};var U=class e extends De{static{r(this,"DynamoDBDocumentClient")}config;constructor(t,n){if(super(t.config),this.config=t.config,this.config.translateConfig=n,this.middlewareStack=t.middlewareStack,this.config?.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.");if(!(t.middlewareStack.identify?.()??[]).some(o=>o.includes?.("serializerMiddleware"))){let o=this.config.logger,a=o&&!o.constructor?.name.includes("NoOp")?o:console,c=new re(Object.assign({},this.config,{defaultUserAgentProvider:void 0,retryStrategy:void 0,extensions:void 0}));if(c.middlewareStack.identify?.().some(g=>g.includes?.("serializerMiddleware")))this.middlewareStack=c.middlewareStack,this.config=c.config,this.config.translateConfig=n,a.warn("@aws-sdk/lib-dynamodb - WARN: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. We have forwarded your client's configuration to a newer version of DynamoDBClient in the dependency closure to instantiate DynamoDBDocumentClient.");else throw new Error("@aws-sdk/lib-dynamodb - ERROR: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. Check @aws-sdk/lib-dynamodb package.json requirements.")}}static from(t,n){return new e(t,n)}destroy(){}};var Iy=Ce(U,Q,"ExclusiveStartKey","LastEvaluatedKey","Limit");var Ty=Ce(U,_e,"ExclusiveStartKey","LastEvaluatedKey","Limit");var Dt=["hour","day","month"],_s=["status","country","device","path"],Ts=["v1","v2"];var dh=M({pk:S(),sk:S(),source:V(Ts),appliedAt:b(),ttl:C(b())}),kt=class{constructor(t){this.props=t}props;static{r(this,"AppliedMarkers")}isApplied=r(async t=>{let{Item:n}=await this.props.dynamo.send(new J({TableName:this.props.tableName,Key:{pk:As(t),sk:"applied"}}));return n!=null},"isApplied");buildMarkerPut=r(t=>{let n={pk:As(t),sk:"applied",source:t.source,appliedAt:Date.now()};return t.ttl!=null&&(n.ttl=t.ttl),{Put:{TableName:this.props.tableName,Item:n,ConditionExpression:"attribute_not_exists(pk) AND attribute_not_exists(sk)"}}},"buildMarkerPut")};function As(e){return`applied#${e.grain}#${e.periodKey}`}r(As,"partitionKey");function ln(e,t=100){let n=[],i=Math.ceil(e.length/t),s=0,o=t;for(let a=0;a<i;a++)n.push(e.slice(s,o)),s+=t,o+=t;return n}r(ln,"splitArrayToChunks");async function wt(e){let t=[],n;do{let{Items:i=[],LastEvaluatedKey:s}=await e.dynamo.send(new Q({...e.input,ExclusiveStartKey:n}));n=s,t.push(...i)}while(n!=null);return t}r(wt,"queryAll");var il=M({pk:S(),sk:S(),dimension:V(_s),grain:V(Dt),periodKey:S(),value:S(),hits:b(),bytes:b(),ttl:C(b())}),Ct=class{constructor(t){this.props=t}props;static{r(this,"Breakdowns")}addMany=r(async t=>{let n=this.buildUpdates(t);for(let i of n)await this.props.dynamo.send(new q(i.Update))},"addMany");buildUpdates=r(t=>t.items.map(n=>({Update:this.buildUpdateMembers({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey,item:n,ttl:t.ttl})})),"buildUpdates");getForPeriod=r(async t=>(await wt({dynamo:this.props.dynamo,input:{TableName:this.props.tableName,KeyConditionExpression:"#pk = :pk",ExpressionAttributeNames:{"#pk":"pk"},ExpressionAttributeValues:{":pk":Ds({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey})}}})).map(i=>this.parseOne(i)),"getForPeriod");buildUpdateMembers=r(t=>{let n={"#dimension":"dimension","#grain":"grain","#periodKey":"periodKey","#value":"value","#hits":"hits","#bytes":"bytes"},i={":dimension":t.dimension,":grain":t.grain,":periodKey":t.periodKey,":value":t.item.value,":hits":t.item.hits,":bytes":t.item.bytes},s=["#dimension = :dimension","#grain = :grain","#periodKey = :periodKey","#value = :value"];return t.ttl!=null&&(n["#ttl"]="ttl",i[":ttl"]=t.ttl,s.push("#ttl = :ttl")),{TableName:this.props.tableName,Key:{pk:Ds({dimension:t.dimension,grain:t.grain,periodKey:t.periodKey}),sk:t.item.value},UpdateExpression:`SET ${s.join(", ")} ADD #hits :hits, #bytes :bytes`,ExpressionAttributeNames:n,ExpressionAttributeValues:i}},"buildUpdateMembers");parseOne=r(t=>{let n=$e(il,t);if(!n.success)throw console.error(Pe(n.issues)),new Error("Malformed stored breakdown record");return n.output},"parseOne")};function Ds(e){return`breakdown#${e.dimension}#${e.grain}#${e.periodKey}`}r(Ds,"partitionKey");function ks(){return U.from(new re,{marshallOptions:{removeUndefinedValues:!0,convertEmptyValues:!1}})}r(ks,"toDynamoClient");function ws(e){let t={hits:0,success:0,errors:0,errors4xx:0,errors5xx:0,bytesSent:0,bytesReceived:0};return e.reduce((n,i)=>({hits:n.hits+i.hits,success:n.success+i.success,errors:n.errors+i.errors,errors4xx:n.errors4xx+i.errors4xx,errors5xx:n.errors5xx+i.errors5xx,bytesSent:n.bytesSent+i.bytesSent,bytesReceived:n.bytesReceived+i.bytesReceived}),t)}r(ws,"sumTotals");function Ae(e){let t={};for(let n of e){let i=t[n.value];i==null?t[n.value]={value:n.value,hits:n.hits,bytes:n.bytes}:t[n.value]={value:n.value,hits:i.hits+n.hits,bytes:i.bytes+n.bytes}}return Object.values(t)}r(Ae,"sumBreakdown");var sl=100;async function Cs({dayKey:e,models:t,dynamo:n}){if(await t.markers.isApplied({grain:"day",periodKey:e}))return{status:"skipped"};let s=await t.totals.queryWindow({grain:"hour",startKey:`${e}-00`,endKey:`${e}-23`}),o=ws(s),a=await ll({breakdowns:t.breakdowns,grain:"hour",periodKeys:pl(e)}),c=t.totals.buildAggregateUpdate({grain:"day",item:{timeKey:e,...o}}),d=cl({breakdowns:t.breakdowns,grain:"day",periodKey:e,byStatus:a.status,byDevice:a.device,byPath:a.path,byCountry:a.country}),g=t.markers.buildMarkerPut({grain:"day",periodKey:e,source:"v2"});return al({dynamo:n,leading:[g,c],rest:d})}r(Cs,"applyDailyRollup");function ol({leading:e,rest:t,limit:n=sl}){let i=Math.max(n-e.length,0),s=[...e,...t.slice(0,i)],o=ln(t.slice(i),n);return[s,...o]}r(ol,"chunkTransactItems");async function al({dynamo:e,leading:t,rest:n}){let i=ol({leading:t,rest:n});try{for(let s of i)s.length!==0&&await e.send(new Te({TransactItems:s}))}catch(s){if(ul(s))return{status:"skipped"};throw s}return{status:"applied"}}r(al,"sendTransacted");function ul(e){if(e==null||typeof e!="object")return!1;let t="name"in e?e.name:void 0;return t==="TransactionCanceledException"||t==="ConditionalCheckFailedException"}r(ul,"isMarkerRaceError");function cl({breakdowns:e,grain:t,periodKey:n,ttl:i,byStatus:s,byDevice:o,byPath:a,byCountry:c}){let d=[{dimension:"status",items:s},{dimension:"device",items:o},{dimension:"country",items:c},{dimension:"path",items:a}],g=[];for(let E of d)E.items.length!==0&&g.push(...e.buildUpdates({dimension:E.dimension,grain:t,periodKey:n,items:E.items,ttl:i}));return g}r(cl,"buildBreakdownUpdates");async function ll({breakdowns:e,grain:t,periodKeys:n}){let i=[],s=[],o=[],a=[];for(let c of n){let[d,g,E,Nt]=await Promise.all([e.getForPeriod({dimension:"status",grain:t,periodKey:c}),e.getForPeriod({dimension:"device",grain:t,periodKey:c}),e.getForPeriod({dimension:"path",grain:t,periodKey:c}),e.getForPeriod({dimension:"country",grain:t,periodKey:c})]);i.push(...d.map(Rt)),s.push(...g.map(Rt)),o.push(...E.map(Rt)),a.push(...Nt.map(Rt))}return{status:Ae(i),device:Ae(s),path:Ae(o),country:Ae(a)}}r(ll,"aggregateFinerBreakdowns");function pl(e){let t=[];for(let n=0;n<24;n+=1)t.push(`${e}-${n.toString().padStart(2,"0")}`);return t}r(pl,"hourWindowKeys");function Rt(e){return{value:e.value,hits:e.hits,bytes:e.bytes}}r(Rt,"toBreakdownRow");function Rs(e){return e.toString().padStart(2,"0")}r(Rs,"pad2");function ml(e){return e.toString().padStart(4,"0")}r(ml,"pad4");function fl(e){return`${ml(e.getUTCFullYear())}-${Rs(e.getUTCMonth()+1)}`}r(fl,"monthKey");function Ps(e){return`${fl(e)}-${Rs(e.getUTCDate())}`}r(Ps,"dayKey");var dl=["hits","success","errors","errors4xx","errors5xx","bytesSent","bytesReceived"],yl=["p50TimeTaken","p95TimeTaken","cacheHitRatio","uniqueIpCount"],hl=M({pk:S(),sk:S(),grain:V(Dt),timeKey:S(),hits:b(),success:b(),errors:b(),errors4xx:b(),errors5xx:b(),bytesSent:b(),bytesReceived:b(),p50TimeTaken:C(b()),p95TimeTaken:C(b()),cacheHitRatio:C(b()),uniqueIpCount:C(b()),ttl:C(b())}),Pt=class{constructor(t){this.props=t}props;static{r(this,"Totals")}addHourly=r(async t=>{let n=this.buildHourlyUpdate(t);await this.props.dynamo.send(new q(n.Update))},"addHourly");addAggregate=r(async t=>{let n=this.buildAggregateUpdate(t);await this.props.dynamo.send(new q(n.Update))},"addAggregate");buildHourlyUpdate=r(t=>({Update:this.buildUpdateMembers({grain:"hour",item:t.item,ttl:t.ttl,includeHourlyDetail:!0})}),"buildHourlyUpdate");buildAggregateUpdate=r(t=>({Update:this.buildUpdateMembers({grain:t.grain,item:t.item,includeHourlyDetail:!1})}),"buildAggregateUpdate");queryWindow=r(async t=>(await wt({dynamo:this.props.dynamo,input:{TableName:this.props.tableName,KeyConditionExpression:"#pk = :pk AND #sk BETWEEN :start AND :end",ExpressionAttributeNames:{"#pk":"pk","#sk":"sk"},ExpressionAttributeValues:{":pk":pn(t.grain),":start":t.startKey,":end":t.endKey}}})).map(i=>this.parseOne(i)),"queryWindow");getOne=r(async t=>{let{Item:n}=await this.props.dynamo.send(new J({TableName:this.props.tableName,Key:{pk:pn(t.grain),sk:t.timeKey}}));if(n!=null)return this.parseOne(n)},"getOne");buildUpdateMembers=r(t=>{let n={"#grain":"grain","#timeKey":"timeKey"},i={":grain":t.grain,":timeKey":t.item.timeKey},s=["#grain = :grain","#timeKey = :timeKey"],o=[];for(let a of dl)n[`#${a}`]=a,i[`:${a}`]=t.item[a],o.push(`#${a} :${a}`);if(t.includeHourlyDetail)for(let a of yl){let c=t.item[a];c!=null&&(n[`#${a}`]=a,i[`:${a}`]=c,s.push(`#${a} = :${a}`))}return t.ttl!=null&&(n["#ttl"]="ttl",i[":ttl"]=t.ttl,s.push("#ttl = :ttl")),{TableName:this.props.tableName,Key:{pk:pn(t.grain),sk:t.item.timeKey},UpdateExpression:`SET ${s.join(", ")} ADD ${o.join(", ")}`,ExpressionAttributeNames:n,ExpressionAttributeValues:i}},"buildUpdateMembers");parseOne=r(t=>{let n=$e(hl,t);if(!n.success)throw console.error(Pe(n.issues)),new Error("Malformed stored totals record");return n.output},"parseOne")};function pn(e){return`totals#${e}`}r(pn,"partitionKey");var vl=M({TABLE_NAME:S(),REVERSE_INDEX_NAME:S()}),mn=Ir(vl,process.env),$t=ks(),xl=new Pt({dynamo:$t,tableName:mn.TABLE_NAME}),bl=new Ct({dynamo:$t,tableName:mn.TABLE_NAME}),Il=new kt({dynamo:$t,tableName:mn.TABLE_NAME});async function iv(){let e=new Date;e.setUTCDate(e.getUTCDate()-1);let t=Ps(e),n=await Cs({dayKey:t,models:{totals:xl,breakdowns:bl,markers:Il},dynamo:$t});console.log(`dailyRollup ${t} ${n.status}`)}r(iv,"handler");export{iv as handler};
|