@spiffcommerce/core 44.1.0 → 44.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/{index-gmZIeppJ.cjs → index-BkN_xe6r.cjs} +4 -4
- package/dist/{index-gmZIeppJ.cjs.map → index-BkN_xe6r.cjs.map} +1 -1
- package/dist/{index-ColmWxba.js → index-DcMNAJco.js} +5 -5
- package/dist/{index-ColmWxba.js.map → index-DcMNAJco.js.map} +1 -1
- package/dist/{index.browser-DYaFZhaU.cjs → index.browser-BEd2eXRE.cjs} +2 -2
- package/dist/{index.browser-DYaFZhaU.cjs.map → index.browser-BEd2eXRE.cjs.map} +1 -1
- package/dist/{index.browser-DELXCUSa.js → index.browser-BTW1nawL.js} +2 -2
- package/dist/{index.browser-DELXCUSa.js.map → index.browser-BTW1nawL.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
60
60
|
`),C=b4(y.slice(0,A)),k=C["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(F=y.slice(A),F){if(S=uk(r,F),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(t4(S)){if(R={},"payload"in S){if(Object.keys(S).length===1&&S.payload===null)return[2];R=me({},S.payload)}"errors"in S&&(R=me(me({},R),{extensions:me(me({},"extensions"in R?R.extensions:null),(j={},j[Rd]=S.errors,j))})),e(R)}else e(S);else if(Object.keys(S).length===1&&"hasNext"in S&&!S.hasNext)return[2]}v=o.indexOf(s)}return[3,1];case 3:return[2]}})})}function b4(r){var e={};return r.split(`
|
|
61
61
|
`).forEach(function(t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();e[i]=a}}),e}function uk(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};ok(r,t(),"Response not successful: Received status code ".concat(r.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=r,n.statusCode=r.status,n.bodyText=e,n}}function w4(r,e){r.result&&r.result.errors&&r.result.data&&e.next(r.result),e.error(r)}function C4(r){return function(e){return e.text().then(function(t){return uk(e,t)}).then(function(t){return!Array.isArray(t)&&!Iw.call(t,"data")&&!Iw.call(t,"errors")&&ok(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var by=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=ji(54,e,i.message);throw n.parseError=i,n}return t},x4={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},S4={accept:"*/*","content-type":"application/json"},E4={method:"POST"},k4={http:x4,headers:S4,options:E4},T4=function(r,e){return e(r)};function F4(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(d){i=me(me(me({},i),d.options),{headers:me(me({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=me(me({},a),d.http)}),i.headers&&(i.headers=I4(i.headers,a.preserveHeaderCase));var s=r.operationName,o=r.extensions,l=r.variables,u=r.query,c={operationName:s,variables:l};return a.includeExtensions&&(c.extensions=o),a.includeQuery&&(c.query=e(u,vl)),{options:i,body:c}}function I4(r,e){if(!e){var t={};return Object.keys(Object(r)).forEach(function(a){t[a.toLowerCase()]=r[a]}),t}var n={};Object.keys(Object(r)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:r[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var D4=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function P4(r,e){var t=[],n=function(d,f){t.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=by(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=by(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var s="",o=r,l=r.indexOf("#");l!==-1&&(s=r.substr(l),o=r.substr(0,l));var u=o.indexOf("?")===-1?"?":"&",c=o+u+t.join("&")+s;return{newURI:c}}var R4=Ta(function(){return fetch}),ck=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?T4:i,s=r.includeExtensions,o=r.preserveHeaderCase,l=r.useGETForQueries,u=r.includeUnusedVariables,c=u===void 0?!1:u,d=is(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]),f={http:{includeExtensions:s,preserveHeaderCase:o},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Ma(function(h){var g=D4(h,t),v=h.getContext(),y={};if(v.clientAwareness){var A=v.clientAwareness,C=A.name,k=A.version;C&&(y["apollographql-client-name"]=C),k&&(y["apollographql-client-version"]=k)}var F=me(me({},y),v.headers),S={http:v.http,options:v.fetchOptions,credentials:v.credentials,headers:F};if(ld(["client"],h.query)){var R=tk(h.query);if(!R)return s0(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));h.query=R}var M=F4(h,a,k4,f,S),j=M.options,G=M.body;G.variables&&!c&&(G.variables=s4(G.variables,h.query));var ie;!j.signal&&typeof AbortController<"u"&&(ie=new AbortController,j.signal=ie.signal);var q=function(Re){return Re.kind==="OperationDefinition"&&Re.operation==="mutation"},Y=function(Re){return Re.kind==="OperationDefinition"&&Re.operation==="subscription"},J=Y(Pd(h.query)),se=ld(["defer"],h.query);if(l&&!h.query.definitions.some(q)&&(j.method="GET"),se||J){j.headers=j.headers||{};var oe="multipart/mixed;";J?oe+="boundary=graphql;subscriptionSpec=1.0,application/json":se&&(oe+="deferSpec=20220824,application/json"),j.headers.accept=oe}if(j.method==="GET"){var he=P4(g,G),ye=he.newURI,Ue=he.parseError;if(Ue)return s0(Ue);g=ye}else try{j.body=by(G,"Payload")}catch(Re){return s0(Re)}return new an(function(Re){var Oe=n||Ta(function(){return fetch})||R4,ee=Re.next.bind(Re);return Oe(g,j).then(function(re){var de;h.setContext({response:re});var Be=(de=re.headers)===null||de===void 0?void 0:de.get("content-type");return Be!==null&&/^multipart\/mixed/i.test(Be)?A4(re,ee):C4(h)(re).then(ee)}).then(function(){ie=void 0,Re.complete()}).catch(function(re){ie=void 0,w4(re,Re)}),function(){ie&&ie.abort()}})})},O4=(function(r){pa(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,ck(t).request)||this;return n.options=t,n}return e})(Ma);const{toString:Dw,hasOwnProperty:B4}=Object.prototype,Pw=Function.prototype.toString,wy=new Map;function Pn(r,e){try{return Cy(r,e)}finally{wy.clear()}}function Cy(r,e){if(r===e)return!0;const t=Dw.call(r),n=Dw.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Ow(r,e))return!0;const i=Rw(r),a=Rw(e),s=i.length;if(s!==a.length)return!1;for(let o=0;o<s;++o)if(!B4.call(e,i[o]))return!1;for(let o=0;o<s;++o){const l=i[o];if(!Cy(r[l],e[l]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Ow(r,e))return!0;const i=r.entries(),a=t==="[object Map]";for(;;){const s=i.next();if(s.done)break;const[o,l]=s.value;if(!e.has(o)||a&&!Cy(l,e.get(o)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Pw.call(r);return i!==Pw.call(e)?!1:!N4(i,_4)}}return!1}function Rw(r){return Object.keys(r).filter(M4,r)}function M4(r){return this[r]!==void 0}const _4="{ [native code] }";function N4(r,e){const t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Ow(r,e){let t=wy.get(r);if(t){if(t.has(e))return!0}else wy.set(r,t=new Set);return t.add(e),!1}function fk(r,e,t,n){var i=e.data,a=is(e,["data"]),s=t.data,o=is(t,["data"]);return Pn(a,o)&&_p(Pd(r).selectionSet,i,s,{fragmentMap:oc(cc(r)),variables:n})}function _p(r,e,t,n){if(e===t)return!0;var i=new Set;return r.selections.every(function(a){if(i.has(a)||(i.add(a),!Dd(a,n.variables))||Bw(a))return!0;if(bo(a)){var s=Ao(a),o=e&&e[s],l=t&&t[s],u=a.selectionSet;if(!u)return Pn(o,l);var c=Array.isArray(o),d=Array.isArray(l);if(c!==d)return!1;if(c&&d){var f=o.length;if(l.length!==f)return!1;for(var h=0;h<f;++h)if(!_p(u,o[h],l[h],n))return!1;return!0}return _p(u,o,l,n)}else{var g=Tg(a,n.fragmentMap);if(g)return Bw(g)?!0:_p(g.selectionSet,e,t,n)}})}function Bw(r){return!!r.directives&&r.directives.some(L4)}function L4(r){return r.name.value==="nonreactive"}var dk=kl?WeakMap:Map,hk=IA?WeakSet:Set,pk=new fc;function gk(r,e,t){return pk.withValue(!0,function(){var n=Of(r,e,t,!1);return n})}function U4(r,e){if(e.has(r))return e.get(r);var t=Array.isArray(r)?[]:Object.create(null);return e.set(r,t),t}function Of(r,e,t,n,i){var a=t.knownChanged,s=U4(r,t.mutableTargets);if(Array.isArray(r)){for(var o=0,l=Array.from(r.entries());o<l.length;o++){var u=l[o],c=u[0],d=u[1];if(d===null){s[c]=null;continue}var f=Of(d,e,t,n);a.has(f)&&a.add(s),s[c]=f}return a.has(s)?s:r}for(var h=0,g=e.selections;h<g.length;h++){var v=g[h],y=void 0;if(n&&a.add(s),v.kind===et.FIELD){var A=Ao(v),C=v.selectionSet;if(y=s[A]||r[A],y===void 0)continue;if(C&&y!==null){var f=Of(r[A],C,t,n);a.has(f)&&(y=f)}s[A]=y}if(v.kind===et.INLINE_FRAGMENT&&(!v.typeCondition||t.cache.fragmentMatches(v,r.__typename))&&(y=Of(r,v.selectionSet,t,n)),v.kind===et.FRAGMENT_SPREAD){var k=v.name.value,F=t.fragmentMap[k]||(t.fragmentMap[k]=t.cache.lookupFragment(k));Mr(F,59,k);var S=qP(v);S!=="mask"&&(y=Of(r,F.selectionSet,t,S==="migrate"))}a.has(y)&&a.add(s)}return"__typename"in r&&!("__typename"in s)&&(s.__typename=r.__typename),Object.keys(s).length!==Object.keys(r).length&&a.add(s),a.has(s)?s:r}function mk(r,e,t,n){if(!t.fragmentMatches)return r;var i=e.definitions.filter(function(s){return s.kind===et.FRAGMENT_DEFINITION});typeof n>"u"&&(Mr(i.length===1,61,i.length),n=i[0].name.value);var a=i.find(function(s){return s.name.value===n});return Mr(!!a,62,n),r==null||Pn(r,{})?r:gk(r,a.selectionSet,{operationName:a.name.value,fragmentMap:oc(cc(e)),cache:t,mutableTargets:new dk,knownChanged:new hk})}function V4(r,e,t){var n;if(!t.fragmentMatches)return r;var i=uc(e);return Mr(i,63),r==null?r:gk(r,i.selectionSet,{operationType:i.operation,operationName:(n=i.name)===null||n===void 0?void 0:n.value,fragmentMap:oc(cc(e)),cache:t,mutableTargets:new dk,knownChanged:new hk})}var z4=(function(){function r(){this.assumeImmutableResults=!1,this.getFragmentDoc=Wu(KP,{max:Bs["cache.fragmentQueryDocuments"]||1e3,cache:ud})}return r.prototype.lookupFragment=function(e){return null},r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){var n=this;return t===void 0&&(t=!!e.optimistic),Di("canonizeResults",function(){return n.read(me(me({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))})},r.prototype.watchFragment=function(e){var t=this,n=e.fragment,i=e.fragmentName,a=e.from,s=e.optimistic,o=s===void 0?!0:s,l=is(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),c=typeof a>"u"||typeof a=="string"?a:this.identify(a),d=!!e[Symbol.for("apollo.dataMasking")],f=me(me({},l),{returnPartialData:!0,id:c,query:u,optimistic:o}),h;return new an(function(g){return t.watch(me(me({},f),{immediate:!0,callback:function(v){var y=d?mk(v.result,n,t,i):v.result;if(!(h&&fk(u,{data:h.result},{data:y},e.variables))){var A={data:y,complete:!!v.complete};v.missing&&(A.missing=Pg(v.missing.map(function(C){return C.missing}))),h=me(me({},v),{result:y}),g.next(A)}}}))})},r.prototype.readFragment=function(e,t){var n=this;return t===void 0&&(t=!!e.optimistic),Di("canonizeResults",function(){return n.read(me(me({},e),{query:n.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))})},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=is(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:n}))},r.prototype.writeFragment=function(e){var t=e.id,n=e.data,i=e.fragment,a=e.fragmentName,s=is(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(s,{query:this.getFragmentDoc(i,a),dataId:t,result:n}))},r.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=Di("canonizeResults",function(){return n.readQuery(e)}),a=t(i);return a==null?i:(n.writeQuery(me(me({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=Di("canonizeResults",function(){return n.readFragment(e)}),a=t(i);return a==null?i:(n.writeFragment(me(me({},e),{data:a})),a)}})},r})(),vk=(function(r){pa(e,r);function e(t,n,i,a){var s,o=r.call(this,t)||this;if(o.message=t,o.path=n,o.query=i,o.variables=a,Array.isArray(o.path)){o.missing=o.message;for(var l=o.path.length-1;l>=0;--l)o.missing=(s={},s[o.path[l]]=o.missing,s)}else o.missing=o.path;return o.__proto__=e.prototype,o}return e})(Error),mi=Object.prototype.hasOwnProperty;function nf(r){return r==null}function yk(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=nf(n)?nf(i)?void 0:{_id:i}:{id:n}),nf(n)&&!nf(i)&&(n=i),!nf(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Ak={dataIdFromObject:yk,addTypename:!0,resultCaching:!0,canonizeResults:!1};function $4(r){return Yu(Ak,r)}function bk(r){var e=r.canonizeResults;return e===void 0?Ak.canonizeResults:e}var wk=/^[_a-z][_0-9a-z]*/i;function Xu(r){var e=r.match(wk);return e?e[0]:r}function xy(r,e,t){return ci(e)?ni(e)?e.every(function(n){return xy(r,n,t)}):r.selections.every(function(n){if(bo(n)&&Dd(n,t)){var i=Ao(n);return mi.call(e,i)&&(!n.selectionSet||xy(n.selectionSet,e[i],t))}return!0}):!1}function Du(r){return ci(r)&&!Tn(r)&&!ni(r)}function H4(){return new Co}function Ck(r,e){var t=oc(cc(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Np=Object.create(null),o0=function(){return Np},Mw=Object.create(null),fd=(function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Tn(i)?n.get(i.__ref,a):i&&i[a]},this.canRead=function(i){return Tn(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Nu(i);if(Tn(i))return i;var s=n.policies.identify(i)[0];if(s){var o=Nu(s);return a&&n.merge(s,i),o}}}return r.prototype.toObject=function(){return me({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),mi.call(this.data,e)){var n=this.data[e];if(n&&mi.call(n,t))return n[t]}if(t==="__typename"&&mi.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof to)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),mi.call(this.data,e))return this.data[e];if(this instanceof to)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;Tn(e)&&(e=e.__ref),Tn(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,s=typeof t=="string"?this.lookup(i=t):t;if(s){Mr(typeof i=="string",2);var o=new Co(G4).merge(a,s);if(this.data[i]=o,o!==a&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);a||(l.__exists=1),Object.keys(s).forEach(function(u){if(!a||a[u]!==o[u]){l[u]=1;var c=Xu(u);c!==u&&!n.policies.hasKeyArgs(o.__typename,c)&&(l[c]=1),o[u]===void 0&&!(n instanceof to)&&delete o[u]}}),l.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===o.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return n.group.dirty(i,u)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),s=!1,o=!0,l={DELETE:Np,INVALIDATE:Mw,isReference:Tn,toReference:this.toReference,canRead:this.canRead,readField:function(u,c){return n.policies.readField(typeof u=="string"?{fieldName:u,from:c||Nu(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var c=Xu(u),d=i[u];if(d!==void 0){var f=typeof t=="function"?t:t[u]||t[c];if(f){var h=f===o0?Np:f(d,me(me({},l),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));h===Mw?n.group.dirty(e,u):(h===Np&&(h=void 0),h!==d&&(a[u]=h,s=!0,d=h))}d!==void 0&&(o=!1)}}),s)return this.merge(e,a),o&&(this instanceof to?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var s=this.getFieldValue(a,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:s,fieldName:t,args:n}):t;return this.modify(e,o?(i={},i[o]=o0,i):o0)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(mi.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof to&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){mi.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(a){e&&mi.call(e,a)||t.delete(a)}),e){var n=e.__META,i=is(e,["__META"]);Object.keys(i).forEach(function(a){t.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof to?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(s){mi.call(n,s)&&(Object.keys(e.findChildRefIds(s)).forEach(t.add,t),delete n[s])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof to;)a=a.parent;i.forEach(function(s){return a.delete(s)})}return i},r.prototype.findChildRefIds=function(e){if(!mi.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var i=new Set([n]);i.forEach(function(a){Tn(a)&&(t[a.__ref]=!0),ci(a)&&Object.keys(a).forEach(function(s){var o=a[s];ci(o)&&i.add(o)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r})(),xk=(function(){function r(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return r.prototype.resetCaching=function(){this.d=this.caching?X2():null,this.keyMaker=new Ms(kl)},r.prototype.depend=function(e,t){if(this.d){this.d(l0(e,t));var n=Xu(t);n!==t&&this.d(l0(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(l0(e,t),t==="__exists"?"forget":"setDirty")},r})();function l0(r,e){return e+"#"+r}function _w(r,e){qf(r)&&r.group.depend(e,"__exists")}(function(r){var e=(function(t){pa(n,t);function n(i){var a=i.policies,s=i.resultCaching,o=s===void 0?!0:s,l=i.seed,u=t.call(this,a,new xk(o))||this;return u.stump=new j4(u),u.storageTrie=new Ms(kl),l&&u.replace(l),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n})(r);r.Root=e})(fd||(fd={}));var to=(function(r){pa(e,r);function e(t,n,i,a){var s=r.call(this,n.policies,a)||this;return s.id=t,s.parent=n,s.replay=i,s.group=a,i(s),s}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var s=n.data[a],o=i.lookup(a);o?s?s!==o&&Object.keys(s).forEach(function(l){Pn(s[l],o[l])||n.group.dirty(a,l)}):(n.group.dirty(a,"__exists"),Object.keys(o).forEach(function(l){n.group.dirty(a,l)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return me(me({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return mi.call(this.data,t)?me(me({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e})(fd),j4=(function(r){pa(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new xk(t.group.caching,t.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(t,n){return this.parent.merge(t,n)},e})(to);function G4(r,e,t){var n=r[t],i=e[t];return Pn(n,i)?n:i}function qf(r){return!!(r instanceof fd&&r.group.caching)}var fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _s(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function q4(r){return ci(r)?ni(r)?r.slice(0):me({__proto__:Object.getPrototypeOf(r)},r):r}var Nw=(function(){function r(){this.known=new(IA?WeakSet:Set),this.pool=new Ms(kl),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return ci(e)&&this.known.has(e)},r.prototype.pass=function(e){if(ci(e)){var t=q4(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(ci(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),s=this.pool.lookupArray(a);return s.array||this.known.add(s.array=a),s.array}case null:case Object.prototype:{if(this.known.has(e))return e;var o=Object.getPrototypeOf(e),l=[o],u=this.sortedKeys(e);l.push(u.json);var c=l.length;u.sorted.forEach(function(h){l.push(t.admit(e[h]))});var s=this.pool.lookupArray(l);if(!s.object){var d=s.object=Object.create(o);this.known.add(d),u.sorted.forEach(function(h,g){d[h]=l[c+g]})}return s.object}}}return e},r.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var i=JSON.stringify(t);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:t,json:i})}return n.keys},r})();function Lw(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var W4=(function(){function r(e){var t=this;this.knownResults=new(kl?WeakMap:Map),this.config=Yu(e,{addTypename:e.addTypename!==!1,canonizeResults:bk(e)}),this.canon=e.canon||new Nw,this.executeSelectionSet=Wu(function(n){var i,a=n.context.canonizeResults,s=Lw(n);s[3]=!a;var o=(i=t.executeSelectionSet).peek.apply(i,s);return o?a?me(me({},o),{result:t.canon.admit(o.result)}):o:(_w(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Lw,makeCacheKey:function(n,i,a,s){if(qf(a.store))return a.store.makeCacheKey(n,Tn(i)?i.__ref:i,a.varString,s)}}),this.executeSubSelectedArray=Wu(function(n){return _w(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,s=n.context;if(qf(s.store))return s.store.makeCacheKey(i,a,s.varString)}})}return r.prototype.resetCanon=function(){this.canon=new Nw},r.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,s=e.variables,o=e.returnPartialData,l=o===void 0?!0:o,u=e.canonizeResults,c=u===void 0?this.config.canonizeResults:u,d=this.config.cache.policies;s=me(me({},DA(CR(n))),s);var f=Nu(a),h=this.executeSelectionSet({selectionSet:Pd(n).selectionSet,objectOrReference:f,enclosingRef:f,context:me({store:t,query:n,policies:d,variables:s,varString:ho(s),canonizeResults:c},Ck(n,this.config.fragments))}),g;if(h.missing&&(g=[new vk(Q4(h.missing),h.missing,n,s)],!l))throw g[0];return{result:h.result,complete:!g,missing:g}},r.prototype.isFresh=function(e,t,n,i){if(qf(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,s=e.context;if(Tn(i)&&!s.policies.rootTypenamesById[i.__ref]&&!s.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var o=s.variables,l=s.policies,u=s.store,c=u.getFieldValue(i,"__typename"),d=[],f,h=new Co;this.config.addTypename&&typeof c=="string"&&!l.rootIdsByTypename[c]&&d.push({__typename:c});function g(k,F){var S;return k.missing&&(f=h.merge(f,(S={},S[F]=k.missing,S))),k.result}var v=new Set(n.selections);v.forEach(function(k){var F,S;if(Dd(k,o))if(bo(k)){var R=l.readField({fieldName:k.name.value,field:k,variables:s.variables,from:i},s),M=Ao(k);R===void 0?ek.added(k)||(f=h.merge(f,(F={},F[M]="Can't find field '".concat(k.name.value,"' on ").concat(Tn(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),F))):ni(R)?R.length>0&&(R=g(t.executeSubSelectedArray({field:k,array:R,enclosingRef:a,context:s}),M)):k.selectionSet?R!=null&&(R=g(t.executeSelectionSet({selectionSet:k.selectionSet,objectOrReference:R,enclosingRef:Tn(R)?R:a,context:s}),M)):s.canonizeResults&&(R=t.canon.pass(R)),R!==void 0&&d.push((S={},S[M]=R,S))}else{var j=Tg(k,s.lookupFragment);if(!j&&k.kind===et.FRAGMENT_SPREAD)throw ji(10,k.name.value);j&&l.fragmentMatches(j,c)&&j.selectionSet.selections.forEach(v.add,v)}});var y=Pg(d),A={result:y,missing:f},C=s.canonizeResults?this.canon.admit(A):A;return C.result&&this.knownResults.set(C.result,n),C},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,s=e.context,o,l=new Co;function u(c,d){var f;return c.missing&&(o=l.merge(o,(f={},f[d]=c.missing,f))),c.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map(function(c,d){return c===null?null:ni(c)?u(t.executeSubSelectedArray({field:n,array:c,enclosingRef:a,context:s}),d):n.selectionSet?u(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:c,enclosingRef:Tn(c)?c:a,context:s}),d):c}),{result:s.canonizeResults?this.canon.admit(i):i,missing:o}},r})();function Q4(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}var VA=new fc,Uw=new WeakMap;function Wf(r){var e=Uw.get(r);return e||Uw.set(r,e={vars:new Set,dep:X2()}),e}function Vw(r){Wf(r).vars.forEach(function(e){return e.forgetCache(r)})}function Y4(r){Wf(r).vars.forEach(function(e){return e.attachCache(r)})}function X4(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(l){Wf(l).dep.dirty(n),J4(l)});var s=Array.from(t);t.clear(),s.forEach(function(l){return l(r)})}}else{var o=VA.getValue();o&&(i(o),Wf(o).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Wf(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function J4(r){r.broadcastWatches&&r.broadcastWatches()}var zw=Object.create(null);function zA(r){var e=JSON.stringify(r);return zw[e]||(zw[e]=Object.create(null))}function $w(r){var e=zA(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(s,o){return n.readField(o,s)},a=n.keyObject=$A(r,function(s){var o=Uu(n.storeObject,s,i);return o===void 0&&t!==n.storeObject&&mi.call(t,s[0])&&(o=Uu(t,s,Ek)),Mr(o!==void 0,5,s.join("."),t),o});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Hw(r){var e=zA(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,s=n.fieldName,o=$A(r,function(u){var c=u[0],d=c.charAt(0);if(d==="@"){if(i&&os(i.directives)){var f=c.slice(1),h=i.directives.find(function(A){return A.name.value===f}),g=h&&Fg(h,a);return g&&Uu(g,u.slice(1))}return}if(d==="$"){var v=c.slice(1);if(a&&mi.call(a,v)){var y=u.slice(0);return y[0]=v,Uu(a,y)}return}if(t)return Uu(t,u)}),l=JSON.stringify(o);return(t||l!=="{}")&&(s+=":"+l),s})}function $A(r,e){var t=new Co;return Sk(r).reduce(function(n,i){var a,s=e(i);if(s!==void 0){for(var o=i.length-1;o>=0;--o)s=(a={},a[i[o]]=s,a);n=t.merge(n,s)}return n},Object.create(null))}function Sk(r){var e=zA(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ni(i)?(Sk(i).forEach(function(s){return t.push(n.concat(s))}),n.length=0):(n.push(i),ni(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function Ek(r,e){return r[e]}function Uu(r,e,t){return t=t||Ek,kk(e.reduce(function n(i,a){return ni(i)?i.map(function(s){return n(s,a)}):i&&t(i,a)},r))}function kk(r){return ci(r)?ni(r)?r.map(kk):$A(Object.keys(r).sort(),function(e){return Uu(r,e)}):r}function Sy(r){return r.args!==void 0?r.args:r.field?Fg(r.field,r.variables):null}var K4=function(){},jw=function(r,e){return e.fieldName},Gw=function(r,e,t){var n=t.mergeObjects;return n(r,e)},qw=function(r,e){return e},Z4=(function(){function r(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=me({dataIdFromObject:yk},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var s=t&&t.storeObject||e,o=me(me({},t),{typename:a,storeObject:s,readField:t&&t.readField||function(){var d=HA(arguments,s);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),l,u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;return pk.withValue(!0,function(){for(;c;){var d=c(me(me({},e),s),o);if(ni(d))c=$w(d);else{l=d;break}}}),l=l?String(l):void 0,o.keyObject?[l,o.keyObject]:[l]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,s=i.mutationType,o=i.subscriptionType,l=is(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),s&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),mi.call(t.toBeAdded,n)?t.toBeAdded[n].push(l):t.toBeAdded[n]=[l]})},r.prototype.updateTypePolicy=function(e,t,n){var i=this.getTypePolicy(e),a=t.keyFields,s=t.fields;function o(l,u){l.merge=typeof u=="function"?u:u===!0?Gw:u===!1?qw:l.merge}o(i,t.merge),i.keyFn=a===!1?K4:ni(a)?$w(a):typeof a=="function"?a:i.keyFn,s&&Object.keys(s).forEach(function(l){var u=n[l];(!u||u?.typename!==e)&&(u=n[l]={typename:e});var c=s[l];if(typeof c=="function")u.read=c;else{var d=c.keyArgs,f=c.read,h=c.merge;u.keyFn=d===!1?jw:ni(d)?Hw(d):typeof d=="function"?d:u.keyFn,typeof f=="function"&&(u.read=f),o(u,h)}u.read&&u.merge&&(u.keyFn=u.keyFn||jw)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(Mr(!i||i===e,6,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(wk);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!mi.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(s,o){if(s.test(e)){var l=t.supertypeMap.get(o);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(s){var o=t.getTypePolicy(s),l=o.fields,u=is(o,["fields"]);Object.assign(n,u),Object.assign(n.fields,l)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(s){t.updateTypePolicy(e,s,t.typePolicies[e].fields)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t){if(e)return this.getTypePolicy(e).fields[t]},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var s=e.typeCondition.name.value;if(t===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s))for(var o=this.getSupertypeSet(t,!0),l=[o],u=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&l.indexOf(g)<0&&l.push(g)},c=!!(n&&this.fuzzySubtypes.size),d=0;d<l.length;++d){var f=l[d];if(f.has(s))return o.has(s)||o.add(s),!0;f.forEach(u),c&&d===l.length-1&&xy(e.selectionSet,n,i)&&(c=!1,this.fuzzySubtypes.forEach(function(h,g){var v=t.match(h);v&&v[0]===t&&u(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n),a,s=i&&i.keyFn;if(s&&t)for(var o={typename:t,fieldName:n,field:e.field||null,variables:e.variables},l=Sy(e);s;){var u=s(l,o);if(ni(u))s=Hw(u);else{a=u||n;break}}return a===void 0&&(a=e.field?AR(e.field,e.variables):U2(n,Sy(e))),a===!1?n:n===Xu(a)?a:n+":"+a},r.prototype.readField=function(e,t){var n=e.from;if(n){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var a=t.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var s=this.getStoreFieldName(e),o=Xu(s),l=t.store.getFieldValue(n,s),u=this.getFieldPolicy(e.typename,o),c=u&&u.read;if(c){var d=Ww(this,n,e,t,t.store.getStorage(Tn(n)?n.__ref:n,s));return VA.withValue(this.cache,c,[l,d])}return l}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var s=n.field,o=n.typename,l=n.merge;return l===Gw?Tk(i.store)(e,t):l===qw?t:(i.overwrite&&(e=void 0),l(e,t,Ww(this,void 0,{typename:o,fieldName:s.name.value,field:s,variables:i.variables},i,a||Object.create(null))))},r})();function Ww(r,e,t,n,i){var a=r.getStoreFieldName(t),s=Xu(a),o=t.variables||n.variables,l=n.store,u=l.toReference,c=l.canRead;return{args:Sy(t),field:t.field||null,fieldName:s,storeFieldName:a,variables:o,isReference:Tn,toReference:u,storage:i,cache:r.cache,canRead:c,readField:function(){return r.readField(HA(arguments,e,o),n)},mergeObjects:Tk(n.store)}}function HA(r,e,t){var n=r[0],i=r[1],a=r.length,s;return typeof n=="string"?s={fieldName:n,from:a>1?i:e}:(s=me({},n),mi.call(s,"from")||(s.from=e)),s.variables===void 0&&(s.variables=t),s}function Tk(r){return function(t,n){if(ni(t)||ni(n))throw ji(9);if(ci(t)&&ci(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),s=i&&a&&i!==a;if(s)return n;if(Tn(t)&&Du(n))return r.merge(t.__ref,n),t;if(Du(t)&&Tn(n))return r.merge(t,n.__ref),n;if(Du(t)&&Du(n))return me(me({},t),n)}return n}}function u0(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:me(me({},r),{clientOnly:e,deferred:t})),i}var eO=(function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,s=t.dataId,o=t.variables,l=t.overwrite,u=uc(i),c=H4();o=me(me({},DA(u)),o);var d=me(me({store:e,written:Object.create(null),merge:function(h,g){return c.merge(h,g)},variables:o,varString:ho(o)},Ck(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:s,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:d});if(!Tn(f))throw ji(12,a);return d.incomingById.forEach(function(h,g){var v=h.storeObject,y=h.mergeTree;h.fieldNodeSet;var A=Nu(g);if(y&&y.map.size){var C=n.applyMerges(y,A,v,d);if(Tn(C))return;v=C}e.merge(g,v)}),e.retain(f.__ref),f},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,s=e.context,o=e.mergeTree,l=this.cache.policies,u=Object.create(null),c=n&&l.rootTypenamesById[n]||hy(i,a,s.fragmentMap)||n&&s.store.get(n,"__typename");typeof c=="string"&&(u.__typename=c);var d=function(){var k=HA(arguments,u,s.variables);if(Tn(k.from)){var F=s.incomingById.get(k.from.__ref);if(F){var S=l.readField(me(me({},k),{from:F.storeObject}),s);if(S!==void 0)return S}}return l.readField(k,s)},f=new Set;this.flattenFields(a,i,s,c).forEach(function(k,F){var S,R=Ao(F),M=i[R];if(f.add(F),M!==void 0){var j=l.getStoreFieldName({typename:c,fieldName:F.name.value,field:F,variables:k.variables}),G=Qw(o,j),ie=t.processFieldValue(M,F,F.selectionSet?u0(k,!1,!1):k,G),q=void 0;F.selectionSet&&(Tn(ie)||Du(ie))&&(q=d("__typename",ie));var Y=l.getMergeFunction(c,F.name.value,q);Y?G.info={field:F,typename:c,merge:Y}:Yw(o,j),u=k.merge(u,(S={},S[j]=ie,S))}});try{var h=l.identify(i,{typename:c,selectionSet:a,fragmentMap:s.fragmentMap,storeObject:u,readField:d}),g=h[0],v=h[1];n=n||g,v&&(u=s.merge(u,v))}catch(k){if(!n)throw k}if(typeof n=="string"){var y=Nu(n),A=s.written[n]||(s.written[n]=[]);if(A.indexOf(a)>=0||(A.push(a),this.reader&&this.reader.isFresh(i,y,a,s)))return y;var C=s.incomingById.get(n);return C?(C.storeObject=s.merge(C.storeObject,u),C.mergeTree=Ey(C.mergeTree,o),f.forEach(function(k){return C.fieldNodeSet.add(k)})):s.incomingById.set(n,{storeObject:u,mergeTree:tg(o)?void 0:o,fieldNodeSet:f}),y}return u},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?e:ni(e)?e.map(function(s,o){var l=a.processFieldValue(s,t,n,Qw(i,o));return Yw(i,o),l}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=hy(t,e,n.fragmentMap));var a=new Map,s=this.cache.policies,o=new Ms(!1);return(function l(u,c){var d=o.lookup(u,c.clientOnly,c.deferred);d.visited||(d.visited=!0,u.selections.forEach(function(f){if(Dd(f,n.variables)){var h=c.clientOnly,g=c.deferred;if(!(h&&g)&&os(f.directives)&&f.directives.forEach(function(A){var C=A.name.value;if(C==="client"&&(h=!0),C==="defer"){var k=Fg(A,n.variables);(!k||k.if!==!1)&&(g=!0)}}),bo(f)){var v=a.get(f);v&&(h=h&&v.clientOnly,g=g&&v.deferred),a.set(f,u0(n,h,g))}else{var y=Tg(f,n.lookupFragment);if(!y&&f.kind===et.FRAGMENT_SPREAD)throw ji(14,f.name.value);y&&s.fragmentMatches(y,i,t,n.variables)&&l(y.selectionSet,u0(n,h,g))}}}))})(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var s,o=this;if(e.map.size&&!Tn(n)){var l=!ni(n)&&(Tn(t)||Du(t))?t:void 0,u=n;l&&!a&&(a=[Tn(l)?l.__ref:l]);var c,d=function(f,h){return ni(f)?typeof h=="number"?f[h]:void 0:i.store.getFieldValue(f,String(h))};e.map.forEach(function(f,h){var g=d(l,h),v=d(u,h);if(v!==void 0){a&&a.push(h);var y=o.applyMerges(f,g,v,i,a);y!==v&&(c=c||new Map,c.set(h,y)),a&&Mr(a.pop()===h)}}),c&&(n=ni(u)?u.slice(0):me({},u),c.forEach(function(f,h){n[h]=f}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(s=i.store).getStorage.apply(s,a)):n},r})(),Fk=[];function Qw(r,e){var t=r.map;return t.has(e)||t.set(e,Fk.pop()||{map:new Map}),t.get(e)}function Ey(r,e){if(r===e||!e||tg(e))return r;if(!r||tg(r))return e;var t=r.info&&e.info?me(me({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var s=new Set(e.map.keys());r.map.forEach(function(o,l){a.map.set(l,Ey(o,e.map.get(l))),s.delete(l)}),s.forEach(function(o){a.map.set(o,Ey(e.map.get(o),r.map.get(o)))})}return a}function tg(r){return!r||!(r.info||r.map.size)}function Yw(r,e){var t=r.map,n=t.get(e);n&&tg(n)&&(Fk.push(n),t.delete(e))}var tO=(function(r){pa(e,r);function e(t){t===void 0&&(t={});var n=r.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new J2(ek),n.assumeImmutableResults=!0,n.makeVar=X4,n.txCount=0,n.config=$4(t),n.addTypename=!!n.config.addTypename,n.policies=new Z4({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var t=this.data=new fd.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var n=this,i=this.storeReader,a=this.config.fragments;this.addTypenameTransform.resetCache(),a?.resetCaches(),this.storeWriter=new eO(this,this.storeReader=new W4({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:bk(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Wu(function(s,o){return n.broadcastWatch(s,o)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(s){var o=s.optimistic?n.optimisticData:n.data;if(qf(o)){var l=s.optimistic,u=s.id,c=s.variables;return o.makeCacheKey(s.query,s.callback,ho({optimistic:l,id:u,variables:c}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(s){return s.resetCaching()})},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(me(me({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof vk)return null;throw a}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(mi.call(t,"id")&&!t.id)return!1;var n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(me(me({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var n=this;return this.watches.size||Y4(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&Vw(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){ho.reset(),vl.reset();var n=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(t,n){return(n?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,n){return(n?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(Tn(t))return t.__ref;try{return this.policies.identify(t)[0]}catch{}},e.prototype.evict=function(t){if(!t.id){if(mi.call(t,"id"))return!1;t=me(me({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(t){var n=this;return this.init(),ho.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Vw(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(t){var n=this,i=t.update,a=t.optimistic,s=a===void 0?!0:a,o=t.removeOptimistic,l=t.onWatchUpdated,u,c=function(f){var h=n,g=h.data,v=h.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=g,n.optimisticData=v}},d=new Set;return l&&!this.txCount&&this.broadcastWatches(me(me({},t),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof s=="string"?this.optimisticData=this.optimisticData.addLayer(s,c):s===!1?c(this.data):c(),typeof o=="string"&&(this.optimisticData=this.optimisticData.removeLayer(o)),l&&d.size?(this.broadcastWatches(me(me({},t),{onWatchUpdated:function(f,h){var g=l.call(this,f,h);return g!==!1&&d.delete(f),g}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(t),u},e.prototype.performTransaction=function(t,n){return this.batch({update:t,optimistic:n||n!==null})},e.prototype.transformDocument=function(t){return this.addTypenameToDocument(this.addFragmentsToDocument(t))},e.prototype.fragmentMatches=function(t,n){return this.policies.fragmentMatches(t,n)},e.prototype.lookupFragment=function(t){var n;return((n=this.config.fragments)===null||n===void 0?void 0:n.lookup(t))||null},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.addFragmentsToDocument=function(t){var n=this.config.fragments;return n?n.transform(t):t},e.prototype.addTypenameToDocument=function(t){return this.addTypename?this.addTypenameTransform.transformDocument(t):t},e.prototype.broadcastWatch=function(t,n){var i=this,a=t.lastDiff,s=Di("canonizeResults",function(){return i.diff(t)});n&&(t.optimistic&&typeof n.optimistic=="string"&&(s.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,s,a)===!1)||(!a||!Pn(a.result,s.result))&&t.callback(t.lastDiff=s,a)},e})(z4),Jr;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(Jr||(Jr={}));function Pu(r){return r?r<7:!1}var Xw=Object.assign,Lp=(function(r){pa(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,s=this,o=e.inactiveOnCreation.getValue();s=r.call(this,function(A){s._getOrCreateQuery();try{var C=A._subscription._observer;C&&!C.error&&(C.error=rO)}catch{}var k=!s.observers.size;s.observers.add(A);var F=s.last;return F&&F.error?A.error&&A.error(F.error):F&&F.result&&A.next&&A.next(s.maskResult(F.result)),k&&s.reobserve().catch(function(){}),function(){s.observers.delete(A)&&!s.observers.size&&s.tearDownQuery()}})||this,s.observers=new Set,s.subscriptions=new Set,s.dirty=!1,s._getOrCreateQuery=function(){return o&&(n.queries.set(s.queryId,i),o=!1),s.queryManager.getOrCreateQuery(s.queryId)},s.queryInfo=i,s.queryManager=n,s.waitForOwnResult=c0(a.fetchPolicy),s.isTornDown=!1,s.subscribeToMore=s.subscribeToMore.bind(s),s.maskResult=s.maskResult.bind(s);var l=n.defaultOptions.watchQuery,u=l===void 0?{}:l,c=u.fetchPolicy,d=c===void 0?"cache-first":c,f=a.fetchPolicy,h=f===void 0?d:f,g=a.initialFetchPolicy,v=g===void 0?h==="standby"?d:h:g;s.options=me(me({},a),{initialFetchPolicy:v,fetchPolicy:h}),s.queryId=i.queryId||n.generateQueryId();var y=uc(s.query);return s.queryName=y&&y.name&&y.name.value,s}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(o){n(o),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){s.unsubscribe()},0)},error:i},s=t.subscribe(a)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentFullResult=function(t){var n=this;t===void 0&&(t=!0);var i=Di("getLastResult",function(){return n.getLastResult(!0)}),a=this.queryInfo.networkStatus||i&&i.networkStatus||Jr.ready,s=me(me({},i),{loading:Pu(a),networkStatus:a}),o=this.options.fetchPolicy,l=o===void 0?"cache-first":o;if(!(c0(l)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(s.data=u.result),Pn(s.data,{})&&(s.data=void 0),u.complete?(delete s.partial,u.complete&&s.networkStatus===Jr.loading&&(l==="cache-first"||l==="cache-only")&&(s.networkStatus=Jr.ready,s.loading=!1)):s.partial=!0,s.networkStatus===Jr.ready&&(s.error||s.errors)&&(s.networkStatus=Jr.error)}return t&&this.updateLastResult(s),s},e.prototype.getCurrentResult=function(t){return t===void 0&&(t=!0),this.maskResult(this.getCurrentFullResult(t))},e.prototype.isDifferentFromLastResult=function(t,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),a=this.queryManager.dataMasking,s=a?i.nonReactiveQuery:this.query,o=a||i.hasNonreactiveDirective?!fk(s,this.last.result,t,this.variables):!Pn(this.last.result,t);return o||n&&!Pn(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||Pn(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n={pollInterval:0},i=this.options.fetchPolicy;return i==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",t&&!Pn(this.options.variables,t)&&(n.variables=this.options.variables=me(me({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(n,Jr.refetch)},e.prototype.fetchMore=function(t){var n=this,i=me(me({},t.query?t:me(me(me(me({},this.options),{query:this.options.query}),t),{variables:me(me({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=t.query?this.transformDocument(this.options.query):i.query;var s=this.queryInfo,o=s.networkStatus;s.networkStatus=Jr.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=t?.updateQuery,c=this.options.fetchPolicy!=="no-cache";return c||Mr(u,29),this.queryManager.fetchQuery(a,i,Jr.fetchMore).then(function(d){if(n.queryManager.removeQuery(a),s.networkStatus===Jr.fetchMore&&(s.networkStatus=o),c)n.queryManager.cache.batch({update:function(g){var v=t.updateQuery;v?g.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(y){return v(y,{fetchMoreResult:d.data,variables:i.variables})}):g.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(g){l.add(g.query)}});else{var f=n.getLast("result"),h=u(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(me(me({},f),{networkStatus:o,loading:Pu(o),data:h}),n.variables)}return n.maskResult(d)}).finally(function(){c&&!l.has(n.query)&&n.reobserveCacheFirst()})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var s=t.updateQuery;s&&n.updateQuery(function(o,l){return s(o,me({subscriptionData:a},l))})},error:function(a){if(t.onError){t.onError(a);return}}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.silentSetOptions=function(t){var n=Yu(this.options,t||{});Xw(this.options,n)},e.prototype.setVariables=function(t){var n=this;return Pn(this.variables,t)?this.observers.size?Di("observableQuery.result",function(){return n.result()}):Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},Jr.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),a=i.result,s=i.complete,o=t(a,{variables:this.variables,complete:!!s,previousData:a});o&&(n.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,s=n.initialFetchPolicy,o=s===void 0?a:s;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:o}):t==="variables-changed"?n.fetchPolicy=o:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n,i){var a=this._getOrCreateQuery();return a.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(a,t,n,i)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){Mr(a,32);var s=i||(this.pollingInfo={});s.interval=a;var o=function(){var u,c;t.pollingInfo&&(!Pu(t.queryInfo.networkStatus)&&!(!((c=(u=t.options).skipPollAttempt)===null||c===void 0)&&c.call(u))?t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Jr.poll).then(l,l):l())},l=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(o,u.interval))};l()}}},e.prototype.updateLastResult=function(t,n){var i=this;n===void 0&&(n=this.variables);var a=Di("getLastError",function(){return i.getLastError()});return a&&this.last&&!Pn(n,this.last.variables)&&(a=void 0),this.last=me({result:this.queryManager.assumeImmutableResults?t:KR(t),variables:n},a?{error:a}:null)},e.prototype.reobserveAsConcast=function(t,n){var i=this;this.isTornDown=!1;var a=n===Jr.refetch||n===Jr.fetchMore||n===Jr.poll,s=this.options.variables,o=this.options.fetchPolicy,l=Yu(this.options,t||{}),u=a?l:Xw(this.options,l),c=this.transformDocument(u.query);this.lastQuery=c,a||(this.updatePolling(),t&&t.variables&&!Pn(t.variables,s)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===o||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=Jr.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=c0(u.fetchPolicy));var d=function(){i.concast===g&&(i.waitForOwnResult=!1)},f=u.variables&&me({},u.variables),h=this.fetch(u,n,c),g=h.concast,v=h.fromLink,y={next:function(A){Pn(i.variables,f)&&(d(),i.reportResult(A,f))},error:function(A){Pn(i.variables,f)&&(lk(A)||(A=new no({networkError:A})),d(),i.reportError(A,f))}};return!a&&(v||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=g,this.observer=y),g.addObserver(y),g},e.prototype.reobserve=function(t,n){return XR(this.reobserveAsConcast(t,n).promise.then(this.maskResult))},e.prototype.resubscribeAfterError=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=this.last;Di("resetLastResults",function(){return t.resetLastResults()});var s=this.subscribe.apply(this,n);return this.last=a,s},e.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this,a=Di("getLastError",function(){return i.getLastError()}),s=this.isDifferentFromLastResult(t,n);(a||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),(a||s)&&Gf(this.observers,"next",this.maskResult(t))},e.prototype.reportError=function(t,n){var i=this,a=me(me({},Di("getLastResult",function(){return i.getLastResult()})),{error:t,errors:t.graphQLErrors,networkStatus:Jr.error,loading:!1});this.updateLastResult(a,n),Gf(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(t){return this.queryManager.transform(t)},e.prototype.maskResult=function(t){return t&&"data"in t?me(me({},t),{data:this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):t},e.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},e.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},e.prototype.scheduleNotify=function(){var t=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!Pu(this.queryInfo.networkStatus))){var t=this.queryInfo.getDiff();t.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},e.prototype.reobserveCacheFirst=function(){var t=this.options,n=t.fetchPolicy,i=t.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(a,s){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(a,s):n}}):this.reobserve()},e.inactiveOnCreation=new fc,e})(an);ak(Lp);function rO(r){}function c0(r){return r==="network-only"||r==="no-cache"||r==="standby"}var Ru=new(kl?WeakMap:Map);function f0(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return Ru.set(r,(Ru.get(r)+1)%1e15),t.apply(this,arguments)})}var d0=(function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var n=this.cache=e.cache;Ru.has(n)||(Ru.set(n,0),f0(n,"evict"),f0(n,"modify"),f0(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||Jr.loading;return this.variables&&this.networkStatus!==Jr.loading&&!Pn(this.variables,e.variables)&&(t=Jr.setVariables),Pn(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.resetDiff=function(){this.lastDiff=void 0},r.prototype.getDiff=function(){var e=this,t=this.getDiffOptions();if(this.lastDiff&&Pn(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=Di("canonizeResults",function(){return e.cache.diff(t)});return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&Di("getLastError",function(){var a;return(a=t.observableQuery)===null||a===void 0?void 0:a.getLastError()})||(this.updateLastDiff(e),Pn(i&&i.result,e&&e.result)||(n=this.observableQuery)===null||n===void 0||n.scheduleNotify())},r.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},r.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,(e=this.observableQuery)===null||e===void 0||e.resetNotifications(),this.cancel();var t=this.observableQuery;t&&t.stopPolling()}},r.prototype.cancel=function(){var e;(e=this.cancelWatch)===null||e===void 0||e.call(this),this.cancelWatch=void 0},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=me(me({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!Pn(i,this.lastWatch))&&(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Ru.get(this.cache)&&Pn(t,n.variables)&&Pn(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,s,o=new Co,l=os(e.errors)?e.errors.slice(0):[];if((s=this.observableQuery)===null||s===void 0||s.resetNotifications(),"incremental"in e&&os(e.incremental)){var u=sk(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=l,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ky(e,n.errorPolicy)?this.cache.performTransaction(function(d){if(a.shouldWrite(e,n.variables))d.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Ru.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),h=Di("canonizeResults",function(){return d.diff(f)});!a.stopped&&Pn(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(h,f),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Jr.ready},r.prototype.markError=function(e){var t;return this.networkStatus=Jr.error,this.lastWrite=void 0,(t=this.observableQuery)===null||t===void 0||t.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r})();function ky(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!Mp(r);return!n&&t&&r.data&&(n=!0),n}var nO=Object.prototype.hasOwnProperty,Jw=Object.create(null),iO=(function(){function r(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new L2(Bs["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Ms(!1),this.noCacheWarningsByQueryId=new Set;var n=new J2(function(a){return t.cache.transformDocument(a)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var i=e.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(ji(35))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){return es(this,arguments,void 0,function(t){var n,i,a,s,o,l,u,c=t.mutation,d=t.variables,f=t.optimisticResponse,h=t.updateQueries,g=t.refetchQueries,v=g===void 0?[]:g,y=t.awaitRefetchQueries,A=y===void 0?!1:y,C=t.update,k=t.onQueryUpdated,F=t.fetchPolicy,S=F===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":F,R=t.errorPolicy,M=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,j=t.keepRootFields,G=t.context;return ts(this,function(ie){switch(ie.label){case 0:return Mr(c,36),Mr(S==="network-only"||S==="no-cache",37),n=this.generateMutationId(),c=this.cache.transformForLink(this.transform(c)),i=this.getDocumentInfo(c).hasClientExports,d=this.getVariables(c,d),i?[4,this.localState.addExportedVariables(c,d,G)]:[3,2];case 1:d=ie.sent(),ie.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:c,variables:d,loading:!0,error:null}),s=f&&this.markMutationOptimistic(f,{mutationId:n,document:c,variables:d,fetchPolicy:S,errorPolicy:M,context:G,updateQueries:h,update:C,keepRootFields:j}),this.broadcastQueries(),o=this,[2,new Promise(function(q,Y){return n0(o.getObservableFromLink(c,me(me({},G),{optimisticResponse:s?f:void 0}),d,{},!1),function(J){if(Mp(J)&&M==="none")throw new no({graphQLErrors:vy(J)});a&&(a.loading=!1,a.error=null);var se=me({},J);return typeof v=="function"&&(v=v(se)),M==="ignore"&&Mp(se)&&delete se.errors,o.markMutationResult({mutationId:n,result:se,document:c,variables:d,fetchPolicy:S,errorPolicy:M,context:G,update:C,updateQueries:h,awaitRefetchQueries:A,refetchQueries:v,removeOptimistic:s?n:void 0,onQueryUpdated:k,keepRootFields:j})}).subscribe({next:function(J){o.broadcastQueries(),(!("hasNext"in J)||J.hasNext===!1)&&q(me(me({},J),{data:o.maskOperation({document:c,data:J.data,fetchPolicy:S,id:n})}))},error:function(J){a&&(a.loading=!1,a.error=J),s&&o.cache.removeOptimistic(n),o.broadcastQueries(),Y(J instanceof no?J:new no({networkError:J}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],s=e.fetchPolicy==="no-cache";if(!s&&ky(i,e.errorPolicy)){if(Lu(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Lu(i)&&os(i.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;o.result&&(l=sk(o.result,i)),typeof l<"u"&&(i.data=l,a.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(d,f){var h=d.observableQuery,g=h&&h.queryName;if(!(!g||!nO.call(u,g))){var v=u[g],y=n.queries.get(f),A=y.document,C=y.variables,k=t.diff({query:A,variables:C,returnPartialData:!0,optimistic:!1}),F=k.result,S=k.complete;if(S&&F){var R=v(F,{mutationResult:i,queryName:A&&Op(A)||void 0,queryVariables:C});R&&a.push({result:R,dataId:"ROOT_QUERY",query:A,variables:C})}}})}if(a.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(d){s||a.forEach(function(v){return d.write(v)});var f=e.update,h=!e4(i)||Lu(i)&&!i.hasNext;if(f){if(!s){var g=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});g.complete&&(i=me(me({},i),{data:g.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}h&&f(d,i,{context:e.context,variables:e.variables})}!s&&!e.keepRootFields&&h&&d.modify({id:"ROOT_MUTATION",fields:function(v,y){var A=y.fieldName,C=y.DELETE;return A==="__typename"?v:C}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return c.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables,{IGNORE:Jw}):e;return i===Jw?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(me(me({},t),{result:{data:i}}),a)}catch{}},t.mutationId),!0)},r.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),t,n).concast.promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},r.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:HP(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:ld(["nonreactive"],e),nonReactiveQuery:UR(e),clientQuery:this.localState.clientQuery(e),serverQuery:Z2([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:DA(uc(e)),asQuery:me(me({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?me(me({},i),{operation:"query"}):i})})};t.set(e,n)}return t.get(e)},r.prototype.getVariables=function(e,t){return me(me({},this.getDocumentInfo(e).defaultVars),t)},r.prototype.watchQuery=function(e){var t=this.transform(e.query);e=me(me({},e),{variables:this.getVariables(t,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var n=new d0(this),i=new Lp({queryManager:this,queryInfo:n,options:e});return i.lastQuery=t,Lp.inactiveOnCreation.getValue()||this.queries.set(i.queryId,n),n.init({document:t,observableQuery:i,variables:i.variables}),i},r.prototype.query=function(e,t){var n=this;t===void 0&&(t=this.generateQueryId()),Mr(e.query,38),Mr(e.query.kind==="Document",39),Mr(!e.returnPartialData,40),Mr(!e.pollInterval,41);var i=this.transform(e.query);return this.fetchQuery(t,me(me({},e),{query:i})).then(function(a){return a&&me(me({},a),{data:n.maskOperation({document:i,data:a.data,fetchPolicy:e.fetchPolicy,id:t})})}).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(ji(42)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=Jr.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){if(typeof o=="string")i.set(o,o),a.set(o,!1);else if(uR(o)){var l=vl(t.transform(o));i.set(l,Op(o)),a.set(l,!1)}else ci(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,l){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(l,u);return}var d=u.queryName,f=u.options.fetchPolicy;if(f==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||d&&a.has(d)||c&&a.has(vl(c)))&&(n.set(l,u),d&&a.set(d,!0),c&&a.set(vl(c),!0))}}),s.size&&s.forEach(function(o){var l=oy("legacyOneTimeQuery"),u=t.getOrCreateQuery(l).init({document:o.query,variables:o.variables}),c=new Lp({queryManager:t,queryInfo:u,options:me(me({},o),{fetchPolicy:"network-only"})});Mr(c.queryId===l),u.setObservableQuery(c),n.set(l,c)}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var s=i.options.fetchPolicy;Di("resetLastResults",function(){return i.resetLastResults()}),(e||s!=="standby"&&s!=="cache-only")&&n.push(i.refetch()),(t.queries.get(a)||i.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.variables,a=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,l=e.context,u=l===void 0?{}:l,c=e.extensions,d=c===void 0?{}:c;n=this.transform(n),i=this.getVariables(n,i);var f=function(g){return t.getObservableFromLink(n,u,g,d).map(function(v){a!=="no-cache"&&(ky(v,o)&&t.cache.write({query:n,result:v.data,dataId:"ROOT_SUBSCRIPTION",variables:g}),t.broadcastQueries());var y=Mp(v),A=UA(v);if(y||A){var C={};if(y&&(C.graphQLErrors=v.errors),A&&(C.protocolErrors=v.extensions[Rd]),o==="none"||A)throw new no(C)}return o==="ignore"&&delete v.errors,v})};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,i,u).then(f);return new an(function(g){var v=null;return h.then(function(y){return v=y.subscribe(g)},g.error),function(){return v&&v.unsubscribe()}})}return f(i)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){var t;this.fetchCancelFns.delete(e),this.queries.has(e)&&((t=this.queries.get(e))===null||t===void 0||t.stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var t;return(t=e.observableQuery)===null||t===void 0?void 0:t.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i,a){var s=this,o;a===void 0&&(a=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var l,u=this.getDocumentInfo(e),c=u.serverQuery,d=u.clientQuery;if(c){var f=this,h=f.inFlightLinkObservables,g=f.link,v={query:c,variables:n,operationName:Op(c)||void 0,context:this.prepareContext(me(me({},t),{forceFetch:!a})),extensions:i};if(t=v.context,a){var y=vl(c),A=ho(n),C=h.lookup(y,A);if(l=C.observable,!l){var k=new Tu([Ay(g,v)]);l=C.observable=k,k.beforeNext(function F(S,R){S==="next"&&"hasNext"in R&&R.hasNext?k.beforeNext(F):h.remove(y,A)})}}else l=new Tu([Ay(g,v)])}else l=new Tu([an.of({data:{}})]),t=this.prepareContext(t);return d&&(l=n0(l,function(F){return s.localState.runResolvers({document:d,remoteResult:F,context:t,variables:n})})),l},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return n0(this.getObservableFromLink(a,n.context,n.variables),function(s){var o=vy(s),l=o.length>0,u=n.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new no({graphQLErrors:o}));e.markResult(s,a,n,t),e.markReady()}var c={data:s.data,loading:!1,networkStatus:Jr.ready};return l&&u==="none"&&(c.data=void 0),l&&u!=="ignore"&&(c.errors=o,c.networkStatus=Jr.error),c},function(s){var o=lk(s)?s:new no({networkError:s});throw i>=e.lastRequestId&&e.markError(o),o})},r.prototype.fetchConcastWithInfo=function(e,t,n,i){var a=this;n===void 0&&(n=Jr.loading),i===void 0&&(i=t.query);var s=this.getVariables(i,t.variables),o=this.defaultOptions.watchQuery,l=t.fetchPolicy,u=l===void 0?o&&o.fetchPolicy||"cache-first":l,c=t.errorPolicy,d=c===void 0?o&&o.errorPolicy||"none":c,f=t.returnPartialData,h=f===void 0?!1:f,g=t.notifyOnNetworkStatusChange,v=g===void 0?!1:g,y=t.context,A=y===void 0?{}:y,C=Object.assign({},t,{query:i,variables:s,fetchPolicy:u,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:v,context:A}),k=function(j){C.variables=j;var G=a.fetchQueryByPolicy(e,C,n);return C.fetchPolicy!=="standby"&&G.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",t),G},F=function(){return a.fetchCancelFns.delete(e.queryId)};this.fetchCancelFns.set(e.queryId,function(j){F(),setTimeout(function(){return S.cancel(j)})});var S,R;if(this.getDocumentInfo(C.query).hasClientExports)S=new Tu(this.localState.addExportedVariables(C.query,C.variables,C.context).then(k).then(function(j){return j.sources})),R=!0;else{var M=k(C.variables);R=M.fromLink,S=new Tu(M.sources)}return S.promise.then(F,F),{concast:S,fromLink:R}},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,s=a===void 0?!1:a,o=e.removeOptimistic,l=o===void 0?s?oy("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;i&&this.getObservableQueries(i).forEach(function(f,h){c.set(h,{oq:f,lastDiff:(t.queries.get(h)||f.queryInfo).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:s&&l||!1,removeOptimistic:l,onWatchUpdated:function(f,h,g){var v=f.watcher instanceof d0&&f.watcher.observableQuery;if(v){if(u){c.delete(v.queryId);var y=u(v,h,g);return y===!0&&(y=v.refetch()),y!==!1&&d.set(v,y),y}u!==null&&c.set(v.queryId,{oq:v,lastDiff:g,diff:h})}}}),c.size&&c.forEach(function(f,h){var g=f.oq,v=f.lastDiff,y=f.diff,A;u&&(y||(y=Di("canonizeResults",function(){return t.cache.diff(g.queryInfo.getDiffOptions())})),A=u(g,y,v)),(!u||A===!0)&&(A=g.refetch()),A!==!1&&d.set(g,A),h.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(h)}),l&&this.cache.removeOptimistic(l),d},r.prototype.maskOperation=function(e){var t=e.document,n=e.data;return this.dataMasking?V4(n,t,this.cache):n},r.prototype.maskFragment=function(e){var t=e.data,n=e.fragment,i=e.fragmentName;return this.dataMasking?mk(t,n,this.cache,i):t},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,s=t.variables,o=t.fetchPolicy,l=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,d=t.context,f=t.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:a,variables:s,networkStatus:n});var g=function(){return e.getDiff()},v=function(F,S){S===void 0&&(S=e.networkStatus||Jr.loading);var R=F.result,M=function(j){return an.of(me({data:j,loading:Pu(S),networkStatus:S},F.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:s,onlyRunForcedResolvers:!0}).then(function(j){return M(j.data||void 0)}):u==="none"&&S===Jr.refetch&&Array.isArray(F.missing)?M(void 0):M(R)},y=o==="no-cache"?0:n===Jr.refetch&&l!=="merge"?1:2,A=function(){return i.getResultsFromLink(e,y,{query:a,variables:s,context:d,fetchPolicy:o,errorPolicy:u})},C=f&&typeof h=="number"&&h!==n&&Pu(n);switch(o){default:case"cache-first":{var k=g();return k.complete?{fromLink:!1,sources:[v(k,e.markReady())]}:c||C?{fromLink:!0,sources:[v(k),A()]}:{fromLink:!0,sources:[A()]}}case"cache-and-network":{var k=g();return k.complete||c||C?{fromLink:!0,sources:[v(k),A()]}:{fromLink:!0,sources:[A()]}}case"cache-only":return{fromLink:!1,sources:[v(g(),e.markReady())]};case"network-only":return C?{fromLink:!0,sources:[v(g()),A()]}:{fromLink:!0,sources:[A()]};case"no-cache":return C?{fromLink:!0,sources:[v(e.getDiff()),A()]}:{fromLink:!0,sources:[A()]};case"standby":return{fromLink:!1,sources:[]}}},r.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new d0(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return me(me(me({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},r})(),aO=(function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=yw(t.resolvers,n)}):this.resolvers=yw(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){return es(this,arguments,void 0,function(t){var n=t.document,i=t.remoteResult,a=t.context,s=t.variables,o=t.onlyRunForcedResolvers,l=o===void 0?!1:o;return ts(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,s,this.fragmentMatcher,l).then(function(c){return me(me({},i),{data:c.result})})]:[2,i]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return ld(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return tk(e)},r.prototype.prepareContext=function(e){var t=this.cache;return me(me({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e){return es(this,arguments,void 0,function(t,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),ts(this,function(a){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,n)||{},this.prepareContext(i),n).then(function(s){return me(me({},n),s.exportedVariables)})]:[2,me({},n)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Ia(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return FA}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:LR(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t){return es(this,arguments,void 0,function(n,i,a,s,o,l){var u,c,d,f,h,g,v,y,A,C,k;return a===void 0&&(a={}),s===void 0&&(s={}),o===void 0&&(o=function(){return!0}),l===void 0&&(l=!1),ts(this,function(F){return u=Pd(n),c=cc(n),d=oc(c),f=this.collectSelectionsToResolve(u,d),h=u.operation,g=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",v=this,y=v.cache,A=v.client,C={fragmentMap:d,context:me(me({},a),{cache:y,client:A}),variables:s,fragmentMatcher:o,defaultOperationType:g,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:l},k=!1,[2,this.resolveSelectionSet(u.selectionSet,k,i,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return es(this,void 0,void 0,function(){var a,s,o,l,u,c=this;return ts(this,function(d){return a=i.fragmentMap,s=i.context,o=i.variables,l=[n],u=function(f){return es(c,void 0,void 0,function(){var h,g;return ts(this,function(v){return!t&&!i.selectionsToResolve.has(f)?[2]:Dd(f,o)?bo(f)?[2,this.resolveField(f,t,n,i).then(function(y){var A;typeof y<"u"&&l.push((A={},A[Ao(f)]=y,A))})]:(wR(f)?h=f:(h=a[f.name.value],Mr(h,21,f.name.value)),h&&h.typeCondition&&(g=h.typeCondition.name.value,i.fragmentMatcher(n,g,s))?[2,this.resolveSelectionSet(h.selectionSet,t,n,i).then(function(y){l.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Pg(l)})]})})},r.prototype.resolveField=function(e,t,n,i){return es(this,void 0,void 0,function(){var a,s,o,l,u,c,d,f,h,g=this;return ts(this,function(v){return n?(a=i.variables,s=e.name.value,o=Ao(e),l=s!==o,u=n[o]||n[s],c=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(h=f[l?s:o],h&&(c=Promise.resolve(VA.withValue(this.cache,h,[n,Fg(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,c.then(function(y){var A,C;if(y===void 0&&(y=u),e.directives&&e.directives.forEach(function(F){F.name.value==="export"&&F.arguments&&F.arguments.forEach(function(S){S.name.value==="as"&&S.value.kind==="StringValue"&&(i.exportedVariables[S.value.value]=y)})}),!e.selectionSet||y==null)return y;var k=(C=(A=e.directives)===null||A===void 0?void 0:A.some(function(F){return F.name.value==="client"}))!==null&&C!==void 0?C:!1;if(Array.isArray(y))return g.resolveSubSelectedArray(e,t||k,y,i);if(e.selectionSet)return g.resolveSelectionSet(e.selectionSet,t||k,y,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(s){if(s===null)return null;if(Array.isArray(s))return a.resolveSubSelectedArray(e,t,s,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,s,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(s){return!Array.isArray(s)},i=this.selectionsToResolveCache;function a(s){if(!i.has(s)){var o=new Set;i.set(s,o),Ia(s,{Directive:function(l,u,c,d,f){l.name.value==="client"&&f.forEach(function(h){n(h)&&uw(h)&&o.add(h)})},FragmentSpread:function(l,u,c,d,f){var h=t[l.name.value];Mr(h,22,l.name.value);var g=a(h);g.size>0&&(f.forEach(function(v){n(v)&&uw(v)&&o.add(v)}),o.add(l),g.forEach(function(v){o.add(v)}))}})}return i.get(s)}return a(e)},r})(),sO=(function(){function r(e){var t=this,n,i,a;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw ji(16);var s=e.uri,o=e.credentials,l=e.headers,u=e.cache,c=e.documentTransform,d=e.ssrMode,f=d===void 0?!1:d,h=e.ssrForceFetchDelay,g=h===void 0?0:h,v=e.connectToDevTools,y=e.queryDeduplication,A=y===void 0?!0:y,C=e.defaultOptions,k=e.defaultContext,F=e.assumeImmutableResults,S=F===void 0?u.assumeImmutableResults:F,R=e.resolvers,M=e.typeDefs,j=e.fragmentMatcher,G=e.clientAwareness,ie=e.name,q=e.version,Y=e.devtools,J=e.dataMasking,se=e.link;se||(se=s?new O4({uri:s,credentials:o,headers:l}):Ma.empty()),this.link=se,this.cache=u,this.disableNetworkFetches=f||g>0,this.queryDeduplication=A,this.defaultOptions=C||Object.create(null),this.typeDefs=M,this.devtoolsConfig=me(me({},Y),{enabled:(n=Y?.enabled)!==null&&n!==void 0?n:v}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=!1),g&&setTimeout(function(){return t.disableNetworkFetches=!1},g),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=xA,this.localState=new aO({cache:u,client:this,resolvers:R,fragmentMatcher:j}),this.queryManager=new iO({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:k,documentTransform:c,queryDeduplication:A,ssrMode:f,dataMasking:!!J,clientAwareness:{name:(i=G?.name)!==null&&i!==void 0?i:ie,version:(a=G?.version)!==null&&a!==void 0?a:q},localState:this.localState,assumeImmutableResults:S,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(r.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e},enumerable:!1,configurable:!0}),r.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}},Object.defineProperty(r.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=i0(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=me(me({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=i0(this.defaultOptions.query,e)),Mr(e.fetchPolicy!=="cache-and-network",18),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=me(me({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=i0(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){var t=this,n=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(i){return me(me({},i),{data:t.queryManager.maskOperation({document:e.query,data:i.data,fetchPolicy:e.fetchPolicy,id:n})})})},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.watchFragment=function(e){var t;return this.cache.watchFragment(me(me({},e),(t={},t[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,t)))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return Ay(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(s,o){n.push(o),i.push(s)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(s){}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(r.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),r})(),Up=new Map,Ty=new Map,Ik=!0,Qf=!1;function Dk(r){return r.replace(/[\s,]+/g," ").trim()}function oO(r){return Dk(r.source.body.substring(r.start,r.end))}function lO(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=oO(n.loc),s=Ty.get(i);s&&!s.has(a)?Ik&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
62
62
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
63
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Ty.set(i,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),me(me({},r),{definitions:t})}function uO(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function cO(r){var e=Dk(r);if(!Up.has(e)){var t=OP(r,{experimentalFragmentVariables:Qf,allowLegacyFragmentVariables:Qf,experimentalFragmentArguments:Qf});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Up.set(e,uO(lO(t)))}return Up.get(e)}function Ee(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),cO(n)}function fO(){Up.clear(),Ty.clear()}function dO(){Ik=!1}function hO(){Qf=!0}function pO(){Qf=!1}var af={gql:Ee,resetCaches:fO,disableFragmentWarnings:dO,enableExperimentalFragmentVariables:hO,disableExperimentalFragmentVariables:pO};(function(r){r.gql=af.gql,r.resetCaches=af.resetCaches,r.disableFragmentWarnings=af.disableFragmentWarnings,r.enableExperimentalFragmentVariables=af.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=af.disableExperimentalFragmentVariables})(Ee||(Ee={}));Ee.default=Ee;var dd=(r=>(r.Data="Data",r.Font="Font",r.Frame="Frame",r.Illustration="Illustration",r.Image="Image",r.Model="Model",r.Material="Material",r.Color="Color",r.QuestionnaireCollateral="QuestionnaireCollateral",r.RequestCollateral="RequestCollateral",r.SignupCollateral="SignupCollateral",r.Video="Video",r.ColorProfile="ColorProfile",r.Environment="Environment",r))(dd||{}),Pk=(r=>(r.AND="AND",r.OR="OR",r))(Pk||{}),Hn=(r=>(r.FileUpload="FileUpload",r.Option="Option",r.ColorOption="ColorOption",r.Text="Text",r))(Hn||{}),Xe=(r=>(r.Information="Information",r.Bulk="Bulk",r.DigitalContent="DigitalContent",r.Finish="Finish",r.Frame="Frame",r.Illustration="Illustration",r.Introduction="Introduction",r.Material="Material",r.Model="Model",r.Module="Module",r.Picture="Picture",r.Photo="Photo",r.Product="Product",r.ProductOverlay="ProductOverlay",r.Question="Question",r.Shape="Shape",r.SilentIllustration="SilentIllustration",r.Text="Text",r))(Xe||{}),Rk=(r=>(r.Color="Color",r.Colors="Colors",r.Selection="Selection",r.Selections="Selections",r.Text="Text",r.Upload="Upload",r))(Rk||{}),Ju=(r=>(r.ThreeD="ThreeD",r.FreeDesign="FreeDesign",r.Print="Print",r))(Ju||{}),er=(r=>(r.Frame="frame",r.Group="group",r.Image="image",r.Pattern="pattern",r.Illustration="illustration",r.Textbox="textbox",r))(er||{}),Ok=(r=>(r.Default="Default",r.FirstTransaction="FirstTransaction",r.OneToOne="OneToOne",r))(Ok||{}),Rg=(r=>(r.Pending="Pending",r.Failed="Failed",r.Validated="Validated",r.Overridden="Overridden",r.Skipped="Skipped",r))(Rg||{}),Bk=(r=>(r.Hyperlink="Hyperlink",r.Edit="Edit",r.Approve="Approve",r))(Bk||{}),Mk=(r=>(r.Hub="Hub",r.Shopify="Shopify",r))(Mk||{}),Og=(r=>(r.AdvancedImageManipulation="BackgroundRemover",r.ConversionAccelerator="Conversion Accelerator",r.ProcessBuilder="ProcessBuilder",r))(Og||{}),_k=(r=>(r[r.Orbit=0]="Orbit",r[r.Pan=1]="Pan",r))(_k||{}),jA=(r=>(r.Owner="Owner",r.Approver="Approver",r.Editor="Editor",r.Viewer="Viewer",r))(jA||{}),Tl=(r=>(r.Autosize="Autosize",r.Traditional="Traditional",r))(Tl||{}),gi=(r=>(r[r.North=0]="North",r[r.Northeast=1]="Northeast",r[r.East=2]="East",r[r.Southeast=3]="Southeast",r[r.South=4]="South",r[r.Southwest=5]="Southwest",r[r.West=6]="West",r[r.Northwest=7]="Northwest",r))(gi||{}),Nk=(r=>(r.Pixel="px",r.Millimeter="mm",r.Centimeter="cm",r))(Nk||{}),Yf=(r=>(r.Email="Email",r.FirstName="FirstName",r.LastName="LastName",r.Phone="Phone",r.Apartment="Apartment",r.City="City",r.Country="Country",r.OrganizationName="OrganizationName",r.PostCode="PostCode",r.State="State",r.StreetAddress="StreetAddress",r.Custom="Custom",r))(Yf||{});class Lk extends Error{constructor(e){super(e),this.name=this.constructor.name}}class Od extends Lk{constructor(e){super(`ConfigurationError - ${e}`)}}class hd extends Od{constructor(e){super(`Option not Configured: ${e.stepTitle}`),this.optionId=e?.optionId||"N/A"}}class Ai extends Od{constructor(e){super(`Panel not Found: ${e.panelId}`),this.panelId=e?.panelId||"N/A"}}class xo extends Od{constructor(e){super(`Asset not found for variant: ${e.name}`),this.variant=e}}class Ku extends Od{constructor(e){super(`Resource not found for asset: ${e.name}`),this.asset=e}}class as extends Od{constructor(e,t){super(`Workflow Misconfiguration: ${e.stepName} - ${t}`),this.step=e}}class Bg extends Lk{constructor(e){super(`ImplementationError - ${e}`)}}class nn extends Bg{constructor(e){super(`Unhandled Behavior Encountered: ${e}`)}}class yl extends Bg{constructor(e){super(`Parsing Error: ${e}`)}}class so extends Bg{constructor(e){super(`Client Error: ${e}`)}}class Mg extends Bg{constructor(e){super(`Resource Generation Failed: ${e}`)}}class gO{get(e){return localStorage.getItem(e)||void 0}set(e,t){localStorage.setItem(e,t)}remove(e){localStorage.removeItem(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}class Kw{constructor(){this.storage=new Map}get(e){return this.storage.get(e)||void 0}set(e,t){this.storage.set(e,t)}remove(e){this.storage.delete(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}const mO=()=>{try{return localStorage?new gO:new Kw}catch{return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."),new Kw}},wr=mO();function vO(r){return new Ma(function(e,t){var n=is(e,[]);return new an(function(i){var a,s=!1;return Promise.resolve(n).then(function(o){return r(o,e.getContext())}).then(e.setContext).then(function(){s||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,a&&a.unsubscribe()}})})}function Uk(r){return new Ma(function(e,t){return new an(function(n){var i,a,s;try{i=t(e).subscribe({next:function(o){if(o.errors?s=r({graphQLErrors:o.errors,response:o,operation:e,forward:t}):UA(o)&&(s=r({protocolErrors:o.extensions[Rd],response:o,operation:e,forward:t})),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(o)},error:function(o){if(s=r({operation:e,networkError:o,graphQLErrors:o&&o.result&&o.result.errors||void 0,forward:t}),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(o)},complete:function(){s||n.complete.bind(n)()}})}catch(o){r({networkError:o,operation:e,forward:t}),n.error(o)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){pa(e,r);function e(t){var n=r.call(this)||this;return n.link=Uk(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(Ma);class yO{constructor(){this.defaultServerUrl="https://moonlight.au.spiffcommerce.com",this.defaultServicesApiUrl="https://services.au.spiffcommerce.com",this.defaultHubUrl="https://hub.au.spiffcommerce.com",this.endpointVersion="2026-06",this.serverUrl=this.defaultServerUrl+`/${this.endpointVersion}`,this.servicesApiUrl=this.defaultServicesApiUrl,this.hubUrl=this.defaultHubUrl,this.serverUrlCallbacks=[]}getServerUrl(){return this.serverUrl}getServicesApiUrl(){return this.servicesApiUrl}getHubUrl(){return this.hubUrl}setServerUrl(e){e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith(".com")?this.serverUrl=e+`/${this.endpointVersion}`:e.includes("spiffcommerce.com")?(e=e.slice(0,e.lastIndexOf("/")),this.serverUrl=`${e}/${this.endpointVersion}`):this.serverUrl=e,this.serverUrlCallbacks.forEach(t=>t())}setServicesApiUrl(e){this.servicesApiUrl=e}setHubUrl(e){this.hubUrl=e}addServerUrlCallback(e){this.serverUrlCallbacks.push(e)}}const po=new yO;var Xs={},ol={},Uh={exports:{}},br={};var Zw;function AO(){if(Zw)return br;Zw=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;function f(ee){return ee===null||typeof ee!="object"?null:(ee=d&&ee[d]||ee["@@iterator"],typeof ee=="function"?ee:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(ee,re,de){this.props=ee,this.context=re,this.refs=v,this.updater=de||h}y.prototype.isReactComponent={},y.prototype.setState=function(ee,re){if(typeof ee!="object"&&typeof ee!="function"&&ee!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ee,re,"setState")},y.prototype.forceUpdate=function(ee){this.updater.enqueueForceUpdate(this,ee,"forceUpdate")};function A(){}A.prototype=y.prototype;function C(ee,re,de){this.props=ee,this.context=re,this.refs=v,this.updater=de||h}var k=C.prototype=new A;k.constructor=C,g(k,y.prototype),k.isPureReactComponent=!0;var F=Array.isArray,S=Object.prototype.hasOwnProperty,R={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function j(ee,re,de){var Be,ke={},ze=null,je=null;if(re!=null)for(Be in re.ref!==void 0&&(je=re.ref),re.key!==void 0&&(ze=""+re.key),re)S.call(re,Be)&&!M.hasOwnProperty(Be)&&(ke[Be]=re[Be]);var qe=arguments.length-2;if(qe===1)ke.children=de;else if(1<qe){for(var Ge=Array(qe),bt=0;bt<qe;bt++)Ge[bt]=arguments[bt+2];ke.children=Ge}if(ee&&ee.defaultProps)for(Be in qe=ee.defaultProps,qe)ke[Be]===void 0&&(ke[Be]=qe[Be]);return{$$typeof:r,type:ee,key:ze,ref:je,props:ke,_owner:R.current}}function G(ee,re){return{$$typeof:r,type:ee.type,key:re,ref:ee.ref,props:ee.props,_owner:ee._owner}}function ie(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===r}function q(ee){var re={"=":"=0",":":"=2"};return"$"+ee.replace(/[=:]/g,function(de){return re[de]})}var Y=/\/+/g;function J(ee,re){return typeof ee=="object"&&ee!==null&&ee.key!=null?q(""+ee.key):re.toString(36)}function se(ee,re,de,Be,ke){var ze=typeof ee;(ze==="undefined"||ze==="boolean")&&(ee=null);var je=!1;if(ee===null)je=!0;else switch(ze){case"string":case"number":je=!0;break;case"object":switch(ee.$$typeof){case r:case e:je=!0}}if(je)return je=ee,ke=ke(je),ee=Be===""?"."+J(je,0):Be,F(ke)?(de="",ee!=null&&(de=ee.replace(Y,"$&/")+"/"),se(ke,re,de,"",function(bt){return bt})):ke!=null&&(ie(ke)&&(ke=G(ke,de+(!ke.key||je&&je.key===ke.key?"":(""+ke.key).replace(Y,"$&/")+"/")+ee)),re.push(ke)),1;if(je=0,Be=Be===""?".":Be+":",F(ee))for(var qe=0;qe<ee.length;qe++){ze=ee[qe];var Ge=Be+J(ze,qe);je+=se(ze,re,de,Ge,ke)}else if(Ge=f(ee),typeof Ge=="function")for(ee=Ge.call(ee),qe=0;!(ze=ee.next()).done;)ze=ze.value,Ge=Be+J(ze,qe++),je+=se(ze,re,de,Ge,ke);else if(ze==="object")throw re=String(ee),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(ee).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.");return je}function oe(ee,re,de){if(ee==null)return ee;var Be=[],ke=0;return se(ee,Be,"","",function(ze){return re.call(de,ze,ke++)}),Be}function he(ee){if(ee._status===-1){var re=ee._result;re=re(),re.then(function(de){(ee._status===0||ee._status===-1)&&(ee._status=1,ee._result=de)},function(de){(ee._status===0||ee._status===-1)&&(ee._status=2,ee._result=de)}),ee._status===-1&&(ee._status=0,ee._result=re)}if(ee._status===1)return ee._result.default;throw ee._result}var ye={current:null},Ue={transition:null},Re={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Ue,ReactCurrentOwner:R};function Oe(){throw Error("act(...) is not supported in production builds of React.")}return br.Children={map:oe,forEach:function(ee,re,de){oe(ee,function(){re.apply(this,arguments)},de)},count:function(ee){var re=0;return oe(ee,function(){re++}),re},toArray:function(ee){return oe(ee,function(re){return re})||[]},only:function(ee){if(!ie(ee))throw Error("React.Children.only expected to receive a single React element child.");return ee}},br.Component=y,br.Fragment=t,br.Profiler=i,br.PureComponent=C,br.StrictMode=n,br.Suspense=l,br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Re,br.act=Oe,br.cloneElement=function(ee,re,de){if(ee==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ee+".");var Be=g({},ee.props),ke=ee.key,ze=ee.ref,je=ee._owner;if(re!=null){if(re.ref!==void 0&&(ze=re.ref,je=R.current),re.key!==void 0&&(ke=""+re.key),ee.type&&ee.type.defaultProps)var qe=ee.type.defaultProps;for(Ge in re)S.call(re,Ge)&&!M.hasOwnProperty(Ge)&&(Be[Ge]=re[Ge]===void 0&&qe!==void 0?qe[Ge]:re[Ge])}var Ge=arguments.length-2;if(Ge===1)Be.children=de;else if(1<Ge){qe=Array(Ge);for(var bt=0;bt<Ge;bt++)qe[bt]=arguments[bt+2];Be.children=qe}return{$$typeof:r,type:ee.type,key:ke,ref:ze,props:Be,_owner:je}},br.createContext=function(ee){return ee={$$typeof:s,_currentValue:ee,_currentValue2:ee,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ee.Provider={$$typeof:a,_context:ee},ee.Consumer=ee},br.createElement=j,br.createFactory=function(ee){var re=j.bind(null,ee);return re.type=ee,re},br.createRef=function(){return{current:null}},br.forwardRef=function(ee){return{$$typeof:o,render:ee}},br.isValidElement=ie,br.lazy=function(ee){return{$$typeof:c,_payload:{_status:-1,_result:ee},_init:he}},br.memo=function(ee,re){return{$$typeof:u,type:ee,compare:re===void 0?null:re}},br.startTransition=function(ee){var re=Ue.transition;Ue.transition={};try{ee()}finally{Ue.transition=re}},br.unstable_act=Oe,br.useCallback=function(ee,re){return ye.current.useCallback(ee,re)},br.useContext=function(ee){return ye.current.useContext(ee)},br.useDebugValue=function(){},br.useDeferredValue=function(ee){return ye.current.useDeferredValue(ee)},br.useEffect=function(ee,re){return ye.current.useEffect(ee,re)},br.useId=function(){return ye.current.useId()},br.useImperativeHandle=function(ee,re,de){return ye.current.useImperativeHandle(ee,re,de)},br.useInsertionEffect=function(ee,re){return ye.current.useInsertionEffect(ee,re)},br.useLayoutEffect=function(ee,re){return ye.current.useLayoutEffect(ee,re)},br.useMemo=function(ee,re){return ye.current.useMemo(ee,re)},br.useReducer=function(ee,re,de){return ye.current.useReducer(ee,re,de)},br.useRef=function(ee){return ye.current.useRef(ee)},br.useState=function(ee){return ye.current.useState(ee)},br.useSyncExternalStore=function(ee,re,de){return ye.current.useSyncExternalStore(ee,re,de)},br.useTransition=function(){return ye.current.useTransition()},br.version="18.3.1",br}var Bf={exports:{}};Bf.exports;var eC;function bO(){return eC||(eC=1,(function(r,e){process.env.NODE_ENV!=="production"&&(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,A="@@iterator";function C(B){if(B===null||typeof B!="object")return null;var Z=y&&B[y]||B[A];return typeof Z=="function"?Z:null}var k={current:null},F={transition:null},S={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},M={},j=null;function G(B){j=B}M.setExtraStackFrame=function(B){j=B},M.getCurrentStack=null,M.getStackAddendum=function(){var B="";j&&(B+=j);var Z=M.getCurrentStack;return Z&&(B+=Z()||""),B};var ie=!1,q=!1,Y=!1,J=!1,se=!1,oe={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:F,ReactCurrentOwner:R};oe.ReactDebugCurrentFrame=M,oe.ReactCurrentActQueue=S;function he(B){{for(var Z=arguments.length,fe=new Array(Z>1?Z-1:0),be=1;be<Z;be++)fe[be-1]=arguments[be];Ue("warn",B,fe)}}function ye(B){{for(var Z=arguments.length,fe=new Array(Z>1?Z-1:0),be=1;be<Z;be++)fe[be-1]=arguments[be];Ue("error",B,fe)}}function Ue(B,Z,fe){{var be=oe.ReactDebugCurrentFrame,Me=be.getStackAddendum();Me!==""&&(Z+="%s",fe=fe.concat([Me]));var Ke=fe.map(function(Je){return String(Je)});Ke.unshift("Warning: "+Z),Function.prototype.apply.call(console[B],console,Ke)}}var Re={};function Oe(B,Z){{var fe=B.constructor,be=fe&&(fe.displayName||fe.name)||"ReactClass",Me=be+"."+Z;if(Re[Me])return;ye("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Z,be),Re[Me]=!0}}var ee={isMounted:function(B){return!1},enqueueForceUpdate:function(B,Z,fe){Oe(B,"forceUpdate")},enqueueReplaceState:function(B,Z,fe,be){Oe(B,"replaceState")},enqueueSetState:function(B,Z,fe,be){Oe(B,"setState")}},re=Object.assign,de={};Object.freeze(de);function Be(B,Z,fe){this.props=B,this.context=Z,this.refs=de,this.updater=fe||ee}Be.prototype.isReactComponent={},Be.prototype.setState=function(B,Z){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,Z,"setState")},Be.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};{var ke={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},ze=function(B,Z){Object.defineProperty(Be.prototype,B,{get:function(){he("%s(...) is deprecated in plain JavaScript React classes. %s",Z[0],Z[1])}})};for(var je in ke)ke.hasOwnProperty(je)&&ze(je,ke[je])}function qe(){}qe.prototype=Be.prototype;function Ge(B,Z,fe){this.props=B,this.context=Z,this.refs=de,this.updater=fe||ee}var bt=Ge.prototype=new qe;bt.constructor=Ge,re(bt,Be.prototype),bt.isPureReactComponent=!0;function rr(){var B={current:null};return Object.seal(B),B}var Pr=Array.isArray;function Gt(B){return Pr(B)}function ar(B){{var Z=typeof Symbol=="function"&&Symbol.toStringTag,fe=Z&&B[Symbol.toStringTag]||B.constructor.name||"Object";return fe}}function St(B){try{return st(B),!1}catch{return!0}}function st(B){return""+B}function Qr(B){if(St(B))return ye("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(B)),st(B)}function Sr(B,Z,fe){var be=B.displayName;if(be)return be;var Me=Z.displayName||Z.name||"";return Me!==""?fe+"("+Me+")":fe}function gr(B){return B.displayName||"Context"}function nr(B){if(B==null)return null;if(typeof B.tag=="number"&&ye("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof B=="function")return B.displayName||B.name||null;if(typeof B=="string")return B;switch(B){case a:return"Fragment";case i:return"Portal";case o:return"Profiler";case s:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof B=="object")switch(B.$$typeof){case u:var Z=B;return gr(Z)+".Consumer";case l:var fe=B;return gr(fe._context)+".Provider";case c:return Sr(B,B.render,"ForwardRef");case h:var be=B.displayName||null;return be!==null?be:nr(B.type)||"Memo";case g:{var Me=B,Ke=Me._payload,Je=Me._init;try{return nr(Je(Ke))}catch{return null}}}return null}var fr=Object.prototype.hasOwnProperty,Yt={key:!0,ref:!0,__self:!0,__source:!0},Xt,mt,Cr;Cr={};function sn(B){if(fr.call(B,"ref")){var Z=Object.getOwnPropertyDescriptor(B,"ref").get;if(Z&&Z.isReactWarning)return!1}return B.ref!==void 0}function _r(B){if(fr.call(B,"key")){var Z=Object.getOwnPropertyDescriptor(B,"key").get;if(Z&&Z.isReactWarning)return!1}return B.key!==void 0}function ir(B,Z){var fe=function(){Xt||(Xt=!0,ye("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};fe.isReactWarning=!0,Object.defineProperty(B,"key",{get:fe,configurable:!0})}function Yr(B,Z){var fe=function(){mt||(mt=!0,ye("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};fe.isReactWarning=!0,Object.defineProperty(B,"ref",{get:fe,configurable:!0})}function kr(B){if(typeof B.ref=="string"&&R.current&&B.__self&&R.current.stateNode!==B.__self){var Z=nr(R.current.type);Cr[Z]||(ye('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Z,B.ref),Cr[Z]=!0)}}var Zr=function(B,Z,fe,be,Me,Ke,Je){var yt={$$typeof:n,type:B,key:Z,ref:fe,props:Je,_owner:Ke};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Vr(B,Z,fe){var be,Me={},Ke=null,Je=null,yt=null,Ot=null;if(Z!=null){sn(Z)&&(Je=Z.ref,kr(Z)),_r(Z)&&(Qr(Z.key),Ke=""+Z.key),yt=Z.__self===void 0?null:Z.__self,Ot=Z.__source===void 0?null:Z.__source;for(be in Z)fr.call(Z,be)&&!Yt.hasOwnProperty(be)&&(Me[be]=Z[be])}var pr=arguments.length-2;if(pr===1)Me.children=fe;else if(pr>1){for(var yr=Array(pr),ur=0;ur<pr;ur++)yr[ur]=arguments[ur+2];Object.freeze&&Object.freeze(yr),Me.children=yr}if(B&&B.defaultProps){var Fr=B.defaultProps;for(be in Fr)Me[be]===void 0&&(Me[be]=Fr[be])}if(Ke||Je){var Gr=typeof B=="function"?B.displayName||B.name||"Unknown":B;Ke&&ir(Me,Gr),Je&&Yr(Me,Gr)}return Zr(B,Ke,Je,yt,Ot,R.current,Me)}function pn(B,Z){var fe=Zr(B.type,Z,B.ref,B._self,B._source,B._owner,B.props);return fe}function gn(B,Z,fe){if(B==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var be,Me=re({},B.props),Ke=B.key,Je=B.ref,yt=B._self,Ot=B._source,pr=B._owner;if(Z!=null){sn(Z)&&(Je=Z.ref,pr=R.current),_r(Z)&&(Qr(Z.key),Ke=""+Z.key);var yr;B.type&&B.type.defaultProps&&(yr=B.type.defaultProps);for(be in Z)fr.call(Z,be)&&!Yt.hasOwnProperty(be)&&(Z[be]===void 0&&yr!==void 0?Me[be]=yr[be]:Me[be]=Z[be])}var ur=arguments.length-2;if(ur===1)Me.children=fe;else if(ur>1){for(var Fr=Array(ur),Gr=0;Gr<ur;Gr++)Fr[Gr]=arguments[Gr+2];Me.children=Fr}return Zr(B.type,Ke,Je,yt,Ot,pr,Me)}function Tr(B){return typeof B=="object"&&B!==null&&B.$$typeof===n}var zr=".",en=":";function $r(B){var Z=/[=:]/g,fe={"=":"=0",":":"=2"},be=B.replace(Z,function(Me){return fe[Me]});return"$"+be}var zt=!1,sr=/\/+/g;function Er(B){return B.replace(sr,"$&/")}function tt(B,Z){return typeof B=="object"&&B!==null&&B.key!=null?(Qr(B.key),$r(""+B.key)):Z.toString(36)}function Nr(B,Z,fe,be,Me){var Ke=typeof B;(Ke==="undefined"||Ke==="boolean")&&(B=null);var Je=!1;if(B===null)Je=!0;else switch(Ke){case"string":case"number":Je=!0;break;case"object":switch(B.$$typeof){case n:case i:Je=!0}}if(Je){var yt=B,Ot=Me(yt),pr=be===""?zr+tt(yt,0):be;if(Gt(Ot)){var yr="";pr!=null&&(yr=Er(pr)+"/"),Nr(Ot,Z,yr,"",function(Va){return Va})}else Ot!=null&&(Tr(Ot)&&(Ot.key&&(!yt||yt.key!==Ot.key)&&Qr(Ot.key),Ot=pn(Ot,fe+(Ot.key&&(!yt||yt.key!==Ot.key)?Er(""+Ot.key)+"/":"")+pr)),Z.push(Ot));return 1}var ur,Fr,Gr=0,yn=be===""?zr:be+en;if(Gt(B))for(var Wi=0;Wi<B.length;Wi++)ur=B[Wi],Fr=yn+tt(ur,Wi),Gr+=Nr(ur,Z,fe,Fr,Me);else{var sa=C(B);if(typeof sa=="function"){var Qi=B;sa===Qi.entries&&(zt||he("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),zt=!0);for(var Wn=sa.call(Qi),Yi,hi=0;!(Yi=Wn.next()).done;)ur=Yi.value,Fr=yn+tt(ur,hi++),Gr+=Nr(ur,Z,fe,Fr,Me)}else if(Ke==="object"){var Ua=String(B);throw new Error("Objects are not valid as a React child (found: "+(Ua==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Ua)+"). If you meant to render a collection of children, use an array instead.")}}return Gr}function Xr(B,Z,fe){if(B==null)return B;var be=[],Me=0;return Nr(B,be,"","",function(Ke){return Z.call(fe,Ke,Me++)}),be}function Se(B){var Z=0;return Xr(B,function(){Z++}),Z}function P(B,Z,fe){Xr(B,function(){Z.apply(this,arguments)},fe)}function U(B){return Xr(B,function(Z){return Z})||[]}function X(B){if(!Tr(B))throw new Error("React.Children.only expected to receive a single React element child.");return B}function ue(B){var Z={$$typeof:u,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};Z.Provider={$$typeof:l,_context:Z};var fe=!1,be=!1,Me=!1;{var Ke={$$typeof:u,_context:Z};Object.defineProperties(Ke,{Provider:{get:function(){return be||(be=!0,ye("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),Z.Provider},set:function(Je){Z.Provider=Je}},_currentValue:{get:function(){return Z._currentValue},set:function(Je){Z._currentValue=Je}},_currentValue2:{get:function(){return Z._currentValue2},set:function(Je){Z._currentValue2=Je}},_threadCount:{get:function(){return Z._threadCount},set:function(Je){Z._threadCount=Je}},Consumer:{get:function(){return fe||(fe=!0,ye("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),Z.Consumer}},displayName:{get:function(){return Z.displayName},set:function(Je){Me||(he("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",Je),Me=!0)}}}),Z.Consumer=Ke}return Z._currentRenderer=null,Z._currentRenderer2=null,Z}var Fe=-1,We=0,wt=1,Pt=2;function Nt(B){if(B._status===Fe){var Z=B._result,fe=Z();if(fe.then(function(Ke){if(B._status===We||B._status===Fe){var Je=B;Je._status=wt,Je._result=Ke}},function(Ke){if(B._status===We||B._status===Fe){var Je=B;Je._status=Pt,Je._result=Ke}}),B._status===Fe){var be=B;be._status=We,be._result=fe}}if(B._status===wt){var Me=B._result;return Me===void 0&&ye(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Ty.set(i,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),me(me({},r),{definitions:t})}function uO(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function cO(r){var e=Dk(r);if(!Up.has(e)){var t=OP(r,{experimentalFragmentVariables:Qf,allowLegacyFragmentVariables:Qf,experimentalFragmentArguments:Qf});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Up.set(e,uO(lO(t)))}return Up.get(e)}function Ee(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),cO(n)}function fO(){Up.clear(),Ty.clear()}function dO(){Ik=!1}function hO(){Qf=!0}function pO(){Qf=!1}var af={gql:Ee,resetCaches:fO,disableFragmentWarnings:dO,enableExperimentalFragmentVariables:hO,disableExperimentalFragmentVariables:pO};(function(r){r.gql=af.gql,r.resetCaches=af.resetCaches,r.disableFragmentWarnings=af.disableFragmentWarnings,r.enableExperimentalFragmentVariables=af.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=af.disableExperimentalFragmentVariables})(Ee||(Ee={}));Ee.default=Ee;var dd=(r=>(r.Data="Data",r.Font="Font",r.Frame="Frame",r.Illustration="Illustration",r.Image="Image",r.Model="Model",r.Material="Material",r.Color="Color",r.QuestionnaireCollateral="QuestionnaireCollateral",r.RequestCollateral="RequestCollateral",r.SignupCollateral="SignupCollateral",r.Video="Video",r.ColorProfile="ColorProfile",r.Environment="Environment",r))(dd||{}),Pk=(r=>(r.AND="AND",r.OR="OR",r))(Pk||{}),Hn=(r=>(r.FileUpload="FileUpload",r.Option="Option",r.ColorOption="ColorOption",r.Text="Text",r))(Hn||{}),Xe=(r=>(r.Information="Information",r.Bulk="Bulk",r.DigitalContent="DigitalContent",r.Finish="Finish",r.Frame="Frame",r.Illustration="Illustration",r.Introduction="Introduction",r.Material="Material",r.Model="Model",r.Module="Module",r.Picture="Picture",r.Photo="Photo",r.Product="Product",r.ProductOverlay="ProductOverlay",r.Question="Question",r.Shape="Shape",r.SilentIllustration="SilentIllustration",r.Text="Text",r))(Xe||{}),Rk=(r=>(r.Color="Color",r.Colors="Colors",r.Selection="Selection",r.Selections="Selections",r.Text="Text",r.Upload="Upload",r))(Rk||{}),Ju=(r=>(r.ThreeD="ThreeD",r.FreeDesign="FreeDesign",r.Print="Print",r))(Ju||{}),er=(r=>(r.Frame="frame",r.Group="group",r.Image="image",r.Pattern="pattern",r.Illustration="illustration",r.Textbox="textbox",r))(er||{}),Ok=(r=>(r.Default="Default",r.FirstTransaction="FirstTransaction",r.OneToOne="OneToOne",r))(Ok||{}),Rg=(r=>(r.Pending="Pending",r.Failed="Failed",r.Validated="Validated",r.Overridden="Overridden",r.Skipped="Skipped",r))(Rg||{}),Bk=(r=>(r.Hyperlink="Hyperlink",r.Edit="Edit",r.Approve="Approve",r))(Bk||{}),Mk=(r=>(r.Hub="Hub",r.Shopify="Shopify",r))(Mk||{}),Og=(r=>(r.AdvancedImageManipulation="BackgroundRemover",r.ConversionAccelerator="Conversion Accelerator",r.ProcessBuilder="ProcessBuilder",r))(Og||{}),_k=(r=>(r[r.Orbit=0]="Orbit",r[r.Pan=1]="Pan",r))(_k||{}),jA=(r=>(r.Owner="Owner",r.Approver="Approver",r.Editor="Editor",r.Viewer="Viewer",r))(jA||{}),Tl=(r=>(r.Autosize="Autosize",r.Traditional="Traditional",r))(Tl||{}),gi=(r=>(r[r.North=0]="North",r[r.Northeast=1]="Northeast",r[r.East=2]="East",r[r.Southeast=3]="Southeast",r[r.South=4]="South",r[r.Southwest=5]="Southwest",r[r.West=6]="West",r[r.Northwest=7]="Northwest",r))(gi||{}),Nk=(r=>(r.Pixel="px",r.Millimeter="mm",r.Centimeter="cm",r))(Nk||{}),Yf=(r=>(r.Email="Email",r.FirstName="FirstName",r.LastName="LastName",r.Phone="Phone",r.Apartment="Apartment",r.City="City",r.Country="Country",r.OrganizationName="OrganizationName",r.PostCode="PostCode",r.State="State",r.StreetAddress="StreetAddress",r.Custom="Custom",r))(Yf||{});class Lk extends Error{constructor(e){super(e),this.name=this.constructor.name}}class Od extends Lk{constructor(e){super(`ConfigurationError - ${e}`)}}class hd extends Od{constructor(e){super(`Option not Configured: ${e.stepTitle}`),this.optionId=e?.optionId||"N/A"}}class Ai extends Od{constructor(e){super(`Panel not Found: ${e.panelId}`),this.panelId=e?.panelId||"N/A"}}class xo extends Od{constructor(e){super(`Asset not found for variant: ${e.name}`),this.variant=e}}class Ku extends Od{constructor(e){super(`Resource not found for asset: ${e.name}`),this.asset=e}}class as extends Od{constructor(e,t){super(`Workflow Misconfiguration: ${e.stepName} - ${t}`),this.step=e}}class Bg extends Lk{constructor(e){super(`ImplementationError - ${e}`)}}class nn extends Bg{constructor(e){super(`Unhandled Behavior Encountered: ${e}`)}}class yl extends Bg{constructor(e){super(`Parsing Error: ${e}`)}}class so extends Bg{constructor(e){super(`Client Error: ${e}`)}}class Mg extends Bg{constructor(e){super(`Resource Generation Failed: ${e}`)}}class gO{get(e){return localStorage.getItem(e)||void 0}set(e,t){localStorage.setItem(e,t)}remove(e){localStorage.removeItem(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}class Kw{constructor(){this.storage=new Map}get(e){return this.storage.get(e)||void 0}set(e,t){this.storage.set(e,t)}remove(e){this.storage.delete(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}const mO=()=>{try{return localStorage?new gO:new Kw}catch{return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."),new Kw}},wr=mO();function vO(r){return new Ma(function(e,t){var n=is(e,[]);return new an(function(i){var a,s=!1;return Promise.resolve(n).then(function(o){return r(o,e.getContext())}).then(e.setContext).then(function(){s||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,a&&a.unsubscribe()}})})}function Uk(r){return new Ma(function(e,t){return new an(function(n){var i,a,s;try{i=t(e).subscribe({next:function(o){if(o.errors?s=r({graphQLErrors:o.errors,response:o,operation:e,forward:t}):UA(o)&&(s=r({protocolErrors:o.extensions[Rd],response:o,operation:e,forward:t})),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(o)},error:function(o){if(s=r({operation:e,networkError:o,graphQLErrors:o&&o.result&&o.result.errors||void 0,forward:t}),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(o)},complete:function(){s||n.complete.bind(n)()}})}catch(o){r({networkError:o,operation:e,forward:t}),n.error(o)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){pa(e,r);function e(t){var n=r.call(this)||this;return n.link=Uk(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(Ma);class yO{constructor(){this.defaultServerUrl="https://moonlight.au.spiffcommerce.com",this.defaultServicesApiUrl="https://services.au.spiffcommerce.com",this.defaultHubUrl="https://hub.au.spiffcommerce.com",this.endpointVersion="2026-07",this.serverUrl=this.defaultServerUrl+`/${this.endpointVersion}`,this.servicesApiUrl=this.defaultServicesApiUrl,this.hubUrl=this.defaultHubUrl,this.serverUrlCallbacks=[]}getServerUrl(){return this.serverUrl}getServicesApiUrl(){return this.servicesApiUrl}getHubUrl(){return this.hubUrl}setServerUrl(e){e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith(".com")?this.serverUrl=e+`/${this.endpointVersion}`:e.includes("spiffcommerce.com")?(e=e.slice(0,e.lastIndexOf("/")),this.serverUrl=`${e}/${this.endpointVersion}`):this.serverUrl=e,this.serverUrlCallbacks.forEach(t=>t())}setServicesApiUrl(e){this.servicesApiUrl=e}setHubUrl(e){this.hubUrl=e}addServerUrlCallback(e){this.serverUrlCallbacks.push(e)}}const po=new yO;var Xs={},ol={},Uh={exports:{}},br={};var Zw;function AO(){if(Zw)return br;Zw=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;function f(ee){return ee===null||typeof ee!="object"?null:(ee=d&&ee[d]||ee["@@iterator"],typeof ee=="function"?ee:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(ee,re,de){this.props=ee,this.context=re,this.refs=v,this.updater=de||h}y.prototype.isReactComponent={},y.prototype.setState=function(ee,re){if(typeof ee!="object"&&typeof ee!="function"&&ee!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ee,re,"setState")},y.prototype.forceUpdate=function(ee){this.updater.enqueueForceUpdate(this,ee,"forceUpdate")};function A(){}A.prototype=y.prototype;function C(ee,re,de){this.props=ee,this.context=re,this.refs=v,this.updater=de||h}var k=C.prototype=new A;k.constructor=C,g(k,y.prototype),k.isPureReactComponent=!0;var F=Array.isArray,S=Object.prototype.hasOwnProperty,R={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function j(ee,re,de){var Be,ke={},ze=null,je=null;if(re!=null)for(Be in re.ref!==void 0&&(je=re.ref),re.key!==void 0&&(ze=""+re.key),re)S.call(re,Be)&&!M.hasOwnProperty(Be)&&(ke[Be]=re[Be]);var qe=arguments.length-2;if(qe===1)ke.children=de;else if(1<qe){for(var Ge=Array(qe),bt=0;bt<qe;bt++)Ge[bt]=arguments[bt+2];ke.children=Ge}if(ee&&ee.defaultProps)for(Be in qe=ee.defaultProps,qe)ke[Be]===void 0&&(ke[Be]=qe[Be]);return{$$typeof:r,type:ee,key:ze,ref:je,props:ke,_owner:R.current}}function G(ee,re){return{$$typeof:r,type:ee.type,key:re,ref:ee.ref,props:ee.props,_owner:ee._owner}}function ie(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===r}function q(ee){var re={"=":"=0",":":"=2"};return"$"+ee.replace(/[=:]/g,function(de){return re[de]})}var Y=/\/+/g;function J(ee,re){return typeof ee=="object"&&ee!==null&&ee.key!=null?q(""+ee.key):re.toString(36)}function se(ee,re,de,Be,ke){var ze=typeof ee;(ze==="undefined"||ze==="boolean")&&(ee=null);var je=!1;if(ee===null)je=!0;else switch(ze){case"string":case"number":je=!0;break;case"object":switch(ee.$$typeof){case r:case e:je=!0}}if(je)return je=ee,ke=ke(je),ee=Be===""?"."+J(je,0):Be,F(ke)?(de="",ee!=null&&(de=ee.replace(Y,"$&/")+"/"),se(ke,re,de,"",function(bt){return bt})):ke!=null&&(ie(ke)&&(ke=G(ke,de+(!ke.key||je&&je.key===ke.key?"":(""+ke.key).replace(Y,"$&/")+"/")+ee)),re.push(ke)),1;if(je=0,Be=Be===""?".":Be+":",F(ee))for(var qe=0;qe<ee.length;qe++){ze=ee[qe];var Ge=Be+J(ze,qe);je+=se(ze,re,de,Ge,ke)}else if(Ge=f(ee),typeof Ge=="function")for(ee=Ge.call(ee),qe=0;!(ze=ee.next()).done;)ze=ze.value,Ge=Be+J(ze,qe++),je+=se(ze,re,de,Ge,ke);else if(ze==="object")throw re=String(ee),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(ee).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.");return je}function oe(ee,re,de){if(ee==null)return ee;var Be=[],ke=0;return se(ee,Be,"","",function(ze){return re.call(de,ze,ke++)}),Be}function he(ee){if(ee._status===-1){var re=ee._result;re=re(),re.then(function(de){(ee._status===0||ee._status===-1)&&(ee._status=1,ee._result=de)},function(de){(ee._status===0||ee._status===-1)&&(ee._status=2,ee._result=de)}),ee._status===-1&&(ee._status=0,ee._result=re)}if(ee._status===1)return ee._result.default;throw ee._result}var ye={current:null},Ue={transition:null},Re={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Ue,ReactCurrentOwner:R};function Oe(){throw Error("act(...) is not supported in production builds of React.")}return br.Children={map:oe,forEach:function(ee,re,de){oe(ee,function(){re.apply(this,arguments)},de)},count:function(ee){var re=0;return oe(ee,function(){re++}),re},toArray:function(ee){return oe(ee,function(re){return re})||[]},only:function(ee){if(!ie(ee))throw Error("React.Children.only expected to receive a single React element child.");return ee}},br.Component=y,br.Fragment=t,br.Profiler=i,br.PureComponent=C,br.StrictMode=n,br.Suspense=l,br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Re,br.act=Oe,br.cloneElement=function(ee,re,de){if(ee==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ee+".");var Be=g({},ee.props),ke=ee.key,ze=ee.ref,je=ee._owner;if(re!=null){if(re.ref!==void 0&&(ze=re.ref,je=R.current),re.key!==void 0&&(ke=""+re.key),ee.type&&ee.type.defaultProps)var qe=ee.type.defaultProps;for(Ge in re)S.call(re,Ge)&&!M.hasOwnProperty(Ge)&&(Be[Ge]=re[Ge]===void 0&&qe!==void 0?qe[Ge]:re[Ge])}var Ge=arguments.length-2;if(Ge===1)Be.children=de;else if(1<Ge){qe=Array(Ge);for(var bt=0;bt<Ge;bt++)qe[bt]=arguments[bt+2];Be.children=qe}return{$$typeof:r,type:ee.type,key:ke,ref:ze,props:Be,_owner:je}},br.createContext=function(ee){return ee={$$typeof:s,_currentValue:ee,_currentValue2:ee,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ee.Provider={$$typeof:a,_context:ee},ee.Consumer=ee},br.createElement=j,br.createFactory=function(ee){var re=j.bind(null,ee);return re.type=ee,re},br.createRef=function(){return{current:null}},br.forwardRef=function(ee){return{$$typeof:o,render:ee}},br.isValidElement=ie,br.lazy=function(ee){return{$$typeof:c,_payload:{_status:-1,_result:ee},_init:he}},br.memo=function(ee,re){return{$$typeof:u,type:ee,compare:re===void 0?null:re}},br.startTransition=function(ee){var re=Ue.transition;Ue.transition={};try{ee()}finally{Ue.transition=re}},br.unstable_act=Oe,br.useCallback=function(ee,re){return ye.current.useCallback(ee,re)},br.useContext=function(ee){return ye.current.useContext(ee)},br.useDebugValue=function(){},br.useDeferredValue=function(ee){return ye.current.useDeferredValue(ee)},br.useEffect=function(ee,re){return ye.current.useEffect(ee,re)},br.useId=function(){return ye.current.useId()},br.useImperativeHandle=function(ee,re,de){return ye.current.useImperativeHandle(ee,re,de)},br.useInsertionEffect=function(ee,re){return ye.current.useInsertionEffect(ee,re)},br.useLayoutEffect=function(ee,re){return ye.current.useLayoutEffect(ee,re)},br.useMemo=function(ee,re){return ye.current.useMemo(ee,re)},br.useReducer=function(ee,re,de){return ye.current.useReducer(ee,re,de)},br.useRef=function(ee){return ye.current.useRef(ee)},br.useState=function(ee){return ye.current.useState(ee)},br.useSyncExternalStore=function(ee,re,de){return ye.current.useSyncExternalStore(ee,re,de)},br.useTransition=function(){return ye.current.useTransition()},br.version="18.3.1",br}var Bf={exports:{}};Bf.exports;var eC;function bO(){return eC||(eC=1,(function(r,e){process.env.NODE_ENV!=="production"&&(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,A="@@iterator";function C(B){if(B===null||typeof B!="object")return null;var Z=y&&B[y]||B[A];return typeof Z=="function"?Z:null}var k={current:null},F={transition:null},S={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},M={},j=null;function G(B){j=B}M.setExtraStackFrame=function(B){j=B},M.getCurrentStack=null,M.getStackAddendum=function(){var B="";j&&(B+=j);var Z=M.getCurrentStack;return Z&&(B+=Z()||""),B};var ie=!1,q=!1,Y=!1,J=!1,se=!1,oe={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:F,ReactCurrentOwner:R};oe.ReactDebugCurrentFrame=M,oe.ReactCurrentActQueue=S;function he(B){{for(var Z=arguments.length,fe=new Array(Z>1?Z-1:0),be=1;be<Z;be++)fe[be-1]=arguments[be];Ue("warn",B,fe)}}function ye(B){{for(var Z=arguments.length,fe=new Array(Z>1?Z-1:0),be=1;be<Z;be++)fe[be-1]=arguments[be];Ue("error",B,fe)}}function Ue(B,Z,fe){{var be=oe.ReactDebugCurrentFrame,Me=be.getStackAddendum();Me!==""&&(Z+="%s",fe=fe.concat([Me]));var Ke=fe.map(function(Je){return String(Je)});Ke.unshift("Warning: "+Z),Function.prototype.apply.call(console[B],console,Ke)}}var Re={};function Oe(B,Z){{var fe=B.constructor,be=fe&&(fe.displayName||fe.name)||"ReactClass",Me=be+"."+Z;if(Re[Me])return;ye("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Z,be),Re[Me]=!0}}var ee={isMounted:function(B){return!1},enqueueForceUpdate:function(B,Z,fe){Oe(B,"forceUpdate")},enqueueReplaceState:function(B,Z,fe,be){Oe(B,"replaceState")},enqueueSetState:function(B,Z,fe,be){Oe(B,"setState")}},re=Object.assign,de={};Object.freeze(de);function Be(B,Z,fe){this.props=B,this.context=Z,this.refs=de,this.updater=fe||ee}Be.prototype.isReactComponent={},Be.prototype.setState=function(B,Z){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,Z,"setState")},Be.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};{var ke={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},ze=function(B,Z){Object.defineProperty(Be.prototype,B,{get:function(){he("%s(...) is deprecated in plain JavaScript React classes. %s",Z[0],Z[1])}})};for(var je in ke)ke.hasOwnProperty(je)&&ze(je,ke[je])}function qe(){}qe.prototype=Be.prototype;function Ge(B,Z,fe){this.props=B,this.context=Z,this.refs=de,this.updater=fe||ee}var bt=Ge.prototype=new qe;bt.constructor=Ge,re(bt,Be.prototype),bt.isPureReactComponent=!0;function rr(){var B={current:null};return Object.seal(B),B}var Pr=Array.isArray;function Gt(B){return Pr(B)}function ar(B){{var Z=typeof Symbol=="function"&&Symbol.toStringTag,fe=Z&&B[Symbol.toStringTag]||B.constructor.name||"Object";return fe}}function St(B){try{return st(B),!1}catch{return!0}}function st(B){return""+B}function Qr(B){if(St(B))return ye("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(B)),st(B)}function Sr(B,Z,fe){var be=B.displayName;if(be)return be;var Me=Z.displayName||Z.name||"";return Me!==""?fe+"("+Me+")":fe}function gr(B){return B.displayName||"Context"}function nr(B){if(B==null)return null;if(typeof B.tag=="number"&&ye("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof B=="function")return B.displayName||B.name||null;if(typeof B=="string")return B;switch(B){case a:return"Fragment";case i:return"Portal";case o:return"Profiler";case s:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof B=="object")switch(B.$$typeof){case u:var Z=B;return gr(Z)+".Consumer";case l:var fe=B;return gr(fe._context)+".Provider";case c:return Sr(B,B.render,"ForwardRef");case h:var be=B.displayName||null;return be!==null?be:nr(B.type)||"Memo";case g:{var Me=B,Ke=Me._payload,Je=Me._init;try{return nr(Je(Ke))}catch{return null}}}return null}var fr=Object.prototype.hasOwnProperty,Yt={key:!0,ref:!0,__self:!0,__source:!0},Xt,mt,Cr;Cr={};function sn(B){if(fr.call(B,"ref")){var Z=Object.getOwnPropertyDescriptor(B,"ref").get;if(Z&&Z.isReactWarning)return!1}return B.ref!==void 0}function _r(B){if(fr.call(B,"key")){var Z=Object.getOwnPropertyDescriptor(B,"key").get;if(Z&&Z.isReactWarning)return!1}return B.key!==void 0}function ir(B,Z){var fe=function(){Xt||(Xt=!0,ye("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};fe.isReactWarning=!0,Object.defineProperty(B,"key",{get:fe,configurable:!0})}function Yr(B,Z){var fe=function(){mt||(mt=!0,ye("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};fe.isReactWarning=!0,Object.defineProperty(B,"ref",{get:fe,configurable:!0})}function kr(B){if(typeof B.ref=="string"&&R.current&&B.__self&&R.current.stateNode!==B.__self){var Z=nr(R.current.type);Cr[Z]||(ye('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Z,B.ref),Cr[Z]=!0)}}var Zr=function(B,Z,fe,be,Me,Ke,Je){var yt={$$typeof:n,type:B,key:Z,ref:fe,props:Je,_owner:Ke};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Vr(B,Z,fe){var be,Me={},Ke=null,Je=null,yt=null,Ot=null;if(Z!=null){sn(Z)&&(Je=Z.ref,kr(Z)),_r(Z)&&(Qr(Z.key),Ke=""+Z.key),yt=Z.__self===void 0?null:Z.__self,Ot=Z.__source===void 0?null:Z.__source;for(be in Z)fr.call(Z,be)&&!Yt.hasOwnProperty(be)&&(Me[be]=Z[be])}var pr=arguments.length-2;if(pr===1)Me.children=fe;else if(pr>1){for(var yr=Array(pr),ur=0;ur<pr;ur++)yr[ur]=arguments[ur+2];Object.freeze&&Object.freeze(yr),Me.children=yr}if(B&&B.defaultProps){var Fr=B.defaultProps;for(be in Fr)Me[be]===void 0&&(Me[be]=Fr[be])}if(Ke||Je){var Gr=typeof B=="function"?B.displayName||B.name||"Unknown":B;Ke&&ir(Me,Gr),Je&&Yr(Me,Gr)}return Zr(B,Ke,Je,yt,Ot,R.current,Me)}function pn(B,Z){var fe=Zr(B.type,Z,B.ref,B._self,B._source,B._owner,B.props);return fe}function gn(B,Z,fe){if(B==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var be,Me=re({},B.props),Ke=B.key,Je=B.ref,yt=B._self,Ot=B._source,pr=B._owner;if(Z!=null){sn(Z)&&(Je=Z.ref,pr=R.current),_r(Z)&&(Qr(Z.key),Ke=""+Z.key);var yr;B.type&&B.type.defaultProps&&(yr=B.type.defaultProps);for(be in Z)fr.call(Z,be)&&!Yt.hasOwnProperty(be)&&(Z[be]===void 0&&yr!==void 0?Me[be]=yr[be]:Me[be]=Z[be])}var ur=arguments.length-2;if(ur===1)Me.children=fe;else if(ur>1){for(var Fr=Array(ur),Gr=0;Gr<ur;Gr++)Fr[Gr]=arguments[Gr+2];Me.children=Fr}return Zr(B.type,Ke,Je,yt,Ot,pr,Me)}function Tr(B){return typeof B=="object"&&B!==null&&B.$$typeof===n}var zr=".",en=":";function $r(B){var Z=/[=:]/g,fe={"=":"=0",":":"=2"},be=B.replace(Z,function(Me){return fe[Me]});return"$"+be}var zt=!1,sr=/\/+/g;function Er(B){return B.replace(sr,"$&/")}function tt(B,Z){return typeof B=="object"&&B!==null&&B.key!=null?(Qr(B.key),$r(""+B.key)):Z.toString(36)}function Nr(B,Z,fe,be,Me){var Ke=typeof B;(Ke==="undefined"||Ke==="boolean")&&(B=null);var Je=!1;if(B===null)Je=!0;else switch(Ke){case"string":case"number":Je=!0;break;case"object":switch(B.$$typeof){case n:case i:Je=!0}}if(Je){var yt=B,Ot=Me(yt),pr=be===""?zr+tt(yt,0):be;if(Gt(Ot)){var yr="";pr!=null&&(yr=Er(pr)+"/"),Nr(Ot,Z,yr,"",function(Va){return Va})}else Ot!=null&&(Tr(Ot)&&(Ot.key&&(!yt||yt.key!==Ot.key)&&Qr(Ot.key),Ot=pn(Ot,fe+(Ot.key&&(!yt||yt.key!==Ot.key)?Er(""+Ot.key)+"/":"")+pr)),Z.push(Ot));return 1}var ur,Fr,Gr=0,yn=be===""?zr:be+en;if(Gt(B))for(var Wi=0;Wi<B.length;Wi++)ur=B[Wi],Fr=yn+tt(ur,Wi),Gr+=Nr(ur,Z,fe,Fr,Me);else{var sa=C(B);if(typeof sa=="function"){var Qi=B;sa===Qi.entries&&(zt||he("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),zt=!0);for(var Wn=sa.call(Qi),Yi,hi=0;!(Yi=Wn.next()).done;)ur=Yi.value,Fr=yn+tt(ur,hi++),Gr+=Nr(ur,Z,fe,Fr,Me)}else if(Ke==="object"){var Ua=String(B);throw new Error("Objects are not valid as a React child (found: "+(Ua==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Ua)+"). If you meant to render a collection of children, use an array instead.")}}return Gr}function Xr(B,Z,fe){if(B==null)return B;var be=[],Me=0;return Nr(B,be,"","",function(Ke){return Z.call(fe,Ke,Me++)}),be}function Se(B){var Z=0;return Xr(B,function(){Z++}),Z}function P(B,Z,fe){Xr(B,function(){Z.apply(this,arguments)},fe)}function U(B){return Xr(B,function(Z){return Z})||[]}function X(B){if(!Tr(B))throw new Error("React.Children.only expected to receive a single React element child.");return B}function ue(B){var Z={$$typeof:u,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};Z.Provider={$$typeof:l,_context:Z};var fe=!1,be=!1,Me=!1;{var Ke={$$typeof:u,_context:Z};Object.defineProperties(Ke,{Provider:{get:function(){return be||(be=!0,ye("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),Z.Provider},set:function(Je){Z.Provider=Je}},_currentValue:{get:function(){return Z._currentValue},set:function(Je){Z._currentValue=Je}},_currentValue2:{get:function(){return Z._currentValue2},set:function(Je){Z._currentValue2=Je}},_threadCount:{get:function(){return Z._threadCount},set:function(Je){Z._threadCount=Je}},Consumer:{get:function(){return fe||(fe=!0,ye("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),Z.Consumer}},displayName:{get:function(){return Z.displayName},set:function(Je){Me||(he("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",Je),Me=!0)}}}),Z.Consumer=Ke}return Z._currentRenderer=null,Z._currentRenderer2=null,Z}var Fe=-1,We=0,wt=1,Pt=2;function Nt(B){if(B._status===Fe){var Z=B._result,fe=Z();if(fe.then(function(Ke){if(B._status===We||B._status===Fe){var Je=B;Je._status=wt,Je._result=Ke}},function(Ke){if(B._status===We||B._status===Fe){var Je=B;Je._status=Pt,Je._result=Ke}}),B._status===Fe){var be=B;be._status=We,be._result=fe}}if(B._status===wt){var Me=B._result;return Me===void 0&&ye(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
64
64
|
|
|
65
65
|
Your code should look like:
|
|
66
66
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -2874,7 +2874,7 @@ Minimum version required to store current data is: `+q+`.
|
|
|
2874
2874
|
`;class hV{constructor(e,t=He.getShadowGraphqlClient.bind(He)){this.options=e,this.client=t}query(e){const t=this.options?.onQuery?this.options?.onQuery(e):{};return this.client().query({...t,...e,context:{...t.context??{},...e.context??{}}})}mutate(e){const t=this.options?.onMutate?this.options?.onMutate(e):{};return this.client().mutate({...t,...e,context:{...t.context??{},...e.context??{}}})}}function pV(r,e,t){return r.$source||(r.$source={}),r.$source[e]=t,r}const gV=r=>r?.body instanceof ReadableStream,fl=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const n of e)t.push(n);return t},eo=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Ag=()=>{let r=[],e=[],t=!1;const n=new Set,i=d=>d.sort((f,h)=>IE[h.step]-IE[f.step]||DE[h.priority||"normal"]-DE[f.priority||"normal"]),a=d=>{let f=!1;const h=g=>{const v=fl(g.name,g.aliases);if(v.includes(d)){f=!0;for(const y of v)n.delete(y);return!1}return!0};return r=r.filter(h),e=e.filter(h),f},s=d=>{let f=!1;const h=g=>{if(g.middleware===d){f=!0;for(const v of fl(g.name,g.aliases))n.delete(v);return!1}return!0};return r=r.filter(h),e=e.filter(h),f},o=d=>(r.forEach(f=>{d.add(f.middleware,{...f})}),e.forEach(f=>{d.addRelativeTo(f.middleware,{...f})}),d.identifyOnResolve?.(c.identifyOnResolve()),d),l=d=>{const f=[];return d.before.forEach(h=>{h.before.length===0&&h.after.length===0?f.push(h):f.push(...l(h))}),f.push(d),d.after.reverse().forEach(h=>{h.before.length===0&&h.after.length===0?f.push(h):f.push(...l(h))}),f},u=(d=!1)=>{const f=[],h=[],g={};return r.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;f.push(A)}),e.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;h.push(A)}),h.forEach(y=>{if(y.toMiddleware){const A=g[y.toMiddleware];if(A===void 0){if(d)return;throw new Error(`${y.toMiddleware} is not found when adding ${eo(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&A.after.push(y),y.relation==="before"&&A.before.push(y)}}),i(f).map(l).reduce((y,A)=>(y.push(...A),y),[])},c={add:(d,f={})=>{const{name:h,override:g,aliases:v}=f,y={step:"initialize",priority:"normal",middleware:d,...f},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${eo(h,v)}'`);for(const C of A){const k=r.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const F=r[k];if(F.step!==y.step||y.priority!==F.priority)throw new Error(`"${eo(F.name,F.aliases)}" middleware with ${F.priority} priority in ${F.step} step cannot be overridden by "${eo(h,v)}" middleware with ${y.priority} priority in ${y.step} step.`);r.splice(k,1)}}for(const C of A)n.add(C)}r.push(y)},addRelativeTo:(d,f)=>{const{name:h,override:g,aliases:v}=f,y={middleware:d,...f},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${eo(h,v)}'`);for(const C of A){const k=e.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const F=e[k];if(F.toMiddleware!==y.toMiddleware||F.relation!==y.relation)throw new Error(`"${eo(F.name,F.aliases)}" middleware ${F.relation} "${F.toMiddleware}" middleware cannot be overridden by "${eo(h,v)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);e.splice(k,1)}}for(const C of A)n.add(C)}e.push(y)},clone:()=>o(Ag()),use:d=>{d.applyToStack(c)},remove:d=>typeof d=="string"?a(d):s(d),removeByTag:d=>{let f=!1;const h=g=>{const{tags:v,name:y,aliases:A}=g;if(v&&v.includes(d)){const C=fl(y,A);for(const k of C)n.delete(k);return f=!0,!1}return!0};return r=r.filter(h),e=e.filter(h),f},concat:d=>{const f=o(Ag());return f.use(d),f.identifyOnResolve(t||f.identifyOnResolve()||(d.identifyOnResolve?.()??!1)),f},applyToStack:o,identify:()=>u(!0).map(d=>{const f=d.step??d.relation+" "+d.toMiddleware;return eo(d.name,d.aliases)+" - "+f}),identifyOnResolve(d){return typeof d=="boolean"&&(t=d),t},resolve:(d,f)=>{for(const h of u().map(g=>g.middleware).reverse())d=h(d,f);return t&&console.log(c.identify()),d}};return c},IE={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},DE={high:3,normal:2,low:1};var xd;(function(r){r.HTTP="http",r.HTTPS="https"})(xd||(xd={}));var Sd;(function(r){r.MD5="md5",r.CRC32="crc32",r.CRC32C="crc32c",r.SHA1="sha1",r.SHA256="sha256"})(Sd||(Sd={}));const gA="__smithy_context",mc=r=>r[gA]||(r[gA]={});class na{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new na({...e,headers:{...e.headers}});return t.query&&(t.query=mV(t.query)),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query=="object"&&typeof t.headers=="object"}clone(){return na.clone(this)}}function mV(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return{...e,[t]:Array.isArray(n)?[...n]:n}},{})}class ac{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}}const vV=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Kg=(r,e=!1)=>{if(!e)return vV.test(r);const t=r.split(".");for(const n of t)if(!Kg(n))return!1;return!0},Os=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};function yV(r){const e={};if(r=r.replace(/^\?/,""),r)for(const t of r.split("&")){let[n,i=null]=t.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const bg=r=>{if(typeof r=="string")return bg(new URL(r));const{hostname:e,pathname:t,port:n,protocol:i,search:a}=r;let s;return a&&(s=yV(a)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:t,query:s}},N1=r=>{if(typeof r=="object"){if("url"in r){const e=bg(r.url);if(r.headers){e.headers={};for(const t in r.headers)e.headers[t.toLowerCase()]=r.headers[t].join(", ")}return e}return r}return bg(r)},AV=r=>()=>Promise.reject(r);class bV{config;middlewareStack=Ag();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&typeof t=="function"&&(e.protocol=new t(n))}send(e,t,n){const i=typeof t!="function"?t:void 0,a=typeof t=="function"?t:n,s=i===void 0&&this.config.cacheMiddleware===!0;let o;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(e.constructor)?o=l.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,i),l.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(a)o(e).then(l=>a(null,l.output),l=>a(l)).catch(()=>{});else return o(e).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const Qp=r=>typeof r=="function"?r():r,DI=(r,e,t,n,i)=>({name:e,namespace:r,traits:t,input:n,output:i}),wV=r=>(e,t)=>async n=>{const{response:i}=await e(n),{operationSchema:a}=mc(t),[,s,o,l,u,c]=a??[];try{const d=await r.protocol.deserializeResponse(DI(s,o,l,u,c),{...r,...t},i);return{response:i,output:d}}catch(d){if(Object.defineProperty(d,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in d)){const f="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{d.message+=`
|
|
2875
2875
|
`+f}catch{!t.logger||t.logger?.constructor?.name==="NoOpLogger"?console.warn(f):t.logger?.warn?.(f)}typeof d.$responseBodyText<"u"&&d.$response&&(d.$response.body=d.$responseBodyText);try{if(ac.isInstance(i)){const{headers:h={},statusCode:g}=i,v=Object.entries(h);d.$metadata={httpStatusCode:g,requestId:Bv(/^x-[\w-]+-request-?id$/,v),extendedRequestId:Bv(/^x-[\w-]+-id-2$/,v),cfId:Bv(/^x-[\w-]+-cf-id$/,v)}}}catch{}}throw d}},Bv=(r,e)=>(e.find(([t])=>t.match(r))||[void 0,void 0])[1],CV=r=>(e,t)=>async n=>{const{operationSchema:i}=mc(t),[,a,s,o,l,u]=i??[],c=t.endpointV2?async()=>N1(t.endpointV2):r.endpoint,d=await r.protocol.serializeRequest(DI(a,s,o,l,u),n.input,{...r,...t,endpoint:c});return e({...n,request:d})},xV={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},SV={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function EV(r){return{applyToStack:e=>{e.add(CV(r),SV),e.add(wV(r),xV),r.protocol.setSerdeContext(r)}}}const Mv=[];function $f(r){if(typeof r=="object")return r;if(r=r|0,Mv[r])return Mv[r];const e={};let t=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(r>>t++&1)===1&&(e[n]=1);return Mv[r]=e}const kf={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},_v=[],Nv={};class vi{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=vi.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let i=e,a=e;for(this._isMemberSchema=!1;Lv(i);)n.push(i[1]),i=i[0],a=Qp(i),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let s=n.length-1;s>=0;--s){const o=n[s];Object.assign(this.memberTraits,$f(o))}}else this.memberTraits=0;if(a instanceof vi){const s=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},s,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??a.memberName;return}if(this.schema=Qp(a),kV(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);return!t&&typeof e=="object"&&e!==null?e.symbol===this.symbol:t}static of(e){const t=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(_v[e])return _v[e]}else if(typeof e=="string"){if(Nv[e])return Nv[e]}else if(t&&e[kf.ns])return e[kf.ns];const n=Qp(e);if(n instanceof vi)return n;if(Lv(n)){const[a,s]=n;if(a instanceof vi)return Object.assign(a.getMergedTraits(),$f(s)),a;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const i=new vi(n);return t?e[kf.ns]=i:typeof n=="string"?Nv[n]=i:typeof n=="number"?_v[n]=i:i}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const e=this.getSchema();if(typeof e!="object")return!1;const t=e[0];return t===3||t===-3||t===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return $f(this.memberTraits)}getOwnTraits(){return $f(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),i=e?15:n[4]??0;return Tf([i,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],a=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||i)?e[3+e[0]]:t?15:void 0;if(a!=null)return Tf([a,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),i=t[5][n];return Tf(Lv(i)?i:[i,0],e)}if(this.isDocumentSchema())return Tf([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),t=e[4].length;let n=e[kf.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let i=0;i<t;++i){const a=e[4][i],s=Tf([e[5][i],0],a);yield n[i]=[a,s]}e[kf.it]=n}}function Tf(r,e){if(r instanceof vi)return Object.assign(r,{memberName:e,_isMemberSchema:!0});const t=vi;return new t(r,e)}const Lv=r=>Array.isArray(r)&&r.length===2,kV=r=>Array.isArray(r)&&r.length>=5;class Zi{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return Zi.registries.has(e)||Zi.registries.set(e,new Zi(e)),Zi.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[i,a]of e.schemas)t.has(i)||t.set(i,a);for(const[i,a]of e.exceptions)n.has(i)||n.set(i,a)}register(e,t){const n=this.normalizeShapeId(e);for(const i of[this,Zi.for(n.split("#")[0])])i.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t)){if(!e.includes("#")){const n="#"+e,i=[];for(const[a,s]of this.schemas.entries())a.endsWith(n)&&i.push(s);if(i.length===1)return i[0]}throw new Error(`@smithy/core/schema - schema not found for ${t}`)}return this.schemas.get(t)}registerError(e,t){const n=e,i=n[1];for(const a of[this,Zi.for(i)])a.schemas.set(i+"#"+n[2],n),a.exceptions.set(n,t)}getErrorCtor(e){const t=e;return this.exceptions.has(t)?this.exceptions.get(t):Zi.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,i=t+"#"+n;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return e}}find(e){for(const t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const Uv="***SensitiveInformation***";function mA(r,e){if(e==null)return e;const t=vi.of(r);if(t.getMergedTraits().sensitive)return Uv;if(t.isListSchema()){if(!!t.getValueSchema().getMergedTraits().sensitive)return Uv}else if(t.isMapSchema()){if(!!t.getKeySchema().getMergedTraits().sensitive||!!t.getValueSchema().getMergedTraits().sensitive)return Uv}else if(t.isStructSchema()&&typeof e=="object"){const n=e,i={};for(const[a,s]of t.structIterator())n[a]!=null&&(i[a]=mA(s,n[a]));return i}return e}class L1{middlewareStack=Ag();schema;static classBuilder(){return new TV}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:d}){for(const A of i.bind(this)(d,e,t,n))this.middlewareStack.use(A);const f=e.concat(this.middlewareStack),{logger:h}=t,g={logger:h,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[gA]:{commandInstance:this,...u},...c},{requestHandler:v}=t;let y=n??{};return u.eventStream&&(y={isEventStream:!0,...y}),f.resolve(A=>v.handle(A.request,y),g)}}class TV{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=n=>n,t=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends L1{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.input=n??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,i,a){const s=e._operationSchema,o=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,a,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(s?mA.bind(null,o):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(s?mA.bind(null,l):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class _u extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return _u.prototype.isPrototypeOf(t)||!!t.$fault&&!!t.$metadata&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===_u?_u.isInstance(e):_u.isInstance(e)?t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e):!1}}const PE=(r,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(r[n]==null||r[n]==="")&&(r[n]=i)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},FV=r=>{switch(r){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},PI=Object.values(Sd),IV=r=>{const e=[];for(const t in Sd){const n=Sd[t];r[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>r[n]})}for(const[t,n]of Object.entries(r.checksumAlgorithms??{}))e.push({algorithmId:()=>t,checksumConstructor:()=>n});return{addChecksumAlgorithm(t){r.checksumAlgorithms=r.checksumAlgorithms??{};const n=t.algorithmId(),i=t.checksumConstructor();PI.includes(n)?r.checksumAlgorithms[n.toUpperCase()]=i:r.checksumAlgorithms[n]=i,e.push(t)},checksumAlgorithms(){return e}}},DV=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{const n=t.algorithmId();PI.includes(n)&&(e[n]=t.checksumConstructor())}),e},PV=r=>({setRetryStrategy(e){r.retryStrategy=e},retryStrategy(){return r.retryStrategy}}),RV=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},OV=r=>Object.assign(IV(r),PV(r)),BV=r=>Object.assign(DV(r),RV(r));class RI{trace(){}debug(){}info(){}warn(){}error(){}}const OI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RE=Object.entries(OI).reduce((r,[e,t])=>(r[t]=Number(e),r),{}),MV=OI.split(""),ju=6,ed=8,_V=63,Zg=r=>{let e=r.length/4*3;r.slice(-2)==="=="?e-=2:r.slice(-1)==="="&&e--;const t=new ArrayBuffer(e),n=new DataView(t);for(let i=0;i<r.length;i+=4){let a=0,s=0;for(let u=i,c=i+3;u<=c;u++)if(r[u]!=="="){if(!(r[u]in RE))throw new TypeError(`Invalid character ${r[u]} in base64 string.`);a|=RE[r[u]]<<(c-u)*ju,s+=ju}else a>>=ju;const o=i/4*3;a>>=s%ed;const l=Math.floor(s/ed);for(let u=0;u<l;u++){const c=(l-u-1)*ed;n.setUint8(o+u,(a&255<<c)>>c)}}return new Uint8Array(t)},El=r=>new TextEncoder().encode(r);function wg(r){let e;typeof r=="string"?e=El(r):e=r;const t=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!t&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let a=0;a<e.length;a+=3){let s=0,o=0;for(let u=a,c=Math.min(a+3,e.length);u<c;u++)s|=e[u]<<(c-u-1)*ed,o+=ed;const l=Math.ceil(o/ju);s<<=l*ju-o;for(let u=1;u<=l;u++){const c=(l-u)*ju;i+=MV[(s&_V<<c)>>c]}i+="==".slice(0,4-l)}return i}function NV(r,e,t,n){return class Yp extends Uint8Array{static fromString(a,s="utf-8"){if(typeof a=="string")return s==="base64"?Yp.mutate(n(a)):Yp.mutate(e(a));throw new Error(`Unsupported conversion from ${typeof a} to Uint8ArrayBlobAdapter.`)}static mutate(a){return Object.setPrototypeOf(a,Yp.prototype),a}transformToString(a="utf-8"){return a==="base64"?t(this):r(this)}}}const em=r=>{if(typeof r=="string")return r;if(typeof r!="object"||typeof r.byteOffset!="number"||typeof r.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(r)},Ii=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function LV(r){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{const e=new Uint8Array(16);return r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Ii[e[0]]+Ii[e[1]]+Ii[e[2]]+Ii[e[3]]+"-"+Ii[e[4]]+Ii[e[5]]+"-"+Ii[e[6]]+Ii[e[7]]+"-"+Ii[e[8]]+Ii[e[9]]+"-"+Ii[e[10]]+Ii[e[11]]+Ii[e[12]]+Ii[e[13]]+Ii[e[14]]+Ii[e[15]]}}const vA=r=>{if(r!=null){if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return String(e)!==String(r)&&WV.warn(qV(`Expected number but observed string: ${r}`)),e}if(typeof r=="number")return r;throw new TypeError(`Expected number, got ${typeof r}: ${r}`)}},UV=Math.ceil(2**127*(2-2**-23)),OE=r=>{const e=vA(r);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>UV)throw new TypeError(`Expected 32-bit float, got ${r}`);return e},VV=r=>{if(r!=null){if(Number.isInteger(r)&&!Number.isNaN(r))return r;throw new TypeError(`Expected integer, got ${typeof r}: ${r}`)}},BE=r=>BI(r,16),ME=r=>BI(r,8),BI=(r,e)=>{const t=VV(r);if(t!==void 0&&zV(t,e)!==t)throw new TypeError(`Expected ${e}-bit integer, got ${r}`);return t},zV=(r,e)=>{switch(e){case 32:return Int32Array.of(r)[0];case 16:return Int16Array.of(r)[0];case 8:return Int8Array.of(r)[0]}},$V=r=>vA(typeof r=="string"?tm(r):r),HV=r=>OE(typeof r=="string"?tm(r):r),jV=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,tm=r=>{const e=r.match(jV);if(e===null||e[0].length!==r.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(r)},Cg=r=>BE(typeof r=="string"?tm(r):r),GV=r=>ME(typeof r=="string"?tm(r):r),qV=r=>String(new TypeError(r).stack||r).split(`
|
|
2876
2876
|
`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
|
|
2877
|
-
`),WV={warn:console.warn},QV=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],U1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function YV(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,d=o<10?`0${o}`:`${o}`;return`${QV[n]}, ${l} ${U1[t]} ${e} ${u}:${c}:${d} GMT`}const XV=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),JV=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=XV.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,d=Cg(Ed(n)),f=vo(i,"month",1,12),h=vo(a,"day",1,31),g=Xp(d,f,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-uz(c)),g},KV=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ZV=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ez=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),MI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=KV.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Xp(Cg(Ed(a)),Vv(i),vo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=ZV.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return iz(Xp(rz(a),Vv(i),vo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=ez.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Xp(Cg(Ed(u)),Vv(n),vo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},tz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=$V(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Xp=(r,e,t,n)=>{const i=e-1;return sz(r,i,t),new Date(Date.UTC(r,i,t,vo(n.hours,"hour",0,23),vo(n.minutes,"minute",0,59),vo(n.seconds,"seconds",0,60),lz(n.fractionalMilliseconds)))},rz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+Cg(Ed(r));return t<e?t+100:t},nz=50*365*24*60*60*1e3,iz=r=>r.getTime()-new Date().getTime()>nz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,Vv=r=>{const e=U1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},az=[31,28,31,30,31,30,31,31,30,31,30,31],sz=(r,e,t)=>{let n=az[e];if(e===1&&oz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${U1[e]} in ${r}: ${t}`)},oz=r=>r%4===0&&(r%100!==0||r%400===0),vo=(r,e,t,n)=>{const i=GV(Ed(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},lz=r=>r==null?0:HV("0."+r)*1e3,uz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ed=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},fo=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};fo.from=r=>r&&typeof r=="object"&&(r instanceof fo||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?fo(String(r)):fo(JSON.stringify(r));fo.fromObject=fo.from;const _E=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!_E.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&_E.test(t.string)}}const _I={},yA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),_I[r]=e,yA[e]=r}function NI(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in yA)e[t/2]=yA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function yo(r){let e="";for(let t=0;t<r.byteLength;t++)e+=_I[r[t]];return e}const NE=typeof TextEncoder=="function"?new TextEncoder:null,cz=r=>{if(typeof r=="string"){if(NE)return NE.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kd=r=>typeof r=="string"?El(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),fz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",LI=async r=>{},dz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),vz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!mz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},hz=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,pz=/(\d+\.){3}\d+/,gz=/\.\./,mz=r=>hz.test(r)&&!pz.test(r)&&!gz.test(r),vz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},yz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Az(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(N1(o)),n.isCustomEndpoint=!0)}const a=await bz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const bz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await yz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await dz(n),n};function wz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Cz(r){const e=Az(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&wz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=mc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const xz={name:"serializerMiddleware"},Sz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:xz.name};function Ez(r){const e=Cz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),Sz)}})}function kz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>N1(await Os(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Os(i??!1),useFipsEndpoint:Os(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class V1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new V1(e,t,n,i)}}class Tz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Fz="endpoints";function xg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${xg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(xg).join(", ")})`:JSON.stringify(r,null,2)}const z1={},Iz=(r,e)=>r===e;function Dz(...r){for(const e of r)if(e!=null)return e}const Pz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},UI=(r,e)=>Pz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Rz=r=>r!=null;function Oz(r,e,t){return r?e:t}const Bz=r=>!r,Mz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),VI=r=>Mz.test(r)||r.startsWith("[")&&r.endsWith("]"),zv={[xd.HTTP]:80,[xd.HTTPS]:443},_z=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:f,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${f}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,k])=>`${C}=${k}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xd).includes(l))return null;const u=VI(i),c=t.includes(`${n}:${zv[l]}`)||typeof r=="string"&&r.includes(`${n}:${zv[l]}`),d=`${n}${c?`:${zv[l]}`:""}`;return{scheme:l,authority:d,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Nz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const Lz=(r,e)=>r===e,Uz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Vz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),zz={booleanEquals:Iz,coalesce:Dz,getAttr:UI,isSet:Rz,isValidHostLabel:Kg,ite:Oz,not:Bz,parseURL:_z,split:Nz,stringEquals:Lz,substring:Uz,uriEncode:Vz},zI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(UI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},$z=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return zI(r,t);if(r.fn)return HI.callFunction(r,t);if(r.ref)return $z(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},$I=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=HI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=z1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=zz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},HI={evaluateExpression:rm,callFunction:$I},Hz=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=$I(r,e);e.logger?.debug?.(`${Fz} evaluateCondition: ${xg(r)} = ${xg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},jz=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),jI=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=qI.getEndpointProperty(i,e),t),{}),GI=(r,e)=>{if(Array.isArray(r))return r.map(t=>GI(t,e));switch(typeof r){case"string":return zI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return qI.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},qI={getEndpointProperty:GI,getEndpointProperties:jI},Gz=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},$v=1e8,qz=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<$v;){const u=3*(Math.abs(s)-1),[c,d,f]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=Hz({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?d:f}if(s>=$v){const u=i[s-$v];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,d,f]=u;return{url:Gz(c,l),properties:jI(d,l),headers:jz(f??{},l)}}throw new Ba("No matching endpoint.")},Wz=kz(LI),WI=Ez(LI);class Hv extends NV(em,El,wg,Zg){}const Qz=r=>crypto.getRandomValues(r),QI=LV(Qz),Yz=QI,AA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Hv.mutate(r);if(!r)return Hv.mutate(new Uint8Array);const t=e.streamCollector(r);return Hv.mutate(await t)};class Xz{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Jz extends Xz{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return ac}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=$f(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-DYaFZhaU.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Kz extends Jz{async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const d=t&&typeof t=="object"?t:{},f=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(f,o),this.setHostPrefix(f,e,d)),d){const h=l.getEventStreamMember();if(h){if(d[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&d[v]&&(i.write(y,d[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:d[h],requestSchema:l,initialRequest:g})}}else i.write(u,d),c=i.flush()}return f.headers=Object.assign(f.headers,s),f.query=a,f.body=c,f.method="POST",f}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await AA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await AA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function YI(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const Zz=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),e$=r=>({httpHandler:r.httpHandler()}),LE="content-length";function t$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(LE)===-1)try{const s=r(i);n.headers={...n.headers,[LE]:String(s)}}catch{}}return e({...t,request:n})}}const r$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},n$=r=>({applyToStack:e=>{e.add(t$(r.bodyLengthChecker),r$)}}),wl=r=>encodeURIComponent(r).replace(/[!'()*]/g,i$),i$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function a$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=wl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${wl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${wl(n)}`),e.push(i)}}return e.join("&")}const s$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],o$=["TimeoutError","RequestTimeout","RequestTimeoutException"],l$=[500,502,503,504],u$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],c$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],f$=r=>r?.$retryable!==void 0,d$=r=>r.$metadata?.clockSkewCorrected,h$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},XI=r=>r.$metadata?.httpStatusCode===429||s$.includes(r.name)||r.$retryable?.throttling==!0,$1=(r,e=0)=>f$(r)||d$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||o$.includes(r.name)||u$.includes(r?.code||"")||c$.includes(r?.code||"")||l$.includes(r.$metadata?.httpStatusCode||0)||h$(r)||g$(r)||r.cause!==void 0&&e<=10&&$1(r.cause,e+1),p$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!$1(r)}return!1};function g$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const JI=20*1e3,UE=500,m$=1,v$="amz-sdk-invocation-id",y$="amz-sdk-request";function A$(r,e){if(ac.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(MI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const b$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function w$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(x$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:d}=i,f=na.isInstance(d);for(f&&(d.headers[v$]=QI());;)try{f&&(d.headers[y$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=S$(h,e.logger);if(l=b$(h),f&&r(d))throw(n.logger instanceof RI?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await C$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const C$=r=>new Promise(e=>setTimeout(e,r)),x$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",S$=(r,e)=>{const t={error:r,errorType:E$(r)},n=A$(r.$response,e);return n&&(t.retryAfterHint=n),t},E$=r=>XI(r)?"THROTTLING":$1(r)?"TRANSIENT":p$(r)?"SERVER_ERROR":"CLIENT_ERROR",k$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function T$(r){const e=w$(r);return t=>({applyToStack:n=>{n.add(e(t),k$)}})}class H1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||XI(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>H1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class F${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,JI);return Math.floor(i)}setDelayBase(e){this.x=e}}class VE{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(JI,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Io;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Io||(Io={}));const td=3,I$=Io.STANDARD,Ep={incompatible:1,attempts:2,capacity:3};class bA{mode=Io.STANDARD;retryBackoffStrategy;capacity=UE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>td,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new F$}async acquireInitialRetryToken(e){return new VE(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const d=new VE(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(f=>setTimeout(f,u)),d.$retryLog.acquisitionDelay=u,d}else{const c=Ei.v2026&&i===Ep.capacity&&s?u:0;c>0&&await new Promise(d=>setTimeout(d,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(UE,this.capacity+(e.getRetryCost()??m$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${td}`),td}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:Ep.incompatible,s=i<n?0:Ep.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:Ep.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class D${mode=Io.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new H1,this.standardRetryStrategy=t?new bA({maxAttempts:typeof e=="number"?e:3,...t}):new bA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const P$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=td,defaultBaseDelay:a=Ei.delay()}={},s=Os(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Os(n)()===Io.ADAPTIVE?new D$(s,{maxAttempts:u,baseDelay:a}):new bA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},R$=T$(gV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Fs(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const O$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},B$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},M$=r=>({applyToStack:e=>{e.add(O$(r),B$)}}),_$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,d=u??e.outputFilterSensitiveLog,{$metadata:f,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:d(h),metadata:f}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},N$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},L$=r=>({applyToStack:e=>{e.add(_$(),N$)}}),U$=r=>({applyToStack:e=>{}}),V$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function z$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const $$=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=V$(a,s),l=z$(r.httpAuthSchemes),u=mc(n),c=[];for(const d of o){const f=l.get(d.schemeId);if(!f){c.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}const h=f.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=d.propertiesExtractor?.(r,n)||{};d.identityProperties=Object.assign(d.identityProperties||{},g),d.signingProperties=Object.assign(d.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:d,identity:await h(d.identityProperties),signer:f.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
|
|
2877
|
+
`),WV={warn:console.warn},QV=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],U1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function YV(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,d=o<10?`0${o}`:`${o}`;return`${QV[n]}, ${l} ${U1[t]} ${e} ${u}:${c}:${d} GMT`}const XV=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),JV=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=XV.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,d=Cg(Ed(n)),f=vo(i,"month",1,12),h=vo(a,"day",1,31),g=Xp(d,f,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-uz(c)),g},KV=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ZV=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ez=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),MI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=KV.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Xp(Cg(Ed(a)),Vv(i),vo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=ZV.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return iz(Xp(rz(a),Vv(i),vo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=ez.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Xp(Cg(Ed(u)),Vv(n),vo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},tz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=$V(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Xp=(r,e,t,n)=>{const i=e-1;return sz(r,i,t),new Date(Date.UTC(r,i,t,vo(n.hours,"hour",0,23),vo(n.minutes,"minute",0,59),vo(n.seconds,"seconds",0,60),lz(n.fractionalMilliseconds)))},rz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+Cg(Ed(r));return t<e?t+100:t},nz=50*365*24*60*60*1e3,iz=r=>r.getTime()-new Date().getTime()>nz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,Vv=r=>{const e=U1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},az=[31,28,31,30,31,30,31,31,30,31,30,31],sz=(r,e,t)=>{let n=az[e];if(e===1&&oz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${U1[e]} in ${r}: ${t}`)},oz=r=>r%4===0&&(r%100!==0||r%400===0),vo=(r,e,t,n)=>{const i=GV(Ed(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},lz=r=>r==null?0:HV("0."+r)*1e3,uz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ed=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},fo=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};fo.from=r=>r&&typeof r=="object"&&(r instanceof fo||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?fo(String(r)):fo(JSON.stringify(r));fo.fromObject=fo.from;const _E=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!_E.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&_E.test(t.string)}}const _I={},yA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),_I[r]=e,yA[e]=r}function NI(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in yA)e[t/2]=yA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function yo(r){let e="";for(let t=0;t<r.byteLength;t++)e+=_I[r[t]];return e}const NE=typeof TextEncoder=="function"?new TextEncoder:null,cz=r=>{if(typeof r=="string"){if(NE)return NE.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kd=r=>typeof r=="string"?El(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),fz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",LI=async r=>{},dz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),vz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!mz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},hz=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,pz=/(\d+\.){3}\d+/,gz=/\.\./,mz=r=>hz.test(r)&&!pz.test(r)&&!gz.test(r),vz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},yz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Az(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(N1(o)),n.isCustomEndpoint=!0)}const a=await bz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const bz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await yz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await dz(n),n};function wz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Cz(r){const e=Az(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&wz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=mc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const xz={name:"serializerMiddleware"},Sz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:xz.name};function Ez(r){const e=Cz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),Sz)}})}function kz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>N1(await Os(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Os(i??!1),useFipsEndpoint:Os(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class V1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new V1(e,t,n,i)}}class Tz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Fz="endpoints";function xg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${xg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(xg).join(", ")})`:JSON.stringify(r,null,2)}const z1={},Iz=(r,e)=>r===e;function Dz(...r){for(const e of r)if(e!=null)return e}const Pz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},UI=(r,e)=>Pz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Rz=r=>r!=null;function Oz(r,e,t){return r?e:t}const Bz=r=>!r,Mz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),VI=r=>Mz.test(r)||r.startsWith("[")&&r.endsWith("]"),zv={[xd.HTTP]:80,[xd.HTTPS]:443},_z=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:f,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${f}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,k])=>`${C}=${k}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xd).includes(l))return null;const u=VI(i),c=t.includes(`${n}:${zv[l]}`)||typeof r=="string"&&r.includes(`${n}:${zv[l]}`),d=`${n}${c?`:${zv[l]}`:""}`;return{scheme:l,authority:d,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Nz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const Lz=(r,e)=>r===e,Uz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Vz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),zz={booleanEquals:Iz,coalesce:Dz,getAttr:UI,isSet:Rz,isValidHostLabel:Kg,ite:Oz,not:Bz,parseURL:_z,split:Nz,stringEquals:Lz,substring:Uz,uriEncode:Vz},zI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(UI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},$z=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return zI(r,t);if(r.fn)return HI.callFunction(r,t);if(r.ref)return $z(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},$I=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=HI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=z1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=zz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},HI={evaluateExpression:rm,callFunction:$I},Hz=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=$I(r,e);e.logger?.debug?.(`${Fz} evaluateCondition: ${xg(r)} = ${xg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},jz=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),jI=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=qI.getEndpointProperty(i,e),t),{}),GI=(r,e)=>{if(Array.isArray(r))return r.map(t=>GI(t,e));switch(typeof r){case"string":return zI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return qI.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},qI={getEndpointProperty:GI,getEndpointProperties:jI},Gz=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},$v=1e8,qz=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<$v;){const u=3*(Math.abs(s)-1),[c,d,f]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=Hz({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?d:f}if(s>=$v){const u=i[s-$v];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,d,f]=u;return{url:Gz(c,l),properties:jI(d,l),headers:jz(f??{},l)}}throw new Ba("No matching endpoint.")},Wz=kz(LI),WI=Ez(LI);class Hv extends NV(em,El,wg,Zg){}const Qz=r=>crypto.getRandomValues(r),QI=LV(Qz),Yz=QI,AA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Hv.mutate(r);if(!r)return Hv.mutate(new Uint8Array);const t=e.streamCollector(r);return Hv.mutate(await t)};class Xz{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Jz extends Xz{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return ac}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=$f(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-BEd2eXRE.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Kz extends Jz{async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const d=t&&typeof t=="object"?t:{},f=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(f,o),this.setHostPrefix(f,e,d)),d){const h=l.getEventStreamMember();if(h){if(d[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&d[v]&&(i.write(y,d[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:d[h],requestSchema:l,initialRequest:g})}}else i.write(u,d),c=i.flush()}return f.headers=Object.assign(f.headers,s),f.query=a,f.body=c,f.method="POST",f}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await AA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await AA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function YI(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const Zz=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),e$=r=>({httpHandler:r.httpHandler()}),LE="content-length";function t$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(LE)===-1)try{const s=r(i);n.headers={...n.headers,[LE]:String(s)}}catch{}}return e({...t,request:n})}}const r$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},n$=r=>({applyToStack:e=>{e.add(t$(r.bodyLengthChecker),r$)}}),wl=r=>encodeURIComponent(r).replace(/[!'()*]/g,i$),i$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function a$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=wl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${wl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${wl(n)}`),e.push(i)}}return e.join("&")}const s$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],o$=["TimeoutError","RequestTimeout","RequestTimeoutException"],l$=[500,502,503,504],u$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],c$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],f$=r=>r?.$retryable!==void 0,d$=r=>r.$metadata?.clockSkewCorrected,h$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},XI=r=>r.$metadata?.httpStatusCode===429||s$.includes(r.name)||r.$retryable?.throttling==!0,$1=(r,e=0)=>f$(r)||d$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||o$.includes(r.name)||u$.includes(r?.code||"")||c$.includes(r?.code||"")||l$.includes(r.$metadata?.httpStatusCode||0)||h$(r)||g$(r)||r.cause!==void 0&&e<=10&&$1(r.cause,e+1),p$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!$1(r)}return!1};function g$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const JI=20*1e3,UE=500,m$=1,v$="amz-sdk-invocation-id",y$="amz-sdk-request";function A$(r,e){if(ac.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(MI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const b$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function w$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(x$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:d}=i,f=na.isInstance(d);for(f&&(d.headers[v$]=QI());;)try{f&&(d.headers[y$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=S$(h,e.logger);if(l=b$(h),f&&r(d))throw(n.logger instanceof RI?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await C$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const C$=r=>new Promise(e=>setTimeout(e,r)),x$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",S$=(r,e)=>{const t={error:r,errorType:E$(r)},n=A$(r.$response,e);return n&&(t.retryAfterHint=n),t},E$=r=>XI(r)?"THROTTLING":$1(r)?"TRANSIENT":p$(r)?"SERVER_ERROR":"CLIENT_ERROR",k$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function T$(r){const e=w$(r);return t=>({applyToStack:n=>{n.add(e(t),k$)}})}class H1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||XI(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>H1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class F${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,JI);return Math.floor(i)}setDelayBase(e){this.x=e}}class VE{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(JI,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Io;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Io||(Io={}));const td=3,I$=Io.STANDARD,Ep={incompatible:1,attempts:2,capacity:3};class bA{mode=Io.STANDARD;retryBackoffStrategy;capacity=UE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>td,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new F$}async acquireInitialRetryToken(e){return new VE(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const d=new VE(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(f=>setTimeout(f,u)),d.$retryLog.acquisitionDelay=u,d}else{const c=Ei.v2026&&i===Ep.capacity&&s?u:0;c>0&&await new Promise(d=>setTimeout(d,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(UE,this.capacity+(e.getRetryCost()??m$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${td}`),td}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:Ep.incompatible,s=i<n?0:Ep.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:Ep.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class D${mode=Io.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new H1,this.standardRetryStrategy=t?new bA({maxAttempts:typeof e=="number"?e:3,...t}):new bA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const P$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=td,defaultBaseDelay:a=Ei.delay()}={},s=Os(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Os(n)()===Io.ADAPTIVE?new D$(s,{maxAttempts:u,baseDelay:a}):new bA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},R$=T$(gV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Fs(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const O$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},B$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},M$=r=>({applyToStack:e=>{e.add(O$(r),B$)}}),_$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,d=u??e.outputFilterSensitiveLog,{$metadata:f,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:d(h),metadata:f}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},N$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},L$=r=>({applyToStack:e=>{e.add(_$(),N$)}}),U$=r=>({applyToStack:e=>{}}),V$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function z$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const $$=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=V$(a,s),l=z$(r.httpAuthSchemes),u=mc(n),c=[];for(const d of o){const f=l.get(d.schemeId);if(!f){c.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}const h=f.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=d.propertiesExtractor?.(r,n)||{};d.identityProperties=Object.assign(d.identityProperties||{},g),d.signingProperties=Object.assign(d.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:d,identity:await h(d.identityProperties),signer:f.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
|
|
2878
2878
|
`));return t(i)},H$={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},j$=(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t})=>({applyToStack:n=>{n.addRelativeTo($$(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t}),H$)}}),G$=r=>e=>{throw e},q$=(r,e)=>{},W$=r=>(e,t)=>async n=>{if(!na.isInstance(n.request))return e(n);const a=mc(t).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:s={}},identity:o,signer:l}=a,u=await e({...n,request:await l.sign(n.request,o,s)}).catch((l.errorHandler||G$)(s));return(l.successHandler||q$)(u.response,s),u},Q$={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Y$=r=>({applyToStack:e=>{e.addRelativeTo(W$(),Q$)}}),rd=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};class X${authSchemes=new Map;constructor(e){for(const t in e){const n=e[t];n!==void 0&&this.authSchemes.set(t,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class J${async sign(e,t,n){return e}}const K$=r=>function(t){return KI(t)&&t.expiration.getTime()-Date.now()<r},Z$=3e5,eH=K$(Z$),KI=r=>r.expiration!==void 0,tH=(r,e,t)=>{if(r===void 0)return;const n=typeof r!="function"?async()=>Promise.resolve(r):r;let i,a,s,o=!1;const l=async u=>{a||(a=n(u));try{i=await a,s=!0,o=!1}finally{a=void 0}return i};return e===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),o?i:t(i)?(e(i)&&await l(u),i):(o=!0,i))},rH=void 0;function nH(r){return r===void 0?!0:typeof r=="string"&&r.length<=50}function iH(r){const e=rd(r.userAgentAppId??rH),{customUserAgent:t}=r;return Object.assign(r,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const n=await e();if(!nH(n)){const i=r.logger?.constructor?.name==="NoOpLogger"||!r.logger?console:r.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}const aH={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};let sH=aH;const oH=r=>{const{partitions:e}=sH;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},lH=/\d{12}\.ddb/;async function uH(r,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Fs(r,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case Io.ADAPTIVE:Fs(r,"RETRY_MODE_ADAPTIVE","F");break;case Io.STANDARD:Fs(r,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const a=r.endpointV2;switch(String(a?.url?.hostname).match(lH)&&Fs(r,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Fs(r,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Fs(r,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Fs(r,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=r.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const a=i;a.accountId&&Fs(r,"RESOLVED_ACCOUNT_ID","T");for(const[s,o]of Object.entries(a.$source??{}))Fs(r,s,o)}}const zE="user-agent",jv="x-amz-user-agent",$E=" ",Gv="/",cH=/[^!$%&'*+\-.^_`|~\w]/g,fH=/[^!$%&'*+\-.^_`|~\w#]/g,HE="-",dH=1024;function hH(r){let e="";for(const t in r){const n=r[t];if(e.length+n.length+1<=dH){e.length?e+=","+n:e+=n;continue}break}return e}const pH=r=>(e,t)=>async n=>{const{request:i}=n;if(!na.isInstance(i))return e(n);const{headers:a}=i,s=t?.userAgent?.map(kp)||[],o=(await r.defaultUserAgentProvider()).map(kp);await uH(t,r,n);const l=t;o.push(`m/${hH(Object.assign({},t.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=r?.customUserAgent?.map(kp)||[],c=await r.userAgentAppId();c&&o.push(kp(["app",`${c}`]));const d=[].concat([...o,...s,...u]).join($E),f=[...o.filter(h=>h.startsWith("aws-sdk-")),...u].join($E);return r.runtime!=="browser"?(f&&(a[jv]=a[jv]?`${a[zE]} ${f}`:f),a[zE]=d):a[jv]=d,e({...n,request:i})},kp=r=>{const e=r[0].split(Gv).map(s=>s.replace(cH,HE)).join(Gv),t=r[1]?.replace(fH,HE),n=e.indexOf(Gv),i=e.substring(0,n);let a=e.substring(n+1);return i==="api"&&(a=a.toLowerCase()),[i,a,t].filter(s=>s&&s.length>0).reduce((s,o,l)=>{switch(l){case 0:return o;case 1:return`${s}/${o}`;default:return`${s}#${o}`}},"")},gH={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},mH=r=>({applyToStack:e=>{e.add(pH(r),gH)}}),vH=({serviceId:r,clientVersion:e})=>async t=>{const n=typeof window<"u"?window.navigator:void 0,i=n?.userAgent??"",a=n?.userAgentData?.platform??jE.os(i)??"other",s=void 0,o=n?.userAgentData?.brands??[],l=o[o.length-1],u=l?.brand??jE.browser(i)??"unknown",c=l?.version??"unknown",d=[["aws-sdk-js",e],["ua","2.1"],[`os/${a}`,s],["lang/js"],["md/browser",`${u}_${c}`]];r&&d.push([`api/${r}`,e]);const f=await t?.userAgentAppId?.();return f&&d.push([`app/${f}`]),d},jE={os(r){if(/iPhone|iPad|iPod/.test(r))return"iOS";if(/Macintosh|Mac OS X/.test(r))return"macOS";if(/Windows NT/.test(r))return"Windows";if(/Android/.test(r))return"Android";if(/Linux/.test(r))return"Linux"},browser(r){if(/EdgiOS|EdgA|Edg\//.test(r))return"Microsoft Edge";if(/Firefox\//.test(r))return"Firefox";if(/Chrome\//.test(r))return"Chrome";if(/Safari\//.test(r))return"Safari"}},ZI=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!ZI(t))return!1;return!0}return!(!Kg(r)||r.length<3||r.length>63||r!==r.toLowerCase()||VI(r))},GE=":",yH="/",AH=r=>{const e=r.split(GE);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(GE)==="")return null;const l=o.map(u=>u.split(yH)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},eD={isVirtualHostableS3Bucket:ZI,parseArn:AH,partition:oH};z1.aws=eD;const bH=(r,e,t)=>{let n,i,a,s=!1;const o=async()=>{i||(i=r());try{n=await i,a=!0,s=!1}finally{i=void 0}return n};return async l=>((!a||l?.forceRefresh)&&(n=await o()),n)},qE=new Set,wH=(r,e=Kg)=>{if(!qE.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else qE.add(r)},tD=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),CH=r=>tD(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,xH=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{const n=typeof e=="function"?await e():e,i=CH(n);return wH(i),i},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return tD(n)?!0:typeof t!="function"?Promise.resolve(!!t):t()}})},SH=["in-region","cross-region","mobile","standard","legacy"],EH=({defaultsMode:r}={})=>bH(async()=>{const e=typeof r=="function"?await r():r;switch(e?.toLowerCase()){case"auto":return Promise.resolve(kH()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${SH.join(", ")}, got ${e}`)}}),kH=()=>{const r=window?.navigator;if(r?.connection){const{effectiveType:e,rtt:t,downlink:n}=r?.connection;if(typeof e=="string"&&e!=="4g"||Number(t)>100||Number(n)<10)return!0}return r?.userAgentData?.mobile||typeof r?.maxTouchPoints=="number"&&r?.maxTouchPoints>1},TH=!1,FH=!1,IH=r=>({setRegion(e){r.region=e},region(){return r.region}}),DH=r=>({region:r.region()}),WE=r=>ac.isInstance(r)?r.headers?.date??r.headers?.Date:void 0,rD=r=>new Date(Date.now()+r),PH=(r,e)=>Math.abs(rD(e).getTime()-r)>=3e5,QE=(r,e)=>{const t=Date.parse(r);return PH(t,e)?t-Date.now():e},nd=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},RH=async r=>{const e=nd("context",r.context),t=nd("config",r.config),n=e.endpointV2?.properties?.authSchemes?.[0],a=await nd("signer",t.signer)(n),s=r?.signingRegion,o=r?.signingRegionSet,l=r?.signingName;return{config:t,signer:a,signingRegion:s,signingRegionSet:o,signingName:l}};class OH{async sign(e,t,n){if(!na.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await RH(n),{config:a,signer:s}=i;let{signingRegion:o,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[d,f]=u.authSchemes;d?.name==="sigv4a"&&f?.name==="sigv4"&&(o=f?.signingRegion??o,l=f?.signingName??l)}return n._preRequestSystemClockOffset=a.systemClockOffset,await s.sign(e,{signingDate:rD(a.systemClockOffset),signingRegion:o,signingService:l})}errorHandler(e){return t=>{const n=t,i=n.ServerTime??WE(n.$response);if(i){const a=nd("config",e.config),s=e._preRequestSystemClockOffset,o=QE(i,a.systemClockOffset);(o!==a.systemClockOffset||s!==void 0&&s!==o)&&n.$metadata&&(a.systemClockOffset=o,n.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=WE(e);if(n){const i=nd("config",t.config);i.systemClockOffset=QE(n,i.systemClockOffset)}}}class BH{format(e){const t=[];for(const a of Object.keys(e)){const s=El(a);t.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(e[a]))}const n=new Uint8Array(t.reduce((a,s)=>a+s.byteLength,0));let i=0;for(const a of t)n.set(a,i),i+=a.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(a.buffer);return s.set(e.value,3),s;case"string":const o=El(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(j1.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!MH.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(NI(e.value.replace(/\-/g,"")),1),d}}}var YE;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(YE||(YE={}));const MH=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class j1{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)t[n]=i;return e<0&&XE(t),new j1(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&XE(e),parseInt(yo(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function XE(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const _H="X-Amz-Algorithm",NH="X-Amz-Credential",nD="X-Amz-Date",LH="X-Amz-SignedHeaders",UH="X-Amz-Expires",iD="X-Amz-Signature",aD="X-Amz-Security-Token",sD="authorization",oD=nD.toLowerCase(),VH="date",zH=[sD,oD,VH],$H=iD.toLowerCase(),wA="x-amz-content-sha256",HH=aD.toLowerCase(),jH={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},GH=/^proxy-/,qH=/^sec-/,qv="AWS4-HMAC-SHA256",WH="AWS4-HMAC-SHA256-PAYLOAD",QH="UNSIGNED-PAYLOAD",YH=50,lD="aws4_request",XH=3600*24*7,JH=({query:r={}})=>{const e=[],t={};for(const n of Object.keys(r)){if(n.toLowerCase()===$H)continue;const i=wl(n);e.push(i);const a=r[n];typeof a=="string"?t[i]=`${i}=${wl(a)}`:Array.isArray(a)&&(t[i]=a.slice(0).reduce((s,o)=>s.concat([`${i}=${wl(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>t[n]).filter(n=>n).join("&")},KH=r=>ZH(r).toISOString().replace(/\.\d{3}Z$/,"Z"),ZH=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class ej{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){this.service=i,this.sha256=a,this.uriEscapePath=s,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Os(n),this.credentialProvider=Os(t)}createCanonicalRequest(e,t,n){const i=Object.keys(t).sort();return`${e.method}
|
|
2879
2879
|
${this.getCanonicalPath(e)}
|
|
2880
2880
|
${JH(e)}
|
|
@@ -2887,7 +2887,7 @@ ${e}
|
|
|
2887
2887
|
${t}
|
|
2888
2888
|
${yo(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const a of e.split("/"))a?.length!==0&&a!=="."&&(a===".."?t.pop():t.push(a));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return wl(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const t=KH(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}const Tp={},Wv=[],Qv=(r,e,t)=>`${r}/${e}/${t}/${lD}`,tj=async(r,e,t,n,i)=>{const a=await JE(r,e.secretAccessKey,e.accessKeyId),s=`${t}:${n}:${i}:${yo(a)}:${e.sessionToken}`;if(s in Tp)return Tp[s];for(Wv.push(s);Wv.length>YH;)delete Tp[Wv.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,n,i,lD])o=await JE(r,o,l);return Tp[s]=o},JE=(r,e,t)=>{const n=new r(e);return n.update(kd(t)),n.digest()},KE=({headers:r},e,t)=>{const n={};for(const i of Object.keys(r).sort()){if(r[i]==null)continue;const a=i.toLowerCase();(a in jH||e?.has(a)||GH.test(a)||qH.test(a))&&(!t||t&&!t.has(a))||(n[a]=r[i].trim().replace(/\s+/g," "))}return n},Yv=async({headers:r,body:e},t)=>{for(const n of Object.keys(r))if(n.toLowerCase()===wA)return r[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||fz(e)){const n=new t;return n.update(kd(e)),yo(await n.digest())}return QH},rj=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},nj=(r,e={})=>{const{headers:t,query:n={}}=na.clone(r);for(const i of Object.keys(t)){const a=i.toLowerCase();(a.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(a)||e.hoistableHeaders?.has(a))&&(n[i]=t[i],delete t[i])}return{...r,headers:t,query:n}},ZE=r=>{r=na.clone(r);for(const e of Object.keys(r.headers))zH.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r};class e2 extends ej{headerFormatter=new BH;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:a,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:l,signingRegion:u,signingService:c}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const f=u??await this.regionProvider(),{longDate:h,shortDate:g}=this.formatDate(n);if(i>XH)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const v=Qv(g,f,c??this.service),y=nj(ZE(e),{unhoistableHeaders:s,hoistableHeaders:l});d.sessionToken&&(y.query[aD]=d.sessionToken),y.query[_H]=qv,y.query[NH]=`${d.accessKeyId}/${v}`,y.query[nD]=h,y.query[UH]=i.toString(10);const A=KE(y,a,o);return y.query[LH]=this.getCanonicalHeaderList(A),y.query[iD]=await this.getSignature(h,v,this.getSigningKey(d,f,g,c),this.createCanonicalRequest(y,A,await Yv(e,this.sha256))),y}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:i,signingRegion:a,signingService:s,eventStreamCredentials:o}){const l=a??await this.regionProvider(),{shortDate:u,longDate:c}=this.formatDate(n),d=Qv(u,l,s??this.service),f=await Yv({headers:{},body:t},this.sha256),h=new this.sha256;h.update(e);const g=yo(await h.digest()),v=[WH,c,d,i,g,f].join(`
|
|
2889
2889
|
`);return this.signString(v,{signingDate:n,signingRegion:l,signingService:s,eventStreamCredentials:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:i,priorSignature:e.priorSignature,eventStreamCredentials:a}).then(o=>({message:e.message,signature:o}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}={}){const s=a??await this.credentialProvider();this.validateResolvedCredentials(s);const o=n??await this.regionProvider(),{shortDate:l}=this.formatDate(t),u=new this.sha256(await this.getSigningKey(s,o,l,i));return u.update(kd(e)),yo(await u.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:a,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const l=a??await this.regionProvider(),u=ZE(e),{longDate:c,shortDate:d}=this.formatDate(t),f=Qv(d,l,s??this.service);u.headers[oD]=c,o.sessionToken&&(u.headers[HH]=o.sessionToken);const h=await Yv(u,this.sha256);!rj(wA,u.headers)&&this.applyChecksum&&(u.headers[wA]=h);const g=KE(u,i,n),v=await this.getSignature(c,f,this.getSigningKey(o,l,d,s),this.createCanonicalRequest(u,g,h));return u.headers[sD]=`${qv} Credential=${o.accessKeyId}/${f}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${v}`,u}async getSignature(e,t,n,i){const a=await this.createStringToSign(e,t,i,qv),s=new this.sha256(await n);return s.update(kd(a)),yo(await s.digest())}getSigningKey(e,t,n,i){return tj(this.sha256,e,n,t,i||this.service)}}const ij=r=>{let e=r.credentials,t=!!r.credentials,n;Object.defineProperty(r,"credentials",{set(u){u&&u!==e&&u!==n&&(t=!0),e=u;const c=aj(r,{credentials:e,credentialDefaultProvider:r.credentialDefaultProvider}),d=sj(r,c);if(t&&!d.attributed){const f=typeof e=="object"&&e!==null;n=async h=>{const v=await d(h);return f&&(!v.$source||Object.keys(v.$source).length===0)?pV(v,"CREDENTIALS_CODE","e"):v},n.memoized=d.memoized,n.configBound=d.configBound,n.attributed=!0}else n=d},get(){return n},enumerable:!0,configurable:!0}),r.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:a=r.systemClockOffset||0,sha256:s}=r;let o;return r.signer?o=rd(r.signer):r.regionInfoProvider?o=()=>rd(r.region)().then(async u=>[await r.regionInfoProvider(u,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},u]).then(([u,c])=>{const{signingRegion:d,signingService:f}=u;r.signingRegion=r.signingRegion||d||c,r.signingName=r.signingName||f||r.serviceId;const h={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},g=r.signerConstructor||e2;return new g(h)}):o=async u=>{u=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await rd(r.region)(),properties:{}},u);const c=u.signingRegion,d=u.signingName;r.signingRegion=r.signingRegion||c,r.signingName=r.signingName||d||r.serviceId;const f={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},h=r.signerConstructor||e2;return new h(f)},Object.assign(r,{systemClockOffset:a,signingEscapePath:i,signer:o})};function aj(r,{credentials:e,credentialDefaultProvider:t}){let n;return e?e?.memoized?n=e:n=tH(e,eH,KI):t?n=rd(t(Object.assign({},r,{parentClientConfig:r}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function sj(r,e){if(e.configBound)return e;const t=async n=>e({...n,callerClientConfig:r});return t.memoized=e.memoized,t.configBound=!0,t}const oj=async(r,e,t)=>({operation:mc(e).operation,region:await Os(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function lj(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Ur(r){return{schemeId:"smithy.api#noAuth"}}const uj=r=>{const e=[];switch(r.operation){case"AssociateSoftwareToken":{e.push(Ur());break}case"ChangePassword":{e.push(Ur());break}case"CompleteWebAuthnRegistration":{e.push(Ur());break}case"ConfirmDevice":{e.push(Ur());break}case"ConfirmForgotPassword":{e.push(Ur());break}case"ConfirmSignUp":{e.push(Ur());break}case"DeleteUser":{e.push(Ur());break}case"DeleteUserAttributes":{e.push(Ur());break}case"DeleteWebAuthnCredential":{e.push(Ur());break}case"ForgetDevice":{e.push(Ur());break}case"ForgotPassword":{e.push(Ur());break}case"GetDevice":{e.push(Ur());break}case"GetTokensFromRefreshToken":{e.push(Ur());break}case"GetUser":{e.push(Ur());break}case"GetUserAttributeVerificationCode":{e.push(Ur());break}case"GetUserAuthFactors":{e.push(Ur());break}case"GlobalSignOut":{e.push(Ur());break}case"InitiateAuth":{e.push(Ur());break}case"ListDevices":{e.push(Ur());break}case"ListWebAuthnCredentials":{e.push(Ur());break}case"ResendConfirmationCode":{e.push(Ur());break}case"RespondToAuthChallenge":{e.push(Ur());break}case"RevokeToken":{e.push(Ur());break}case"SetUserMFAPreference":{e.push(Ur());break}case"SetUserSettings":{e.push(Ur());break}case"SignUp":{e.push(Ur());break}case"StartWebAuthnRegistration":{e.push(Ur());break}case"UpdateAuthEventFeedback":{e.push(Ur());break}case"UpdateDeviceStatus":{e.push(Ur());break}case"UpdateUserAttributes":{e.push(Ur());break}case"VerifySoftwareToken":{e.push(Ur());break}case"VerifyUserAttribute":{e.push(Ur());break}default:e.push(lj(r))}return e},cj=r=>{const e=ij(r);return Object.assign(e,{authSchemePreference:Os(r.authSchemePreference??[])})},fj=r=>Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),uD={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},dj="3.1075.0",hj={version:dj},pj=r=>new TextEncoder().encode(r);var gj=typeof Buffer<"u"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:pj;function Td(r){return r instanceof Uint8Array?r:typeof r=="string"?gj(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function CA(r){return typeof r=="string"?r.length===0:r.byteLength===0}var cD={name:"SHA-256"},t2={name:"HMAC",hash:cD},mj=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const vj={};function Jp(){return typeof window<"u"?window:typeof self<"u"?self:vj}var yj=(function(){function r(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return r.prototype.update=function(e){if(!CA(e)){var t=Td(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},r.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Jp().crypto.subtle.sign(t2,t,e.toHash).then(function(n){return new Uint8Array(n)})}):CA(this.toHash)?Promise.resolve(mj):Promise.resolve().then(function(){return Jp().crypto.subtle.digest(cD,e.toHash)}).then(function(t){return Promise.resolve(new Uint8Array(t))})},r.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(t,n){Jp().crypto.subtle.importKey("raw",Td(e.secret),t2,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},r})(),ha=64,Aj=32,bj=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),wj=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Cj=Math.pow(2,53)-1,Kp=(function(){function r(){this.state=Int32Array.from(wj),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>Cj)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ha&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ha>=ha-8){for(var i=this.bufferLength;i<ha;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ha-8;i++)t.setUint8(i,0);t.setUint32(ha-8,Math.floor(e/4294967296),!0),t.setUint32(ha-4,e),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(Aj),i=0;i<8;i++)a[i*4]=this.state[i]>>>24&255,a[i*4+1]=this.state[i]>>>16&255,a[i*4+2]=this.state[i]>>>8&255,a[i*4+3]=this.state[i]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var e=this,t=e.buffer,n=e.state,i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=0;f<ha;f++){if(f<16)this.temp[f]=(t[f*4]&255)<<24|(t[f*4+1]&255)<<16|(t[f*4+2]&255)<<8|t[f*4+3]&255;else{var h=this.temp[f-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=this.temp[f-15];var v=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[f]=(g+this.temp[f-7]|0)+(v+this.temp[f-16]|0)}var y=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&c)|0)+(d+(bj[f]+this.temp[f]|0)|0)|0,A=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&s^a&s)|0;d=c,c=u,u=l,l=o+y|0,o=s,s=a,a=i,i=y+A|0}n[0]+=i,n[1]+=a,n[2]+=s,n[3]+=o,n[4]+=l,n[5]+=u,n[6]+=c,n[7]+=d},r})(),xj=(function(){function r(e){this.secret=e,this.hash=new Kp,this.reset()}return r.prototype.update=function(e){if(!(CA(e)||this.error))try{this.hash.update(Td(e))}catch(t){this.error=t}},r.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},r.prototype.digest=function(){return es(this,void 0,void 0,function(){return ts(this,function(e){return[2,this.digestSync()]})})},r.prototype.reset=function(){if(this.hash=new Kp,this.secret){this.outer=new Kp;var e=Sj(this.secret),t=new Uint8Array(ha);t.set(e);for(var n=0;n<ha;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(var n=0;n<e.byteLength;n++)e[n]=0}},r})();function Sj(r){var e=Td(r);if(e.byteLength>ha){var t=new Kp;t.update(e),e=t.digest()}var n=new Uint8Array(ha);return n.set(e),n}var Ej=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function kj(r){if(Tj(r)&&typeof r.crypto.subtle=="object"){var e=r.crypto.subtle;return Fj(e)}return!1}function Tj(r){if(typeof r=="object"&&typeof r.crypto=="object"){var e=r.crypto.getRandomValues;return typeof e=="function"}return!1}function Fj(r){return r&&Ej.every(function(e){return typeof r[e]=="function"})}var Ij=(function(){function r(e){kj(Jp())?this.hash=new yj(e):this.hash=new xj(e)}return r.prototype.update=function(e,t){this.hash.update(Td(e))},r.prototype.digest=function(){return this.hash.digest()},r.prototype.reset=function(){this.hash.reset()},r})();function r2(r,e){return new Request(r,e)}function Dj(r=0){return new Promise((e,t)=>{r&&setTimeout(()=>{const n=new Error(`Request did not complete within ${r} ms`);n.name="TimeoutError",t(n)},r)})}const Xv={supported:void 0};class G1{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new G1(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(t=>t||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),Xv.supported===void 0&&(Xv.supported=typeof Request<"u"&&"keepalive"in r2("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,a=this.config.keepAlive===!0,s=this.config.credentials;if(t?.aborted){const C=n2(t);return Promise.reject(C)}let o=e.path;const l=a$(e.query||{});l&&(o+=`?${l}`),e.fragment&&(o+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){const C=e.username??"",k=e.password??"";u=`${C}:${k}@`}const{port:c,method:d}=e,f=`${e.protocol}//${u}${e.hostname}${c?`:${c}`:""}${o}`,h=d==="GET"||d==="HEAD"?void 0:e.body,g={body:h,headers:new Headers(e.headers),method:d,credentials:s};this.config?.cache&&(g.cache=this.config.cache),h&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=t),Xv.supported&&(g.keepalive=a),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(e));let v=()=>{};const y=r2(f,g),A=[fetch(y).then(C=>{const k=C.headers,F={};for(const R of k.entries())F[R[0]]=R[1];return C.body!=null?{response:new ac({headers:F,reason:C.statusText,statusCode:C.status,body:C.body})}:C.blob().then(R=>({response:new ac({headers:F,reason:C.statusText,statusCode:C.status,body:R})}))}),Dj(i)];return t&&A.push(new Promise((C,k)=>{const F=()=>{const S=n2(t);k(S)};if(typeof t.addEventListener=="function"){const S=t;S.addEventListener("abort",F,{once:!0}),v=()=>S.removeEventListener("abort",F)}else t.onabort=F})),Promise.race(A).finally(v)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function n2(r){const e=r&&typeof r=="object"&&"reason"in r?r.reason:void 0;if(e){if(e instanceof Error){const i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}const n=new Error(String(e));return n.name="AbortError",n}const t=new Error("Request aborted");return t.name="AbortError",t}const Pj=async r=>typeof Blob=="function"&&r instanceof Blob||r.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await r.arrayBuffer()):Rj(r):Oj(r);async function Rj(r){const e=await Bj(r),t=Zg(e);return new Uint8Array(t)}async function Oj(r){const e=[],t=r.getReader();let n=!1,i=0;for(;!n;){const{done:o,value:l}=await t.read();l&&(e.push(l),i+=l.length),n=o}const a=new Uint8Array(i);let s=0;for(const o of e)a.set(o,s),s+=o.length;return a}function Bj(r){return new Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return t(new Error("Reader aborted too early"));const i=n.result??"",a=i.indexOf(","),s=a>-1?a+1:i.length;e(i.substring(s))},n.onabort=()=>t(new Error("Read aborted")),n.onerror=()=>t(n.error),n.readAsDataURL(r)})}class Mj{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),i=Object.values(n).find(a=>!!a.getMergedTraits().httpPayload);if(i){const a=i.getMergedTraits().mediaType;return a||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(n).find(s=>{const{httpQuery:o,httpQueryParams:l,httpHeader:u,httpLabel:c,httpPrefixHeaders:d}=s.getMergedTraits();return!o&&!l&&!u&&!c&&d===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,i,a,s){let o=e;e.includes("#")&&([,o]=e.split("#"));const l={$metadata:a,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:s?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:l}}catch{i.message=i.message??i.Message??"UnknownError";const c=this.errorRegistry,d=c.getBaseException();if(d){const g=c.getErrorCtor(d)??Error;throw this.decorateServiceException(Object.assign(new g({name:o}),l),i)}const f=i,h=f?.message??f?.Message??f?.Error?.Message??f?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(h),{name:o},l),i)}}compose(e,t,n){let i=n;t.includes("#")&&([i]=t.split("#"));const a=Zi.for(i),s=Zi.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(a),e.copyFrom(s),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,i=PE(e,t);n&&(i.message=n);const a=i.Error??{};a.Type=i.Error?.Type,a.Code=i.Error?.Code,a.Message=i.Error?.message??i.Error?.Message??n,i.Error=a;const s=i.$metadata.requestId;return s&&(i.RequestId=s),i}return PE(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(e!==void 0&&n!=null){const[i,a]=n.split(";"),s=Object.keys(e),o={Code:i,Type:a};e.Code=i,e.Type=a;for(let l=0;l<s.length;l++){const u=s[l];o[u==="message"?"Message":u]=e[u]}delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>vi.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class q1{serdeContext;setSerdeContext(e){this.serdeContext=e}}class _j{from;to;keys;constructor(e,t){this.from=e,this.to=t;const n=Object.keys(this.from),i=new Set(n);i.delete("__type"),this.keys=i}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function Nj(r,e,t){if(t?.source){const n=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new ns(n,"bigDecimal"):BigInt(n)}return e}const Lj=(r,e)=>AA(r,e).then(t=>(e?.utf8Encoder??em)(t)),Uj=(r,e)=>Lj(r,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:t}),n}return{}}),i2=(r,e)=>Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase()),Jv=r=>{let e=r;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},Vj=(r,e,t=!1)=>zj(r,e,t?["code","header","type"]:["type","code","header"]),zj=({headers:r},e,t)=>{for(;t.length>0;)switch(t.shift()){case"header":const i=i2(r??{},"x-amzn-errortype");if(i!==void 0)return Jv(r[i]);break;case"code":const a=i2(e??{},"code");if(a&&e[a]!==void 0)return Jv(e[a]);break;case"type":if(e?.__type!==void 0)return Jv(e.__type);break}};class $j extends q1{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,Nj):await Uj(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=t!==null&&typeof t=="object",i=vi.of(e);if(n){if(i.isStructSchema()){const s=t,o=i.isUnionSchema(),l={};let u;const{jsonName:c}=this.settings;c&&(u={});let d;o&&(d=new _j(s,l));for(const[f,h]of i.structIterator()){let g=f;c&&(g=h.getMergedTraits().jsonName??g,u[g]=f),o&&d.mark(g),s[g]!=null&&(l[f]=this._read(h,s[g]))}if(o)d.writeUnknown();else if(typeof s.__type=="string")for(const f in s){const h=s[f],g=c?u[f]??f:f;g in l||(l[g]=h)}return l}if(Array.isArray(t)&&i.isListSchema()){const s=i.getValueSchema(),o=[];for(const l of t)o.push(this._read(s,l));return o}if(i.isMapSchema()){const s=i.getValueSchema(),o={};for(const l in t)o[l]=this._read(s,t[l]);return o}}if(i.isBlobSchema()&&typeof t=="string")return Zg(t);const a=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof t=="string"&&a)return a==="application/json"||a.endsWith("+json")?fo.from(t):t;if(i.isTimestampSchema()&&t!=null)switch(YI(i,this.settings)){case 5:return JV(t);case 6:return MI(t);case 7:return tz(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(i.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(i.isBigDecimalSchema()&&t!=null){if(t instanceof ns)return t;const s=t;return s.type==="bigDecimal"&&"string"in s?new ns(s.string,s.type):new ns(String(t),"bigDecimal")}if(i.isNumericSchema()&&typeof t=="string"){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(i.isDocumentSchema())if(n){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?s[o]=l:s[o]=this._read(i,l)}return s}else return structuredClone(t);return t}}const a2="Ν";class Hj{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof ns){const n=`${a2+"nv"+this.counter++}_`+t.string;return this.values.set(`"${n}"`,t.string),n}if(typeof t=="bigint"){const n=t.toString(),i=`${a2+"b"+this.counter++}_`+n;return this.values.set(`"${i}"`,n),i}return t}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class jj extends q1{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=vi.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const n=new Hj;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=vi.of(e).getName(!0))}_write(e,t,n){const i=t!==null&&typeof t=="object",a=vi.of(e);if(i){if(a.isStructSchema()){const s=t,o={},{jsonName:l}=this.settings;let u;l&&(u={});let c=0;for(const[d,f]of a.structIterator()){const h=this._write(f,s[d],a);if(h!==void 0){let g=d;l&&(g=f.getMergedTraits().jsonName??d,u[d]=g),o[g]=h,c++}}if(a.isUnionSchema()&&c===0){const{$unknown:d}=s;if(Array.isArray(d)){const[f,h]=d;o[f]=this._write(15,h)}}else if(typeof s.__type=="string")for(const d in s){const f=s[d],h=l?u[d]??d:d;h in o||(o[h]=this._write(15,f))}return o}if(Array.isArray(t)&&a.isListSchema()){const s=a.getValueSchema(),o=[],l=!!a.getMergedTraits().sparse;for(const u of t)(l||u!=null)&&o.push(this._write(s,u));return o}if(a.isMapSchema()){const s=a.getValueSchema(),o={},l=!!a.getMergedTraits().sparse;for(const u in t){const c=t[u];(l||c!=null)&&(o[u]=this._write(s,c))}return o}if(t instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??wg)(t);if(t instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(YI(a,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return YV(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof ns&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(a.isStringSchema()){if(typeof t>"u"&&a.isIdempotencyToken())return Yz();const s=a.getMergedTraits().mediaType;return t!=null&&s&&(s==="application/json"||s.endsWith("+json"))?fo.from(t):t}if(typeof t=="number"&&a.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&a.isBlobSchema())return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??wg)(t);if(typeof t=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(i){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?(this.useReplacer=!0,s[o]=l):s[o]=this._write(a,l)}return s}else return structuredClone(t);return t}}}class Gj extends q1{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new jj(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new $j(this.settings);return e.setSerdeContext(this.serdeContext),e}}class qj extends Kz{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=a??new Gj({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new Mj(this.awsQueryCompatible)}async serializeRequest(e,t,n){const i=await super.serializeRequest(e,t,n);return i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,i.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(Qp(e.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(e,t,n,i,a){const{awsQueryCompatible:s}=this;s&&this.mixin.setQueryCompatError(i,n);const o=Vj(n,i,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);const{errorSchema:l,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,i,a,s?this.mixin.findQueryCompatibleError:void 0),c=vi.of(l),d=i.message??i.Message??"UnknownError",f=this.compositeErrorRegistry.getErrorCtor(l)??Error,h=new f({}),g={},v=this.codec.createDeserializer();for(const[y,A]of c.structIterator())i[y]!=null&&(g[y]=v.readObject(A,i[y]));throw s&&this.mixin.queryCompatOutput(i,g),this.mixin.decorateServiceException(Object.assign(h,u,{$fault:c.getMergedTraits().error,message:d},g),i)}}class Wj extends qj{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const Fd="ref",dl=-1,Fp=!0,s2="isSet",fD="PartitionResult",Ip="booleanEquals",Kv="getAttr",Ff="stringEquals",o2={[Fd]:"Endpoint"},Zv={[Fd]:fD},Hf={[Fd]:"Region"},Ya={},l2=[Hf],u2={conditions:[[s2,[o2]],[s2,l2],["aws.partition",l2,fD],[Ip,[{[Fd]:"UseFIPS"},Fp]],[Ip,[{fn:Kv,argv:[Zv,"supportsFIPS"]},Fp]],[Ip,[{[Fd]:"UseDualStack"},Fp]],[Ip,[{fn:Kv,argv:[Zv,"supportsDualStack"]},Fp]],[Ff,[{fn:Kv,argv:[Zv,"name"]},"aws"]],[Ff,[Hf,"us-east-1"]],[Ff,[Hf,"us-east-2"]],[Ff,[Hf,"us-west-1"]],[Ff,[Hf,"us-west-2"]]],results:[[dl],[dl,"Invalid Configuration: FIPS and custom endpoint are not supported"],[dl,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[o2,Ya],["https://cognito-idp-fips.us-east-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-east-2.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-2.amazonaws.com",Ya],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[dl,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",Ya],[dl,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",Ya],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[dl,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",Ya],[dl,"Invalid Configuration: Missing Region"]]},Qj=2,pi=1e8,Yj=new Int32Array([-1,1,-1,0,17,3,1,4,pi+16,2,5,pi+16,3,9,6,5,7,pi+15,6,8,pi+14,7,pi+12,pi+13,4,11,10,5,pi+9,pi+11,5,12,pi+10,6,13,pi+9,8,pi+4,14,9,pi+5,15,10,pi+6,16,11,pi+7,pi+8,3,pi+1,18,5,pi+2,pi+3]),Xj=V1.from(Yj,Qj,u2.conditions,u2.results),Jj=new Tz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Kj=(r,e={})=>Jj.get(r,()=>qz(Xj,{endpointParams:r,logger:e.logger}));z1.aws=eD;class Ct extends _u{constructor(e){super(e),Object.setPrototypeOf(this,Ct.prototype)}}class W1 extends Ct{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,W1.prototype)}}class Q1 extends Ct{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,Q1.prototype)}}class Y1 extends Ct{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,Y1.prototype),this.reasonCode=e.reasonCode}}class X1 extends Ct{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,X1.prototype)}}class J1 extends Ct{name="OperationNotEnabledException";$fault="client";constructor(e){super({name:"OperationNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,J1.prototype)}}class K1 extends Ct{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,K1.prototype)}}class Z1 extends Ct{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,Z1.prototype)}}class eb extends Ct{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,eb.prototype)}}class tb extends Ct{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,tb.prototype)}}class rb extends Ct{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,rb.prototype)}}class nb extends Ct{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,nb.prototype)}}class ib extends Ct{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,ib.prototype)}}class ab extends Ct{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,ab.prototype)}}class sb extends Ct{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,sb.prototype)}}class ob extends Ct{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,ob.prototype)}}class lb extends Ct{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,lb.prototype)}}class ub extends Ct{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,ub.prototype)}}class cb extends Ct{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,cb.prototype)}}class fb extends Ct{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,fb.prototype)}}class db extends Ct{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,db.prototype)}}class hb extends Ct{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,hb.prototype)}}class pb extends Ct{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,pb.prototype)}}class gb extends Ct{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,gb.prototype)}}class mb extends Ct{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,mb.prototype)}}class vb extends Ct{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,vb.prototype)}}class yb extends Ct{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,yb.prototype)}}class Ab extends Ct{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,Ab.prototype)}}class bb extends Ct{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,bb.prototype)}}class wb extends Ct{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,wb.prototype)}}class Cb extends Ct{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Cb.prototype)}}class xb extends Ct{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,xb.prototype)}}class Sb extends Ct{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,Sb.prototype)}}class Eb extends Ct{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,Eb.prototype)}}class kb extends Ct{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,kb.prototype)}}class Tb extends Ct{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,Tb.prototype)}}class Fb extends Ct{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,Fb.prototype)}}class Ib extends Ct{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Ib.prototype)}}class Db extends Ct{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Db.prototype)}}class Pb extends Ct{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,Pb.prototype)}}class Rb extends Ct{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Rb.prototype)}}class Ob extends Ct{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ob.prototype)}}class Bb extends Ct{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Bb.prototype)}}class Mb extends Ct{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Mb.prototype)}}class _b extends Ct{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,_b.prototype)}}class Nb extends Ct{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Nb.prototype)}}class Lb extends Ct{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Lb.prototype)}}class Ub extends Ct{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Ub.prototype)}}class Vb extends Ct{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,Vb.prototype)}}class zb extends Ct{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,zb.prototype)}}class $b extends Ct{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,$b.prototype)}}class Hb extends Ct{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,Hb.prototype)}}class jb extends Ct{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,jb.prototype)}}class Gb extends Ct{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Gb.prototype)}}class qb extends Ct{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,qb.prototype)}}class Wb extends Ct{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,Wb.prototype)}}class Qb extends Ct{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Qb.prototype)}}class Yb extends Ct{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,Yb.prototype)}}class Xb extends Ct{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,Xb.prototype)}}const Zj="AvailableChallenges",eG="AccessDeniedException",tG="AliasExistsException",rG="AnalyticsEndpointId",nG="AuthFlow",dD="AnalyticsMetadata",iG="AnalyticsMetadataType",aG="AuthParameters",sG="AuthParametersType",hD="AuthenticationResult",oG="AuthenticationResultType",lG="AccessToken",uG="CodeDeliveryFailureException",pD="ClientId",cG="ClientIdType",gD="ClientMetadata",fG="CodeMismatchException",dG="ConcurrentModificationException",Jb="ChallengeName",mD="ChallengeParameters",hG="ChallengeResponses",pG="ChallengeResponsesType",gG="DeviceGroupKey",mG="DeviceKey",vG="DeviceKeyExistsException",yG="DuplicateProviderException",AG="ExpiredCodeException",bG="EncodedData",wG="ExpiresIn",CG="EnableSoftwareTokenMFAException",xG="ForbiddenException",SG="FeatureUnavailableInTierException",EG="GroupExistsException",kG="IpAddress",TG="InitiateAuthRequest",FG="InitiateAuthResponse",IG="InitiateAuth",DG="InternalErrorException",PG="InvalidEmailRoleAccessPolicyException",RG="InvalidLambdaResponseException",OG="InvalidOAuthFlowException",BG="InvalidParameterException",MG="InvalidPasswordException",_G="InternalServerException",NG="InvalidSmsRoleAccessPolicyException",LG="InvalidSmsRoleTrustRelationshipException",UG="IdToken",VG="InvalidUserPoolConfigurationException",zG="LimitExceededException",$G="MFAMethodNotFoundException",HG="ManagedLoginBrandingExistsException",jG="NotAuthorizedException",GG="NewDeviceMetadata",qG="NewDeviceMetadataType",WG="OperationNotEnabledException",QG="PasswordHistoryPolicyViolationException",YG="PreconditionNotMetException",XG="PasswordResetRequiredException",JG="ResourceNotFoundException",KG="RefreshToken",ZG="RespondToAuthChallenge",eq="RespondToAuthChallengeRequest",tq="RespondToAuthChallengeResponse",rq="RefreshTokenReuseException",nm="Session",nq="ScopeDoesNotExistException",iq="SessionType",aq="SoftwareTokenMFANotFoundException",sq="TierChangeNotAllowedException",oq="TermsExistsException",lq="TooManyFailedAttemptsException",uq="TooManyRequestsException",cq="TokenModelType",fq="TokenType",dq="UserContextDataType",vD="UserContextData",hq="UnauthorizedException",pq="UsernameExistsException",gq="UserImportInProgressException",mq="UnsupportedIdentityProviderException",vq="UnexpectedLambdaException",yq="UserLambdaValidationException",Aq="UserNotConfirmedException",bq="UserNotFoundException",wq="UnsupportedOperationException",Cq="UserPoolAddOnNotEnabledException",xq="UserPoolTaggingException",Sq="UnsupportedTokenTypeException",Eq="UnsupportedUserStateException",kq="WebAuthnClientMismatchException",Tq="WebAuthnConfigurationMissingException",Fq="WebAuthnChallengeNotFoundException",Iq="WebAuthnCredentialNotSupportedException",Dq="WebAuthnNotEnabledException",Pq="WebAuthnOriginNotAllowedException",Rq="WebAuthnRelyingPartyMismatchException",It="client",Tt="error",Dt="httpError",Ft="message",Oq="reasonCode",yD="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",AD="server",at="com.amazonaws.cognitoidentityprovider",bD=Zi.for(yD);var Bq=[-3,yD,"CognitoIdentityProviderServiceException",0,[],[]];bD.registerError(Bq,Ct);const kt=Zi.for(at);var Mq=[-3,at,eG,{[Tt]:It,[Dt]:403},[Ft],[0]];kt.registerError(Mq,W1);var _q=[-3,at,tG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(_q,gb);var Nq=[-3,at,uG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Nq,lb);var Lq=[-3,at,fG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Lq,xb);var Uq=[-3,at,dG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Uq,Tb);var Vq=[-3,at,vG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Vq,Mb);var zq=[-3,at,yG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(zq,Nb);var $q=[-3,at,CG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError($q,Xb);var Hq=[-3,at,AG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Hq,Sb);var jq=[-3,at,SG,{[Tt]:It,[Dt]:403},[Ft],[0]];kt.registerError(jq,Vb);var Gq=[-3,at,xG,{[Tt]:It,[Dt]:403},[Ft],[0]];kt.registerError(Gq,Fb);var qq=[-3,at,EG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(qq,_b);var Wq=[-3,at,DG,{[Tt]:AD},[Ft],[0]];kt.registerError(Wq,Q1);var Qq=[-3,at,_G,{[Tt]:AD},[Ft],[0]];kt.registerError(Qq,tb);var Yq=[-3,at,PG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Yq,vb);var Xq=[-3,at,RG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Xq,ib);var Jq=[-3,at,OG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Jq,Hb);var Kq=[-3,at,BG,{[Tt]:It,[Dt]:400},[Ft,Oq],[0,0]];kt.registerError(Kq,Y1);var Zq=[-3,at,MG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(Zq,ub);var eW=[-3,at,NG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(eW,cb);var tW=[-3,at,LG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(tW,fb);var rW=[-3,at,VG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(rW,mb);var nW=[-3,at,zG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(nW,rb);var iW=[-3,at,HG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(iW,Lb);var aW=[-3,at,$G,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(aW,yb);var sW=[-3,at,jG,{[Tt]:It,[Dt]:403},[Ft],[0]];kt.registerError(sW,X1);var oW=[-3,at,WG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(oW,J1);var lW=[-3,at,QG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(lW,Eb);var uW=[-3,at,XG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(uW,Ab);var cW=[-3,at,YG,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(cW,db);var fW=[-3,at,rq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(fW,qb);var dW=[-3,at,JG,{[Tt]:It,[Dt]:404},[Ft],[0]];kt.registerError(dW,K1);var hW=[-3,at,nq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(hW,jb);var pW=[-3,at,aq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(pW,kb);var gW=[-3,at,oq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(gW,Ub);var mW=[-3,at,sq,{[Tt]:It,[Dt]:403},[Ft],[0]];kt.registerError(mW,zb);var vW=[-3,at,lq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(vW,ab);var yW=[-3,at,uq,{[Tt]:It,[Dt]:429},[Ft],[0]];kt.registerError(yW,Z1);var AW=[-3,at,hq,{[Tt]:It,[Dt]:401},[Ft],[0]];kt.registerError(AW,Wb);var bW=[-3,at,vq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(bW,sb);var wW=[-3,at,mq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(wW,Gb);var CW=[-3,at,wq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(CW,bb);var xW=[-3,at,Sq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(xW,Qb);var SW=[-3,at,Eq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(SW,hb);var EW=[-3,at,gq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(EW,eb);var kW=[-3,at,yq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(kW,ob);var TW=[-3,at,pq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(TW,pb);var FW=[-3,at,Aq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(FW,wb);var IW=[-3,at,bq,{[Tt]:It,[Dt]:404},[Ft],[0]];kt.registerError(IW,nb);var DW=[-3,at,Cq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(DW,Cb);var PW=[-3,at,xq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(PW,$b);var RW=[-3,at,Fq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(RW,Ib);var OW=[-3,at,kq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(OW,Db);var BW=[-3,at,Tq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(BW,Yb);var MW=[-3,at,Iq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(MW,Pb);var _W=[-3,at,Dq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(_W,Rb);var NW=[-3,at,Pq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(NW,Ob);var LW=[-3,at,Rq,{[Tt]:It,[Dt]:400},[Ft],[0]];kt.registerError(LW,Bb);const UW=[bD,kt];var wD=[0,at,cG,8,0],im=[0,at,iq,8,0],ey=[0,at,cq,8,0],CD=[3,at,iG,0,[rG],[0]],xD=[3,at,oG,0,[lG,wG,fq,KG,UG,GG],[[()=>ey,0],1,0,[()=>ey,0],[()=>ey,0],()=>$W]],VW=[3,at,TG,0,[nG,pD,aG,gD,dD,vD,nm],[0,[()=>wD,0],[()=>GW,0],128,()=>CD,[()=>SD,0],[()=>im,0]],2],zW=[3,at,FG,0,[Jb,nm,mD,hD,Zj],[0,[()=>im,0],128,[()=>xD,0],64]],$W=[3,at,qG,0,[mG,gG],[0,0]],HW=[3,at,eq,0,[pD,Jb,nm,hG,dD,vD,gD],[[()=>wD,0],0,[()=>im,0],[()=>qW,0],()=>CD,[()=>SD,0],128],2],jW=[3,at,tq,0,[Jb,nm,mD,hD],[0,[()=>im,0],128,[()=>xD,0]]],SD=[3,at,dq,8,[kG,bG],[0,0]],GW=[2,at,sG,8,0,0],qW=[2,at,pG,8,0,0],WW=[9,at,IG,0,()=>VW,()=>zW],QW=[9,at,ZG,0,()=>HW,()=>jW];const YW=r=>({apiVersion:"2016-04-18",base64Decoder:r?.base64Decoder??Zg,base64Encoder:r?.base64Encoder??wg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Kj,extensions:r?.extensions??[],httpAuthSchemeProvider:r?.httpAuthSchemeProvider??uj,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new OH},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new J$}],logger:r?.logger??new RI,protocol:r?.protocol??Wj,protocolSettings:r?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:UW,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:r?.serviceId??"Cognito Identity Provider",urlParser:r?.urlParser??bg,utf8Decoder:r?.utf8Decoder??El,utf8Encoder:r?.utf8Encoder??em}),XW=r=>{const e=EH(r),t=()=>e().then(FV),n=YW(r);return{...n,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:r?.bodyLengthChecker??cz,credentialDefaultProvider:r?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:r?.defaultUserAgentProvider??vH({serviceId:n.serviceId,clientVersion:hj.version}),maxAttempts:r?.maxAttempts??td,region:r?.region??AV("Region is missing"),requestHandler:G1.create(r?.requestHandler??t),retryMode:r?.retryMode??(async()=>(await t()).retryMode||I$),sha256:r?.sha256??Ij,streamCollector:r?.streamCollector??Pj,useDualstackEndpoint:r?.useDualstackEndpoint??(()=>Promise.resolve(TH)),useFipsEndpoint:r?.useFipsEndpoint??(()=>Promise.resolve(FH))}},JW=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,n=r.credentials;return{setHttpAuthScheme(i){const a=e.findIndex(s=>s.schemeId===i.schemeId);a===-1?e.push(i):e.splice(a,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){n=i},credentials(){return n}}},KW=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),ZW=(r,e)=>{const t=Object.assign(IH(r),OV(r),Zz(r),JW(r));return e.forEach(n=>n.configure(t)),Object.assign(r,DH(t),BV(t),e$(t),KW(t))};class eQ extends bV{config;constructor(...[e]){const t=XW(e||{});super(t),this.initConfig=t;const n=fj(t),i=iH(n),a=P$(i),s=xH(a),o=s,l=Wz(o),u=cj(l),c=ZW(u,e?.extensions||[]);this.config=c,this.middlewareStack.use(EV(this.config)),this.middlewareStack.use(mH(this.config)),this.middlewareStack.use(R$(this.config)),this.middlewareStack.use(n$(this.config)),this.middlewareStack.use(M$(this.config)),this.middlewareStack.use(L$(this.config)),this.middlewareStack.use(U$(this.config)),this.middlewareStack.use(j$(this.config,{httpAuthSchemeParametersProvider:oj,identityProviderConfigProvider:async d=>new X$({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(Y$(this.config))}destroy(){super.destroy()}}class c2 extends L1.classBuilder().ep(uD).m(function(e,t,n,i){return[WI(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(WW).build(){}class tQ extends L1.classBuilder().ep(uD).m(function(e,t,n,i){return[WI(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").sc(QW).build(){}class rQ{init(e,t,n){this.cognitoClient=new eQ({region:t}),this.spiffRegion=e,this.userPoolClientId=n}async generateCode(e){const t=await this.cognitoClient?.send(new c2({AuthFlow:"CUSTOM_AUTH",ClientId:this.userPoolClientId,AuthParameters:{USERNAME:e}}));t?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=t.Session)}async verifyCode(e,t,n){const i=await this.cognitoClient?.send(new tQ({ClientId:this.userPoolClientId,ChallengeName:"CUSTOM_CHALLENGE",Session:this.challengeSession,ChallengeResponses:{USERNAME:e,ANSWER:t},ClientMetadata:{partnerId:n,environment:(this.spiffRegion||"").toLowerCase()}}));return i?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=i.Session),i}async refreshTokens(){const e=localStorage.getItem("cognito-tokens");if(!e)throw new Error("Failed to find existing tokens.");const t=JSON.parse(e);return await this.cognitoClient?.send(new c2({AuthFlow:"REFRESH_TOKEN_AUTH",ClientId:this.userPoolClientId,AuthParameters:{REFRESH_TOKEN:t.RefreshToken||""}}))}}const If=new rQ;var nQ={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},iQ={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function id(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?id=function(e){return typeof e}:id=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},id(r)}function f2(r){return aQ(r)||sQ(r)||oQ(r)||lQ()}function aQ(r){if(Array.isArray(r))return r}function sQ(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function oQ(r,e){if(r){if(typeof r=="string")return d2(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d2(r,e)}}function d2(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function lQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2890
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var uQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=f2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=f2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function ED(r){return!isNaN(parseInt(r))&&isFinite(r)}function cQ(r){return ED(r)&&r<=100&&r>=0}function fQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function h2(r){return r%2===0}function p2(r){return ED(r)&&!Number.isInteger(r)}function dQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Df(r){return Math.abs(r)%1===.5}function hQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),pQ(i,e.headers),i.send()})}function pQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function jf(r){return typeof r>"u"}function kD(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(id(n[1])==="object"){var i=kD(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function gQ(r){return!!r&&(id(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function TD(){var r=function(n,i){var a=function(l){return Math.pow(10,dQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Df(n)&&h2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Df(n)?h2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Df(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Df(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Df(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return p2(n)||p2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var mQ=TD();function vQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!jf(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return jf(this.getMatches().find(n))?0:this.getMatches()[mQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return jf(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!jf(this.getMatches().find(function(n){return n===","}))}}}function yQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return hQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(gQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return kD(s)[e(r.propertyPath,{from:i,to:a})]})}}}function Id(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function AQ(r){Id(cQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function bQ(r){Id(fQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ty(r){Id(Number.isInteger(r),"You must provide an integer.",TypeError)}var kn=TD(),wQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;ty(n),ty(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),d=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},f=function(g){Id(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return d.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ty(g);var y=this.getPrecision(),A=g>y,C=A?kn.multiply:kn.divide,k=A?[g,y]:[y,g],F=Math.pow(10,kn.subtract.apply(kn,k));return d.call(this,{amount:kn.round(C(this.getAmount(),F),v),precision:g})},add:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return d.call(this,{amount:kn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return d.call(this,{amount:kn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:kn.round(kn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:kn.round(kn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return AQ(g),this.multiply(kn.divide(g,100),v)},allocate:function(g){var v=this;bQ(g);for(var y=g.reduce(function(F,S){return kn.add(F,S)}),A=this.getAmount(),C=g.map(function(F){var S=Math.floor(kn.divide(kn.multiply(v.getAmount(),F),y));return A=kn.subtract(A,S),d.call(v,{amount:S})}),k=0;A>0;)g[k]>0&&(C[k]=C[k].add(d.call(this,{amount:1})),A=kn.subtract(A,1)),k+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,k=y.propertyPath,F=k===void 0?c.propertyPath||"rates.{{to}}":k,S=y.headers,R=S===void 0?c.headers:S,M=y.roundingMode,j=M===void 0?l:M,G=Object.assign({},{endpoint:C,propertyPath:F,headers:R,roundingMode:j});return yQ(G).getExchangeRate(this.getCurrency(),g).then(function(ie){return Id(!jf(ie),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),d.call(v,{amount:kn.round(kn.multiply(v.getAmount(),parseFloat(ie)),G.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=vQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return kn.divide(kn.round(kn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},CQ=Object.assign(wQ,nQ,iQ,uQ),Xa={},ry,g2;function xQ(){if(g2)return ry;g2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ry=e,ry}var ny={exports:{}},m2;function SQ(){if(m2)return ny.exports;m2=1;var r=ny.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},ny.exports}var iy,v2;function EQ(){return v2||(v2=1,iy=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),iy}var ay,y2;function kQ(){return y2||(y2=1,ay="2024-06-25"),ay}var A2;function TQ(){if(A2)return Xa;A2=1;var r=xQ(),e=SQ(),t=EQ(),n=kQ(),i=function(c){return c=c.toUpperCase(),r(t,function(d){return d.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(d){return(d.countries.map(function(f){return f.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(d){return d.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(d){return d.number});return c.filter(function(d){if(d)return d})},u=function(){var c=t.filter(function(d){return d.countries}).map(function(d){return d.countries});return e(Array.prototype.concat.apply([],c))};return Xa.code=i,Xa.country=a,Xa.number=s,Xa.codes=o,Xa.numbers=l,Xa.countries=u,Xa.publishDate=n,Xa.data=t,Xa}var b2=TQ();class FD{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return CQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=b2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(b2.code(t)?.code==="CLP")return"USD0,0"}}const w2=new FD;class ID{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,w2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,w2.getPrecisionForCurrency(t))}}const FQ=async(r,e)=>{const t=await He.getShadowGraphqlClient().query({query:V3(e?.assets?.metadata||!1),errorPolicy:"all",variables:{ids:r}});if(t.error)throw t.error;if(t.errors)throw t.errors.forEach(i=>console.error(i)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!t.data.workflows||t.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${t.errors??"Length mismatch in response"}`);const n=go(t.data.workflows);return n.forEach(i=>{i.finalizeStepConfig||(i.finalizeStepConfig={}),i.finalizeStepConfig.termsMarkdown=i.finalizeStepConfig.termsMarkdown||i.partner.termsMarkdown}),n},IQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Kb=async(r,e)=>{const t=r.map(o=>md.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=FQ(n,e),a=n.map(o=>md.set({id:o,options:e},IQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},DD=async(r,e)=>(await Kb([r],e))[0],PD=async r=>{const e=await He.getShadowGraphqlClient().query({query:hT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class DQ{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return He.getShadowGraphqlClient().mutate({...t,mutation:E3})}catch(n){throw console.error(n),new so("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&GO(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.0.0"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){po.setHubUrl(e.hubUrl),po.setServerUrl(e.serverUrl),po.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&qk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&If.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.0.0"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!qO())throw new Error("Application key required to use Flow Service.");return new TI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await He.getShadowGraphqlClient().query({query:q3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new ID(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=RD(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=wr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),wr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await He.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=He.getShadowGraphqlClient(),i=(await t.query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:uV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await If.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await He.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await He.getShadowGraphqlClient().mutate({mutation:cV,variables:{emailAddress:e}}),await If.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await If.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await He.getShadowGraphqlClient().mutate({mutation:fV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||mg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await If.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await He.getShadowGraphqlClient().query({query:dV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await He.getShadowGraphqlClient().mutate({mutation:WU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,d)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=wr.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),wr.setMap("bundlePartnerIds",o);const l=wr.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),wr.setMap("bundleOwnerIds",l);const u=new FE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=wr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,k])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!mg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await He.getShadowGraphqlClient().query({query:$U(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const d=c.data?.bundles[0],f=wr.getMap("bundlePartnerIds")||new Map;f.set(d.id,d.partner.id),wr.setMap("bundlePartnerIds",f);const h=new FE(this,d,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await MD(e),...i?.graphql?.additionalHeaders},l=(await He.getShadowGraphqlClient().mutate({mutation:QU(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=wr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),wr.setMap("bundlePartnerIds",u);const c=wr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),wr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await He.getShadowGraphqlClient().query({query:a9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await He.getShadowGraphqlClient().query({query:HU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=wr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),wr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new so("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=fA(s,l),c=fA(o,l);let d=0;const f=He.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await f.query({query:S3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),se=J.data.transactions;if(d=d+se.length,i&&i(d,s.length),se.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new so(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&se[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(se[0].integrationProduct.integration)),se.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await f.mutate({mutation:x3,variables:{inputs:q.map(se=>({integrationProductId:se.option.type==="integration"?se.option.integrationProductId:void 0,externalIntegrationId:se.option.type==="external"?se.option.externalIntegrationId:void 0,externalProductId:se.option.type==="external"?se.option.externalProductId:void 0,workflowId:se.option.workflowId,designName:se.option.designName,claim:!0,quantity:se.option.quantity,recipient:se.option.recipient,parentTransactionId:se.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const se=Y.errors?.[0]?.message||"Unknown error";throw new so(`Failed to create transactions: ${se}`)}return d=d+J.length,i&&i(d,s.length),J.map((se,oe)=>({transaction:se,workflowId:se.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,k]=await Promise.all([(async()=>y.length>0?await PD(y):[])(),(async()=>A.length>0?await Kb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),S=new Map(k.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:se,index:oe}=q,he=J?S.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=wr.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),wr.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new hV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:se?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:se,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await sA(re),ee.reloadedState=re}else if(!se&&ye.workflowState){const re=JSON.parse(ye.workflowState);await sA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),j=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let G=[],ie=[];for(const q of j){const{experienceOptions:Y,options:J}=q,se=new wI(this,Y);await se.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(se),G=[...G,se],se.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),se=(await f.mutate({mutation:N9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(se&&se?.length>0){const oe=se[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return G}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=wr.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=wr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),wr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await He.getShadowGraphqlClient().query({query:R3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new pA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await He.getShadowGraphqlClient().query({query:O3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new pA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(wr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await He.getShadowGraphqlClient().query({query:D3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await He.getShadowGraphqlClient().mutate({mutation:G3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const RD=async(r,e)=>(await He.getShadowGraphqlClient().query({query:$3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,PQ=async r=>{const t=await He.getShadowGraphqlClient().query({query:I3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},RQ=async(r,e)=>(await He.getShadowGraphqlClient().query({query:z3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,OQ=async r=>(await He.getShadowGraphqlClient().query({query:j3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,BQ=async r=>(await He.getShadowGraphqlClient().query({query:H3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,OD=async r=>(await He.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",variables:{id:r}})).data?.activation,MQ=async r=>(await OD(r))?.marketplaceThemeInstallConfiguration;async function BD(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!mg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function MD(r){const t=wr.getMap("bundleOwnerIds")?.get(r),n=await BD();return{bundleOwnerId:t,...n}}async function _Q(r){const t=wr.getMap("transactionOwnerIds")?.get(r),n=await BD();return{transactionOwnerId:t,...n}}const NQ=async r=>{const e=await MD(r),t=await He.getShadowGraphqlClient().mutate({mutation:p9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},LQ=async r=>{const e=await _Q(r),t=await He.getShadowGraphqlClient().mutate({mutation:g9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function _D(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class ND{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=bI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Yd(o),u=this.frameData?this.frameData[s]:void 0;vd(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=Bu.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=Vg(this.imageData.svg,this.imageData.colors||{},!1);return Lg(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],d=n[o]-u*e[o];return{x:c,y:d,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=_D(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(d=>d.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new hL(l,t,e[c]),new pL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...w1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class UQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,d,f,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var LD=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(LD||{}),UD=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(UD||{});class VD extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new ND(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return ao.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await ao.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Og.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await ao.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await ao.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ft.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?ao.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Da(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=oT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return ao.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const VQ=Ee`
|
|
2890
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var uQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=f2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=f2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function ED(r){return!isNaN(parseInt(r))&&isFinite(r)}function cQ(r){return ED(r)&&r<=100&&r>=0}function fQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function h2(r){return r%2===0}function p2(r){return ED(r)&&!Number.isInteger(r)}function dQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Df(r){return Math.abs(r)%1===.5}function hQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),pQ(i,e.headers),i.send()})}function pQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function jf(r){return typeof r>"u"}function kD(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(id(n[1])==="object"){var i=kD(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function gQ(r){return!!r&&(id(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function TD(){var r=function(n,i){var a=function(l){return Math.pow(10,dQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Df(n)&&h2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Df(n)?h2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Df(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Df(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Df(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return p2(n)||p2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var mQ=TD();function vQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!jf(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return jf(this.getMatches().find(n))?0:this.getMatches()[mQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return jf(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!jf(this.getMatches().find(function(n){return n===","}))}}}function yQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return hQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(gQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return kD(s)[e(r.propertyPath,{from:i,to:a})]})}}}function Id(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function AQ(r){Id(cQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function bQ(r){Id(fQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ty(r){Id(Number.isInteger(r),"You must provide an integer.",TypeError)}var kn=TD(),wQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;ty(n),ty(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),d=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},f=function(g){Id(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return d.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ty(g);var y=this.getPrecision(),A=g>y,C=A?kn.multiply:kn.divide,k=A?[g,y]:[y,g],F=Math.pow(10,kn.subtract.apply(kn,k));return d.call(this,{amount:kn.round(C(this.getAmount(),F),v),precision:g})},add:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return d.call(this,{amount:kn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return d.call(this,{amount:kn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:kn.round(kn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:kn.round(kn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return AQ(g),this.multiply(kn.divide(g,100),v)},allocate:function(g){var v=this;bQ(g);for(var y=g.reduce(function(F,S){return kn.add(F,S)}),A=this.getAmount(),C=g.map(function(F){var S=Math.floor(kn.divide(kn.multiply(v.getAmount(),F),y));return A=kn.subtract(A,S),d.call(v,{amount:S})}),k=0;A>0;)g[k]>0&&(C[k]=C[k].add(d.call(this,{amount:1})),A=kn.subtract(A,1)),k+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,k=y.propertyPath,F=k===void 0?c.propertyPath||"rates.{{to}}":k,S=y.headers,R=S===void 0?c.headers:S,M=y.roundingMode,j=M===void 0?l:M,G=Object.assign({},{endpoint:C,propertyPath:F,headers:R,roundingMode:j});return yQ(G).getExchangeRate(this.getCurrency(),g).then(function(ie){return Id(!jf(ie),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),d.call(v,{amount:kn.round(kn.multiply(v.getAmount(),parseFloat(ie)),G.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=vQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return kn.divide(kn.round(kn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},CQ=Object.assign(wQ,nQ,iQ,uQ),Xa={},ry,g2;function xQ(){if(g2)return ry;g2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ry=e,ry}var ny={exports:{}},m2;function SQ(){if(m2)return ny.exports;m2=1;var r=ny.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},ny.exports}var iy,v2;function EQ(){return v2||(v2=1,iy=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),iy}var ay,y2;function kQ(){return y2||(y2=1,ay="2024-06-25"),ay}var A2;function TQ(){if(A2)return Xa;A2=1;var r=xQ(),e=SQ(),t=EQ(),n=kQ(),i=function(c){return c=c.toUpperCase(),r(t,function(d){return d.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(d){return(d.countries.map(function(f){return f.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(d){return d.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(d){return d.number});return c.filter(function(d){if(d)return d})},u=function(){var c=t.filter(function(d){return d.countries}).map(function(d){return d.countries});return e(Array.prototype.concat.apply([],c))};return Xa.code=i,Xa.country=a,Xa.number=s,Xa.codes=o,Xa.numbers=l,Xa.countries=u,Xa.publishDate=n,Xa.data=t,Xa}var b2=TQ();class FD{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return CQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=b2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(b2.code(t)?.code==="CLP")return"USD0,0"}}const w2=new FD;class ID{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,w2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,w2.getPrecisionForCurrency(t))}}const FQ=async(r,e)=>{const t=await He.getShadowGraphqlClient().query({query:V3(e?.assets?.metadata||!1),errorPolicy:"all",variables:{ids:r}});if(t.error)throw t.error;if(t.errors)throw t.errors.forEach(i=>console.error(i)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!t.data.workflows||t.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${t.errors??"Length mismatch in response"}`);const n=go(t.data.workflows);return n.forEach(i=>{i.finalizeStepConfig||(i.finalizeStepConfig={}),i.finalizeStepConfig.termsMarkdown=i.finalizeStepConfig.termsMarkdown||i.partner.termsMarkdown}),n},IQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Kb=async(r,e)=>{const t=r.map(o=>md.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=FQ(n,e),a=n.map(o=>md.set({id:o,options:e},IQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},DD=async(r,e)=>(await Kb([r],e))[0],PD=async r=>{const e=await He.getShadowGraphqlClient().query({query:hT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class DQ{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return He.getShadowGraphqlClient().mutate({...t,mutation:E3})}catch(n){throw console.error(n),new so("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&GO(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.1.0"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){po.setHubUrl(e.hubUrl),po.setServerUrl(e.serverUrl),po.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&qk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&If.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.1.0"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!qO())throw new Error("Application key required to use Flow Service.");return new TI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await He.getShadowGraphqlClient().query({query:q3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new ID(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=RD(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=wr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),wr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await He.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=He.getShadowGraphqlClient(),i=(await t.query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:uV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await If.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await He.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await He.getShadowGraphqlClient().mutate({mutation:cV,variables:{emailAddress:e}}),await If.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await If.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await He.getShadowGraphqlClient().mutate({mutation:fV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||mg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await If.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await He.getShadowGraphqlClient().query({query:dV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await He.getShadowGraphqlClient().mutate({mutation:WU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,d)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=wr.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),wr.setMap("bundlePartnerIds",o);const l=wr.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),wr.setMap("bundleOwnerIds",l);const u=new FE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=wr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,k])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!mg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await He.getShadowGraphqlClient().query({query:$U(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const d=c.data?.bundles[0],f=wr.getMap("bundlePartnerIds")||new Map;f.set(d.id,d.partner.id),wr.setMap("bundlePartnerIds",f);const h=new FE(this,d,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await MD(e),...i?.graphql?.additionalHeaders},l=(await He.getShadowGraphqlClient().mutate({mutation:QU(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=wr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),wr.setMap("bundlePartnerIds",u);const c=wr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),wr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await He.getShadowGraphqlClient().query({query:a9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await He.getShadowGraphqlClient().query({query:HU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=wr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),wr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new so("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=fA(s,l),c=fA(o,l);let d=0;const f=He.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await f.query({query:S3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),se=J.data.transactions;if(d=d+se.length,i&&i(d,s.length),se.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new so(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&se[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(se[0].integrationProduct.integration)),se.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await f.mutate({mutation:x3,variables:{inputs:q.map(se=>({integrationProductId:se.option.type==="integration"?se.option.integrationProductId:void 0,externalIntegrationId:se.option.type==="external"?se.option.externalIntegrationId:void 0,externalProductId:se.option.type==="external"?se.option.externalProductId:void 0,workflowId:se.option.workflowId,designName:se.option.designName,claim:!0,quantity:se.option.quantity,recipient:se.option.recipient,parentTransactionId:se.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const se=Y.errors?.[0]?.message||"Unknown error";throw new so(`Failed to create transactions: ${se}`)}return d=d+J.length,i&&i(d,s.length),J.map((se,oe)=>({transaction:se,workflowId:se.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,k]=await Promise.all([(async()=>y.length>0?await PD(y):[])(),(async()=>A.length>0?await Kb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),S=new Map(k.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:se,index:oe}=q,he=J?S.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=wr.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),wr.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new hV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:se?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:se,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await sA(re),ee.reloadedState=re}else if(!se&&ye.workflowState){const re=JSON.parse(ye.workflowState);await sA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),j=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let G=[],ie=[];for(const q of j){const{experienceOptions:Y,options:J}=q,se=new wI(this,Y);await se.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(se),G=[...G,se],se.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),se=(await f.mutate({mutation:N9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(se&&se?.length>0){const oe=se[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return G}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=wr.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=wr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),wr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await He.getShadowGraphqlClient().query({query:R3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new pA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await He.getShadowGraphqlClient().query({query:O3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new pA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(wr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await He.getShadowGraphqlClient().query({query:D3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await He.getShadowGraphqlClient().mutate({mutation:G3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const RD=async(r,e)=>(await He.getShadowGraphqlClient().query({query:$3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,PQ=async r=>{const t=await He.getShadowGraphqlClient().query({query:I3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},RQ=async(r,e)=>(await He.getShadowGraphqlClient().query({query:z3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,OQ=async r=>(await He.getShadowGraphqlClient().query({query:j3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,BQ=async r=>(await He.getShadowGraphqlClient().query({query:H3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,OD=async r=>(await He.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",variables:{id:r}})).data?.activation,MQ=async r=>(await OD(r))?.marketplaceThemeInstallConfiguration;async function BD(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!mg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function MD(r){const t=wr.getMap("bundleOwnerIds")?.get(r),n=await BD();return{bundleOwnerId:t,...n}}async function _Q(r){const t=wr.getMap("transactionOwnerIds")?.get(r),n=await BD();return{transactionOwnerId:t,...n}}const NQ=async r=>{const e=await MD(r),t=await He.getShadowGraphqlClient().mutate({mutation:p9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},LQ=async r=>{const e=await _Q(r),t=await He.getShadowGraphqlClient().mutate({mutation:g9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function _D(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class ND{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=bI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Yd(o),u=this.frameData?this.frameData[s]:void 0;vd(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=Bu.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=Vg(this.imageData.svg,this.imageData.colors||{},!1);return Lg(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],d=n[o]-u*e[o];return{x:c,y:d,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=_D(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(d=>d.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new hL(l,t,e[c]),new pL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...w1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class UQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,d,f,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var LD=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(LD||{}),UD=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(UD||{});class VD extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new ND(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return ao.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await ao.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Og.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await ao.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await ao.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ft.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?ao.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Da(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=oT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return ao.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const VQ=Ee`
|
|
2891
2891
|
query GetLoggedInCustomer($email: String!) {
|
|
2892
2892
|
customer(emailAddress: $email) {
|
|
2893
2893
|
id
|
|
@@ -3099,4 +3099,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3099
3099
|
}
|
|
3100
3100
|
}
|
|
3101
3101
|
`,yY=async r=>(await He.getShadowGraphqlClient().query({query:vY,variables:{ids:r}})).data.integrationProducts;exports.AddonHandle=Og;exports.AddressValidationJobStatus=HD;exports.AddressValidationResultConfirmationLevel=$D;exports.AddressValidationStatus=Rg;exports.ArrayInput=lV;exports.AspectType=Hn;exports.AssetNotFoundError=xo;exports.AssetType=dd;exports.BringForwardCommand=AL;exports.BringToBackCommand=yL;exports.BringToFrontCommand=vL;exports.BundleDesignCreationCartAddMode=Ok;exports.CanvasCommand=Fn;exports.CollectionProduct=Vf;exports.ColorOptionGlobalPropertyHandle=dA;exports.CommandContext=VF;exports.ConversionDataType=Yf;exports.CreateElementCommand=ii;exports.CreateLayoutCommand=S1;exports.CurrencyContext=ID;exports.CurrencyService=FD;exports.DeleteElementCommand=Rl;exports.DigitalContentStepHandle=gI;exports.FileUploadGlobalPropertyHandle=CI;exports.FlowExecutionNodeResult=zf;exports.FlowExecutionResult=FI;exports.FlowService=TI;exports.FontAlignmentCommand=qF;exports.FontColorCommand=jF;exports.FontSizeCommand=GF;exports.FontSourceCommand=oA;exports.FrameService=ND;exports.FrameStep=LD;exports.FrameStepHandle=VD;exports.GlobalPropertyHandle=Jg;exports.GroupCommand=On;exports.IllustrationStepHandle=oI;exports.ImageState=UD;exports.InformationMessageType=Xd;exports.InformationStepHandle=pI;exports.IntegrationProduct=pA;exports.IntegrationType=Mk;exports.LayoutElementFactory=uL;exports.LayoutElementType=er;exports.LayoutNotFoundError=Ai;exports.LayoutRenderingPurpose=Ju;exports.MaterialStepHandle=lI;exports.MisconfigurationError=as;exports.MockWorkflowManager=UQ;exports.ModelStepHandle=uI;exports.ModuleStepHandle=mI;exports.MoveCommand=cL;exports.ObjectInput=_1;exports.ObjectInputType=II;exports.OptionGlobalPropertyHandle=O1;exports.OptionNotFoundError=hd;exports.ParseError=yl;exports.PictureStepHandle=cI;exports.ProductCameraRig=_k;exports.ProductCollection=B1;exports.ProductCollectionProductSortKey=kI;exports.ProductStepHandle=vI;exports.ProductWorkflow=Hu;exports.PromiseQueue=Gg;exports.QuestionStepHandle=fI;exports.QueueablePromise=jg;exports.ResizeCommand=dL;exports.ResourceNotFoundError=Ku;exports.RotateCommand=fL;exports.ScaleAxis=gi;exports.SendBackwardsCommand=bL;exports.ShapeStepHandle=dI;exports.ShareActionType=Bk;exports.SpiffCommerceClient=DQ;exports.StakeholderType=jA;exports.StepAspectType=Rk;exports.StepHandle=Ui;exports.StepType=Xe;exports.TextAlgorithm=Tl;exports.TextChangeCommand=WF;exports.TextGlobalPropertyHandle=xI;exports.TextInput=oV;exports.TextStepHandle=hI;exports.UnhandledBehaviorError=nn;exports.UnitOfMeasurement=Nk;exports.UpdateImageSourceCommand=gL;exports.Variant=Fa;exports.WorkflowExperienceEventType=vg;exports.WorkflowExperienceImpl=wI;exports.__values=KD;exports.amtChannelsForAspect=SI;exports.assetConfigurationDeleteMutation=Y3;exports.assetConfigurationUpdateMutation=Q3;exports.assetConfigurationsQuery=W3;exports.assetService=Ln;exports.browserColorToHex=nT;exports.bundleEmailMutation=m9;exports.cmPerPixel=z_;exports.currentDirection=L_;exports.dataUrlFromExternalUrl=OO;exports.deleteBundle=NQ;exports.designService=Wp;exports.determineCorrectFontSizeAndLines=Zf;exports.digitalContentStepService=k1;exports.domParser=ls;exports.duplicateBundle=XQ;exports.duplicateTransaction=JQ;exports.fetchAsString=ra;exports.findAngle=P_;exports.findElement=Un;exports.findPmsColors=JB;exports.frameDataCache=Bu;exports.frameStepService=ao;exports.fromHex=NI;exports.fromUtf8=El;exports.generate=Ar;exports.generateCommands=iI;exports.generateSVGWithUnknownColors=Da;exports.generateStateFromDesignInputSteps=_U;exports.getActivation=OD;exports.getActivationThemeConfiguration=MQ;exports.getAddressValidationJobs=dY;exports.getAssetsForProductImagesQuery=X3;exports.getAttributesFromArrayBuffer=_d;exports.getAxisAlignedBoundingBox=D_;exports.getBoundedOffsets=_D;exports.getBundleIdForTransaction=LQ;exports.getBundleThemeConfiguration=OQ;exports.getCustomer=KQ;exports.getCustomerBundles=ZQ;exports.getElementVertices=U_;exports.getFrameData=Yd;exports.getGlobalPropertyStateForBundle=VU;exports.getIntegration=RD;exports.getIntegrationProducts=yY;exports.getNEPoint=__;exports.getNWPoint=M_;exports.getOrderedTransactions=rY;exports.getOverrideThemeConfiguration=RQ;exports.getPointOfRotation=B_;exports.getProductCollections=tV;exports.getSEPoint=N_;exports.getSvgElement=Qg;exports.getTemplateBundles=iY;exports.getTemplateTransactions=nY;exports.getTransaction=PQ;exports.getTransactionThemeConfiguration=BQ;exports.getTransactionsForBundle=eY;exports.getTransformedAssetURL=zg;exports.getTrueCoordinates=O_;exports.getUnorderedTransactions=tY;exports.getValidationJobsForWorkflowExperiences=fY;exports.getWorkflow=DD;exports.getWorkflows=Kb;exports.graphQlManager=He;exports.illustrationStepService=Kf;exports.isCloseToValue=R_;exports.loadFont=Pl;exports.matchHexToPms=QB;exports.materialStepService=T1;exports.mergeColorClasses=oT;exports.metafieldManager=yg;exports.mmPerPixel=V_;exports.modelStepService=F1;exports.modifySVGColors=Vg;exports.moduleStepService=I1;exports.nameBundle=QQ;exports.nameTransaction=YQ;exports.optionService=ft;exports.outlineFontsInSvg=y7;exports.overrideWorkflowExperienceRecipientAddress=gY;exports.patternImageDataCache=Ds;exports.persistenceService=wr;exports.pictureStepService=D1;exports.pmsToRgb=WB;exports.promiseCache=md;exports.questionStepService=P1;exports.registerFetchImplementation=FO;exports.registerWindowImplementation=TO;exports.rehydrateSerializedLayout=sA;exports.rgbToPms=rT;exports.rotateAroundPoint=Lf;exports.sanitizeSvgTree=Ug;exports.setBearerAuthenticationToken=qk;exports.setCanvasModule=qA;exports.shapeStepService=Mu;exports.shortenUrl=ZF;exports.skipWorkflowExperienceRecipientAddress=mY;exports.spiffCoreConfiguration=po;exports.stepAspectValuesToDesignInputSteps=MU;exports.svgColorValueToDefinition=$y;exports.svgStringDimensions=x1;exports.svgToDataUrl=Lg;exports.textStepService=li;exports.toHex=yo;exports.toUtf8=em;exports.toast=tI;exports.validateWorkflowExperienceRecipient=hY;exports.validateWorkflowExperienceRecipients=pY;exports.xmlSerializer=Do;
|
|
3102
|
-
//# sourceMappingURL=index-
|
|
3102
|
+
//# sourceMappingURL=index-BkN_xe6r.cjs.map
|