dynamic-mui 2.0.13 → 2.0.15

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.
@@ -399,7 +399,7 @@ If this is intentional, you can suppress this warning by passing the \`suppressC
399
399
  `));r[e.field]=t;return}const{groupId:o,children:i}=e;i.forEach(s=>{t6(s,[...t,o],r)})},mP=e=>{if(!e)return{};const t={};return e.forEach(r=>{t6(r,[],t)}),t},gP=(e,t,r)=>{const o=c=>t[c]??[],i=[],s=Math.max(0,...e.map(c=>o(c).length)),a=(c,u,d)=>{const f=o(c),p=o(u);for(let h=0;h<=d;h+=1)if(f[h]!==p[h])return!1;return!0},l=(c,u)=>{const d=r?.left,f=r?.right,p=!!d?.includes(c),h=!!d?.includes(u),b=!!f?.includes(c),g=!!f?.includes(u);return p!==h||b!==g};for(let c=0;c<s;c+=1){const u=[];for(let d=0;d<e.length;d+=1){const f=e[d],p=o(f)[c]??null;if(u.length===0){u.push({columnFields:[f],groupId:p});continue}const h=u[u.length-1],b=h.columnFields[h.columnFields.length-1];h.groupId!==p||!a(b,f,c)||l(b,f)?u.push({columnFields:[f],groupId:p}):h.columnFields.push(f)}i.push(u)}return i},nke=(e,t,r)=>{if(r.current.caches.columnGrouping={lastColumnGroupingModel:t.columnGroupingModel},!t.columnGroupingModel)return E({},e,{columnGrouping:void 0});const o=xa(r),i=Hm(r),s=Kk(t.columnGroupingModel??[]),a=mP(t.columnGroupingModel??[]),l=gP(o,a,r.current.state.pinnedColumns??{}),c=i.length===0?0:Math.max(...i.map(u=>a[u]?.length??0));return E({},e,{columnGrouping:{lookup:s,unwrappedGroupingModel:a,headerStructure:l,maxDepth:c}})},rke=(e,t)=>{const r=S.useCallback(l=>qU(e)[l]??[],[e]),o=S.useCallback(()=>UU(e),[e]);Gt(e,{getColumnGroupPath:r,getAllGroupDetails:o},"public");const s=S.useCallback(()=>{const l=mP(t.columnGroupingModel??[]);e.current.setState(c=>{const u=c.columns?.orderedFields??[],d=c.pinnedColumns??{},f=gP(u,l,d);return E({},c,{columnGrouping:E({},c.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),a=S.useCallback(l=>{if(!l&&!e.current.caches.columnGrouping.lastColumnGroupingModel)return;e.current.caches.columnGrouping.lastColumnGroupingModel=l;const c=e.current.getPinnedColumns?.()??{},u=xa(e),d=Hm(e),f=Kk(l??[]),p=mP(l??[]),h=gP(u,p,c),b=d.length===0?0:Math.max(...d.map(g=>p[g]?.length??0));e.current.setState(g=>E({},g,{columnGrouping:{lookup:f,unwrappedGroupingModel:p,headerStructure:h,maxDepth:b}}))},[e]);ct(e,"columnIndexChange",s),ct(e,"columnsChange",()=>{a(t.columnGroupingModel)}),ct(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),S.useEffect(()=>{t.columnGroupingModel!==e.current.caches.columnGrouping.lastColumnGroupingModel&&a(t.columnGroupingModel)},[e,a,t.columnGroupingModel])};function oke(){let e,t;const r=new Promise((o,i)=>{e=o,t=i});return r.resolve=e,r.reject=t,r}function Bj(e,t){if(t!==void 0&&e.changedTouches){for(let r=0;r<e.changedTouches.length;r+=1){const o=e.changedTouches[r];if(o.identifier===t)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Vj(e,t,r,o){let i=e;return o==="Right"?i+=t-r.left:i+=r.right-t,Math.round(i)}function ike(e,t,r){return r==="Left"?e-t.left:t.right-e}function ske(e){return e==="Right"?"Left":"Right"}function ake(e,t){const r=e.classList.contains(fe["columnSeparator--sideRight"])?"Right":"Left";return t?ske(r):r}function Hj(e,t){return t===ha.LEFT?e?"--DataGrid-rightPinnedWidth":"--DataGrid-leftPinnedWidth":e?"--DataGrid-leftPinnedWidth":"--DataGrid-rightPinnedWidth"}function zj(e,t,r){return r===ha.LEFT?t?e.rightPinnedWidth:e.leftPinnedWidth:t?e.leftPinnedWidth:e.rightPinnedWidth}function qj(e){e.preventDefault(),e.stopImmediatePropagation()}function lke(e){const t=S.useRef(void 0),r=()=>eOe(e),o=He(e,r);return S.useEffect(()=>{t.current&&o===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(r()===!1)return Promise.resolve();t.current=oke()}return t.current}}function cke(e,t){if(e.length<4)return e;const r=e.slice();r.sort((l,c)=>l-c);const o=r[Math.floor(r.length*.25)],i=r[Math.floor(r.length*.75)-1],s=i-o,a=s<5?5:s*t;return r.filter(l=>l>o-a&&l<i+a)}function uke(e,t,r){const o={},i=e.current.rootElementRef.current;i.classList.add(fe.autosizing);const s=t.includeHeaderFilters&&zU(e);return r.forEach(a=>{const c=R1e(e.current,a.field).map(g=>g.getBoundingClientRect().width??0),u=t.includeOutliers?c:cke(c,t.outliersFactor);if(t.includeHeaders){const g=I1e(e.current,a.field);if(g){const y=g.querySelector(`.${fe.columnHeaderTitleContainer}`),v=Array.from(y.children),C=g.querySelector(`.${fe.menuIcon}`),O=window.getComputedStyle(y,null),T=parseInt(O.gap,10)||0,P=window.getComputedStyle(g,null),k=parseInt(P.paddingLeft,10)+parseInt(P.paddingRight,10);let M=0,_=0;for(let A=0;A<v.length;A+=1){const F=v[A];F.clientWidth>0&&(M+=1,_+=F.scrollWidth)}_+=1;const D=_+T*(M-1)+k+(C?.clientWidth??0);u.push(D)}}if(s){const g=k1e(e.current,a.field);if(g){const y=window.getComputedStyle(g,null),v=parseInt(y.paddingLeft,10)+parseInt(y.paddingRight,10),O=g.scrollWidth+v;u.push(O)}}const d=a.minWidth!==-1/0&&a.minWidth!==void 0,f=a.maxWidth!==1/0&&a.maxWidth!==void 0,p=d?a.minWidth:0,h=f?a.maxWidth:1/0,b=u.length===0?0:Math.max(...u);o[a.field]=tu(b,p,h)}),i.classList.remove(fe.autosizing),o}const dke=e=>E({},e,{columnResize:{resizingColumnField:""}});function fke(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const pke=(e,t)=>{const r=In(),o=ao(e,"useGridColumnResize"),i=ai(fke).current,s=S.useRef(null),a=S.useRef(null),l=oo(),c=S.useRef(void 0),u=A=>{o.debug(`Updating width to ${A} for col ${i.colDef.field}`);const F=i.columnHeaderElement.offsetWidth,I=A-F,N=A-i.initialColWidth;if(N>0){const B=i.initialTotalWidth+N;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${B}px`)}i.colDef.computedWidth=A,i.colDef.width=A,i.colDef.flex=0,i.columnHeaderElement.style.width=`${A}px`;const j=i.headerFilterElement;j&&(j.style.width=`${A}px`),i.groupHeaderElements.forEach(B=>{const q=B;let U;q.getAttribute("aria-colspan")==="1"?U=`${A}px`:U=`${q.offsetWidth+I}px`,q.style.width=U}),i.cellElements.forEach(B=>{const q=B;let U;q.getAttribute("aria-colspan")==="1"?U=`${A}px`:U=`${q.offsetWidth+I}px`,q.style.setProperty("--width",U)});const H=ir(e),$=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);$===ha.LEFT&&(Rd(i.fillerLeft,"width",I),i.leftPinnedCellsAfter.forEach(B=>{Rd(B,"left",I)}),i.leftPinnedHeadersAfter.forEach(B=>{Rd(B,"left",I)}),e.current.rootElementRef?.current?.style.setProperty(Hj(r,$),`${zj(H,r,$)+N}px`)),$===ha.RIGHT&&(Rd(i.fillerRight,"width",I),i.rightPinnedCellsBefore.forEach(B=>{Rd(B,"right",I)}),i.rightPinnedHeadersBefore.forEach(B=>{Rd(B,"right",I)}),e.current.rootElementRef?.current?.style.setProperty(Hj(r,$),`${zj(H,r,$)+N}px`))},d=A=>{if(C(),i.previousMouseClickEvent){const F=i.previousMouseClickEvent,I=F.timeStamp,N=F.clientX,j=F.clientY;if(A.timeStamp-I<300&&A.clientX===N&&A.clientY===j){i.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,A);return}}if(i.colDef){e.current.setColumnWidth(i.colDef.field,i.colDef.width),o.debug(`Updating col ${i.colDef.field} with new width: ${i.colDef.width}`);const F=ta(e);i.groupHeaderElements.forEach(I=>{const N=S1e(I),j=I,$=`${N.reduce((B,q)=>F.columnVisibilityModel[q]!==!1?B+F.lookup[q].computedWidth:B,0)}px`;j.style.width=$})}l.start(0,()=>{e.current.publishEvent("columnResizeStop",null,A)})},f=()=>{i.columnHeaderElement&&(i.cellElements=w1e(i.columnHeaderElement,e.current))},p=(A,F,I)=>{const N=e.current.rootElementRef.current;i.initialColWidth=A.computedWidth,i.initialTotalWidth=e.current.getRootDimensions().rowWidth,i.colDef=A,i.columnHeaderElement=x1e(e.current.columnHeadersContainerRef.current,A.field);const j=N.querySelector(`.${fe.headerFilterRow} [data-field="${ka(A.field)}"]`);j&&(i.headerFilterElement=j),i.groupHeaderElements=C1e(e.current.columnHeadersContainerRef?.current,A.field),f(),i.fillerLeft=Pj(e.current,r?"filler--pinnedRight":"filler--pinnedLeft"),i.fillerRight=Pj(e.current,r?"filler--pinnedLeft":"filler--pinnedRight");const H=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);i.leftPinnedCellsAfter=H!==ha.LEFT?[]:T1e(e.current,i.columnHeaderElement,r),i.rightPinnedCellsBefore=H!==ha.RIGHT?[]:O1e(e.current,i.columnHeaderElement,r),i.leftPinnedHeadersAfter=H!==ha.LEFT?[]:P1e(e.current,i.columnHeaderElement,r),i.rightPinnedHeadersBefore=H!==ha.RIGHT?[]:E1e(e.current,i.columnHeaderElement,r),a.current=ake(F,r),s.current=ike(I,i.columnHeaderElement.getBoundingClientRect(),a.current)},h=Ee(d),b=Ee(A=>{if(A.buttons===0){h(A);return}let F=Vj(s.current,A.clientX,i.columnHeaderElement.getBoundingClientRect(),a.current);F=tu(F,i.colDef.minWidth,i.colDef.maxWidth),u(F);const I={element:i.columnHeaderElement,colDef:i.colDef,width:F};e.current.publishEvent("columnResize",I,A)}),g=Ee(A=>{Bj(A,c.current)&&d(A)}),y=Ee(A=>{const F=Bj(A,c.current);if(!F)return;if(A.type==="mousemove"&&A.buttons===0){g(A);return}let I=Vj(s.current,F.x,i.columnHeaderElement.getBoundingClientRect(),a.current);I=tu(I,i.colDef.minWidth,i.colDef.maxWidth),u(I);const N={element:i.columnHeaderElement,colDef:i.colDef,width:I};e.current.publishEvent("columnResize",N,A)}),v=Ee(A=>{const F=Rx(A.target,fe["columnSeparator--resizable"]);if(!F)return;const I=A.changedTouches[0];I!=null&&(c.current=I.identifier);const N=Rx(A.target,fe.columnHeader),j=v1e(N),H=e.current.getColumn(j);o.debug(`Start Resize on col ${H.field}`),e.current.publishEvent("columnResizeStart",{field:j},A),p(H,F,I.clientX);const $=$n(A.currentTarget);$.addEventListener("touchmove",y),$.addEventListener("touchend",g)}),C=S.useCallback(()=>{const A=$n(e.current.rootElementRef.current);A.body.style.removeProperty("cursor"),A.removeEventListener("mousemove",b),A.removeEventListener("mouseup",h),A.removeEventListener("touchmove",y),A.removeEventListener("touchend",g),setTimeout(()=>{A.removeEventListener("click",qj,!0)},100),i.columnHeaderElement&&(i.columnHeaderElement.style.pointerEvents="unset")},[e,i,b,h,y,g]),O=S.useCallback(({field:A})=>{e.current.setState(F=>E({},F,{columnResize:E({},F.columnResize,{resizingColumnField:A})}))},[e]),T=S.useCallback(()=>{e.current.setState(A=>E({},A,{columnResize:E({},A.columnResize,{resizingColumnField:""})}))},[e]),P=Ee(({colDef:A},F)=>{if(F.button!==0||!F.currentTarget.classList.contains(fe["columnSeparator--resizable"]))return;F.preventDefault(),o.debug(`Start Resize on col ${A.field}`),e.current.publishEvent("columnResizeStart",{field:A.field},F),p(A,F.currentTarget,F.clientX);const I=$n(e.current.rootElementRef.current);I.body.style.cursor="col-resize",i.previousMouseClickEvent=F.nativeEvent,I.addEventListener("mousemove",b),I.addEventListener("mouseup",h),I.addEventListener("click",qj,!0)}),k=Ee((A,F)=>{if(t.disableAutosize||F.button!==0)return;const I=e.current.state.columns.lookup[A.field];I.resizable!==!1&&e.current.autosizeColumns(E({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[I.field]}))}),M=lke(e),_=S.useRef(!1),D=S.useCallback(async A=>{if(!e.current.rootElementRef?.current||_.current)return;_.current=!0;const I=ta(e),N=E({},pTe,A,{columns:A?.columns??I.orderedFields});N.columns=N.columns.filter(H=>I.columnVisibilityModel[H]!==!1);const j=N.columns.map(H=>e.current.state.columns.lookup[H]);try{!t.disableVirtualization&&N.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await M());const H=uke(e,N,j),$=j.map(B=>E({},B,{width:H[B.field],computedWidth:H[B.field],flex:0}));if(N.expand){const q=I.orderedFields.map(G=>I.lookup[G]).filter(G=>I.columnVisibilityModel[G.field]!==!1).reduce((G,Z)=>G+(H[Z.field]??Z.computedWidth??Z.width),0),L=e.current.getRootDimensions().viewportInnerSize.width-q;if(L>0){const G=L/($.length||1);$.forEach(Z=>{Z.width+=G,Z.computedWidth+=G})}}e.current.updateColumns($),$.forEach((B,q)=>{if(B.width!==j[q].width){const U=B.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(B.field),colDef:B,width:U})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),_.current=!1}},[e,M,t.disableVirtualization]);S.useEffect(()=>C,[C]),N0(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),KU(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",v,{passive:!0}),Gt(e,{autosizeColumns:D},"public"),ct(e,"columnResizeStop",T),ct(e,"columnResizeStart",O),ct(e,"columnSeparatorMouseDown",P),ct(e,"columnSeparatorDoubleClick",k),ct(e,"rowsSet",()=>{fTe(e)!==""&&requestAnimationFrame(()=>{f()})}),An(e,"columnResize",t.onColumnResize),An(e,"columnWidthChange",t.onColumnWidthChange)};function Rd(e,t,r){e&&(e.style[t]=`${Math.round(parseFloat(e.style[t]))+r}px`)}function hke(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function Uj(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const hO=(e,t,r)=>{if(!e)return null;const o=e[t.field];return t.rowSpanValueGetter?t.rowSpanValueGetter(o,e,t,r):N4(e,t,r)},mke={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},gke={firstRowIndex:0,lastRowIndex:0},qc={caches:mke,processedRange:gke},bke=(e,t,r,o,i,s)=>{const a=e.current.virtualizer,l=s?qc:If.selectors.state(a.store.state),c=E({},l.caches.spannedCells),u=E({},l.caches.hiddenCells),d=E({},l.caches.hiddenCellOriginMap),f={firstRowIndex:Math.min(l.processedRange.firstRowIndex,i.firstRowIndex),lastRowIndex:Math.max(l.processedRange.lastRowIndex,i.lastRowIndex)};return t.forEach((p,h)=>{for(let b=i.firstRowIndex;b<i.lastRowIndex;b+=1){const g=r[b];if(u[g.id]?.[h])continue;const y=hO(g.model,p,e);if(y==null)continue;let v=g.id,C=b,O=0;const T=[];if(b===i.firstRowIndex){let k=b-1,M=r[k];for(;k>=o.firstRowIndex&&M&&hO(M.model,p,e)===y;){const _=r[k+1];u[_.id]?u[_.id][h]=!0:u[_.id]={[h]:!0},T.push(b),O+=1,v=M.id,C=k,k-=1,M=r[k]}}T.forEach(k=>{d[k]?d[k][h]=C:d[k]={[h]:C}});let P=b+1;for(;P<=o.lastRowIndex&&r[P]&&hO(r[P].model,p,e)===y;){const k=r[P];u[k.id]?u[k.id][h]=!0:u[k.id]={[h]:!0},d[P]?d[P][h]=C:d[P]={[h]:C},P+=1,O+=1}O>0&&(c[v]?c[v][h]=O+1:c[v]={[h]:O+1})}}),{caches:{spannedCells:c,hiddenCells:u,hiddenCellOriginMap:d},processedRange:f}},yke=e=>E({},e,{rowSpanning:qc}),vke=(e,t)=>{const r=S.useCallback((a,l=!1)=>{const c=e.current.virtualizer.store,{range:u,rows:d}=lf(e);if(l&&c.set("rowSpanning",qc),u===null||!Uj(a))return;const f=l?qc:If.selectors.state(c.state),p=hke({firstRowIndex:a.firstRowIndex,lastRowIndex:Math.min(a.lastRowIndex,u.lastRowIndex-u.firstRowIndex+1)},f.processedRange);if(p===null)return;const h=yr(e),b=bke(e,h,d,u,p,l),g=Object.keys(b.caches.spannedCells).length,y=Object.keys(b.caches.hiddenCells).length,v=Object.keys(f.caches.spannedCells).length,C=Object.keys(f.caches.hiddenCells).length;!(l||g!==v||y!==C)||g===0&&v===0||c.set("rowSpanning",b)},[e]),{schedule:o,cancel:i}=Gwe(r),s=S.useCallback(()=>{const a=cP(e);Uj(a)&&o(a,!0)},[e,o]);ct(e,"renderedRowsIntervalChange",ni(t.rowSpanning,a=>{const l=i();r(a,l)})),ct(e,"sortedRowsSet",ni(t.rowSpanning,s)),ct(e,"paginationModelChange",ni(t.rowSpanning,s)),ct(e,"filteredRowsSet",ni(t.rowSpanning,s)),ct(e,"columnsChange",ni(t.rowSpanning,s)),ct(e,"rowExpansionChange",ni(t.rowSpanning,s)),S.useEffect(()=>{const a=e.current.virtualizer?.store;a&&(t.rowSpanning?a.state.rowSpanning===qc&&r(cP(e)):a.state.rowSpanning!==qc&&a.set("rowSpanning",qc))},[e,t.rowSpanning,r])},xke=(e,t,r)=>E({},e,{listViewColumn:t.listViewColumn?E({},t.listViewColumn,{computedWidth:bP(r)}):void 0});function Ske(e,t){const r=()=>{e.current.setState(s=>s.listViewColumn?E({},s,{listViewColumn:E({},s.listViewColumn,{computedWidth:bP(e)})}):s)},o=S.useRef(null);ct(e,"viewportInnerSizeChange",s=>{o.current!==s.width&&(o.current=s.width,r())}),ct(e,"columnVisibilityModelChange",r),Mt(()=>{const s=t.listViewColumn;s&&e.current.setState(a=>E({},a,{listViewColumn:E({},s,{computedWidth:bP(e)})}))},[e,t.listViewColumn]),S.useEffect(()=>{t.listView&&!t.listViewColumn&&er(["MUI X: The `listViewColumn` prop must be set if `listView` is enabled.",'To fix, pass a column definition to the `listViewColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.',"For more details, see https://mui.com/x/react-data-grid/list-view/"])},[t.listView,t.listViewColumn])}function bP(e){return ir(e).viewportInnerSize.width}const Cke=at(no,bs,mo,(e,t,r)=>({groupKeys:[],paginationModel:r,sortModel:t,filterModel:e,start:r.page*r.pageSize,end:r.page*r.pageSize+r.pageSize-1}));let Lc=(function(e){return e.Default="set-flat-rows",e.LazyLoading="replace-row-range",e.GroupedData="set-grouped-rows",e})({});class mO{constructor(t){this.chunkSize=t}getCacheKeys=t=>{if(this.chunkSize<1||typeof t.start!="number")return[t];const r=[];for(let o=t.start;o<=t.end;o+=this.chunkSize){const i=Math.min(o+this.chunkSize-1,t.end);r.push(E({},t,{start:o,end:i}))}return r};splitResponse=(t,r)=>{const o=this.getCacheKeys(t);if(o.length===1)return new Map([[t,r]]);const i=new Map;return o.forEach(s=>{const a=s.end===t.end,l=E({},r,{pageInfo:E({},r.pageInfo,{hasNextPage:r.pageInfo?.hasNextPage!==void 0&&!a?!0:r.pageInfo?.hasNextPage,nextCursor:r.pageInfo?.nextCursor!==void 0&&!a?r.rows[s.end+1].id:r.pageInfo?.nextCursor}),rows:typeof s.start!="number"||typeof t.start!="number"?r.rows:r.rows.slice(s.start-t.start,s.end-t.start+1)});i.set(s,l)}),i};static mergeResponses=t=>t.length===1?t[0]:t.reduce((r,o)=>E({},o,{rows:[...r.rows,...o.rows]}),{rows:[],rowCount:0,pageInfo:{}})}const wke=["skipCache","keepChildrenExpanded"],Tke={clear:()=>{},get:()=>{},set:()=>{}};function Gj(e,t={}){return e===null?Tke:e??new iOe(t)}const Oke=(e,t,r={})=>{const o=S.useCallback(()=>{e.current.setStrategyAvailability(Ka.DataSource,Lc.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[i,s]=S.useState(e.current.getActiveStrategy(Ka.DataSource)),a=S.useMemo(()=>i===Lc.Default||i===Lc.GroupedData,[i]),l=He(e,mo),c=S.useRef(0),u=t.onDataSourceError,d=ai(()=>{if(!t.pagination)return new mO(l.pageSize);const k=t.pageSizeOptions.map(_=>typeof _=="number"?_:_.value).sort((_,D)=>_-D),M=Math.min(l.pageSize,k[0]);return new mO(M)}).current,[f,p]=S.useState(()=>Gj(t.dataSourceCache,r.cacheOptions)),h=S.useCallback(async(k,M)=>{const _=t.dataSource?.getRows;if(!_)return;if(k&&k!==gr&&t.signature!=="DataGrid"){r.fetchRowChildren?.([k]);return}r.clearDataSourceState?.();const D=M||{},{skipCache:A,keepChildrenExpanded:F}=D,I=ye(D,wke),N=E({},Cke(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),I),H=d.getCacheKeys(N).map(B=>f.get(B));if(!A&&H.every(B=>B!==void 0)){e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:mO.mergeResponses(H),fetchParams:N,options:{skipCache:A,keepChildrenExpanded:F}});return}(a||e.current.getRowsCount()===0)&&e.current.setLoading(!0);const $=c.current+1;c.current=$;try{const B=await _(N);d.splitResponse(N,B).forEach((U,V)=>f.set(V,U)),c.current===$&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:B,fetchParams:N,options:{skipCache:A,keepChildrenExpanded:F}})}catch(B){c.current===$&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:B,fetchParams:N,options:{skipCache:A,keepChildrenExpanded:F}}),typeof u=="function"?u(new sOe({message:B?.message,params:N,cause:B})):er(["MUI X: A call to `dataSource.getRows()` threw an error which was not handled because `onDataSourceError()` is missing.","To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.","For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling."],"error"))}finally{a&&c.current===$&&e.current.setLoading(!1)}},[d,f,e,a,t.dataSource?.getRows,u,r,t.signature]),b=S.useCallback(()=>{s(e.current.getActiveStrategy(Ka.DataSource))},[e]),g=S.useCallback(k=>{if("error"in k){e.current.setRows([]);return}const{response:M}=k;M.rowCount!==void 0&&e.current.setRowCount(M.rowCount),e.current.setRows(M.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:k.fetchParams,response:M},!0)},[e]),y=t.dataSource?.updateRow,v=r.handleEditRow,C=S.useCallback(async k=>{if(y)try{const M=await y(k);return typeof v=="function"?(v(k,M),M):(M&&!si(M,k.previousRow)&&e.current.dataSource.cache.clear(),e.current.updateNestedRows([M],[]),M)}catch(M){throw typeof u=="function"?u(new aOe({message:M?.message,params:k,cause:M})):er(["MUI X: A call to `dataSource.updateRow()` threw an error which was not handled because `onDataSourceError()` is missing.","To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.","For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling."],"error"),M}},[e,y,u,v]),O={dataSource:{fetchRows:h,cache:f,editRow:C}},T=S.useMemo(()=>wa(h,0),[h]),P=S.useRef(!0);return S.useEffect(()=>{if(P.current){P.current=!1;return}if(t.dataSourceCache===void 0)return;const k=Gj(t.dataSourceCache,r.cacheOptions);p(M=>M!==k?k:M)},[t.dataSourceCache,r.cacheOptions]),S.useEffect(()=>{if(!(i!==Lc.Default&&i!==Lc.LazyLoading&&i!==Lc.GroupedData))return t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows()),()=>{c.current+=1}},[e,t.dataSource,i]),{api:{public:O},debouncedFetchRows:T,strategyProcessor:{strategyName:Lc.Default,group:"dataSourceRowsUpdate",processor:g},setStrategyAvailability:o,cacheChunkManager:d,cache:f,events:{strategyAvailabilityChange:b,sortModelChange:ni(a,()=>T()),filterModelChange:ni(a,()=>T()),paginationModelChange:ni(a,()=>T())}}},Pke=(e,t)=>{const{api:r,strategyProcessor:o,events:i,setStrategyAvailability:s}=Oke(e,t);Gt(e,r.public,"public"),Qh(e,o.strategyName,o.group,o.processor),Object.entries(i).forEach(([a,l])=>{ct(e,a,l)}),S.useEffect(()=>{s()},[s])},Eke=(e,t,r)=>{zEe(e,t),HIe(e,t),LIe(e),eo(VEe,e,t),eo(jIe,e,t),eo(XEe,e,t),eo(AIe,e,t),eo(xIe,e,t),eo(RIe,e,t),eo(pIe,e,t),eo(zIe,e,t),eo(CIe,e,t),eo(cIe,e,t),eo(yke,e,t),eo(eIe,e,t),eo(dke,e,t),eo(YEe,e,t),eo(nke,e,t),eo(QTe,e,t),eo(KIe,e,t),eo(xOe,e,t),eo(xke,e,t),bIe(e,t),BIe(e,t),QEe(e,t),DIe(e,t,r),vke(e,t),$Ie(e,t,r),eke(e),rke(e,t),MIe(e,t,r),hIe(e,t),wIe(e,t),fIe(e,t,r),qIe(e,t),tIe(e,t),pke(e,t),SIe(e,t),UIe(e,t),ZEe(e),rIe(e,t),lIe(e,t),KEe(e,t),ZIe(e,t),GIe(e,t),JIe(e),JTe(e,t),Ske(e,t),Pke(e,t),Mu(()=>{e.current.runAppliersForPendingProcessors()}),S.useEffect(()=>{e.current.runAppliersForPendingProcessors()})},Ike=e=>{const{classes:t,headerAlign:r,isDragging:o,isLastColumn:i,showLeftBorder:s,showRightBorder:a,groupId:l,pinnedPosition:c}=e,u={root:["columnHeader",r==="left"&&"columnHeader--alignLeft",r==="center"&&"columnHeader--alignCenter",r==="right"&&"columnHeader--alignRight",o&&"columnHeader--moving",a&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder","withBorderColor",l===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",c===nn.LEFT&&"columnHeader--pinnedLeft",c===nn.RIGHT&&"columnHeader--pinnedRight",i&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Ie(u,Wt,t)};function kke(e){const{groupId:t,width:r,depth:o,maxDepth:i,fields:s,height:a,colIndex:l,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:f,pinnedOffset:p}=e,h=nt(),b=In(),g=S.useRef(null),y=Nt(),v=He(y,UU),C=t?v[t]:{},{headerName:O=t??"",description:T="",headerAlign:P=void 0}=C;let k;const M=t&&v[t]?.renderHeaderGroup,_=S.useMemo(()=>({groupId:t,headerName:O,description:T,depth:o,maxDepth:i,fields:s,colIndex:l,isLastColumn:d}),[t,O,T,o,i,s,l,d]);t&&M&&(k=M(_));const D=E({},e,{classes:h.classes,headerAlign:P,depth:o,isDragging:!1}),A=O??t,F=Ht(),I=t===null?`empty-group-cell-${F}`:t,N=Ike(D);S.useLayoutEffect(()=>{if(c){const U=g.current.querySelector('[tabindex="0"]')||g.current;if(!U)return;if(AS())U.focus({preventScroll:!0});else{const V=y.current.getScrollPosition();U.focus(),y.current.scroll(V)}}},[y,c]);const j=S.useCallback(q=>U=>{Km(U)||y.current.publishEvent(q,_,U)},[y,_]),H=S.useMemo(()=>({onKeyDown:j("columnGroupHeaderKeyDown"),onFocus:j("columnGroupHeaderFocus"),onBlur:j("columnGroupHeaderBlur")}),[j]),$=typeof C.headerClassName=="function"?C.headerClassName(_):C.headerClassName,B=S.useMemo(()=>DS(E({},e.style),b,f,p),[f,p,e.style,b]);return w.jsx(Ck,E({ref:g,classes:N,columnMenuOpen:!1,colIndex:l,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:k,headerClassName:$,description:T,elementId:I,width:r,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:A,"aria-colspan":s.length,"data-fields":`|-${s.join("-|-")}-|`,style:B},H))}const Wj={root:fe.scrollbarFiller,pinnedRight:fe["scrollbarFiller--pinnedRight"]};function Rke({pinnedRight:e}){return w.jsx("div",{role:"presentation",className:Te(Wj.root,e&&Wj.pinnedRight)})}const Kj=ie("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),Mke=e=>{const{visibleColumns:t,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:s,columnHeaderFocus:a,columnGroupHeaderFocus:l,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:p}=e,[h,b]=S.useState(""),[g,y]=S.useState(""),v=li(),C=nt(),O=He(v,qU),T=He(v,ku),P=He(v,rOe),k=He(v,xS),M=He(v,pl),_=r9(T,P,k.left.length),D=He(v,VI),A=He(v,M4),F=He(v,sSe),I=He(v,aSe),N=He(v,A4),j=S.useCallback(te=>y(te.field),[]),H=S.useCallback(()=>y(""),[]),$=S.useCallback(te=>b(te.field),[]),B=S.useCallback(()=>b(""),[]),q=S.useMemo(()=>k.left.length?{firstColumnIndex:0,lastColumnIndex:k.left.length}:null,[k.left.length]),U=S.useMemo(()=>k.right.length?{firstColumnIndex:t.length-k.right.length,lastColumnIndex:t.length}:null,[k.right.length,t.length]);ct(v,"columnResizeStart",j),ct(v,"columnResizeStop",H),ct(v,"columnHeaderDragStart",$),ct(v,"columnHeaderDragEndNative",B);const V=te=>{const{renderContext:ce=P}=te||{},me=ce.firstColumnIndex,re=Math.min(ce.lastColumnIndex,t.length);return{renderedColumns:t.slice(me,re),firstColumnToRender:me,lastColumnToRender:re}},L=(te,ce,me,re=!1)=>{const se=te?.position===nn.RIGHT,le=te?.position===void 0,Q=k.right.length>0&&se||k.right.length===0&&le,Ce=_-me;return w.jsxs(S.Fragment,{children:[le&&w.jsx("div",{role:"presentation",style:{width:Ce}}),ce,le&&w.jsx("div",{role:"presentation",className:Te(fe.filler,re&&fe["filler--borderBottom"])}),Q&&w.jsx(Rke,{pinnedRight:se})]})};process.env.NODE_ENV!=="production"&&(L.displayName="getFillers");const G=(te,ce={})=>{const{renderedColumns:me,firstColumnToRender:re}=V(te),se=[];for(let le=0;le<me.length;le+=1){const Q=me[le],Ce=re+le,ge=Ce===0,Se=i!==null&&i.field===Q.field||ge&&!p?0:-1,xe=a!==null&&a.field===Q.field,W=u.open&&u.field===Q.field,K=te?.position,ne=Oh(K,Q.computedWidth,Ce,T,D,N),ae=K===nn.RIGHT?me[le-1]:me[le+1],de=ae?a!==null&&a.field===ae.field:!1,pe=le,Pe=me.length,Me=Dx(K,pe,C.showColumnVerticalBorder,C.pinnedColumnsSectionSeparator),ze=Ax(K,pe,Pe,C.showColumnVerticalBorder,A,C.pinnedColumnsSectionSeparator);se.push(w.jsx($1e,E({},r[Q.field],{columnMenuOpen:W,filterItemsCounter:o[Q.field]&&o[Q.field].length,headerHeight:F,isDragging:Q.field===h,colDef:Q,colIndex:Ce,isResizing:g===Q.field,isLast:Ce===T.length-1,hasFocus:xe,tabIndex:Se,pinnedPosition:K,pinnedOffset:ne,isSiblingFocused:de,showLeftBorder:Me,showRightBorder:ze},ce),Q.field))}return L(te,se,0)},Z=()=>w.jsxs(Kj,{role:"row","aria-rowindex":c+1,ownerState:C,className:fe["row--borderBottom"],style:{height:F},children:[q&&G({position:nn.LEFT,renderContext:q},{disableReorder:!0}),G({renderContext:P}),U&&G({position:nn.RIGHT,renderContext:U},{disableReorder:!0,separatorSide:Sk.Left})]});process.env.NODE_ENV!=="production"&&(Z.displayName="getColumnHeadersRow");const X=({depth:te,params:ce})=>{const me=V(ce);if(me.renderedColumns.length===0)return null;const{firstColumnToRender:re,lastColumnToRender:se}=me,le=f[te],Q=t[re].field,Ce=O[Q]?.[te]??null,ge=le.findIndex(({groupId:Me,columnFields:ze})=>Me===Ce&&ze.includes(Q)),Se=t[se-1].field,xe=O[Se]?.[te]??null,W=le.findIndex(({groupId:Me,columnFields:ze})=>Me===xe&&ze.includes(Se)),K=le.slice(ge,W+1).map(Me=>E({},Me,{columnFields:Me.columnFields.filter(ze=>d[ze]!==!1)})).filter(Me=>Me.columnFields.length>0),ne=K[0].columnFields.indexOf(Q),de=K[0].columnFields.slice(0,ne).reduce((Me,ze)=>{const We=M[ze];return Me+(We.computedWidth??0)},0);let pe=re;const Pe=K.map(({groupId:Me,columnFields:ze},We)=>{const ut=l!==null&&l.depth===te&&ze.includes(l.field),St=s!==null&&s.depth===te&&ze.includes(s.field)?0:-1,Fe={width:ze.reduce((st,yt)=>st+M[yt].computedWidth,0),fields:ze,colIndex:pe},Xe=ce.position,Ae=Oh(Xe,Fe.width,pe,T,D,N);pe+=ze.length;let Qe=We;return Xe===nn.LEFT&&(Qe=pe-1),w.jsx(kke,{groupId:Me,width:Fe.width,fields:Fe.fields,colIndex:Fe.colIndex,depth:te,isLastColumn:We===K.length-1,maxDepth:c,height:I,hasFocus:ut,tabIndex:St,pinnedPosition:Xe,pinnedOffset:Ae,showLeftBorder:Dx(Xe,Qe,C.showColumnVerticalBorder,C.pinnedColumnsSectionSeparator),showRightBorder:Ax(Xe,Qe,K.length,C.showColumnVerticalBorder,A,C.pinnedColumnsSectionSeparator)},We)});return L(ce,Pe,de)};return{renderContext:P,leftRenderContext:q,rightRenderContext:U,pinnedColumns:k,visibleColumns:t,columnPositions:T,getFillers:L,getColumnHeadersRow:Z,getColumnsToRender:V,getColumnGroupHeadersRows:()=>{if(c===0)return null;const te=[];for(let ce=0;ce<c;ce+=1)te.push(w.jsxs(Kj,{role:"row","aria-rowindex":ce+1,ownerState:C,style:{height:I},children:[q&&X({depth:ce,params:{position:nn.LEFT,renderContext:q,maxLastColumn:q.lastColumnIndex}}),X({depth:ce,params:{renderContext:P}}),U&&X({depth:ce,params:{position:nn.RIGHT,renderContext:U,maxLastColumn:U.lastColumnIndex}})]},ce));return te},getPinnedCellOffset:Oh,isDragging:!!h,getInnerProps:()=>({role:"rowgroup"})}},Ake=["className"],Dke=e=>{const{classes:t}=e;return Ie({root:["columnHeaders"]},Wt,t)},_ke=ul("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),n6=Ot(function(t,r){const{className:o}=t,i=ye(t,Ake),s=nt(),a=Dke(s);return w.jsx(_ke,E({className:Te(a.root,o),ownerState:s},i,{role:"presentation",ref:r}))});process.env.NODE_ENV!=="production"&&(n6.displayName="GridBaseColumnHeaders");const Nke=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],Yk=Ot(function(t,r){const{visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:l,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:f,columnVisibility:p,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:b}=t,g=ye(t,Nke),{getInnerProps:y,getColumnHeadersRow:v,getColumnGroupHeadersRows:C}=Mke({visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:l,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:f,columnVisibility:p,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:b});return w.jsxs(n6,E({},g,y(),{ref:r,children:[C(),v()]}))});process.env.NODE_ENV!=="production"&&(Yk.displayName="GridColumnHeaders");process.env.NODE_ENV!=="production"&&(Yk.propTypes={columnGroupHeaderFocus:n.shape({depth:n.number.isRequired,field:n.string.isRequired}),columnGroupHeaderTabIndexState:n.shape({depth:n.number.isRequired,field:n.string.isRequired}),columnGroupsHeaderStructure:n.arrayOf(n.arrayOf(n.shape({columnFields:n.arrayOf(n.string).isRequired,groupId:n.string}))).isRequired,columnHeaderFocus:n.shape({field:n.string.isRequired}),columnHeaderTabIndexState:n.shape({field:n.string.isRequired}),columnMenuState:n.shape({field:n.string,open:n.bool.isRequired}).isRequired,columnVisibility:n.object.isRequired,filterColumnLookup:n.object.isRequired,hasOtherElementInTabSequence:n.bool.isRequired,headerGroupingMaxDepth:n.number.isRequired,sortColumnLookup:n.object.isRequired,visibleColumns:n.arrayOf(n.object).isRequired});const Fke=fl(Yk);function Lke(e){return null}function $ke(e){return null}const r6=Ot(function(t,r){const i=Nt().current.getLocaleText("noResultsOverlayLabel");return w.jsx(np,E({},t,{ref:r,children:i}))});process.env.NODE_ENV!=="production"&&(r6.displayName="GridNoResultsOverlay");const jke=()=>Ie({root:["bottomContainer"]},Wt,{}),Bke=ie("div",{slot:"internal",shouldForwardProp:void 0})({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function Vke(e){const t=jke();return w.jsx(Bke,E({},e,{className:Te(t.root,fe["container--bottom"]),role:"presentation"}))}const Hke=E({},M0e,{cell:$Oe,skeletonCell:qOe,columnHeaderFilterIconButton:I9,columnHeaderSortIcon:E9,columnMenu:Ym,columnHeaders:Fke,detailPanels:Lke,bottomContainer:Vke,footer:Vk,footerRowCount:Uk,toolbar:G9,pinnedRows:$ke,loadingOverlay:Hk,noResultsOverlay:r6,noRowsOverlay:zk,noColumnsOverlay:qk,pagination:Y9,filterPanel:Ik,columnsPanel:tPe,columnsManagement:j9,panel:Ek,row:PEe}),zke={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},qke=e=>E({},zke,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}),Uke=Hke,Gke=e=>{const t=vr(),r=S.useMemo(()=>mE({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),o=S.useMemo(()=>E({},ySe,r.localeText),[r.localeText]),i=S.useMemo(()=>ROe({defaultSlots:Uke,slots:r.slots}),[r.slots]),s=S.useMemo(()=>Object.keys(kx).reduce((a,l)=>(a[l]=r[l]??kx[l],a),{}),[r]);return S.useMemo(()=>E({},r,s,{localeText:o,slots:i},qke(r)),[r,o,i,s])};class Wke{maxListeners=20;warnOnce=!1;events={};on(t,r,o={}){let i=this.events[t];if(i||(i={highPriority:new Map,regular:new Map},this.events[t]=i),o.isFirst?i.highPriority.set(r,!0):i.regular.set(r,!0),process.env.NODE_ENV!=="production"){const s=i.highPriority.size+i.regular.size;s>this.maxListeners&&!this.warnOnce&&(this.warnOnce=!0,console.warn([`Possible EventEmitter memory leak detected. ${s} ${t} listeners added.`].join(`
400
400
  `)))}}removeListener(t,r){this.events[t]&&(this.events[t].regular.delete(r),this.events[t].highPriority.delete(r))}removeAllListeners(){this.events={}}emit(t,...r){const o=this.events[t];if(!o)return;const i=Array.from(o.highPriority.keys()),s=Array.from(o.regular.keys());for(let a=i.length-1;a>=0;a-=1){const l=i[a];o.highPriority.has(l)&&l.apply(this,r)}for(let a=0;a<s.length;a+=1){const l=s[a];o.regular.has(l)&&l.apply(this,r)}}once(t,r){const o=this;this.on(t,function i(...s){o.removeListener(t,i),r.apply(o,s)})}}const o6=Symbol("mui.api_private"),Kke=e=>e.isPropagationStopped!==void 0;let Yj=0;function Yke(e){const t=e.current?.[o6];if(t)return t;const r={},o={state:r,store:jm.create(r),instanceId:{id:Yj}};return Yj+=1,o.getPublicApi=()=>e.current,o.register=(i,s)=>{Object.keys(s).forEach(a=>{const l=s[a],c=o[a];if(c?.spying===!0?c.target=l:o[a]=l,i==="public"){const u=e.current,d=u[a];d?.spying===!0?d.target=l:u[a]=l}})},o.register("private",{caches:{},eventManager:new Wke}),o}function Zke(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[o6]:e.current}}function Xke(e,t){const r=S.useRef(null),o=S.useRef(null);o.current||(o.current=Yke(r)),r.current||(r.current=Zke(o));const i=S.useCallback((...a)=>{const[l,c,u={}]=a;if(u.defaultMuiPrevented=!1,Kke(u)&&u.isPropagationStopped())return;const d=t.signature===Es.DataGridPro||t.signature===Es.DataGridPremium?{api:o.current.getPublicApi()}:{};o.current.eventManager.emit(l,c,u,d)},[o,t.signature]),s=S.useCallback((a,l,c)=>{o.current.eventManager.on(a,l,c);const u=o.current;return()=>{u.eventManager.removeListener(a,l)}},[o]);return Gt(o,{subscribeEvent:s,publishEvent:i},"public"),e&&!e.current?.state&&(e.current=r.current),S.useImperativeHandle(e,()=>r.current,[r]),S.useEffect(()=>{const a=o.current;return()=>{a.publishEvent("unmount")}},[o]),o}const Zj={hooks:{useCSSVariables:_xe,useGridAriaAttributes:EEe,useGridRowAriaAttributes:IEe,useGridRowsOverridableMethods:kEe,useGridParamsOverridableMethods:REe,useIsCellEditable:MEe,useCellAggregationResult:()=>null,useFilterValueGetter:e=>e.current.getRowValue}},Zk=function(t,r){const o=Gke(t),i=Xke(o.apiRef,o);return Eke(i,o,Zj),process.env.NODE_ENV!=="production"&&AOe(o,MOe),w.jsx(AEe,{privateApiRef:i,configuration:Zj,props:o,children:w.jsx(e1e,E({className:o.className,style:o.style,sx:o.sx},o.slotProps?.root,{ref:r}))})};process.env.NODE_ENV!=="production"&&(Zk.displayName="DataGridRaw");const i6=S.memo(Ot(Zk));process.env.NODE_ENV!=="production"&&(i6.displayName="DataGrid");Zk.propTypes={apiRef:n.shape({current:n.object}),"aria-label":n.string,"aria-labelledby":n.string,autoHeight:n.bool,autoPageSize:n.bool,autosizeOnMount:n.bool,autosizeOptions:n.shape({columns:n.arrayOf(n.string),disableColumnVirtualization:n.bool,expand:n.bool,includeHeaders:n.bool,includeOutliers:n.bool,outliersFactor:n.number}),cellModesModel:n.object,checkboxSelection:n.bool,classes:n.object,className:n.string,clipboardCopyCellDelimiter:n.string,columnBufferPx:n.number,columnFilterDebounceMs:n.number,columnGroupHeaderHeight:n.number,columnGroupingModel:n.arrayOf(n.object),columnHeaderHeight:n.number,columns:n.arrayOf(n.object).isRequired,columnVisibilityModel:n.object,dataSource:n.shape({getRows:n.func.isRequired,updateRow:n.func}),dataSourceCache:n.shape({clear:n.func.isRequired,get:n.func.isRequired,set:n.func.isRequired}),density:n.oneOf(["comfortable","compact","standard"]),disableAutosize:n.bool,disableColumnFilter:n.bool,disableColumnMenu:n.bool,disableColumnResize:n.bool,disableColumnSelector:n.bool,disableColumnSorting:n.bool,disableDensitySelector:n.bool,disableEval:n.bool,disableMultipleRowSelection:n.bool,disableRowSelectionExcludeModel:n.bool,disableRowSelectionOnClick:n.bool,disableVirtualization:n.bool,editMode:n.oneOf(["cell","row"]),estimatedRowCount:n.number,experimentalFeatures:n.shape({warnIfFocusStateIsNotSynced:n.bool}),filterDebounceMs:n.number,filterMode:n.oneOf(["client","server"]),filterModel:n.shape({items:n.arrayOf(n.shape({field:n.string.isRequired,id:n.oneOfType([n.number,n.string]),operator:n.string.isRequired,value:n.any})).isRequired,logicOperator:n.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:n.bool,quickFilterLogicOperator:n.oneOf(["and","or"]),quickFilterValues:n.array}),getCellClassName:n.func,getDetailPanelContent:n.func,getEstimatedRowHeight:n.func,getRowClassName:n.func,getRowHeight:n.func,getRowId:n.func,getRowSpacing:n.func,hideFooter:n.bool,hideFooterPagination:n.bool,hideFooterSelectedRowCount:n.bool,ignoreDiacritics:n.bool,ignoreValueFormatterDuringExport:n.oneOfType([n.shape({clipboardExport:n.bool,csvExport:n.bool}),n.bool]),initialState:n.object,isCellEditable:n.func,isRowSelectable:n.func,keepNonExistentRowsSelected:n.bool,label:n.string,loading:n.bool,localeText:n.object,logger:n.shape({debug:n.func.isRequired,error:n.func.isRequired,info:n.func.isRequired,warn:n.func.isRequired}),logLevel:n.oneOf(["debug","error","info","warn",!1]),nonce:n.string,onCellClick:n.func,onCellDoubleClick:n.func,onCellEditStart:n.func,onCellEditStop:n.func,onCellKeyDown:n.func,onCellModesModelChange:n.func,onClipboardCopy:n.func,onColumnHeaderClick:n.func,onColumnHeaderContextMenu:n.func,onColumnHeaderDoubleClick:n.func,onColumnHeaderEnter:n.func,onColumnHeaderLeave:n.func,onColumnHeaderOut:n.func,onColumnHeaderOver:n.func,onColumnOrderChange:n.func,onColumnResize:n.func,onColumnVisibilityModelChange:n.func,onColumnWidthChange:n.func,onDataSourceError:n.func,onDensityChange:n.func,onFilterModelChange:n.func,onMenuClose:n.func,onMenuOpen:n.func,onPaginationMetaChange:n.func,onPaginationModelChange:n.func,onPreferencePanelClose:n.func,onPreferencePanelOpen:n.func,onProcessRowUpdateError:n.func,onResize:n.func,onRowClick:n.func,onRowCountChange:n.func,onRowDoubleClick:n.func,onRowEditStart:n.func,onRowEditStop:n.func,onRowModesModelChange:n.func,onRowSelectionModelChange:n.func,onSortModelChange:n.func,onStateChange:n.func,pageSizeOptions:n.arrayOf(n.oneOfType([n.number,n.shape({label:n.string.isRequired,value:n.number.isRequired})]).isRequired),pagination:n.oneOf([!0]),paginationMeta:n.shape({hasNextPage:n.bool}),paginationMode:n.oneOf(["client","server"]),paginationModel:n.shape({page:n.number.isRequired,pageSize:n.number.isRequired}),processRowUpdate:n.func,resizeThrottleMs:n.number,rowBufferPx:n.number,rowCount:n.number,rowHeight:n.number,rowModesModel:n.object,rows:n.arrayOf(n.object),rowSelection:n.bool,rowSelectionModel:n.shape({ids:n.instanceOf(Set).isRequired,type:n.oneOf(["exclude","include"]).isRequired}),rowSpacingType:n.oneOf(["border","margin"]),rowSpanning:n.bool,scrollbarSize:n.number,showCellVerticalBorder:n.bool,showColumnVerticalBorder:n.bool,showToolbar:n.bool,slotProps:n.object,slots:n.object,sortingMode:n.oneOf(["client","server"]),sortingOrder:n.arrayOf(n.oneOf(["asc","desc"])),sortModel:n.arrayOf(n.shape({field:n.string.isRequired,sort:n.oneOf(["asc","desc"])})),style:n.object,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object]),virtualizeColumnsWithAutoRowHeight:n.bool};function Qke({attributes:e={}}){const{MuiAttributes:t={},container:r={}}=e;return w.jsx("div",{...r,children:w.jsx(i6,{...t})})}var zv={exports:{}},Jke=zv.exports,Xj;function eRe(){return Xj||(Xj=1,(function(e,t){(function(r,o){e.exports=o()})(Jke,(function(){var r=1e3,o=6e4,i=36e5,s="millisecond",a="second",l="minute",c="hour",u="day",d="week",f="month",p="quarter",h="year",b="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var H=["th","st","nd","rd"],$=j%100;return"["+j+(H[($-20)%10]||H[$]||H[0])+"]"}},O=function(j,H,$){var B=String(j);return!B||B.length>=H?j:""+Array(H+1-B.length).join($)+j},T={s:O,z:function(j){var H=-j.utcOffset(),$=Math.abs(H),B=Math.floor($/60),q=$%60;return(H<=0?"+":"-")+O(B,2,"0")+":"+O(q,2,"0")},m:function j(H,$){if(H.date()<$.date())return-j($,H);var B=12*($.year()-H.year())+($.month()-H.month()),q=H.clone().add(B,f),U=$-q<0,V=H.clone().add(B+(U?-1:1),f);return+(-(B+($-q)/(U?q-V:V-q))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:f,y:h,w:d,d:u,D:b,h:c,m:l,s:a,ms:s,Q:p}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},P="en",k={};k[P]=C;var M="$isDayjsObject",_=function(j){return j instanceof I||!(!j||!j[M])},D=function j(H,$,B){var q;if(!H)return P;if(typeof H=="string"){var U=H.toLowerCase();k[U]&&(q=U),$&&(k[U]=$,q=U);var V=H.split("-");if(!q&&V.length>1)return j(V[0])}else{var L=H.name;k[L]=H,q=L}return!B&&q&&(P=q),q||!B&&P},A=function(j,H){if(_(j))return j.clone();var $=typeof H=="object"?H:{};return $.date=j,$.args=arguments,new I($)},F=T;F.l=D,F.i=_,F.w=function(j,H){return A(j,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var I=(function(){function j($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[M]=!0}var H=j.prototype;return H.parse=function($){this.$d=(function(B){var q=B.date,U=B.utc;if(q===null)return new Date(NaN);if(F.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var V=q.match(y);if(V){var L=V[2]-1||0,G=(V[7]||"0").substring(0,3);return U?new Date(Date.UTC(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)):new Date(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)}}return new Date(q)})($),this.init()},H.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},H.$utils=function(){return F},H.isValid=function(){return this.$d.toString()!==g},H.isSame=function($,B){var q=A($);return this.startOf(B)<=q&&q<=this.endOf(B)},H.isAfter=function($,B){return A($)<this.startOf(B)},H.isBefore=function($,B){return this.endOf(B)<A($)},H.$g=function($,B,q){return F.u($)?this[B]:this.set(q,$)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function($,B){var q=this,U=!!F.u(B)||B,V=F.p($),L=function(re,se){var le=F.w(q.$u?Date.UTC(q.$y,se,re):new Date(q.$y,se,re),q);return U?le:le.endOf(u)},G=function(re,se){return F.w(q.toDate()[re].apply(q.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(se)),q)},Z=this.$W,X=this.$M,J=this.$D,te="set"+(this.$u?"UTC":"");switch(V){case h:return U?L(1,0):L(31,11);case f:return U?L(1,X):L(0,X+1);case d:var ce=this.$locale().weekStart||0,me=(Z<ce?Z+7:Z)-ce;return L(U?J-me:J+(6-me),X);case u:case b:return G(te+"Hours",0);case c:return G(te+"Minutes",1);case l:return G(te+"Seconds",2);case a:return G(te+"Milliseconds",3);default:return this.clone()}},H.endOf=function($){return this.startOf($,!1)},H.$set=function($,B){var q,U=F.p($),V="set"+(this.$u?"UTC":""),L=(q={},q[u]=V+"Date",q[b]=V+"Date",q[f]=V+"Month",q[h]=V+"FullYear",q[c]=V+"Hours",q[l]=V+"Minutes",q[a]=V+"Seconds",q[s]=V+"Milliseconds",q)[U],G=U===u?this.$D+(B-this.$W):B;if(U===f||U===h){var Z=this.clone().set(b,1);Z.$d[L](G),Z.init(),this.$d=Z.set(b,Math.min(this.$D,Z.daysInMonth())).$d}else L&&this.$d[L](G);return this.init(),this},H.set=function($,B){return this.clone().$set($,B)},H.get=function($){return this[F.p($)]()},H.add=function($,B){var q,U=this;$=Number($);var V=F.p(B),L=function(X){var J=A(U);return F.w(J.date(J.date()+Math.round(X*$)),U)};if(V===f)return this.set(f,this.$M+$);if(V===h)return this.set(h,this.$y+$);if(V===u)return L(1);if(V===d)return L(7);var G=(q={},q[l]=o,q[c]=i,q[a]=r,q)[V]||1,Z=this.$d.getTime()+$*G;return F.w(Z,this)},H.subtract=function($,B){return this.add(-1*$,B)},H.format=function($){var B=this,q=this.$locale();if(!this.isValid())return q.invalidDate||g;var U=$||"YYYY-MM-DDTHH:mm:ssZ",V=F.z(this),L=this.$H,G=this.$m,Z=this.$M,X=q.weekdays,J=q.months,te=q.meridiem,ce=function(se,le,Q,Ce){return se&&(se[le]||se(B,U))||Q[le].slice(0,Ce)},me=function(se){return F.s(L%12||12,se,"0")},re=te||function(se,le,Q){var Ce=se<12?"AM":"PM";return Q?Ce.toLowerCase():Ce};return U.replace(v,(function(se,le){return le||(function(Q){switch(Q){case"YY":return String(B.$y).slice(-2);case"YYYY":return F.s(B.$y,4,"0");case"M":return Z+1;case"MM":return F.s(Z+1,2,"0");case"MMM":return ce(q.monthsShort,Z,J,3);case"MMMM":return ce(J,Z);case"D":return B.$D;case"DD":return F.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return ce(q.weekdaysMin,B.$W,X,2);case"ddd":return ce(q.weekdaysShort,B.$W,X,3);case"dddd":return X[B.$W];case"H":return String(L);case"HH":return F.s(L,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return re(L,G,!0);case"A":return re(L,G,!1);case"m":return String(G);case"mm":return F.s(G,2,"0");case"s":return String(B.$s);case"ss":return F.s(B.$s,2,"0");case"SSS":return F.s(B.$ms,3,"0");case"Z":return V}return null})(se)||V.replace(":","")}))},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function($,B,q){var U,V=this,L=F.p(B),G=A($),Z=(G.utcOffset()-this.utcOffset())*o,X=this-G,J=function(){return F.m(V,G)};switch(L){case h:U=J()/12;break;case f:U=J();break;case p:U=J()/3;break;case d:U=(X-Z)/6048e5;break;case u:U=(X-Z)/864e5;break;case c:U=X/i;break;case l:U=X/o;break;case a:U=X/r;break;default:U=X}return q?U:F.a(U)},H.daysInMonth=function(){return this.endOf(f).$D},H.$locale=function(){return k[this.$L]},H.locale=function($,B){if(!$)return this.$L;var q=this.clone(),U=D($,B,!0);return U&&(q.$L=U),q},H.clone=function(){return F.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},j})(),N=I.prototype;return A.prototype=N,[["$ms",s],["$s",a],["$m",l],["$H",c],["$W",u],["$M",f],["$y",h],["$D",b]].forEach((function(j){N[j[1]]=function(H){return this.$g(H,j[0],j[1])}})),A.extend=function(j,H){return j.$i||(j(H,I,A),j.$i=!0),A},A.locale=D,A.isDayjs=_,A.unix=function(j){return A(1e3*j)},A.en=k[P],A.Ls=k,A.p={},A}))})(zv)),zv.exports}var tRe=eRe();const mr=Fs(tRe);var qv={exports:{}},nRe=qv.exports,Qj;function rRe(){return Qj||(Qj=1,(function(e,t){(function(r,o){e.exports=o()})(nRe,(function(){var r="week",o="year";return function(i,s,a){var l=s.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=a(this).startOf(o).add(1,o).date(u),f=a(this).endOf(r);if(d.isBefore(f))return 1}var p=a(this).startOf(o).date(u).startOf(r).subtract(1,"millisecond"),h=this.diff(p,r,!0);return h<0?a(this).startOf("week").week():Math.ceil(h)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(qv)),qv.exports}var oRe=rRe();const iRe=Fs(oRe);var Uv={exports:{}},sRe=Uv.exports,Jj;function aRe(){return Jj||(Jj=1,(function(e,t){(function(r,o){e.exports=o()})(sRe,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},u=function(y){return(y=+y)+(y>68?1900:2e3)},d=function(y){return function(v){this[y]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var C=v.match(/([+-]|\d\d)/g),O=60*C[1]+(+C[2]||0);return O===0?0:C[0]==="+"?-O:O})(y)}],p=function(y){var v=c[y];return v&&(v.indexOf?v:v.s.concat(v.f))},h=function(y,v){var C,O=c.meridiem;if(O){for(var T=1;T<=24;T+=1)if(y.indexOf(O(T,0,v))>-1){C=T>12;break}}else C=y===(v?"pm":"PM");return C},b={A:[l,function(y){this.afternoon=h(y,!1)}],a:[l,function(y){this.afternoon=h(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[s,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[a,d("seconds")],ss:[a,d("seconds")],m:[a,d("minutes")],mm:[a,d("minutes")],H:[a,d("hours")],h:[a,d("hours")],HH:[a,d("hours")],hh:[a,d("hours")],D:[a,d("day")],DD:[s,d("day")],Do:[l,function(y){var v=c.ordinal,C=y.match(/\d+/);if(this.day=C[0],v)for(var O=1;O<=31;O+=1)v(O).replace(/\[|\]/g,"")===y&&(this.day=O)}],w:[a,d("week")],ww:[s,d("week")],M:[a,d("month")],MM:[s,d("month")],MMM:[l,function(y){var v=p("months"),C=(p("monthsShort")||v.map((function(O){return O.slice(0,3)}))).indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[l,function(y){var v=p("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,d("year")],YY:[s,function(y){this.year=u(y)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function g(y){var v,C;v=y,C=c&&c.formats;for(var O=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(A,F,I){var N=I&&I.toUpperCase();return F||C[I]||r[I]||C[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(j,H,$){return H||$.slice(1)}))}))).match(o),T=O.length,P=0;P<T;P+=1){var k=O[P],M=b[k],_=M&&M[0],D=M&&M[1];O[P]=D?{regex:_,parser:D}:k.replace(/^\[|\]$/g,"")}return function(A){for(var F={},I=0,N=0;I<T;I+=1){var j=O[I];if(typeof j=="string")N+=j.length;else{var H=j.regex,$=j.parser,B=A.slice(N),q=H.exec(B)[0];$.call(F,q),A=A.replace(q,"")}}return(function(U){var V=U.afternoon;if(V!==void 0){var L=U.hours;V?L<12&&(U.hours+=12):L===12&&(U.hours=0),delete U.afternoon}})(F),F}}return function(y,v,C){C.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var O=v.prototype,T=O.parse;O.parse=function(P){var k=P.date,M=P.utc,_=P.args;this.$u=M;var D=_[1];if(typeof D=="string"){var A=_[2]===!0,F=_[3]===!0,I=A||F,N=_[2];F&&(N=_[2]),c=this.$locale(),!A&&N&&(c=C.Ls[N]),this.$d=(function(B,q,U,V){try{if(["x","X"].indexOf(q)>-1)return new Date((q==="X"?1e3:1)*B);var L=g(q)(B),G=L.year,Z=L.month,X=L.day,J=L.hours,te=L.minutes,ce=L.seconds,me=L.milliseconds,re=L.zone,se=L.week,le=new Date,Q=X||(G||Z?1:le.getDate()),Ce=G||le.getFullYear(),ge=0;G&&!Z||(ge=Z>0?Z-1:le.getMonth());var Se,xe=J||0,W=te||0,K=ce||0,ne=me||0;return re?new Date(Date.UTC(Ce,ge,Q,xe,W,K,ne+60*re.offset*1e3)):U?new Date(Date.UTC(Ce,ge,Q,xe,W,K,ne)):(Se=new Date(Ce,ge,Q,xe,W,K,ne),se&&(Se=V(Se).week(se).toDate()),Se)}catch{return new Date("")}})(k,D,M,C),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),I&&k!=this.format(D)&&(this.$d=new Date("")),c={}}else if(D instanceof Array)for(var j=D.length,H=1;H<=j;H+=1){_[1]=D[H-1];var $=C.apply(this,_);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}H===j&&(this.$d=new Date(""))}else T.call(this,P)}}}))})(Uv)),Uv.exports}var lRe=aRe();const cRe=Fs(lRe);var Gv={exports:{}},uRe=Gv.exports,eB;function dRe(){return eB||(eB=1,(function(e,t){(function(r,o){e.exports=o()})(uRe,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(o,i,s){var a=i.prototype,l=a.format;s.en.formats=r,a.format=function(c){c===void 0&&(c="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,p){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(h,b,g){var y=g&&g.toUpperCase();return b||p[g]||r[g]||p[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(v,C,O){return C||O.slice(1)}))}))})(c,u===void 0?{}:u);return l.call(this,d)}}}))})(Gv)),Gv.exports}var fRe=dRe();const pRe=Fs(fRe);var Wv={exports:{}},hRe=Wv.exports,tB;function mRe(){return tB||(tB=1,(function(e,t){(function(r,o){e.exports=o()})(hRe,(function(){return function(r,o,i){o.prototype.isBetween=function(s,a,l,c){var u=i(s),d=i(a),f=(c=c||"()")[0]==="(",p=c[1]===")";return(f?this.isAfter(u,l):!this.isBefore(u,l))&&(p?this.isBefore(d,l):!this.isAfter(d,l))||(f?this.isBefore(u,l):!this.isAfter(u,l))&&(p?this.isAfter(d,l):!this.isBefore(d,l))}}}))})(Wv)),Wv.exports}var gRe=mRe();const bRe=Fs(gRe);var Kv={exports:{}},yRe=Kv.exports,nB;function vRe(){return nB||(nB=1,(function(e,t){(function(r,o){e.exports=o()})(yRe,(function(){return function(r,o){var i=o.prototype,s=i.format;i.format=function(a){var l=this,c=this.$locale();if(!this.isValid())return s.bind(this)(a);var u=this.$utils(),d=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return c.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return c.ordinal(l.week(),"W");case"w":case"ww":return u.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return s.bind(this)(d)}}}))})(Kv)),Kv.exports}var xRe=vRe();const SRe=Fs(xRe);mr.extend(pRe);mr.extend(iRe);mr.extend(bRe);mr.extend(SRe);const CRe={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},wRe={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},gO=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
401
401
  `),rB=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
402
- `);class Xk{isMUIAdapter=!0;isTimezoneCompatible=!0;lib="dayjs";escapedCharacters={start:"[",end:"]"};formatTokenMap=CRe;constructor({locale:t,formats:r}={}){this.locale=t,this.formats=E({},wRe,r),mr.extend(cRe)}setLocaleToValue=t=>{const r=this.getCurrentLocaleCode();return r===t.locale()?t:t.locale(r)};hasUTCPlugin=()=>typeof mr.utc<"u";hasTimezonePlugin=()=>typeof mr.tz<"u";isSame=(t,r,o)=>{const i=this.setTimezone(r,this.getTimezone(t));return t.format(o)===i.format(o)};cleanTimezone=t=>{switch(t){case"default":return;case"system":return mr.tz.guess();default:return t}};createSystemDate=t=>{let r;if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=mr.tz.guess();o==="UTC"?r=mr(t):r=mr.tz(t,o)}else r=mr(t);return this.setLocaleToValue(r)};createUTCDate=t=>{if(!this.hasUTCPlugin())throw new Error(gO);return this.setLocaleToValue(mr.utc(t))};createTZDate=(t,r)=>{if(!this.hasUTCPlugin())throw new Error(gO);if(!this.hasTimezonePlugin())throw new Error(rB);const o=t!==void 0&&!t.endsWith("Z");return this.setLocaleToValue(mr(t).tz(this.cleanTimezone(r),o))};getLocaleFormats=()=>{const t=mr.Ls,r=this.locale||"en";let o=t[r];return o===void 0&&(process.env.NODE_ENV!=="production"&&er(["MUI X: Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale."]),o=t.en),o.formats};adjustOffset=t=>{if(!this.hasTimezonePlugin())return t;const r=this.getTimezone(t);if(r!=="UTC"){const o=t.tz(this.cleanTimezone(r),!0);if(o.$offset===(t.$offset??0))return t;t.$offset=o.$offset}return t};date=(t,r="default")=>t===null?null:r==="UTC"?this.createUTCDate(t):r==="system"||r==="default"&&!this.hasTimezonePlugin()?this.createSystemDate(t):this.createTZDate(t,r);getInvalidDate=()=>mr(new Date("Invalid date"));getTimezone=t=>{if(this.hasTimezonePlugin()){const r=t.$x?.$timezone;if(r)return r}return this.hasUTCPlugin()&&t.isUTC()?"UTC":"system"};setTimezone=(t,r)=>{if(this.getTimezone(t)===r)return t;if(r==="UTC"){if(!this.hasUTCPlugin())throw new Error(gO);return t.utc()}if(r==="system")return t.local();if(!this.hasTimezonePlugin()){if(r==="default")return t;throw new Error(rB)}return this.setLocaleToValue(mr.tz(t,this.cleanTimezone(r)))};toJsDate=t=>t.toDate();parse=(t,r)=>t===""?null:mr(t,r,this.locale,!0);getCurrentLocaleCode=()=>this.locale||"en";is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||"");expandFormat=t=>{const r=this.getLocaleFormats(),o=i=>i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(s,a,l)=>a||l.slice(1));return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(i,s,a)=>{const l=a&&a.toUpperCase();return s||r[a]||o(r[l])})};isValid=t=>t==null?!1:t.isValid();format=(t,r)=>this.formatByString(t,this.formats[r]);formatByString=(t,r)=>this.setLocaleToValue(t).format(r);formatNumber=t=>t;isEqual=(t,r)=>t===null&&r===null?!0:t===null||r===null?!1:t.toDate().getTime()===r.toDate().getTime();isSameYear=(t,r)=>this.isSame(t,r,"YYYY");isSameMonth=(t,r)=>this.isSame(t,r,"YYYY-MM");isSameDay=(t,r)=>this.isSame(t,r,"YYYY-MM-DD");isSameHour=(t,r)=>t.isSame(r,"hour");isAfter=(t,r)=>t>r;isAfterYear=(t,r)=>this.hasUTCPlugin()?!this.isSameYear(t,r)&&t.utc()>r.utc():t.isAfter(r,"year");isAfterDay=(t,r)=>this.hasUTCPlugin()?!this.isSameDay(t,r)&&t.utc()>r.utc():t.isAfter(r,"day");isBefore=(t,r)=>t<r;isBeforeYear=(t,r)=>this.hasUTCPlugin()?!this.isSameYear(t,r)&&t.utc()<r.utc():t.isBefore(r,"year");isBeforeDay=(t,r)=>this.hasUTCPlugin()?!this.isSameDay(t,r)&&t.utc()<r.utc():t.isBefore(r,"day");isWithinRange=(t,[r,o])=>t>=r&&t<=o;startOfYear=t=>this.adjustOffset(t.startOf("year"));startOfMonth=t=>this.adjustOffset(t.startOf("month"));startOfWeek=t=>this.adjustOffset(this.setLocaleToValue(t).startOf("week"));startOfDay=t=>this.adjustOffset(t.startOf("day"));endOfYear=t=>this.adjustOffset(t.endOf("year"));endOfMonth=t=>this.adjustOffset(t.endOf("month"));endOfWeek=t=>this.adjustOffset(this.setLocaleToValue(t).endOf("week"));endOfDay=t=>this.adjustOffset(t.endOf("day"));addYears=(t,r)=>this.adjustOffset(t.add(r,"year"));addMonths=(t,r)=>this.adjustOffset(t.add(r,"month"));addWeeks=(t,r)=>this.adjustOffset(t.add(r,"week"));addDays=(t,r)=>this.adjustOffset(t.add(r,"day"));addHours=(t,r)=>this.adjustOffset(t.add(r,"hour"));addMinutes=(t,r)=>this.adjustOffset(t.add(r,"minute"));addSeconds=(t,r)=>this.adjustOffset(t.add(r,"second"));getYear=t=>t.year();getMonth=t=>t.month();getDate=t=>t.date();getHours=t=>t.hour();getMinutes=t=>t.minute();getSeconds=t=>t.second();getMilliseconds=t=>t.millisecond();setYear=(t,r)=>this.adjustOffset(t.set("year",r));setMonth=(t,r)=>this.adjustOffset(t.set("month",r));setDate=(t,r)=>this.adjustOffset(t.set("date",r));setHours=(t,r)=>this.adjustOffset(t.set("hour",r));setMinutes=(t,r)=>this.adjustOffset(t.set("minute",r));setSeconds=(t,r)=>this.adjustOffset(t.set("second",r));setMilliseconds=(t,r)=>this.adjustOffset(t.set("millisecond",r));getDaysInMonth=t=>t.daysInMonth();getWeekArray=t=>{const r=this.startOfWeek(this.startOfMonth(t)),o=this.endOfWeek(this.endOfMonth(t));let i=0,s=r;const a=[];for(;s<o;){const l=Math.floor(i/7);a[l]=a[l]||[],a[l].push(s),s=this.addDays(s,1),i+=1}return a};getWeekNumber=t=>t.week();getDayOfWeek(t){return t.day()+1}getYearRange=([t,r])=>{const o=this.startOfYear(t),i=this.endOfYear(r),s=[];let a=o;for(;this.isBefore(a,i);)s.push(a),a=this.addYears(a,1);return s}}function TRe(){const e=Ue.useRef(!0);return e.current?(e.current=!1,!0):e.current}function oa(e,t){const r=TRe();Ue.useEffect(()=>{if(!r)return e()},t)}function ORe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="DatePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}function PRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="DateTimePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}function ERe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="TimePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}const IRe=Pr(w.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank"),kRe=Pr(w.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckBox"),RRe=w.jsx(IRe,{fontSize:"small"}),MRe=w.jsx(kRe,{fontSize:"small"}),oB=(e=[],t="",r=!1,o=",")=>{try{const i=Array.isArray(e)?e:[];if(r){let s=[];if(Array.isArray(t))s=t;else if(typeof t=="string"&&t.trim()!==""){let l=o;t.includes(",")?l=",":t.includes(";")?l=";":t.includes(":")&&(l=":"),s=t.split(l).map(c=>c.trim())}const a=new Set(s);return i.filter(({value:l})=>a.has(l))}if(Array.isArray(t)){const s=t[0];return i.find(({value:a})=>a===s)}return i.find(({value:s})=>s===t)}catch(i){return console.error("getValue error:",i),r?[]:null}};function ARe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},options:i=[],MuiBoxAttributes:s={},id:a="",InputProps:l={}}=e,[c,u]=Ue.useState(()=>e?.value?oB(i,e?.value,o.multiple,e?.separator):o.multiple?[]:null);oa(()=>{u(e?.value?oB(i,e?.value,o.multiple,e?.separator):o.multiple?[]:null)},[e?.value,i]);const[d,f]=Ue.useState(!1),[p,h]=Ue.useState(""),b=O=>{let T=!0,P="";if(t?.validation){for(const k of t.validation)if(k.rule==="mandatory"&&(!O||Array.isArray(O)&&O.length===0)){T=!1,P=k.message||"Required";break}}return{isValid:T,message:P}},g=()=>(o.multiple&&(o.renderOption=(O,T={},{selected:P})=>w.jsxs("li",{...O,children:[w.jsx(gS,{icon:RRe,checkedIcon:MRe,style:{marginRight:8},checked:P,sx:kge(T.color||"")}),T.title||T.label||T.value]})),o),y=Ue.useCallback(O=>O?.value||O?.title||O?.label,[]),v=Ue.useCallback((O,T)=>{u(T);const P=b(T);f(!P.isValid),h(P.message);const k=e?.separator??";";if(T&&r){const M=o.multiple?T.map(y):y(T),_=o.multiple?M.join(k):M;r({id:a,value:_,option:T})}else r&&r({id:a,value:"",option:T})},[a,r,e?.separator,o.multiple,y,t.validation]),C=t?.validation?.some(O=>O.rule==="mandatory")||!1;return w.jsx(hS,{disablePortal:!1,...g(),options:i,value:c,onChange:v,onBlur:()=>{const O=b(c);f(!O.isValid),h(O.message)},PopperProps:{modifiers:[{name:"preventOverflow",options:{boundary:"window"}}]},renderInput:O=>{const T=PI(l),P={...O.InputProps,...T,startAdornment:w.jsxs(w.Fragment,{children:[T?.startAdornment,O.InputProps.startAdornment]}),endAdornment:w.jsxs(w.Fragment,{children:[T?.endAdornment,O.InputProps.endAdornment]})};return w.jsx(dl,{...O,...s,required:C,error:d,helperText:p,slotProps:{input:{...P,autoComplete:"new-password"}}})}})}function DRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},id:s=""}=e,[a,l]=Ue.useState(o.defaultChecked||!!e.value||!1),[c,u]=Ue.useState(!1),[d,f]=Ue.useState("");oa(()=>{l(!!e.value)},[e.value]);const p=t?.validation?.some(C=>C.rule==="mandatory")||!1,h=C=>{let O=!0,T="";if(t?.validation){for(const P of t.validation)if(P.rule==="mandatory"&&!C){O=!1,T=P.message||"Required";break}}return{isValid:O,message:T}},b=C=>{const O=C.target.checked;l(O);const T=h(O);u(!T.isValid),f(T.message),r&&r({id:s,value:O})},{label:g,...y}=i,v=p?w.jsxs("span",{children:[g,w.jsx("span",{"aria-hidden":"true",style:{color:"#d32f2f",marginLeft:2},children:"*"})]}):g;return w.jsxs(Ou,{required:p,error:c,component:"fieldset",children:[w.jsx($m,{...y,label:v,control:w.jsx(gS,{checked:a,onChange:b,required:p,...o,inputProps:{"aria-label":"controlled"}})}),d&&w.jsx(Uf,{children:d})]})}const _Re=ie(({color:e,...t})=>w.jsx(Gh,{...t}))(({theme:e,color:t})=>({"& .MuiSwitch-switchBase.Mui-checked":{color:t||"green","&:hover":{backgroundColor:io(t||"green",e.palette.action.hoverOpacity)}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:t||"green"}}));function NRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},color:s="",id:a=""}=e,[l,c]=Ue.useState(o.defaultValue||!!e.value||!1),[u,d]=Ue.useState(!1),[f,p]=Ue.useState("");oa(()=>{c(!!e.value)},[e.value]);const h=t?.validation?.some(M=>M.rule==="mandatory")||!1,b=M=>{let _=!0,D="";if(t?.validation){for(const A of t.validation)if(A.rule==="mandatory"&&!M){_=!1,D=A.message||"Required";break}}return{isValid:_,message:D}},g=M=>{const _=M.target.checked;c(_);const D=b(_);d(!D.isValid),p(D.message),r&&r({id:a,value:_})},y=s?_Re:Gh,{defaultChecked:v,...C}=o,{label:O,...T}=i,P=h?w.jsxs("span",{children:[O,w.jsx("span",{"aria-hidden":"true",style:{color:"#d32f2f",marginLeft:2},children:"*"})]}):O,k=s?{color:s}:{color:"primary"};return w.jsxs(Ou,{required:h,error:u,component:"fieldset",children:[w.jsx($m,{...T,label:P,control:w.jsx(y,{checked:l,onChange:g,required:h,...C,...k,inputProps:{"aria-label":"controlled"}})}),f&&w.jsx(Uf,{children:f})]})}const FRe=Pr(w.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),LRe=Pr(w.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),$Re=ie("span",{name:"MuiRadioButtonIcon",shouldForwardProp:Ho})({position:"relative",display:"flex"}),jRe=ie(FRe,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),BRe=ie(LRe,{name:"MuiRadioButtonIcon"})(Tt(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function Qk(e){const{checked:t=!1,classes:r={},fontSize:o}=e,i={...e,checked:t};return w.jsxs($Re,{className:r.root,ownerState:i,children:[w.jsx(jRe,{fontSize:o,className:r.background,ownerState:i}),w.jsx(BRe,{fontSize:o,className:r.dot,ownerState:i})]})}process.env.NODE_ENV!=="production"&&(Qk.propTypes={checked:n.bool,classes:n.object,fontSize:n.oneOf(["small","medium"])});const Jk=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jk.displayName="RadioGroupContext");function VRe(){return S.useContext(Jk)}function HRe(e){return Je("MuiRadio",e)}const iB=Ze("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),zRe=e=>{const{classes:t,color:r,size:o}=e,i={root:["root",`color${De(r)}`,o!=="medium"&&`size${De(o)}`]};return{...t,...Ie(i,HRe,t)}},qRe=ie(mS,{shouldForwardProp:e=>Ho(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size!=="medium"&&t[`size${De(r.size)}`],t[`color${De(r.color)}`]]}})(Tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${iB.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ur()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ur()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${iB.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function URe(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const GRe=w.jsx(Qk,{checked:!0}),WRe=w.jsx(Qk,{}),s6=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:s=GRe,color:a="primary",icon:l=WRe,name:c,onChange:u,size:d="medium",className:f,disabled:p,disableRipple:h=!1,slots:b={},slotProps:g={},inputProps:y,...v}=o,C=Qi();let O=p;C&&typeof O>"u"&&(O=C.disabled),O??=!1;const T={...o,disabled:O,disableRipple:h,color:a,size:d},P=zRe(T),k=VRe();let M=i;const _=M1(u,k&&k.onChange);let D=c;k&&(typeof M>"u"&&(M=URe(k.value,o.value)),typeof D>"u"&&(D=k.name));const A=g.input??y,[F,I]=At("root",{ref:r,elementType:qRe,className:Te(P.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:b,slotProps:g,...v},getSlotProps:N=>({...N,onChange:(j,...H)=>{N.onChange?.(j,...H),_(j,...H)}}),ownerState:T,additionalProps:{type:"radio",icon:S.cloneElement(l,{fontSize:l.props.fontSize??d}),checkedIcon:S.cloneElement(s,{fontSize:s.props.fontSize??d}),disabled:O,name:D,checked:M,slots:b,slotProps:{input:typeof A=="function"?A(T):A}}});return w.jsx(F,{...I,classes:P})});process.env.NODE_ENV!=="production"&&(s6.propTypes={checked:n.bool,checkedIcon:n.node,classes:n.object,className:n.string,color:n.oneOfType([n.oneOf(["default","primary","secondary","error","info","success","warning"]),n.string]),disabled:n.bool,disableRipple:n.bool,icon:n.node,id:n.string,inputProps:n.object,inputRef:Tn,name:n.string,onChange:n.func,required:n.bool,size:n.oneOfType([n.oneOf(["medium","small"]),n.string]),slotProps:n.shape({input:n.oneOfType([n.func,n.object]),root:n.oneOfType([n.func,n.object])}),slots:n.shape({input:n.elementType,root:n.elementType}),sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object]),value:n.any});const KRe=Ze("MuiBox",["root"]),YRe=yq(),uf=aoe({themeId:zf,defaultTheme:YRe,defaultClassName:KRe.root,generateClassName:rq.generate});process.env.NODE_ENV!=="production"&&(uf.propTypes={children:n.node,component:n.elementType,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object])});function ZRe(e){return Je("MuiFormGroup",e)}Ze("MuiFormGroup",["root","row","error"]);const XRe=e=>{const{classes:t,row:r,error:o}=e;return Ie({root:["root",r&&"row",o&&"error"]},ZRe,t)},QRe=ie("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),a6=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiFormGroup"}),{className:i,row:s=!1,...a}=o,l=Qi(),c=cc({props:o,muiFormControl:l,states:["error"]}),u={...o,row:s,error:c.error},d=XRe(u);return w.jsx(QRe,{className:Te(d.root,i),ownerState:u,ref:r,...a})});process.env.NODE_ENV!=="production"&&(a6.propTypes={children:n.node,classes:n.object,className:n.string,row:n.bool,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object])});function JRe(e){return Je("MuiRadioGroup",e)}Ze("MuiRadioGroup",["root","row","error"]);const eMe=e=>{const{classes:t,row:r,error:o}=e;return Ie({root:["root",r&&"row",o&&"error"]},JRe,t)},l6=S.forwardRef(function(t,r){const{actions:o,children:i,className:s,defaultValue:a,name:l,onChange:c,value:u,...d}=t,f=S.useRef(null),p=eMe(t),[h,b]=Oi({controlled:u,default:a,name:"RadioGroup"});S.useImperativeHandle(o,()=>({focus:()=>{let C=f.current.querySelector("input:not(:disabled):checked");C||(C=f.current.querySelector("input:not(:disabled)")),C&&C.focus()}}),[]);const g=Lt(r,f),y=Ht(l),v=S.useMemo(()=>({name:y,onChange(C){b(C.target.value),c&&c(C,C.target.value)},value:h}),[y,c,b,h]);return w.jsx(Jk.Provider,{value:v,children:w.jsx(a6,{role:"radiogroup",ref:g,className:Te(p.root,s),...d,children:i})})});process.env.NODE_ENV!=="production"&&(l6.propTypes={children:n.node,className:n.string,defaultValue:n.any,name:n.string,onChange:n.func,value:n.any});function tMe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},MuiRGAttributes:s={},id:a="",MuiFLAttributes:l={},MuiFCLabels:c=[],MuiFLabel:u="",MuiFLabelIcon:d={}}=e,[f,p]=Ue.useState(""),[h,b]=Ue.useState(!1),[g,y]=Ue.useState("");Ue.useEffect(()=>{(e.value||o.defaultValue)&&p(e.value||o.defaultValue)},[]),oa(()=>{p(e.value)},[e.value]);const v=t?.validation?.some(P=>P.rule==="mandatory")||!1,C=P=>{let k=!0,M="";if(t?.validation){for(const _ of t.validation)if(_.rule==="mandatory"&&!P){k=!1,M=_.message||"Required";break}}return{isValid:k,message:M}},O=P=>{const k=P.target.value;p(k);const M=C(k);b(!M.isValid),y(M.message),r&&r({id:a,value:k})},T=Ue.useMemo(()=>d&&d.icon?w.jsxs(uf,{sx:{display:"flex",width:"100%"},children:[d&&d.icon&&w.jsx(ht.Icon,{...d.MuiFLabelIconAttributes,children:d.icon},d.icon),w.jsx(sx,{...l,required:v,error:h,id:"radio-buttons-group-label",children:u})]}):w.jsx(sx,{...l,required:v,error:h,id:"radio-buttons-group-label",children:u}),[v,h,u,d,l]);return w.jsxs(Ou,{required:v,error:h,component:"fieldset",children:[u&&T,w.jsx(l6,{"aria-labelledby":"radio-buttons-group-label",name:"radio-buttons-group",...s,value:f,onChange:O,children:c.map(P=>w.jsx($m,{...i,value:P,control:w.jsx(s6,{...o}),label:P},P))}),g&&w.jsx(Uf,{children:g})]})}function nMe({components:e=[],onUpdate:t}){return w.jsx(w.Fragment,{children:e.map((r,o)=>{const i=uE[r.type];if(!i)return null;const s=iA[i.map];if(!s)return null;const a=r.id||r.props?.id||`stepper-comp-${o}`;return w.jsx(s,{attributes:r.props,onChange:t},a)})})}const rMe={activeStep:0,stepperResponse:{},MuiSteps:[]},oMe=(e,t)=>{const{type:r,payload:o}=t;switch(r){case"SET_STEPS":return{...e,MuiSteps:o.MuiSteps};case"SET_STEP":return{...e,activeStep:o.currentStep};case"UPDATE_RESPONSE":return{...e,stepperResponse:{...e.stepperResponse,[o.id]:o.value}};case"CHANGE_STEP":return{...e,activeStep:e.activeStep+o.stepChange};default:return e}};function iMe({attributes:e={},onChange:t,onStepUpdate:r,currentStep:o=0,patch:i={}}){const[s,a]=Ue.useReducer(oMe,rMe,()=>({activeStep:o,stepperResponse:i,MuiSteps:e.MuiSteps||[]})),{activeStep:l,stepperResponse:c,MuiSteps:u}=s;Ue.useEffect(()=>{a({type:"SET_STEP",payload:{currentStep:o}})},[o]),Ue.useEffect(()=>{i&&Object.keys(i).length>0&&Object.entries(i).forEach(([b,g])=>{c[b]!==g&&a({type:"UPDATE_RESPONSE",payload:{id:b,value:g}})})},[i]);const d=Ue.useCallback((b,g,y)=>{a({type:"CHANGE_STEP",payload:{stepChange:b}});const v=l+b;r&&r(v,g&&b>0,y),y&&t&&e.id&&t({id:e.id,value:c})},[l,e.id,t,r,c]),f=Ue.useCallback(({id:b,value:g})=>{a({type:"UPDATE_RESPONSE",payload:{id:b,value:g}}),t&&t({id:b,value:g})},[t]),p=(b=[],g=[])=>b.some(y=>!c[y])||g.some(y=>c[y.key]===y.value&&y.mandatoryIds.some(v=>!c[v])),h=(b,g,y,v)=>w.jsxs(ht.Box,{sx:{mb:2},children:[w.jsx(ht.Button,{variant:"contained",onClick:()=>d(1,g,b===u.length-1),disabled:p(y,v),sx:{mt:1,mr:1},...e.MuiButtonAttributes?.next,...b===u.length-1&&{...e.MuiButtonAttributes?.final},children:b===u.length-1?"Finish":"Continue"}),w.jsx(ht.Button,{disabled:b===0,onClick:()=>d(-1,g,!1),sx:{mt:1,mr:1},...e.MuiButtonAttributes?.back,children:"Back"})]});return w.jsx(ht.Box,{sx:{maxWidth:400},...e.MuiBoxAttributes,children:w.jsx(ht.Stepper,{activeStep:l,orientation:"vertical",...e.MuiStepperAttributes,children:u.map((b,g)=>w.jsxs(ht.Step,{...e.MuiStepAttributes,children:[w.jsx(ht.StepLabel,{optional:g===u.length-1&&w.jsx(ht.Typography,{variant:"caption",children:"Last step"}),...e.MuiStepLabelAttributes,children:b.label}),w.jsxs(ht.StepContent,{...e.MuiStepContentAttributes,children:[b.components?w.jsx(nMe,{onUpdate:f,components:P5(b.components,c,"",{},b.enableDisableIds)}):w.jsx(ht.Typography,{children:b.description}),h(g,b.isScreenChange,b.mandatoryIds,b.optionalMandatoryIds)]})]},b.label))})})}function sMe(e){return Je("MuiBarElement",e)}const aMe=Ze("MuiBarElement",["root","highlighted","faded","series"]),lMe=e=>{const{classes:t,id:r,isHighlighted:o,isFaded:i}=e,s={root:["root",`series-${r}`,o&&"highlighted",i&&"faded"]};return Ie(s,sMe,t)},_S=({params:e,store:t})=>{S.useEffect(()=>{t.set("animation",E({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const r=S.useCallback(()=>{let o=!1;return t.set("animation",E({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{o||(o=!0,t.set("animation",E({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return Mt(()=>{if(typeof window>"u"||!window?.matchMedia)return;let i;const s=l=>{l.matches?i=r():i?.()},a=window.matchMedia("(prefers-reduced-motion)");return s(a),a.addEventListener("change",s),()=>{a.removeEventListener("change",s)}},[r,t]),{instance:{disableAnimation:r}}};_S.params={skipAnimation:!0};_S.getDefaultizedParams=({params:e})=>E({},e,{skipAnimation:e.skipAnimation??!1});_S.getInitialState=({skipAnimation:e})=>{const t=typeof window>"u"||!window?.matchMedia,r=process.env.NODE_ENV==="test"?t:!1;return{animation:{skip:e,skipAnimationRequests:r?1:0}}};const cMe=e=>e.animation,uMe=it(cMe,e=>e.skip||e.skipAnimationRequests>0);function eR(e,t){const r=S.useRef(!0);S.useEffect(()=>{if(r.current){r.current=!1;return}return e()},t)}const hc="DEFAULT_X_AXIS_KEY",tR="DEFAULT_Y_AXIS_KEY",dMe={top:20,bottom:20,left:20,right:20},fMe=45,pMe=25,c6=20,hl=e=>e.cartesianAxis?.x,mc=e=>e.cartesianAxis?.y,hMe=it(mc,function(t){return(t??[]).reduce((r,o)=>o.position==="left"?r+(o.width||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),mMe=it(mc,function(t){return(t??[]).reduce((r,o)=>o.position==="right"?r+(o.width||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),gMe=it(hl,function(t){return(t??[]).reduce((r,o)=>o.position==="top"?r+(o.height||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),bMe=it(hl,function(t){return(t??[]).reduce((r,o)=>o.position==="bottom"?r+(o.height||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),yMe=Yt(hMe,mMe,gMe,bMe,function(t,r,o,i){return{left:t,right:r,top:o,bottom:i}}),Zm=e=>e.dimensions,vMe=e=>e.dimensions.margin,ci=Yt(Zm,vMe,yMe,function({width:t,height:r},{top:o,right:i,bottom:s,left:a},{left:l,right:c,top:u,bottom:d}){return{width:t-a-i-l-c,left:a+l,right:i+c,height:r-o-s-u-d,top:o+u,bottom:s+d}}),xMe=it(Zm,e=>e.width),SMe=it(Zm,e=>e.height),u6=it(Zm,e=>e.propsWidth),d6=it(Zm,e=>e.propsHeight);function f6(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?E({},t,e):e}const CMe=10,NS=({params:e,store:t,svgRef:r})=>{const o=e.width!==void 0&&e.height!==void 0,i=S.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[s,a]=S.useState(0),[l,c]=S.useState(0),u=S.useCallback(()=>{const b=r?.current;if(!b)return{};const y=As(b).getComputedStyle(b),v=Math.floor(parseFloat(y.height))||0,C=Math.floor(parseFloat(y.width))||0;return(t.state.dimensions.width!==C||t.state.dimensions.height!==v)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??C,height:e.height??v,propsWidth:e.width,propsHeight:e.height}),{height:v,width:C}},[t,r,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);eR(()=>{const b=e.width??t.state.dimensions.width,g=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:b,height:g,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),S.useEffect(()=>{i.current.displayError=!0},[]),Mt(()=>{if(o||!i.current.initialCompute||i.current.computeRun>CMe)return;const b=u();b.width!==s||b.height!==l?(i.current.computeRun+=1,b.width!==void 0&&a(b.width),b.height!==void 0&&c(b.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[l,s,u,o]),Mt(()=>{if(o)return()=>{};u();const b=r.current;if(typeof ResizeObserver>"u")return()=>{};let g;const y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{u()})});return b&&y.observe(b),()=>{g&&cancelAnimationFrame(g),b&&y.unobserve(b)}},[u,o,r]),process.env.NODE_ENV!=="production"&&(i.current.displayError&&e.width===void 0&&s===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),i.current.displayError=!1),i.current.displayError&&e.height===void 0&&l===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),i.current.displayError=!1));const d=t.use(ci),f=S.useCallback(b=>b>=d.left-1&&b<=d.left+d.width,[d.left,d.width]),p=S.useCallback(b=>b>=d.top-1&&b<=d.top+d.height,[d.height,d.top]);return{instance:{isPointInside:S.useCallback((b,g,y)=>y&&"closest"in y&&y.closest("[data-drawing-container]")?!0:f(b)&&p(g),[f,p]),isXInside:f,isYInside:p}}};NS.params={width:!0,height:!0,margin:!0};NS.getDefaultizedParams=({params:e})=>E({},e,{margin:f6(e.margin,dMe)});NS.getInitialState=({width:e,height:t,margin:r})=>({dimensions:{margin:r,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const nR=({params:e,store:t})=>(Mt(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});nR.params={experimentalFeatures:!0};nR.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const wMe=e=>e.experimentalFeatures,FS=it(wMe,e=>!!e?.preferStrictDomainInLineCharts);let sB=0;const TMe=()=>(sB+=1,`mui-chart-${sB}`),rR=({params:e,store:t})=>(S.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",E({},t.state.id,{chartId:e.id??TMe()}))},[t,e.id]),{});rR.params={id:!0};rR.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const OMe=e=>e.id,PMe=it(OMe,e=>e.chartId),EMe=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],IMe=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],p6=e=>e==="dark"?IMe:EMe,h6=({series:e,colors:t,seriesConfig:r})=>{const o={};return e.forEach((i,s)=>{const a=r[i.type].getSeriesWithDefaultValues(i,s,t),l=a.id;if(o[i.type]===void 0&&(o[i.type]={series:{},seriesOrder:[]}),o[i.type]?.series[l]!==void 0)throw new Error(`MUI X Charts: series' id "${l}" is not unique.`);o[i.type].series[l]=a,o[i.type].seriesOrder.push(l)}),o},kMe=(e,t,r,o)=>{const i={};return Object.keys(t).forEach(s=>{const a=e[s];a!==void 0&&(i[s]=t[s]?.seriesProcessor?.(a,r,o)??a)}),i},RMe=(e,t,r)=>{let o=!1;const i={};return Object.keys(e).forEach(s=>{const a=t[s]?.seriesLayout,l=e[s];if(a!==void 0&&l!==void 0){const c=a(l,r);c&&c!==e[s]&&(o=!0,i[s]=c)}}),o?i:{}},oR=(e,t)=>{const r=e[t.type]?.identifierSerializer;if(!r)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return r(t)},LS=({params:e,store:t,seriesConfig:r})=>{const{series:o,dataset:i,theme:s,colors:a}=e;return eR(()=>{t.set("series",E({},t.state.series,{defaultizedSeries:h6({series:o,colors:typeof a=="function"?a(s):a,seriesConfig:r}),dataset:i}))},[a,i,o,s,r,t]),{instance:{serializeIdentifier:Ee(c=>oR(r,c))}}};LS.params={dataset:!0,series:!0,colors:!0,theme:!0};const MMe=[];LS.getDefaultizedParams=({params:e})=>E({},e,{series:e.series?.length?e.series:MMe,colors:e.colors??p6,theme:e.theme??"light"});LS.getInitialState=({series:e=[],colors:t,theme:r,dataset:o},i,s)=>({series:{seriesConfig:s,defaultizedSeries:h6({series:e,colors:typeof t=="function"?t(r):t,seriesConfig:s}),dataset:o}});const AMe=(e,t,r)=>{const o=oR(r,t);return!e.has(o)},DMe=e=>e.visibilityManager,m6=new Map,_Me=it(DMe,e=>e?.visibilityMap??m6),g6=Yt(_Me,e=>(t,r)=>AMe(e,r,t)),b6=(e,t)=>{const r=new Map;return e&&e.forEach(o=>{const i=oR(t,o);r.set(i,o)}),r},op=({store:e,params:t,seriesConfig:r,instance:o})=>{eR(()=>{t.hiddenItems!==void 0&&(process.env.NODE_ENV!=="production"&&!e.state.visibilityManager.isControlled&&console.error(["MUI X Charts: A chart component is changing the `hiddenItems` from uncontrolled to controlled.","Elements should not switch from uncontrolled to controlled (or vice versa).","Decide between using a controlled or uncontrolled for the lifetime of the component.","The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
402
+ `);class Xk{isMUIAdapter=!0;isTimezoneCompatible=!0;lib="dayjs";escapedCharacters={start:"[",end:"]"};formatTokenMap=CRe;constructor({locale:t,formats:r}={}){this.locale=t,this.formats=E({},wRe,r),mr.extend(cRe)}setLocaleToValue=t=>{const r=this.getCurrentLocaleCode();return r===t.locale()?t:t.locale(r)};hasUTCPlugin=()=>typeof mr.utc<"u";hasTimezonePlugin=()=>typeof mr.tz<"u";isSame=(t,r,o)=>{const i=this.setTimezone(r,this.getTimezone(t));return t.format(o)===i.format(o)};cleanTimezone=t=>{switch(t){case"default":return;case"system":return mr.tz.guess();default:return t}};createSystemDate=t=>{let r;if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=mr.tz.guess();o==="UTC"?r=mr(t):r=mr.tz(t,o)}else r=mr(t);return this.setLocaleToValue(r)};createUTCDate=t=>{if(!this.hasUTCPlugin())throw new Error(gO);return this.setLocaleToValue(mr.utc(t))};createTZDate=(t,r)=>{if(!this.hasUTCPlugin())throw new Error(gO);if(!this.hasTimezonePlugin())throw new Error(rB);const o=t!==void 0&&!t.endsWith("Z");return this.setLocaleToValue(mr(t).tz(this.cleanTimezone(r),o))};getLocaleFormats=()=>{const t=mr.Ls,r=this.locale||"en";let o=t[r];return o===void 0&&(process.env.NODE_ENV!=="production"&&er(["MUI X: Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale."]),o=t.en),o.formats};adjustOffset=t=>{if(!this.hasTimezonePlugin())return t;const r=this.getTimezone(t);if(r!=="UTC"){const o=t.tz(this.cleanTimezone(r),!0);if(o.$offset===(t.$offset??0))return t;t.$offset=o.$offset}return t};date=(t,r="default")=>t===null?null:r==="UTC"?this.createUTCDate(t):r==="system"||r==="default"&&!this.hasTimezonePlugin()?this.createSystemDate(t):this.createTZDate(t,r);getInvalidDate=()=>mr(new Date("Invalid date"));getTimezone=t=>{if(this.hasTimezonePlugin()){const r=t.$x?.$timezone;if(r)return r}return this.hasUTCPlugin()&&t.isUTC()?"UTC":"system"};setTimezone=(t,r)=>{if(this.getTimezone(t)===r)return t;if(r==="UTC"){if(!this.hasUTCPlugin())throw new Error(gO);return t.utc()}if(r==="system")return t.local();if(!this.hasTimezonePlugin()){if(r==="default")return t;throw new Error(rB)}return this.setLocaleToValue(mr.tz(t,this.cleanTimezone(r)))};toJsDate=t=>t.toDate();parse=(t,r)=>t===""?null:mr(t,r,this.locale,!0);getCurrentLocaleCode=()=>this.locale||"en";is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||"");expandFormat=t=>{const r=this.getLocaleFormats(),o=i=>i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(s,a,l)=>a||l.slice(1));return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(i,s,a)=>{const l=a&&a.toUpperCase();return s||r[a]||o(r[l])})};isValid=t=>t==null?!1:t.isValid();format=(t,r)=>this.formatByString(t,this.formats[r]);formatByString=(t,r)=>this.setLocaleToValue(t).format(r);formatNumber=t=>t;isEqual=(t,r)=>t===null&&r===null?!0:t===null||r===null?!1:t.toDate().getTime()===r.toDate().getTime();isSameYear=(t,r)=>this.isSame(t,r,"YYYY");isSameMonth=(t,r)=>this.isSame(t,r,"YYYY-MM");isSameDay=(t,r)=>this.isSame(t,r,"YYYY-MM-DD");isSameHour=(t,r)=>t.isSame(r,"hour");isAfter=(t,r)=>t>r;isAfterYear=(t,r)=>this.hasUTCPlugin()?!this.isSameYear(t,r)&&t.utc()>r.utc():t.isAfter(r,"year");isAfterDay=(t,r)=>this.hasUTCPlugin()?!this.isSameDay(t,r)&&t.utc()>r.utc():t.isAfter(r,"day");isBefore=(t,r)=>t<r;isBeforeYear=(t,r)=>this.hasUTCPlugin()?!this.isSameYear(t,r)&&t.utc()<r.utc():t.isBefore(r,"year");isBeforeDay=(t,r)=>this.hasUTCPlugin()?!this.isSameDay(t,r)&&t.utc()<r.utc():t.isBefore(r,"day");isWithinRange=(t,[r,o])=>t>=r&&t<=o;startOfYear=t=>this.adjustOffset(t.startOf("year"));startOfMonth=t=>this.adjustOffset(t.startOf("month"));startOfWeek=t=>this.adjustOffset(this.setLocaleToValue(t).startOf("week"));startOfDay=t=>this.adjustOffset(t.startOf("day"));endOfYear=t=>this.adjustOffset(t.endOf("year"));endOfMonth=t=>this.adjustOffset(t.endOf("month"));endOfWeek=t=>this.adjustOffset(this.setLocaleToValue(t).endOf("week"));endOfDay=t=>this.adjustOffset(t.endOf("day"));addYears=(t,r)=>this.adjustOffset(t.add(r,"year"));addMonths=(t,r)=>this.adjustOffset(t.add(r,"month"));addWeeks=(t,r)=>this.adjustOffset(t.add(r,"week"));addDays=(t,r)=>this.adjustOffset(t.add(r,"day"));addHours=(t,r)=>this.adjustOffset(t.add(r,"hour"));addMinutes=(t,r)=>this.adjustOffset(t.add(r,"minute"));addSeconds=(t,r)=>this.adjustOffset(t.add(r,"second"));getYear=t=>t.year();getMonth=t=>t.month();getDate=t=>t.date();getHours=t=>t.hour();getMinutes=t=>t.minute();getSeconds=t=>t.second();getMilliseconds=t=>t.millisecond();setYear=(t,r)=>this.adjustOffset(t.set("year",r));setMonth=(t,r)=>this.adjustOffset(t.set("month",r));setDate=(t,r)=>this.adjustOffset(t.set("date",r));setHours=(t,r)=>this.adjustOffset(t.set("hour",r));setMinutes=(t,r)=>this.adjustOffset(t.set("minute",r));setSeconds=(t,r)=>this.adjustOffset(t.set("second",r));setMilliseconds=(t,r)=>this.adjustOffset(t.set("millisecond",r));getDaysInMonth=t=>t.daysInMonth();getWeekArray=t=>{const r=this.startOfWeek(this.startOfMonth(t)),o=this.endOfWeek(this.endOfMonth(t));let i=0,s=r;const a=[];for(;s<o;){const l=Math.floor(i/7);a[l]=a[l]||[],a[l].push(s),s=this.addDays(s,1),i+=1}return a};getWeekNumber=t=>t.week();getDayOfWeek(t){return t.day()+1}getYearRange=([t,r])=>{const o=this.startOfYear(t),i=this.endOfYear(r),s=[];let a=o;for(;this.isBefore(a,i);)s.push(a),a=this.addYears(a,1);return s}}function TRe(){const e=Ue.useRef(!0);return e.current?(e.current=!1,!0):e.current}function oa(e,t){const r=TRe();Ue.useEffect(()=>{if(!r)return e()},t)}function ORe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="DatePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}function PRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="DateTimePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}function ERe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},name:i="TimePicker",id:s=""}=e,[a,l]=Ue.useState(e?.value?mr(e?.value):null);oa(()=>{e?.value&&l(mr(e?.value))},[e?.value]);const c=t?.validation?.some(d=>d.rule==="mandatory")||!1,u=EI(i);return w.jsx(Gf,{dateAdapter:Xk,children:w.jsx(u,{value:a,onChange:d=>{l(d),r&&r({id:s,value:d})},slotProps:{textField:{required:c,fullWidth:!0}},...o})})}const IRe=Pr(w.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank"),kRe=Pr(w.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckBox"),RRe=w.jsx(IRe,{fontSize:"small"}),MRe=w.jsx(kRe,{fontSize:"small"}),oB=(e=[],t="",r=!1,o=",")=>{try{const i=Array.isArray(e)?e:[];if(r){let s=[];if(Array.isArray(t))s=t;else if(typeof t=="string"&&t.trim()!==""){let l=o;t.includes(",")?l=",":t.includes(";")?l=";":t.includes(":")&&(l=":"),s=t.split(l).map(c=>c.trim())}const a=new Set(s);return i.filter(({value:l})=>a.has(l))}if(Array.isArray(t)){const s=t[0];return i.find(({value:a})=>a===s)}return i.find(({value:s})=>s===t)}catch(i){return console.error("getValue error:",i),r?[]:null}};function ARe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},options:i=[],MuiBoxAttributes:s={},id:a="",InputProps:l={}}=e,[c,u]=Ue.useState(()=>e?.value?oB(i,e?.value,o.multiple,e?.separator):o.multiple?[]:null);oa(()=>{u(e?.value?oB(i,e?.value,o.multiple,e?.separator):o.multiple?[]:null)},[e?.value,i]);const[d,f]=Ue.useState(!1),[p,h]=Ue.useState(""),b=O=>{let T=!0,P="";if(t?.validation){for(const k of t.validation)if(k.rule==="mandatory"&&(!O||Array.isArray(O)&&O.length===0)){T=!1,P=k.message||"Required";break}}return{isValid:T,message:P}},g=()=>(o.multiple&&(o.renderOption=(O,T={},{selected:P})=>w.jsxs("li",{...O,children:[w.jsx(gS,{icon:RRe,checkedIcon:MRe,style:{marginRight:8},checked:P,sx:kge(T.color||"")}),T.title||T.label||T.value]})),o),y=Ue.useCallback(O=>O?.value||O?.title||O?.label,[]),v=Ue.useCallback((O,T)=>{u(T);const P=b(T);f(!P.isValid),h(P.message);const k=e?.separator??";";if(T&&r){const M=o.multiple?T.map(y):y(T),_=o.multiple?M.join(k):M;r({id:a,value:_,option:T})}else r&&r({id:a,value:"",option:T})},[a,r,e?.separator,o.multiple,y,t.validation]),C=t?.validation?.some(O=>O.rule==="mandatory")||!1;return w.jsx(hS,{disablePortal:!1,...g(),options:i,value:c,onChange:v,onBlur:()=>{const O=b(c);f(!O.isValid),h(O.message)},PopperProps:{modifiers:[{name:"preventOverflow",options:{boundary:"window"}}]},renderInput:O=>{const T=PI(l),P={...O.InputProps,...T,startAdornment:w.jsxs(w.Fragment,{children:[T?.startAdornment,O.InputProps.startAdornment]}),endAdornment:w.jsxs(w.Fragment,{children:[T?.endAdornment,O.InputProps.endAdornment]})};return w.jsx(dl,{...O,...s,required:C,error:d,helperText:p,slotProps:{input:{...P,autoComplete:"new-password"}}})}})}function DRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},id:s=""}=e,[a,l]=Ue.useState(o.defaultChecked||!!e.value||!1),[c,u]=Ue.useState(!1),[d,f]=Ue.useState("");oa(()=>{l(!!e.value)},[e.value]);const p=t?.validation?.some(C=>C.rule==="mandatory")||!1,h=C=>{let O=!0,T="";if(t?.validation){for(const P of t.validation)if(P.rule==="mandatory"&&!C){O=!1,T=P.message||"Required";break}}return{isValid:O,message:T}},b=C=>{const O=C.target.checked;l(O);const T=h(O);u(!T.isValid),f(T.message),r&&r({id:s,value:O})},{label:g,...y}=i,v=p?w.jsxs("span",{children:[g,w.jsx("span",{"aria-hidden":"true",style:{color:"#d32f2f",marginLeft:2},children:"*"})]}):g;return w.jsxs(Ou,{required:p,error:c,component:"fieldset",children:[w.jsx($m,{...y,label:v,control:w.jsx(gS,{checked:a,onChange:b,required:p,...o,inputProps:{"aria-label":"controlled"}})}),d&&w.jsx(Uf,{children:d})]})}const _Re=ie(({color:e,...t})=>w.jsx(Gh,{...t}))(({theme:e,color:t})=>({"& .MuiSwitch-switchBase.Mui-checked":{color:t||"green","&:hover":{backgroundColor:io(t||"green",e.palette.action.hoverOpacity)}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:t||"green"}}));function NRe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},color:s="",id:a=""}=e,[l,c]=Ue.useState(o.defaultValue||!!e.value||!1),[u,d]=Ue.useState(!1),[f,p]=Ue.useState("");oa(()=>{c(!!e.value)},[e.value]);const h=t?.validation?.some(M=>M.rule==="mandatory")||!1,b=M=>{let _=!0,D="";if(t?.validation){for(const A of t.validation)if(A.rule==="mandatory"&&!M){_=!1,D=A.message||"Required";break}}return{isValid:_,message:D}},g=M=>{const _=M.target.checked;c(_);const D=b(_);d(!D.isValid),p(D.message),r&&r({id:a,value:_})},y=s?_Re:Gh,{defaultChecked:v,...C}=o,{label:O,...T}=i,P=h?w.jsxs("span",{children:[O,w.jsx("span",{"aria-hidden":"true",style:{color:"#d32f2f",marginLeft:2},children:"*"})]}):O,k=s?{color:s}:{color:"primary"};return w.jsxs(Ou,{required:h,error:u,component:"fieldset",children:[w.jsx($m,{...T,label:P,control:w.jsx(y,{checked:l,onChange:g,required:h,...C,...k,inputProps:{"aria-label":"controlled"}})}),f&&w.jsx(Uf,{children:f})]})}const FRe=Pr(w.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),LRe=Pr(w.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),$Re=ie("span",{name:"MuiRadioButtonIcon",shouldForwardProp:Ho})({position:"relative",display:"flex"}),jRe=ie(FRe,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),BRe=ie(LRe,{name:"MuiRadioButtonIcon"})(Tt(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function Qk(e){const{checked:t=!1,classes:r={},fontSize:o}=e,i={...e,checked:t};return w.jsxs($Re,{className:r.root,ownerState:i,children:[w.jsx(jRe,{fontSize:o,className:r.background,ownerState:i}),w.jsx(BRe,{fontSize:o,className:r.dot,ownerState:i})]})}process.env.NODE_ENV!=="production"&&(Qk.propTypes={checked:n.bool,classes:n.object,fontSize:n.oneOf(["small","medium"])});const Jk=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jk.displayName="RadioGroupContext");function VRe(){return S.useContext(Jk)}function HRe(e){return Je("MuiRadio",e)}const iB=Ze("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),zRe=e=>{const{classes:t,color:r,size:o}=e,i={root:["root",`color${De(r)}`,o!=="medium"&&`size${De(o)}`]};return{...t,...Ie(i,HRe,t)}},qRe=ie(mS,{shouldForwardProp:e=>Ho(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size!=="medium"&&t[`size${De(r.size)}`],t[`color${De(r.color)}`]]}})(Tt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${iB.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ur()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ur()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${iB.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function URe(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const GRe=w.jsx(Qk,{checked:!0}),WRe=w.jsx(Qk,{}),s6=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:s=GRe,color:a="primary",icon:l=WRe,name:c,onChange:u,size:d="medium",className:f,disabled:p,disableRipple:h=!1,slots:b={},slotProps:g={},inputProps:y,...v}=o,C=Qi();let O=p;C&&typeof O>"u"&&(O=C.disabled),O??=!1;const T={...o,disabled:O,disableRipple:h,color:a,size:d},P=zRe(T),k=VRe();let M=i;const _=M1(u,k&&k.onChange);let D=c;k&&(typeof M>"u"&&(M=URe(k.value,o.value)),typeof D>"u"&&(D=k.name));const A=g.input??y,[F,I]=At("root",{ref:r,elementType:qRe,className:Te(P.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:b,slotProps:g,...v},getSlotProps:N=>({...N,onChange:(j,...H)=>{N.onChange?.(j,...H),_(j,...H)}}),ownerState:T,additionalProps:{type:"radio",icon:S.cloneElement(l,{fontSize:l.props.fontSize??d}),checkedIcon:S.cloneElement(s,{fontSize:s.props.fontSize??d}),disabled:O,name:D,checked:M,slots:b,slotProps:{input:typeof A=="function"?A(T):A}}});return w.jsx(F,{...I,classes:P})});process.env.NODE_ENV!=="production"&&(s6.propTypes={checked:n.bool,checkedIcon:n.node,classes:n.object,className:n.string,color:n.oneOfType([n.oneOf(["default","primary","secondary","error","info","success","warning"]),n.string]),disabled:n.bool,disableRipple:n.bool,icon:n.node,id:n.string,inputProps:n.object,inputRef:Tn,name:n.string,onChange:n.func,required:n.bool,size:n.oneOfType([n.oneOf(["medium","small"]),n.string]),slotProps:n.shape({input:n.oneOfType([n.func,n.object]),root:n.oneOfType([n.func,n.object])}),slots:n.shape({input:n.elementType,root:n.elementType}),sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object]),value:n.any});const KRe=Ze("MuiBox",["root"]),YRe=yq(),uf=aoe({themeId:zf,defaultTheme:YRe,defaultClassName:KRe.root,generateClassName:rq.generate});process.env.NODE_ENV!=="production"&&(uf.propTypes={children:n.node,component:n.elementType,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object])});function ZRe(e){return Je("MuiFormGroup",e)}Ze("MuiFormGroup",["root","row","error"]);const XRe=e=>{const{classes:t,row:r,error:o}=e;return Ie({root:["root",r&&"row",o&&"error"]},ZRe,t)},QRe=ie("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),a6=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiFormGroup"}),{className:i,row:s=!1,...a}=o,l=Qi(),c=cc({props:o,muiFormControl:l,states:["error"]}),u={...o,row:s,error:c.error},d=XRe(u);return w.jsx(QRe,{className:Te(d.root,i),ownerState:u,ref:r,...a})});process.env.NODE_ENV!=="production"&&(a6.propTypes={children:n.node,classes:n.object,className:n.string,row:n.bool,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object])});function JRe(e){return Je("MuiRadioGroup",e)}Ze("MuiRadioGroup",["root","row","error"]);const eMe=e=>{const{classes:t,row:r,error:o}=e;return Ie({root:["root",r&&"row",o&&"error"]},JRe,t)},l6=S.forwardRef(function(t,r){const{actions:o,children:i,className:s,defaultValue:a,name:l,onChange:c,value:u,...d}=t,f=S.useRef(null),p=eMe(t),[h,b]=Oi({controlled:u,default:a,name:"RadioGroup"});S.useImperativeHandle(o,()=>({focus:()=>{let C=f.current.querySelector("input:not(:disabled):checked");C||(C=f.current.querySelector("input:not(:disabled)")),C&&C.focus()}}),[]);const g=Lt(r,f),y=Ht(l),v=S.useMemo(()=>({name:y,onChange(C){b(C.target.value),c&&c(C,C.target.value)},value:h}),[y,c,b,h]);return w.jsx(Jk.Provider,{value:v,children:w.jsx(a6,{role:"radiogroup",ref:g,className:Te(p.root,s),...d,children:i})})});process.env.NODE_ENV!=="production"&&(l6.propTypes={children:n.node,className:n.string,defaultValue:n.any,name:n.string,onChange:n.func,value:n.any});function tMe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},MuiFCLAttributes:i={},MuiRGAttributes:s={},id:a="",MuiFLAttributes:l={},MuiFCLabels:c=[],MuiFLabel:u="",MuiFLabelIcon:d={}}=e,[f,p]=Ue.useState(""),[h,b]=Ue.useState(!1),[g,y]=Ue.useState("");Ue.useEffect(()=>{(e.value||o.defaultValue)&&p(e.value||o.defaultValue)},[]),oa(()=>{p(e.value)},[e.value]);const v=t?.validation?.some(P=>P.rule==="mandatory")||!1,C=P=>{let k=!0,M="";if(t?.validation){for(const _ of t.validation)if(_.rule==="mandatory"&&!P){k=!1,M=_.message||"Required";break}}return{isValid:k,message:M}},O=P=>{const k=P.target.value;p(k);const M=C(k);b(!M.isValid),y(M.message),r&&r({id:a,value:k})},T=Ue.useMemo(()=>d&&d.icon?w.jsxs(uf,{sx:{display:"flex",width:"100%"},children:[d&&d.icon&&w.jsx(ht.Icon,{...d.MuiFLabelIconAttributes,children:d.icon},d.icon),w.jsx(sx,{...l,required:v,error:h,id:"radio-buttons-group-label",children:u})]}):w.jsx(sx,{...l,required:v,error:h,id:"radio-buttons-group-label",children:u}),[v,h,u,d,l]);return w.jsxs(Ou,{required:v,error:h,component:"fieldset",children:[u&&T,w.jsx(l6,{"aria-labelledby":"radio-buttons-group-label",name:"radio-buttons-group",...s,value:f,onChange:O,children:c.map(P=>w.jsx($m,{...i,value:P,control:w.jsx(s6,{...o}),label:P},P))}),g&&w.jsx(Uf,{children:g})]})}function nMe({components:e=[],onUpdate:t}){return w.jsx(w.Fragment,{children:e.map((r,o)=>{const i=uE[r.type];if(!i)return null;const s=iA[i.map];if(!s)return null;const a=r.id||r.props?.id||`stepper-comp-${o}`;return w.jsx(s,{attributes:r.props,onChange:t},a)})})}const rMe={activeStep:0,stepperResponse:{},MuiSteps:[]},oMe=(e,t)=>{const{type:r,payload:o}=t;switch(r){case"SET_STEPS":return{...e,MuiSteps:o.MuiSteps};case"SET_STEP":return{...e,activeStep:o.currentStep};case"UPDATE_RESPONSE":return{...e,stepperResponse:{...e.stepperResponse,[o.id]:o.value}};case"CHANGE_STEP":return{...e,activeStep:e.activeStep+o.stepChange};default:return e}};function iMe({attributes:e={},onChange:t,onStepUpdate:r,currentStep:o=0,patch:i={}}){const[s,a]=Ue.useReducer(oMe,rMe,()=>({activeStep:o,stepperResponse:i,MuiSteps:e.MuiSteps||[]})),{activeStep:l,stepperResponse:c,MuiSteps:u}=s;Ue.useEffect(()=>{a({type:"SET_STEP",payload:{currentStep:o}})},[o]),Ue.useEffect(()=>{i&&Object.keys(i).length>0&&Object.entries(i).forEach(([b,g])=>{c[b]!==g&&a({type:"UPDATE_RESPONSE",payload:{id:b,value:g}})})},[i]),Ue.useEffect(()=>{u.forEach(b=>{(b.components||[]).forEach(g=>{const y=g.id||g.props?.id;y&&g.props?.value!==void 0&&c[y]===void 0&&(a({type:"UPDATE_RESPONSE",payload:{id:y,value:g.props.value}}),t&&t({id:y,value:g.props.value}))})})},[]);const d=Ue.useCallback((b,g,y)=>{a({type:"CHANGE_STEP",payload:{stepChange:b}});const v=l+b;r&&r(v,g&&b>0,y),y&&t&&e.id&&t({id:e.id,value:c})},[l,e.id,t,r,c]),f=Ue.useCallback(({id:b,value:g})=>{a({type:"UPDATE_RESPONSE",payload:{id:b,value:g}}),t&&t({id:b,value:g})},[t]),p=(b=[],g=[])=>b.some(y=>!c[y])||g.some(y=>c[y.key]===y.value&&y.mandatoryIds.some(v=>!c[v])),h=(b,g,y,v)=>w.jsxs(ht.Box,{sx:{mb:2},children:[w.jsx(ht.Button,{variant:"contained",onClick:()=>d(1,g,b===u.length-1),disabled:p(y,v),sx:{mt:1,mr:1},...e.MuiButtonAttributes?.next,...b===u.length-1&&{...e.MuiButtonAttributes?.final},children:b===u.length-1?"Finish":"Continue"}),w.jsx(ht.Button,{disabled:b===0,onClick:()=>d(-1,g,!1),sx:{mt:1,mr:1},...e.MuiButtonAttributes?.back,children:"Back"})]});return w.jsx(ht.Box,{sx:{maxWidth:400},...e.MuiBoxAttributes,children:w.jsx(ht.Stepper,{activeStep:l,orientation:"vertical",...e.MuiStepperAttributes,children:u.map((b,g)=>w.jsxs(ht.Step,{...e.MuiStepAttributes,children:[w.jsx(ht.StepLabel,{optional:g===u.length-1&&w.jsx(ht.Typography,{variant:"caption",children:"Last step"}),...e.MuiStepLabelAttributes,children:b.label}),w.jsxs(ht.StepContent,{...e.MuiStepContentAttributes,children:[b.components?w.jsx(nMe,{onUpdate:f,components:P5(b.components,{...c},"",{},b.enableDisableIds)}):w.jsx(ht.Typography,{children:b.description}),h(g,b.isScreenChange,b.mandatoryIds,b.optionalMandatoryIds)]})]},b.label))})})}function sMe(e){return Je("MuiBarElement",e)}const aMe=Ze("MuiBarElement",["root","highlighted","faded","series"]),lMe=e=>{const{classes:t,id:r,isHighlighted:o,isFaded:i}=e,s={root:["root",`series-${r}`,o&&"highlighted",i&&"faded"]};return Ie(s,sMe,t)},_S=({params:e,store:t})=>{S.useEffect(()=>{t.set("animation",E({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const r=S.useCallback(()=>{let o=!1;return t.set("animation",E({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{o||(o=!0,t.set("animation",E({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return Mt(()=>{if(typeof window>"u"||!window?.matchMedia)return;let i;const s=l=>{l.matches?i=r():i?.()},a=window.matchMedia("(prefers-reduced-motion)");return s(a),a.addEventListener("change",s),()=>{a.removeEventListener("change",s)}},[r,t]),{instance:{disableAnimation:r}}};_S.params={skipAnimation:!0};_S.getDefaultizedParams=({params:e})=>E({},e,{skipAnimation:e.skipAnimation??!1});_S.getInitialState=({skipAnimation:e})=>{const t=typeof window>"u"||!window?.matchMedia,r=process.env.NODE_ENV==="test"?t:!1;return{animation:{skip:e,skipAnimationRequests:r?1:0}}};const cMe=e=>e.animation,uMe=it(cMe,e=>e.skip||e.skipAnimationRequests>0);function eR(e,t){const r=S.useRef(!0);S.useEffect(()=>{if(r.current){r.current=!1;return}return e()},t)}const hc="DEFAULT_X_AXIS_KEY",tR="DEFAULT_Y_AXIS_KEY",dMe={top:20,bottom:20,left:20,right:20},fMe=45,pMe=25,c6=20,hl=e=>e.cartesianAxis?.x,mc=e=>e.cartesianAxis?.y,hMe=it(mc,function(t){return(t??[]).reduce((r,o)=>o.position==="left"?r+(o.width||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),mMe=it(mc,function(t){return(t??[]).reduce((r,o)=>o.position==="right"?r+(o.width||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),gMe=it(hl,function(t){return(t??[]).reduce((r,o)=>o.position==="top"?r+(o.height||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),bMe=it(hl,function(t){return(t??[]).reduce((r,o)=>o.position==="bottom"?r+(o.height||0)+(o.zoom?.slider.enabled?o.zoom.slider.size:0):r,0)}),yMe=Yt(hMe,mMe,gMe,bMe,function(t,r,o,i){return{left:t,right:r,top:o,bottom:i}}),Zm=e=>e.dimensions,vMe=e=>e.dimensions.margin,ci=Yt(Zm,vMe,yMe,function({width:t,height:r},{top:o,right:i,bottom:s,left:a},{left:l,right:c,top:u,bottom:d}){return{width:t-a-i-l-c,left:a+l,right:i+c,height:r-o-s-u-d,top:o+u,bottom:s+d}}),xMe=it(Zm,e=>e.width),SMe=it(Zm,e=>e.height),u6=it(Zm,e=>e.propsWidth),d6=it(Zm,e=>e.propsHeight);function f6(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?E({},t,e):e}const CMe=10,NS=({params:e,store:t,svgRef:r})=>{const o=e.width!==void 0&&e.height!==void 0,i=S.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[s,a]=S.useState(0),[l,c]=S.useState(0),u=S.useCallback(()=>{const b=r?.current;if(!b)return{};const y=As(b).getComputedStyle(b),v=Math.floor(parseFloat(y.height))||0,C=Math.floor(parseFloat(y.width))||0;return(t.state.dimensions.width!==C||t.state.dimensions.height!==v)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??C,height:e.height??v,propsWidth:e.width,propsHeight:e.height}),{height:v,width:C}},[t,r,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);eR(()=>{const b=e.width??t.state.dimensions.width,g=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:b,height:g,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),S.useEffect(()=>{i.current.displayError=!0},[]),Mt(()=>{if(o||!i.current.initialCompute||i.current.computeRun>CMe)return;const b=u();b.width!==s||b.height!==l?(i.current.computeRun+=1,b.width!==void 0&&a(b.width),b.height!==void 0&&c(b.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[l,s,u,o]),Mt(()=>{if(o)return()=>{};u();const b=r.current;if(typeof ResizeObserver>"u")return()=>{};let g;const y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{u()})});return b&&y.observe(b),()=>{g&&cancelAnimationFrame(g),b&&y.unobserve(b)}},[u,o,r]),process.env.NODE_ENV!=="production"&&(i.current.displayError&&e.width===void 0&&s===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),i.current.displayError=!1),i.current.displayError&&e.height===void 0&&l===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),i.current.displayError=!1));const d=t.use(ci),f=S.useCallback(b=>b>=d.left-1&&b<=d.left+d.width,[d.left,d.width]),p=S.useCallback(b=>b>=d.top-1&&b<=d.top+d.height,[d.height,d.top]);return{instance:{isPointInside:S.useCallback((b,g,y)=>y&&"closest"in y&&y.closest("[data-drawing-container]")?!0:f(b)&&p(g),[f,p]),isXInside:f,isYInside:p}}};NS.params={width:!0,height:!0,margin:!0};NS.getDefaultizedParams=({params:e})=>E({},e,{margin:f6(e.margin,dMe)});NS.getInitialState=({width:e,height:t,margin:r})=>({dimensions:{margin:r,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const nR=({params:e,store:t})=>(Mt(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});nR.params={experimentalFeatures:!0};nR.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const wMe=e=>e.experimentalFeatures,FS=it(wMe,e=>!!e?.preferStrictDomainInLineCharts);let sB=0;const TMe=()=>(sB+=1,`mui-chart-${sB}`),rR=({params:e,store:t})=>(S.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",E({},t.state.id,{chartId:e.id??TMe()}))},[t,e.id]),{});rR.params={id:!0};rR.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const OMe=e=>e.id,PMe=it(OMe,e=>e.chartId),EMe=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],IMe=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],p6=e=>e==="dark"?IMe:EMe,h6=({series:e,colors:t,seriesConfig:r})=>{const o={};return e.forEach((i,s)=>{const a=r[i.type].getSeriesWithDefaultValues(i,s,t),l=a.id;if(o[i.type]===void 0&&(o[i.type]={series:{},seriesOrder:[]}),o[i.type]?.series[l]!==void 0)throw new Error(`MUI X Charts: series' id "${l}" is not unique.`);o[i.type].series[l]=a,o[i.type].seriesOrder.push(l)}),o},kMe=(e,t,r,o)=>{const i={};return Object.keys(t).forEach(s=>{const a=e[s];a!==void 0&&(i[s]=t[s]?.seriesProcessor?.(a,r,o)??a)}),i},RMe=(e,t,r)=>{let o=!1;const i={};return Object.keys(e).forEach(s=>{const a=t[s]?.seriesLayout,l=e[s];if(a!==void 0&&l!==void 0){const c=a(l,r);c&&c!==e[s]&&(o=!0,i[s]=c)}}),o?i:{}},oR=(e,t)=>{const r=e[t.type]?.identifierSerializer;if(!r)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return r(t)},LS=({params:e,store:t,seriesConfig:r})=>{const{series:o,dataset:i,theme:s,colors:a}=e;return eR(()=>{t.set("series",E({},t.state.series,{defaultizedSeries:h6({series:o,colors:typeof a=="function"?a(s):a,seriesConfig:r}),dataset:i}))},[a,i,o,s,r,t]),{instance:{serializeIdentifier:Ee(c=>oR(r,c))}}};LS.params={dataset:!0,series:!0,colors:!0,theme:!0};const MMe=[];LS.getDefaultizedParams=({params:e})=>E({},e,{series:e.series?.length?e.series:MMe,colors:e.colors??p6,theme:e.theme??"light"});LS.getInitialState=({series:e=[],colors:t,theme:r,dataset:o},i,s)=>({series:{seriesConfig:s,defaultizedSeries:h6({series:e,colors:typeof t=="function"?t(r):t,seriesConfig:s}),dataset:o}});const AMe=(e,t,r)=>{const o=oR(r,t);return!e.has(o)},DMe=e=>e.visibilityManager,m6=new Map,_Me=it(DMe,e=>e?.visibilityMap??m6),g6=Yt(_Me,e=>(t,r)=>AMe(e,r,t)),b6=(e,t)=>{const r=new Map;return e&&e.forEach(o=>{const i=oR(t,o);r.set(i,o)}),r},op=({store:e,params:t,seriesConfig:r,instance:o})=>{eR(()=>{t.hiddenItems!==void 0&&(process.env.NODE_ENV!=="production"&&!e.state.visibilityManager.isControlled&&console.error(["MUI X Charts: A chart component is changing the `hiddenItems` from uncontrolled to controlled.","Elements should not switch from uncontrolled to controlled (or vice versa).","Decide between using a controlled or uncontrolled for the lifetime of the component.","The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
403
403
  `)),e.set("visibilityManager",E({},e.state.visibilityManager,{visibilityMap:b6(t.hiddenItems,r)})))},[e,t.hiddenItems,r]);const i=Ee(l=>{const c=e.state.visibilityManager.visibilityMap,u=o.serializeIdentifier(l);if(c.has(u))return;const d=new Map(c);d.set(u,l),e.set("visibilityManager",E({},e.state.visibilityManager,{visibilityMap:d})),t.onHiddenItemsChange?.(Array.from(d.values()))}),s=Ee(l=>{const c=e.state.visibilityManager.visibilityMap,u=o.serializeIdentifier(l);if(!c.has(u))return;const d=new Map(c);d.delete(u),e.set("visibilityManager",E({},e.state.visibilityManager,{visibilityMap:d})),t.onHiddenItemsChange?.(Array.from(d.values()))}),a=Ee(l=>{const c=e.state.visibilityManager.visibilityMap,u=o.serializeIdentifier(l);c.has(u)?s(l):i(l)});return{instance:{hideItem:i,showItem:s,toggleItemVisibility:a}}};op.getInitialState=(e,t,r)=>{const o=e.hiddenItems??e.initialHiddenItems;return{visibilityManager:{visibilityMap:o?b6(o,r):m6,isControlled:e.hiddenItems!==void 0}}};op.params={onHiddenItemsChange:!0,hiddenItems:!0,initialHiddenItems:!0};const iR=e=>e.series,y6=it(iR,e=>e.defaultizedSeries),ui=it(iR,e=>e.seriesConfig),NMe=it(iR,e=>e.dataset),sr=Yt(y6,ui,NMe,g6,function(t,r,o,i){return kMe(t,r,o,s=>i(r,s))}),v6=Yt(sr,ui,ci,function(t,r,o){return RMe(t,r,o)}),FMe={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class x6{customData={};constructor(t){if(!t||!t.name)throw new Error("Gesture must be initialized with a valid name.");if(t.name in FMe)throw new Error(`Gesture can't be created with a native event name. Tried to use "${t.name}". Please use a custom name instead.`);this.name=t.name,this.preventDefault=t.preventDefault??!1,this.stopPropagation=t.stopPropagation??!1,this.preventIf=t.preventIf??[],this.requiredKeys=t.requiredKeys??[],this.pointerMode=t.pointerMode??[],this.pointerOptions=t.pointerOptions??{}}init(t,r,o,i){this.element=t,this.pointerManager=r,this.gesturesRegistry=o,this.keyboardManager=i;const s=`${this.name}ChangeOptions`;this.element.addEventListener(s,this.handleOptionsChange);const a=`${this.name}ChangeState`;this.element.addEventListener(a,this.handleStateChange)}handleOptionsChange=t=>{t&&t.detail&&this.updateOptions(t.detail)};updateOptions(t){this.preventDefault=t.preventDefault??this.preventDefault,this.stopPropagation=t.stopPropagation??this.stopPropagation,this.preventIf=t.preventIf??this.preventIf,this.requiredKeys=t.requiredKeys??this.requiredKeys,this.pointerMode=t.pointerMode??this.pointerMode,this.pointerOptions=t.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(t,r){if(t!=="mouse"&&t!=="touch"&&t!=="pen")return r;const o=this.pointerOptions[t];return o?E({},r,o):r}handleStateChange=t=>{t&&t.detail&&this.updateState(t.detail)};updateState(t){Object.assign(this.state,t)}getTargetElement(t){return this.isActive||this.element===t.target||"contains"in this.element&&this.element.contains(t.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&t.composedPath().includes(this.element)?this.element:null}set isActive(t){t?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(t,r){const o=this.getEffectiveConfig(r,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(o.requiredKeys))return!0;if(this.preventIf.length===0)return!1;const i=this.gesturesRegistry.getActiveGestures(t);return this.preventIf.some(s=>i[s])}isPointerTypeAllowed(t){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(t)}destroy(){const t=`${this.name}ChangeOptions`;this.element.removeEventListener(t,this.handleOptionsChange);const r=`${this.name}ChangeState`;this.element.removeEventListener(r,this.handleStateChange)}}class LMe{activeGestures=new Map;registerActiveGesture(t,r){this.activeGestures.has(t)||this.activeGestures.set(t,new Set);const o=this.activeGestures.get(t),i={gesture:r,element:t};o.add(i)}unregisterActiveGesture(t,r){const o=this.activeGestures.get(t);o&&(o.forEach(i=>{i.gesture===r&&o.delete(i)}),o.size===0&&this.activeGestures.delete(t))}getActiveGestures(t){const r=this.activeGestures.get(t);return r?Array.from(r).reduce((o,i)=>(o[i.gesture.name]=!0,o),{}):{}}isGestureActive(t,r){const o=this.activeGestures.get(t);return o?Array.from(o).some(i=>i.gesture===r):!1}destroy(){this.activeGestures.clear()}unregisterElement(t){this.activeGestures.delete(t)}}class $Me{pressedKeys=new Set;constructor(){this.initialize()}initialize(){typeof window>"u"||(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}handleKeyDown=t=>{this.pressedKeys.add(t.key)};handleKeyUp=t=>{this.pressedKeys.delete(t.key)};clearKeys=()=>{this.pressedKeys.clear()};areKeysPressed(t){return!t||t.length===0?!0:t.every(r=>r==="ControlOrMeta"?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(r))}destroy(){typeof window<"u"&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class jMe{preventEventInterruption=!0;pointers=new Map;gestureHandlers=new Set;constructor(t){this.root=t.root??document.getRootNode({composed:!0})??document.body,this.touchAction=t.touchAction||"auto",this.passive=t.passive??!1,this.preventEventInterruption=t.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(t){return this.gestureHandlers.add(t),()=>{this.gestureHandlers.delete(t)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!=="auto"&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}handleInterruptEvents=t=>{if(this.preventEventInterruption&&"pointerType"in t&&t.pointerType==="touch"){t.preventDefault();return}const r=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),o=this.pointers.values().next().value;if(this.pointers.size>0&&o){Object.defineProperties(r,{clientX:{value:o.clientX},clientY:{value:o.clientY},pointerId:{value:o.pointerId},pointerType:{value:o.pointerType}});for(const[i,s]of this.pointers.entries()){const a=E({},s,{type:"forceCancel"});this.pointers.set(i,a)}}this.notifyHandlers(r),this.pointers.clear()};handlePointerEvent=t=>{const{type:r,pointerId:o}=t;if(r==="pointerdown"||r==="pointermove")this.pointers.set(o,this.createPointerData(t));else if(r==="pointerup"||r==="pointercancel"||r==="forceCancel"){this.pointers.set(o,this.createPointerData(t)),this.notifyHandlers(t),this.pointers.delete(o);return}this.notifyHandlers(t)};notifyHandlers(t){this.gestureHandlers.forEach(r=>r(this.pointers,t))}createPointerData(t){return{pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target,timeStamp:t.timeStamp,type:t.type,isPrimary:t.isPrimary,pressure:t.pressure,width:t.width,height:t.height,pointerType:t.pointerType,srcEvent:t}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class BMe{gestureTemplates=new Map;elementGestureMap=new Map;activeGesturesRegistry=new LMe;keyboardManager=new $Me;constructor(t){this.pointerManager=new jMe({root:t.root,touchAction:t.touchAction,passive:t.passive}),t.gestures&&t.gestures.length>0&&t.gestures.forEach(r=>{this.addGestureTemplate(r)})}addGestureTemplate(t){this.gestureTemplates.has(t.name)&&console.warn(`Gesture template with name "${t.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(t.name,t)}setGestureOptions(t,r,o){const i=this.elementGestureMap.get(r);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const s=new CustomEvent(`${t}ChangeOptions`,{detail:o,bubbles:!1,cancelable:!1,composed:!1});r.dispatchEvent(s)}setGestureState(t,r,o){const i=this.elementGestureMap.get(r);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const s=new CustomEvent(`${t}ChangeState`,{detail:o,bubbles:!1,cancelable:!1,composed:!1});r.dispatchEvent(s)}registerElement(t,r,o){return Array.isArray(t)||(t=[t]),t.forEach(i=>{const s=o?.[i];this.registerSingleGesture(i,r,s)}),r}registerSingleGesture(t,r,o){const i=this.gestureTemplates.get(t);if(!i)return console.error(`Gesture template "${t}" not found.`),!1;this.elementGestureMap.has(r)||this.elementGestureMap.set(r,new Map);const s=this.elementGestureMap.get(r);s.has(t)&&(console.warn(`Element already has gesture "${t}" registered. It will be replaced.`),this.unregisterElement(t,r));const a=i.clone(o);return a.init(r,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),s.set(t,a),!0}unregisterElement(t,r){const o=this.elementGestureMap.get(r);return!o||!o.has(t)?!1:(o.get(t).destroy(),o.delete(t),this.activeGesturesRegistry.unregisterElement(r),o.size===0&&this.elementGestureMap.delete(r),!0)}unregisterAllGestures(t){const r=this.elementGestureMap.get(t);if(r){for(const[,o]of r)o.destroy(),this.activeGesturesRegistry.unregisterElement(t);this.elementGestureMap.delete(t)}}destroy(){for(const[t]of this.elementGestureMap)this.unregisterAllGestures(t);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class Au extends x6{unregisterHandler=null;originalTarget=null;constructor(t){super(t),this.minPointers=t.minPointers??1,this.maxPointers=t.maxPointers??1/0}init(t,r,o,i){super.init(t,r,o,i),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(t){super.updateOptions(t),this.minPointers=t.minPointers??this.minPointers,this.maxPointers=t.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(t,r){const o=this.getEffectiveConfig(r,this.getBaseConfig());return t.length>=o.minPointers&&t.length<=o.maxPointers}getRelevantPointers(t,r){return t.filter(o=>this.isPointerTypeAllowed(o.pointerType)&&(r===o.target||o.target===this.originalTarget||r===this.originalTarget||"contains"in r&&r.contains(o.target))||"getRootNode"in r&&r.getRootNode()instanceof ShadowRoot&&o.srcEvent.composedPath().includes(r))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function VMe(e,t){const r=t.x-e.x,o=t.y-e.y;return Math.sqrt(r*r+o*o)}function fv(e){if(e.length<2)return 0;let t=0,r=0;for(let o=0;o<e.length;o+=1)for(let i=o+1;i<e.length;i+=1)t+=VMe({x:e[o].clientX,y:e[o].clientY},{x:e[i].clientX,y:e[i].clientY}),r+=1;return r>0?t/r:0}function ea(e){if(e.length===0)return{x:0,y:0};const t=e.reduce((r,o)=>(r.x+=o.clientX,r.y+=o.clientY,r),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function ks(e,t){return`${e}${t==="ongoing"?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const pv=1e-5,Ml=1e-5,aB=.15;function HMe(e,t){const r=t.x-e.x,o=t.y-e.y,i={vertical:null,horizontal:null,mainAxis:null},s=zMe(t,e),a=Math.abs(r)>Math.abs(o)?"horizontal":"vertical",l=s||a==="horizontal"?pv:aB,c=s?pv:a==="horizontal"?aB:pv;return Math.abs(r)>l&&(i.horizontal=r>0?"right":"left"),Math.abs(o)>c&&(i.vertical=o>0?"down":"up"),i.mainAxis=s?"diagonal":a,i}function zMe(e,t){const r=t.x-e.x,o=t.y-e.y,i=Math.atan2(o,r)*180/Math.PI;return i>=-45+Ml&&i<=-22.5+Ml||i>=22.5+Ml&&i<=45+Ml||i>=135+Ml&&i<=157.5+Ml||i>=-157.5+Ml&&i<=-135+Ml}function qMe(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;const r=e.vertical===null||t.includes(e.vertical),o=e.horizontal===null||t.includes(e.horizontal);return r&&o}const lB=0,UMe=e=>e>lB?1:e<-lB?-1:0,jl=e=>{e.cancelable&&e.preventDefault()};class sR extends Au{state={lastPosition:null};constructor(t){super(t),this.threshold=t.threshold||0}clone(t){return new sR(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,r,o,i){super.init(t,r,o,i),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t)}resetState(){this.isActive=!1,this.state={lastPosition:null}}handleElementEnter=t=>{if(t.pointerType!=="mouse"&&t.pointerType!=="pen")return;const r=this.pointerManager.getPointers()||new Map,o=Array.from(r.values());if(this.isWithinPointerCount(o,t.pointerType)){this.isActive=!0;const i={x:t.clientX,y:t.clientY};this.state.lastPosition=i,this.emitMoveEvent(this.element,"start",o,t),this.emitMoveEvent(this.element,"ongoing",o,t)}};handleElementLeave=t=>{if(t.pointerType!=="mouse"&&t.pointerType!=="pen"||!this.isActive)return;const r=this.pointerManager.getPointers()||new Map,o=Array.from(r.values());this.emitMoveEvent(this.element,"end",o,t),this.resetState()};handlePointerEvent=(t,r)=>{if(r.type!=="pointermove"||r.pointerType!=="mouse"&&r.pointerType!=="pen")return;this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const o=Array.from(t.values()),i=this.getTargetElement(r);if(!i||!this.isWithinPointerCount(o,r.pointerType))return;if(this.shouldPreventGesture(i,r.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(i,"end",o,r);return}const s={x:r.clientX,y:r.clientY};this.state.lastPosition=s,this.isActive||(this.isActive=!0,this.emitMoveEvent(i,"start",o,r)),this.emitMoveEvent(i,"ongoing",o,r)};emitMoveEvent(t,r,o,i){const s=this.state.lastPosition||ea(o),a=this.gesturesRegistry.getActiveGestures(t),l={gestureName:this.name,centroid:s,target:i.target,srcEvent:i,phase:r,pointers:o,timeStamp:i.timeStamp,activeGestures:a,customData:this.customData},c=ks(this.name,r),u=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:l});t.dispatchEvent(u)}}class ru extends Au{state={startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null};constructor(t){super(t),this.direction=t.direction||["up","down","left","right"],this.threshold=t.threshold||0}clone(t){return new ru(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.direction=t.direction||this.direction,this.threshold=t.threshold??this.threshold}resetState(){this.isActive=!1,this.state=E({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}handlePointerEvent=(t,r)=>{const o=Array.from(t.values());if(r.type==="forceCancel"){this.cancel(r.target,o,r);return}const i=this.getTargetElement(r);if(!i)return;if(this.shouldPreventGesture(i,r.pointerType)){this.cancel(i,o,r);return}const s=this.getRelevantPointers(o,i);if(!this.isWithinPointerCount(s,r.pointerType)){this.cancel(i,s,r);return}switch(r.type){case"pointerdown":if(!this.isActive&&!this.state.startCentroid)s.forEach(a=>{this.state.startPointers.set(a.pointerId,a)}),this.originalTarget=i,this.state.startCentroid=ea(s),this.state.lastCentroid=E({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){const a=this.state.lastCentroid,l=ea(s),c=l.x-a.x,u=l.y-a.y;this.state.startCentroid={x:this.state.startCentroid.x+c,y:this.state.startCentroid.y+u},this.state.lastCentroid=l,s.forEach(d=>{this.state.startPointers.has(d.pointerId)||this.state.startPointers.set(d.pointerId,d)})}break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(o,r.pointerType)){const a=ea(s),l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y,u=Math.sqrt(l*l+c*c),d=HMe(this.state.lastCentroid??this.state.startCentroid,a),f=this.state.lastCentroid?a.x-this.state.lastCentroid.x:0,p=this.state.lastCentroid?a.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&u>=this.threshold&&qMe(d,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:f,y:p},this.state.totalDeltaX+=f,this.state.totalDeltaY+=p,this.state.activeDeltaX+=f,this.state.activeDeltaY+=p,this.emitPanEvent(i,"start",s,r,a),this.emitPanEvent(i,"ongoing",s,r,a)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:f,y:p},this.state.totalDeltaX+=f,this.state.totalDeltaY+=p,this.state.activeDeltaX+=f,this.state.activeDeltaY+=p,this.emitPanEvent(i,"ongoing",s,r,a)),this.state.lastCentroid=a,this.state.lastDirection=d}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const a=s.filter(l=>l.type!=="pointerup"&&l.type!=="pointercancel");if(this.isWithinPointerCount(a,r.pointerType)){if(a.length>=1&&this.state.lastCentroid){const l=ea(a),c=l.x-this.state.lastCentroid.x,u=l.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+c,y:this.state.startCentroid.y+u},this.state.lastCentroid=l;const d=s.find(f=>f.type==="pointerup"||f.type==="pointercancel")?.pointerId;d!==void 0&&this.state.startPointers.delete(d)}}else{const l=this.state.lastCentroid||this.state.startCentroid;r.type==="pointercancel"&&this.emitPanEvent(i,"cancel",s,r,l),this.emitPanEvent(i,"end",s,r,l),this.resetState()}}else this.resetState();break}};emitPanEvent(t,r,o,i,s){if(!this.state.startCentroid)return;const a=this.state.lastDeltas?.x??0,l=this.state.lastDeltas?.y??0,c=this.state.startPointers.values().next().value,u=c?(i.timeStamp-c.timeStamp)/1e3:0,d=u>0?a/u:0,f=u>0?l/u:0,p=Math.sqrt(d*d+f*f),h=this.gesturesRegistry.getActiveGestures(t),b={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:s,target:i.target,srcEvent:i,phase:r,pointers:o,timeStamp:i.timeStamp,deltaX:a,deltaY:l,direction:this.state.lastDirection,velocityX:d,velocityY:f,velocity:p,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:h,customData:this.customData},g=ks(this.name,r),y=new CustomEvent(g,{bubbles:!0,cancelable:!0,composed:!0,detail:b});t.dispatchEvent(y),this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation()}cancel(t,r,o){if(this.isActive){const i=t??this.element;this.emitPanEvent(i,"cancel",r,o,this.state.lastCentroid),this.emitPanEvent(i,"end",r,o,this.state.lastCentroid)}this.resetState()}}class aR extends Au{state={startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0};constructor(t){super(E({},t,{minPointers:t.minPointers??2})),this.threshold=t.threshold??0}clone(t){return new aR(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t)}resetState(){this.isActive=!1,this.state=E({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}handlePointerEvent=(t,r)=>{const o=Array.from(t.values()),i=this.getTargetElement(r);if(!i)return;if(this.shouldPreventGesture(i,r.pointerType)){this.isActive&&(this.emitPinchEvent(i,"cancel",o,r),this.resetState());return}const s=this.getRelevantPointers(o,i);switch(r.type){case"pointerdown":if(s.length>=2&&!this.isActive){const a=fv(s);this.state.startDistance=a,this.state.lastDistance=a,this.state.lastTime=r.timeStamp,this.originalTarget=i}else if(this.isActive&&s.length>=2){const a=fv(s);this.state.startDistance=a/this.state.lastScale,this.state.lastDistance=a,this.state.lastTime=r.timeStamp}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(s,r.pointerType)){const a=fv(s),l=Math.abs(a-this.state.lastDistance);if(l!==0&&l>=this.threshold){const c=this.state.startDistance?a/this.state.startDistance:1,u=c/this.state.lastScale;this.state.totalScale*=u;const d=(r.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const p=(a-this.state.lastDistance)/d;this.state.velocity=Number.isNaN(p)?0:p}this.state.lastDistance=a,this.state.deltaScale=c-this.state.lastScale,this.state.lastScale=c,this.state.lastTime=r.timeStamp,this.isActive?this.emitPinchEvent(i,"ongoing",s,r):(this.isActive=!0,this.emitPinchEvent(i,"start",s,r),this.emitPinchEvent(i,"ongoing",s,r))}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const a=s.filter(l=>l.type!=="pointerup"&&l.type!=="pointercancel");if(!this.isWithinPointerCount(a,r.pointerType))r.type==="pointercancel"&&this.emitPinchEvent(i,"cancel",s,r),this.emitPinchEvent(i,"end",s,r),this.resetState();else if(a.length>=2){const l=fv(a);this.state.startDistance=l/this.state.lastScale,this.state.lastDistance=l,this.state.lastTime=r.timeStamp}}break}};emitPinchEvent(t,r,o,i){const s=ea(o),a=this.state.lastDistance,l=this.state.lastScale,c=this.gesturesRegistry.getActiveGestures(t),u={gestureName:this.name,centroid:s,target:i.target,srcEvent:i,phase:r,pointers:o,timeStamp:i.timeStamp,scale:l,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:a,velocity:this.state.velocity,activeGestures:c,direction:UMe(this.state.velocity),customData:this.customData};this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation();const d=ks(this.name,r),f=new CustomEvent(d,{bubbles:!0,cancelable:!0,composed:!0,detail:u});t.dispatchEvent(f)}}class $S extends Au{state={startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1};constructor(t){super(t),this.duration=t.duration??500,this.maxDistance=t.maxDistance??10}clone(t){return new $S(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.duration=t.duration??this.duration,this.maxDistance=t.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=E({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}handlePointerEvent=(t,r)=>{const o=Array.from(t.values());if(r.type==="forceCancel"){this.cancelPress(r.target,o,r);return}const i=this.getTargetElement(r);if(!i)return;if(this.shouldPreventGesture(i,r.pointerType)){this.isActive&&this.cancelPress(i,o,r);return}const s=this.getRelevantPointers(o,i);if(!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelPress(i,s,r);return}switch(r.type){case"pointerdown":!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=ea(s),this.state.lastPosition=E({},this.state.startCentroid),this.state.startTime=r.timeStamp,this.isActive=!0,this.originalTarget=i,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const a=this.state.lastPosition;this.emitPressEvent(i,"start",s,r,a),this.emitPressEvent(i,"ongoing",s,r,a)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=ea(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelPress(i,s,r)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const a=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(i,"end",s,r,a)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(i,s,r);break}};emitPressEvent(t,r,o,i,s){const a=this.gesturesRegistry.getActiveGestures(t),l=i.timeStamp-this.state.startTime,c={gestureName:this.name,centroid:s,target:i.target,srcEvent:i,phase:r,pointers:o,timeStamp:i.timeStamp,x:s.x,y:s.y,duration:l,activeGestures:a,customData:this.customData},u=ks(this.name,r),d=new CustomEvent(u,{bubbles:!0,cancelable:!0,composed:!0,detail:c});t.dispatchEvent(d),this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation()}cancelPress(t,r,o){if(this.isActive&&this.state.pressThresholdReached){const i=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(t??this.element,"cancel",r,o,i),this.emitPressEvent(t??this.element,"end",r,o,i)}this.resetState()}}class lR extends Au{state={phase:"waitingForPress",dragTimeoutId:null};constructor(t){super(t),this.pressDuration=t.pressDuration??500,this.pressMaxDistance=t.pressMaxDistance??10,this.dragTimeout=t.dragTimeout??1e3,this.dragThreshold=t.dragThreshold??0,this.dragDirection=t.dragDirection||["up","down","left","right"],this.pressGesture=new $S({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new ru({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new lR(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,r,o,i){super.init(t,r,o,i),this.pressGesture.init(t,r,o,i),this.panGesture.init(t,r,o,i),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(t){super.updateOptions(t),this.pressDuration=t.pressDuration??this.pressDuration,this.pressMaxDistance=t.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=t.dragTimeout??this.dragTimeout,this.dragThreshold=t.dragThreshold??this.dragThreshold,this.dragDirection=t.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}pressHandler=()=>{this.state.phase==="waitingForPress"&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=t=>{this.state.phase==="pressDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t)))};dragMoveHandler=t=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t))};dragEndHandler=t=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t)))};setTouchAction(){this.element.addEventListener("touchstart",jl,{passive:!1}),this.element.addEventListener("touchmove",jl,{passive:!1}),this.element.addEventListener("touchend",jl,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",jl),this.element.removeEventListener("touchmove",jl),this.element.removeEventListener("touchend",jl)}}class Jh extends Au{state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null};constructor(t){super(t),this.maxDistance=t.maxDistance??10,this.taps=t.taps??1}clone(t){return new Jh(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(t){super.updateOptions(t),this.maxDistance=t.maxDistance??this.maxDistance,this.taps=t.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}handlePointerEvent=(t,r)=>{const o=Array.from(t.values()),i=this.getTargetElement(r);if(!i)return;const s=this.getRelevantPointers(o,i);if(this.shouldPreventGesture(i,r.pointerType)||!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelTap(i,s,r);return}switch(r.type){case"pointerdown":this.isActive||(this.state.startCentroid=ea(s),this.state.lastPosition=E({},this.state.startCentroid),this.isActive=!0,this.originalTarget=i);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=ea(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelTap(i,s,r)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const a=this.state.lastPosition||this.state.startCentroid;if(!a){this.cancelTap(i,s,r);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(i,s,r,a),this.resetState()):(this.state.lastTapTime=r.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(i,s,r);break}};fireTapEvent(t,r,o,i){const s=this.gesturesRegistry.getActiveGestures(t),a={gestureName:this.name,centroid:i,target:o.target,srcEvent:o,phase:"end",pointers:r,timeStamp:o.timeStamp,x:i.x,y:i.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:a});t.dispatchEvent(l),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancelTap(t,r,o){if(this.state.startCentroid||this.state.lastPosition){const i=this.state.lastPosition||this.state.startCentroid,s=this.gesturesRegistry.getActiveGestures(t),a={gestureName:this.name,centroid:i,target:o.target,srcEvent:o,phase:"cancel",pointers:r,timeStamp:o.timeStamp,x:i.x,y:i.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=ks(this.name,"cancel"),c=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});t.dispatchEvent(c)}this.resetState()}}class cR extends Au{state={phase:"waitingForTap",dragTimeoutId:null};constructor(t){super(t),this.tapMaxDistance=t.tapMaxDistance??10,this.dragTimeout=t.dragTimeout??1e3,this.dragThreshold=t.dragThreshold??0,this.dragDirection=t.dragDirection||["up","down","left","right"],this.tapGesture=new Jh({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new ru({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new cR(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(t,r,o,i){super.init(t,r,o,i),this.tapGesture.init(t,r,o,i),this.panGesture.init(t,r,o,i),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(t){super.updateOptions(t),this.tapMaxDistance=t.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=t.dragTimeout??this.dragTimeout,this.dragThreshold=t.dragThreshold??this.dragThreshold,this.dragDirection=t.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}tapHandler=()=>{this.state.phase==="waitingForTap"&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=t=>{this.state.phase==="tapDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t)))};dragMoveHandler=t=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t))};dragEndHandler=t=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(ks(this.name,t.detail.phase),t)))};setTouchAction(){this.element.addEventListener("touchstart",jl,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",jl)}}class _x extends x6{state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0};constructor(t){super(t),this.sensitivity=t.sensitivity??1,this.max=t.max??Number.MAX_SAFE_INTEGER,this.min=t.min??Number.MIN_SAFE_INTEGER,this.initialDelta=t.initialDelta??0,this.invert=t.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(t){return new _x(E({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},t))}init(t,r,o,i){super.init(t,r,o,i),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(t){super.updateOptions(t),this.sensitivity=t.sensitivity??this.sensitivity,this.max=t.max??this.max,this.min=t.min??this.min,this.initialDelta=t.initialDelta??this.initialDelta,this.invert=t.invert??this.invert}handleWheelEvent=t=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const r=this.pointerManager.getPointers()||new Map,o=Array.from(r.values());this.state.totalDeltaX+=t.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=t.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=t.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(i=>{this.state[i]<this.min&&(this.state[i]=this.min),this.state[i]>this.max&&(this.state[i]=this.max)}),this.emitWheelEvent(o,t)};emitWheelEvent(t,r){const o=t.length>0?ea(t):{x:r.clientX,y:r.clientY},i=this.gesturesRegistry.getActiveGestures(this.element),s={gestureName:this.name,centroid:o,target:r.target,srcEvent:r,phase:"ongoing",pointers:t,timeStamp:r.timeStamp,deltaX:r.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:r.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:r.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:r.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:i,customData:this.customData};this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const a=ks(this.name,"ongoing"),l=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:s});this.element.dispatchEvent(l)}}const Md=e=>e.preventDefault(),uR=({svgRef:e})=>{const t=S.useRef(null);S.useEffect(()=>{const i=e.current;t.current||(t.current=new BMe({gestures:[new ru({name:"pan",threshold:0,maxPointers:1}),new sR({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new Jh({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new $S({name:"quickPress",duration:50}),new ru({name:"brush",threshold:0,maxPointers:1}),new ru({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new aR({name:"zoomPinch",threshold:5}),new _x({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new _x({name:"panTurnWheel",sensitivity:.5}),new cR({name:"zoomTapAndDrag",dragThreshold:10}),new lR({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new Jh({name:"zoomDoubleTapReset",taps:2})]}));const s=t.current;if(!(!i||!s))return s.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],i),()=>{s.unregisterAllGestures(i)}},[e,t]);const r=S.useCallback((i,s,a)=>{const l=e.current;return l?.addEventListener(i,s,a),{cleanup:()=>l?.removeEventListener(i,s)}},[e]),o=S.useCallback((i,s)=>{const a=e.current,l=t.current;!l||!a||l.setGestureOptions(i,a,s??{})},[e,t]);return S.useEffect(()=>{const i=e.current;return i?.addEventListener("gesturestart",Md),i?.addEventListener("gesturechange",Md),i?.addEventListener("gestureend",Md),()=>{i?.removeEventListener("gesturestart",Md),i?.removeEventListener("gesturechange",Md),i?.removeEventListener("gestureend",Md)}},[e]),{instance:{addInteractionListener:r,updateZoomInteractionListeners:o}}};uR.params={};uR.getInitialState=()=>({});const GMe=[rR,nR,NS,LS,uR,_S],WMe=["apiRef"],KMe=e=>{let{plugins:t}=e,r=ye(e.props,WMe);const o={};t.forEach(a=>{Object.assign(o,a.params)});const i={};return Object.keys(r).forEach(a=>{const l=r[a];o[a]&&(i[a]=l)}),t.reduce((a,l)=>l.getDefaultizedParams?l.getDefaultizedParams({params:a}):a,i)};let cB=0;function YMe(e,t,r){const o=Ht(),i=S.useMemo(()=>[...GMe,...e],[e]),s=KMe({plugins:i,props:t});s.id=s.id??o;const l=S.useRef({}).current,c=XMe(t.apiRef),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null);if(f.current==null){cB+=1;const b={cacheKey:{id:cB}};i.forEach(g=>{g.getInitialState&&Object.assign(b,g.getInitialState(s,b,r))}),f.current=new jm(b)}const p=b=>{const g=b({instance:l,params:s,plugins:i,store:f.current,svgRef:d,chartRootRef:u,seriesConfig:r});g.publicAPI&&Object.assign(c.current,g.publicAPI),g.instance&&Object.assign(l,g.instance)};return i.forEach(p),{contextValue:S.useMemo(()=>({store:f.current,publicAPI:c.current,instance:l,svgRef:d,chartRootRef:u}),[l,c])}}function ZMe(e){return e.current==null&&(e.current={}),e}function XMe(e){const t=S.useRef({});return e?ZMe(e):t}const dR=S.createContext(null);process.env.NODE_ENV!=="production"&&(dR.displayName="ChartContext");function QMe(e){const{componentName:t,propName:r,controlled:o,defaultValue:i,warningPrefix:s="MUI X"}=e,[{initialDefaultValue:a,isControlled:l}]=S.useState({initialDefaultValue:i,isControlled:o!==void 0});l!==(o!==void 0)&&er([`${s}: A component is changing the ${l?"":"un"}controlled ${r} state of ${t} to be ${l?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"],"error"),JSON.stringify(a)!==JSON.stringify(i)&&er([`${s}: A component is changing the default ${r} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`],"error")}const fR=process.env.NODE_ENV==="production"?()=>{}:QMe,S6=4,C6=20+2*S6,JMe=40+2*S6,eAe="hover",tAe={top:5,bottom:5,left:5,right:5},hv={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:C6,showTooltip:eAe}},pR=(e,t,r,o)=>{if(e)return e===!0?E({axisId:t,axisDirection:r},hv,{reverse:o??!1}):E({axisId:t,axisDirection:r},hv,{reverse:o??!1},e,{slider:E({},hv.slider,{size:e.slider?.preview??hv.slider.preview?JMe:C6},e.slider)})};function w6(e,t){const r={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:hc,scaleType:"linear"}]).map((s,a)=>{const l=s.dataKey,c=a===0?"bottom":"none",u=s.position??c,d=pMe+(s.label?c6:0),f=s.id??`defaultized-x-axis-${a}`,p=E({offset:r[u]},s,{id:f,position:u,height:s.height??d,zoom:pR(s.zoom,f,"x",s.reverse)});if(u!=="none"&&(r[u]+=p.height,p.zoom?.slider.enabled&&(r[u]+=p.zoom.slider.size)),l===void 0||s.data!==void 0)return p;if(t===void 0)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return E({},p,{data:t.map(h=>h[l])})})}function T6(e,t){const r={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:tR,scaleType:"linear"}]).map((s,a)=>{const l=s.dataKey,c=a===0?"left":"none",u=s.position??c,d=fMe+(s.label?c6:0),f=s.id??`defaultized-y-axis-${a}`,p=E({offset:r[u]},s,{id:f,position:u,width:s.width??d,zoom:pR(s.zoom,f,"y",s.reverse)});if(u!=="none"&&(r[u]+=p.width,p.zoom?.slider.enabled&&(r[u]+=p.zoom.slider.size)),l===void 0||s.data!==void 0)return p;if(t===void 0)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return E({},p,{data:t.map(h=>h[l])})})}function nAe(e,t){return function(o,i){if(i.location==="tick"){const s=i.scale.domain();return s[0]===s[1]?i.scale.tickFormat(1)(o):i.scale.tickFormat(e)(o)}return i.location==="zoom-slider-tooltip"?t.tickFormat(2)(o):`${o}`}}function Du(e){return e.scaleType==="band"}function _u(e){return e.scaleType==="point"}function rAe(e){return e.scaleType!=="point"&&e.scaleType!=="band"}function oAe(e){return e.scaleType==="symlog"}function Yv(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function iAe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hR(e){let t,r,o;e.length!==2?(t=Yv,r=(l,c)=>Yv(e(l),c),o=(l,c)=>e(l)-c):(t=e===Yv||e===iAe?e:sAe,r=e,o=e);function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&o(l[f-1],c)>-o(l[f],c)?f-1:f}return{left:i,center:a,right:s}}function sAe(){return 0}function aAe(e){return e===null?NaN:+e}const lAe=hR(Yv),O6=lAe.right;hR(aAe).center;class Nx extends Map{constructor(t,r=dAe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[o,i]of t)this.set(o,i)}get(t){return super.get(uB(this,t))}has(t){return super.has(uB(this,t))}set(t,r){return super.set(cAe(this,t),r)}delete(t){return super.delete(uAe(this,t))}}function uB({_intern:e,_key:t},r){const o=t(r);return e.has(o)?e.get(o):r}function cAe({_intern:e,_key:t},r){const o=t(r);return e.has(o)?e.get(o):(e.set(o,r),r)}function uAe({_intern:e,_key:t},r){const o=t(r);return e.has(o)&&(r=e.get(o),e.delete(o)),r}function dAe(e){return e!==null&&typeof e=="object"?e.valueOf():e}const fAe=Math.sqrt(50),pAe=Math.sqrt(10),hAe=Math.sqrt(2);function Fx(e,t,r){const o=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(o)),s=o/Math.pow(10,i),a=s>=fAe?10:s>=pAe?5:s>=hAe?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/a,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*a,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Fx(e,t,r*2):[l,c,u]}function yP(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const o=t<e,[i,s,a]=o?Fx(t,e,r):Fx(e,t,r);if(!(s>=i))return[];const l=s-i+1,c=new Array(l);if(o)if(a<0)for(let u=0;u<l;++u)c[u]=(s-u)/-a;else for(let u=0;u<l;++u)c[u]=(s-u)*a;else if(a<0)for(let u=0;u<l;++u)c[u]=(i+u)/-a;else for(let u=0;u<l;++u)c[u]=(i+u)*a;return c}function vP(e,t,r){return t=+t,e=+e,r=+r,Fx(e,t,r)[2]}function xP(e,t,r){t=+t,e=+e,r=+r;const o=t<e,i=o?vP(t,e,r):vP(e,t,r);return(o?-1:1)*(i<0?1/-i:i)}function mAe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var o=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++o<i;)s[o]=e+o*r;return s}function gc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function gAe(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const dB=Symbol("implicit");function SP(){var e=new Nx,t=[],r=[],o=dB;function i(s){let a=e.get(s);if(a===void 0){if(o!==dB)return o;e.set(s,a=t.push(s)-1)}return r[a%r.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Nx;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(o=s,i):o},i.copy=function(){return SP(t,r).unknown(o)},gc.apply(i,arguments),i}function mR(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function P6(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function Xm(){}var em=.7,Lx=1/em,df="\\s*([+-]?\\d+)\\s*",tm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bAe=/^#([0-9a-f]{3,8})$/,yAe=new RegExp(`^rgb\\(${df},${df},${df}\\)$`),vAe=new RegExp(`^rgb\\(${Sa},${Sa},${Sa}\\)$`),xAe=new RegExp(`^rgba\\(${df},${df},${df},${tm}\\)$`),SAe=new RegExp(`^rgba\\(${Sa},${Sa},${Sa},${tm}\\)$`),CAe=new RegExp(`^hsl\\(${tm},${Sa},${Sa}\\)$`),wAe=new RegExp(`^hsla\\(${tm},${Sa},${Sa},${tm}\\)$`),fB={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};mR(Xm,nm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pB,formatHex:pB,formatHex8:TAe,formatHsl:OAe,formatRgb:hB,toString:hB});function pB(){return this.rgb().formatHex()}function TAe(){return this.rgb().formatHex8()}function OAe(){return E6(this).formatHsl()}function hB(){return this.rgb().formatRgb()}function nm(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=bAe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?mB(t):r===3?new wi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yAe.exec(e))?new wi(t[1],t[2],t[3],1):(t=vAe.exec(e))?new wi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xAe.exec(e))?mv(t[1],t[2],t[3],t[4]):(t=SAe.exec(e))?mv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=CAe.exec(e))?yB(t[1],t[2]/100,t[3]/100,1):(t=wAe.exec(e))?yB(t[1],t[2]/100,t[3]/100,t[4]):fB.hasOwnProperty(e)?mB(fB[e]):e==="transparent"?new wi(NaN,NaN,NaN,0):null}function mB(e){return new wi(e>>16&255,e>>8&255,e&255,1)}function mv(e,t,r,o){return o<=0&&(e=t=r=NaN),new wi(e,t,r,o)}function PAe(e){return e instanceof Xm||(e=nm(e)),e?(e=e.rgb(),new wi(e.r,e.g,e.b,e.opacity)):new wi}function CP(e,t,r,o){return arguments.length===1?PAe(e):new wi(e,t,r,o??1)}function wi(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o}mR(wi,CP,P6(Xm,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new wi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?em:Math.pow(em,e),new wi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wi(ou(this.r),ou(this.g),ou(this.b),$x(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gB,formatHex:gB,formatHex8:EAe,formatRgb:bB,toString:bB}));function gB(){return`#${Zc(this.r)}${Zc(this.g)}${Zc(this.b)}`}function EAe(){return`#${Zc(this.r)}${Zc(this.g)}${Zc(this.b)}${Zc((isNaN(this.opacity)?1:this.opacity)*255)}`}function bB(){const e=$x(this.opacity);return`${e===1?"rgb(":"rgba("}${ou(this.r)}, ${ou(this.g)}, ${ou(this.b)}${e===1?")":`, ${e})`}`}function $x(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ou(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zc(e){return e=ou(e),(e<16?"0":"")+e.toString(16)}function yB(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qs(e,t,r,o)}function E6(e){if(e instanceof Qs)return new Qs(e.h,e.s,e.l,e.opacity);if(e instanceof Xm||(e=nm(e)),!e)return new Qs;if(e instanceof Qs)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,i=Math.min(t,r,o),s=Math.max(t,r,o),a=NaN,l=s-i,c=(s+i)/2;return l?(t===s?a=(r-o)/l+(r<o)*6:r===s?a=(o-t)/l+2:a=(t-r)/l+4,l/=c<.5?s+i:2-s-i,a*=60):l=c>0&&c<1?0:a,new Qs(a,l,c,e.opacity)}function IAe(e,t,r,o){return arguments.length===1?E6(e):new Qs(e,t,r,o??1)}function Qs(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o}mR(Qs,IAe,P6(Xm,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new Qs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?em:Math.pow(em,e),new Qs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*t,i=2*r-o;return new wi(bO(e>=240?e-240:e+120,i,o),bO(e,i,o),bO(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Qs(vB(this.h),gv(this.s),gv(this.l),$x(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=$x(this.opacity);return`${e===1?"hsl(":"hsla("}${vB(this.h)}, ${gv(this.s)*100}%, ${gv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vB(e){return e=(e||0)%360,e<0?e+360:e}function gv(e){return Math.max(0,Math.min(1,e||0))}function bO(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const gR=e=>()=>e;function kAe(e,t){return function(r){return e+r*t}}function RAe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function MAe(e){return(e=+e)==1?I6:function(t,r){return r-t?RAe(t,r,e):gR(isNaN(t)?r:t)}}function I6(e,t){var r=t-e;return r?kAe(e,r):gR(isNaN(e)?t:e)}const xB=(function e(t){var r=MAe(t);function o(i,s){var a=r((i=CP(i)).r,(s=CP(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),u=I6(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return o.gamma=e,o})(1);function AAe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(s){for(i=0;i<r;++i)o[i]=e[i]*(1-s)+t[i]*s;return o}}function DAe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _Ae(e,t){var r=t?t.length:0,o=e?Math.min(r,e.length):0,i=new Array(o),s=new Array(r),a;for(a=0;a<o;++a)i[a]=jS(e[a],t[a]);for(;a<r;++a)s[a]=t[a];return function(l){for(a=0;a<o;++a)s[a]=i[a](l);return s}}function bR(e,t){var r=new Date;return e=+e,t=+t,function(o){return r.setTime(e*(1-o)+t*o),r}}function Dn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function NAe(e,t){var r={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=jS(e[i],t[i]):o[i]=t[i];return function(s){for(i in r)o[i]=r[i](s);return o}}var wP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yO=new RegExp(wP.source,"g");function FAe(e){return function(){return e}}function LAe(e){return function(t){return e(t)+""}}function yR(e,t){var r=wP.lastIndex=yO.lastIndex=0,o,i,s,a=-1,l=[],c=[];for(e=e+"",t=t+"";(o=wP.exec(e))&&(i=yO.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),l[a]?l[a]+=s:l[++a]=s),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,c.push({i:a,x:Dn(o,i)})),r=yO.lastIndex;return r<t.length&&(s=t.slice(r),l[a]?l[a]+=s:l[++a]=s),l.length<2?c[0]?LAe(c[0].x):FAe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function jS(e,t){var r=typeof t,o;return t==null||r==="boolean"?gR(t):(r==="number"?Dn:r==="string"?(o=nm(t))?(t=o,xB):yR:t instanceof nm?xB:t instanceof Date?bR:DAe(t)?AAe:Array.isArray(t)?_Ae:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?NAe:Dn)(e,t)}function k6(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function $Ae(e){return function(){return e}}function jAe(e){return+e}var SB=[0,1];function ws(e){return e}function TP(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:$Ae(isNaN(t)?NaN:.5)}function BAe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(o){return Math.max(e,Math.min(t,o))}}function VAe(e,t,r){var o=e[0],i=e[1],s=t[0],a=t[1];return i<o?(o=TP(i,o),s=r(a,s)):(o=TP(o,i),s=r(s,a)),function(l){return s(o(l))}}function HAe(e,t,r){var o=Math.min(e.length,t.length)-1,i=new Array(o),s=new Array(o),a=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<o;)i[a]=TP(e[a],e[a+1]),s[a]=r(t[a],t[a+1]);return function(l){var c=O6(e,l,1,o)-1;return s[c](i[c](l))}}function Qm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function BS(){var e=SB,t=SB,r=jS,o,i,s,a=ws,l,c,u;function d(){var p=Math.min(e.length,t.length);return a!==ws&&(a=BAe(e[0],e[p-1])),l=p>2?HAe:VAe,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?s:(c||(c=l(e.map(o),t,r)))(o(a(p)))}return f.invert=function(p){return a(i((u||(u=l(t,e.map(o),Dn)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,jAe),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),r=k6,d()},f.clamp=function(p){return arguments.length?(a=p?!0:ws,d()):a!==ws},f.interpolate=function(p){return arguments.length?(r=p,d()):r},f.unknown=function(p){return arguments.length?(s=p,f):s},function(p,h){return o=p,i=h,d()}}function R6(){return BS()(ws,ws)}function zAe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jx(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),o=e.slice(0,r);return[o.length>1?o[0]+o.slice(2):o,+e.slice(r+1)]}function Rf(e){return e=jx(Math.abs(e)),e?e[1]:NaN}function qAe(e,t){return function(r,o){for(var i=r.length,s=[],a=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>o&&(l=Math.max(1,o-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>o));)l=e[a=(a+1)%e.length];return s.reverse().join(t)}}function UAe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var GAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rm(e){if(!(t=GAe.exec(e)))throw new Error("invalid format: "+e);var t;return new vR({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}rm.prototype=vR.prototype;function vR(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}vR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function WAe(e){e:for(var t=e.length,r=1,o=-1,i;r<t;++r)switch(e[r]){case".":o=i=r;break;case"0":o===0&&(o=r),i=r;break;default:if(!+e[r])break e;o>0&&(o=0);break}return o>0?e.slice(0,o)+e.slice(i+1):e}var Bx;function KAe(e,t){var r=jx(e,t);if(!r)return Bx=void 0,e.toPrecision(t);var o=r[0],i=r[1],s=i-(Bx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=o.length;return s===a?o:s>a?o+new Array(s-a+1).join("0"):s>0?o.slice(0,s)+"."+o.slice(s):"0."+new Array(1-s).join("0")+jx(e,Math.max(0,t+s-1))[0]}function CB(e,t){var r=jx(e,t);if(!r)return e+"";var o=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+o:o.length>i+1?o.slice(0,i+1)+"."+o.slice(i+1):o+new Array(i-o.length+2).join("0")}const wB={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zAe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>CB(e*100,t),r:CB,s:KAe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function TB(e){return e}var OB=Array.prototype.map,PB=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YAe(e){var t=e.grouping===void 0||e.thousands===void 0?TB:qAe(OB.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",o=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?TB:UAe(OB.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,p){f=rm(f);var h=f.fill,b=f.align,g=f.sign,y=f.symbol,v=f.zero,C=f.width,O=f.comma,T=f.precision,P=f.trim,k=f.type;k==="n"?(O=!0,k="g"):wB[k]||(T===void 0&&(T=12),P=!0,k="g"),(v||h==="0"&&b==="=")&&(v=!0,h="0",b="=");var M=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),_=(y==="$"?o:/[%p]/.test(k)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),D=wB[k],A=/[defgprs%]/.test(k);T=T===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function F(I){var N=M,j=_,H,$,B;if(k==="c")j=D(I)+j,I="";else{I=+I;var q=I<0||1/I<0;if(I=isNaN(I)?c:D(Math.abs(I),T),P&&(I=WAe(I)),q&&+I==0&&g!=="+"&&(q=!1),N=(q?g==="("?g:l:g==="-"||g==="("?"":g)+N,j=(k==="s"&&!isNaN(I)&&Bx!==void 0?PB[8+Bx/3]:"")+j+(q&&g==="("?")":""),A){for(H=-1,$=I.length;++H<$;)if(B=I.charCodeAt(H),48>B||B>57){j=(B===46?i+I.slice(H+1):I.slice(H))+j,I=I.slice(0,H);break}}}O&&!v&&(I=t(I,1/0));var U=N.length+I.length+j.length,V=U<C?new Array(C-U+1).join(h):"";switch(O&&v&&(I=t(V+I,V.length?C-j.length:1/0),V=""),b){case"<":I=N+I+j+V;break;case"=":I=N+V+I+j;break;case"^":I=V.slice(0,U=V.length>>1)+N+I+j+V.slice(U);break;default:I=V+N+I+j;break}return s(I)}return F.toString=function(){return f+""},F}function d(f,p){var h=Math.max(-8,Math.min(8,Math.floor(Rf(p)/3)))*3,b=Math.pow(10,-h),g=u((f=rm(f),f.type="f",f),{suffix:PB[8+h/3]});return function(y){return g(b*y)}}return{format:u,formatPrefix:d}}var bv,xR,M6;ZAe({thousands:",",grouping:[3],currency:["$",""]});function ZAe(e){return bv=YAe(e),xR=bv.format,M6=bv.formatPrefix,bv}function XAe(e){return Math.max(0,-Rf(Math.abs(e)))}function QAe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rf(t)/3)))*3-Rf(Math.abs(e)))}function JAe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rf(t)-Rf(e))+1}function eDe(e,t,r,o){var i=xP(e,t,r),s;switch(o=rm(o??",f"),o.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return o.precision==null&&!isNaN(s=QAe(i,a))&&(o.precision=s),M6(o,a)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(s=JAe(i,Math.max(Math.abs(e),Math.abs(t))))&&(o.precision=s-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(s=XAe(i))&&(o.precision=s-(o.type==="%")*2);break}}return xR(o)}function VS(e){var t=e.domain;return e.ticks=function(r){var o=t();return yP(o[0],o[o.length-1],r??10)},e.tickFormat=function(r,o){var i=t();return eDe(i[0],i[i.length-1],r??10,o)},e.nice=function(r){r==null&&(r=10);var o=t(),i=0,s=o.length-1,a=o[i],l=o[s],c,u,d=10;for(l<a&&(u=a,a=l,l=u,u=i,i=s,s=u);d-- >0;){if(u=vP(a,l,r),u===c)return o[i]=a,o[s]=l,t(o);if(u>0)a=Math.floor(a/u)*u,l=Math.ceil(l/u)*u;else if(u<0)a=Math.ceil(a*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function SR(){var e=R6();return e.copy=function(){return Qm(e,SR())},gc.apply(e,arguments),VS(e)}function A6(e,t){e=e.slice();var r=0,o=e.length-1,i=e[r],s=e[o],a;return s<i&&(a=r,r=o,o=a,a=i,i=s,s=a),e[r]=t.floor(i),e[o]=t.ceil(s),e}function EB(e){return Math.log(e)}function IB(e){return Math.exp(e)}function tDe(e){return-Math.log(-e)}function nDe(e){return-Math.exp(-e)}function rDe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function oDe(e){return e===10?rDe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function iDe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kB(e){return(t,r)=>-e(-t,r)}function sDe(e){const t=e(EB,IB),r=t.domain;let o=10,i,s;function a(){return i=iDe(o),s=oDe(o),r()[0]<0?(i=kB(i),s=kB(s),e(tDe,nDe)):e(EB,IB),t}return t.base=function(l){return arguments.length?(o=+l,a()):o},t.domain=function(l){return arguments.length?(r(l),a()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let p=i(u),h=i(d),b,g;const y=l==null?10:+l;let v=[];if(!(o%1)&&h-p<y){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(b=1;b<o;++b)if(g=p<0?b/s(-p):b*s(p),!(g<u)){if(g>d)break;v.push(g)}}else for(;p<=h;++p)for(b=o-1;b>=1;--b)if(g=p>0?b/s(-p):b*s(p),!(g<u)){if(g>d)break;v.push(g)}v.length*2<y&&(v=yP(u,d,y))}else v=yP(p,h,Math.min(h-p,y)).map(s);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=o===10?"s":","),typeof c!="function"&&(!(o%1)&&(c=rm(c)).precision==null&&(c.trim=!0),c=xR(c)),l===1/0)return c;const u=Math.max(1,o*l/t.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*o<o-.5&&(f*=o),f<=u?c(d):""}},t.nice=()=>r(A6(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function Vx(){const e=sDe(BS()).domain([1,10]);return e.copy=()=>Qm(e,Vx()).base(e.base()),gc.apply(e,arguments),e}function RB(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MB(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function aDe(e){var t=1,r=e(RB(t),MB(t));return r.constant=function(o){return arguments.length?e(RB(t=+o),MB(t)):t},VS(r)}function D6(){var e=aDe(BS());return e.copy=function(){return Qm(e,D6()).constant(e.constant())},gc.apply(e,arguments)}function AB(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function lDe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cDe(e){return e<0?-e*e:e*e}function uDe(e){var t=e(ws,ws),r=1;function o(){return r===1?e(ws,ws):r===.5?e(lDe,cDe):e(AB(r),AB(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,o()):r},VS(t)}function CR(){var e=uDe(BS());return e.copy=function(){return Qm(e,CR()).exponent(e.exponent())},gc.apply(e,arguments),e}function dDe(){return CR.apply(null,arguments).exponent(.5)}function _6(){var e=[.5],t=[0,1],r,o=1;function i(s){return s!=null&&s<=s?t[O6(e,s,0,o)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),o=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),o=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var a=t.indexOf(s);return[e[a-1],e[a]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return _6().domain(e).range(t).unknown(r)},gc.apply(i,arguments)}const vO=new Date,xO=new Date;function lo(e,t,r,o){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),l=i.ceil(s);return s-a<l-s?a:l},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s<a)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<a);return c},i.filter=s=>lo(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,l)=>{if(a>=a)if(l<0)for(;++l<=0;)for(;t(a,-1),!s(a););else for(;--l>=0;)for(;t(a,1),!s(a););}),r&&(i.count=(s,a)=>(vO.setTime(+s),xO.setTime(+a),e(vO),e(xO),Math.floor(r(vO,xO))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(o?a=>o(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Hx=lo(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?lo(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Hx);Hx.range;const Za=1e3,Ts=Za*60,Xa=Ts*60,sl=Xa*24,wR=sl*7,DB=sl*30,SO=sl*365,Xc=lo(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Za)},(e,t)=>(t-e)/Za,e=>e.getUTCSeconds());Xc.range;const TR=lo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Za)},(e,t)=>{e.setTime(+e+t*Ts)},(e,t)=>(t-e)/Ts,e=>e.getMinutes());TR.range;const OR=lo(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ts)},(e,t)=>(t-e)/Ts,e=>e.getUTCMinutes());OR.range;const PR=lo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Za-e.getMinutes()*Ts)},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getHours());PR.range;const ER=lo(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getUTCHours());ER.range;const Jm=lo(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ts)/sl,e=>e.getDate()-1);Jm.range;const HS=lo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/sl,e=>e.getUTCDate()-1);HS.range;const N6=lo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/sl,e=>Math.floor(e/sl));N6.range;function Nu(e){return lo(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ts)/wR)}const zS=Nu(0),zx=Nu(1),fDe=Nu(2),pDe=Nu(3),Mf=Nu(4),hDe=Nu(5),mDe=Nu(6);zS.range;zx.range;fDe.range;pDe.range;Mf.range;hDe.range;mDe.range;function Fu(e){return lo(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/wR)}const qS=Fu(0),qx=Fu(1),gDe=Fu(2),bDe=Fu(3),Af=Fu(4),yDe=Fu(5),vDe=Fu(6);qS.range;qx.range;gDe.range;bDe.range;Af.range;yDe.range;vDe.range;const IR=lo(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());IR.range;const kR=lo(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());kR.range;const al=lo(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());al.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lo(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});al.range;const ll=lo(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ll.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lo(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ll.range;function F6(e,t,r,o,i,s){const a=[[Xc,1,Za],[Xc,5,5*Za],[Xc,15,15*Za],[Xc,30,30*Za],[s,1,Ts],[s,5,5*Ts],[s,15,15*Ts],[s,30,30*Ts],[i,1,Xa],[i,3,3*Xa],[i,6,6*Xa],[i,12,12*Xa],[o,1,sl],[o,2,2*sl],[r,1,wR],[t,1,DB],[t,3,3*DB],[e,1,SO]];function l(u,d,f){const p=d<u;p&&([u,d]=[d,u]);const h=f&&typeof f.range=="function"?f:c(u,d,f),b=h?h.range(u,+d+1):[];return p?b.reverse():b}function c(u,d,f){const p=Math.abs(d-u)/f,h=hR(([,,y])=>y).right(a,p);if(h===a.length)return e.every(xP(u/SO,d/SO,f));if(h===0)return Hx.every(Math.max(xP(u,d,f),1));const[b,g]=a[p/a[h-1][2]<a[h][2]/p?h-1:h];return b.every(g)}return[l,c]}const[xDe,SDe]=F6(ll,kR,qS,N6,ER,OR),[CDe,wDe]=F6(al,IR,zS,Jm,PR,TR);function CO(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function wO(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function qp(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function TDe(e){var t=e.dateTime,r=e.date,o=e.time,i=e.periods,s=e.days,a=e.shortDays,l=e.months,c=e.shortMonths,u=Up(i),d=Gp(i),f=Up(s),p=Gp(s),h=Up(a),b=Gp(a),g=Up(l),y=Gp(l),v=Up(c),C=Gp(c),O={a:B,A:q,b:U,B:V,c:null,d:jB,e:jB,f:WDe,g:r_e,G:i_e,H:qDe,I:UDe,j:GDe,L:L6,m:KDe,M:YDe,p:L,q:G,Q:HB,s:zB,S:ZDe,u:XDe,U:QDe,V:JDe,w:e_e,W:t_e,x:null,X:null,y:n_e,Y:o_e,Z:s_e,"%":VB},T={a:Z,A:X,b:J,B:te,c:null,d:BB,e:BB,f:u_e,g:x_e,G:C_e,H:a_e,I:l_e,j:c_e,L:j6,m:d_e,M:f_e,p:ce,q:me,Q:HB,s:zB,S:p_e,u:h_e,U:m_e,V:g_e,w:b_e,W:y_e,x:null,X:null,y:v_e,Y:S_e,Z:w_e,"%":VB},P={a:A,A:F,b:I,B:N,c:j,d:LB,e:LB,f:BDe,g:FB,G:NB,H:$B,I:$B,j:FDe,L:jDe,m:NDe,M:LDe,p:D,q:_De,Q:HDe,s:zDe,S:$De,u:kDe,U:RDe,V:MDe,w:IDe,W:ADe,x:H,X:$,y:FB,Y:NB,Z:DDe,"%":VDe};O.x=k(r,O),O.X=k(o,O),O.c=k(t,O),T.x=k(r,T),T.X=k(o,T),T.c=k(t,T);function k(re,se){return function(le){var Q=[],Ce=-1,ge=0,Se=re.length,xe,W,K;for(le instanceof Date||(le=new Date(+le));++Ce<Se;)re.charCodeAt(Ce)===37&&(Q.push(re.slice(ge,Ce)),(W=_B[xe=re.charAt(++Ce)])!=null?xe=re.charAt(++Ce):W=xe==="e"?" ":"0",(K=se[xe])&&(xe=K(le,W)),Q.push(xe),ge=Ce+1);return Q.push(re.slice(ge,Ce)),Q.join("")}}function M(re,se){return function(le){var Q=qp(1900,void 0,1),Ce=_(Q,re,le+="",0),ge,Se;if(Ce!=le.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(se&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(ge=wO(qp(Q.y,0,1)),Se=ge.getUTCDay(),ge=Se>4||Se===0?qx.ceil(ge):qx(ge),ge=HS.offset(ge,(Q.V-1)*7),Q.y=ge.getUTCFullYear(),Q.m=ge.getUTCMonth(),Q.d=ge.getUTCDate()+(Q.w+6)%7):(ge=CO(qp(Q.y,0,1)),Se=ge.getDay(),ge=Se>4||Se===0?zx.ceil(ge):zx(ge),ge=Jm.offset(ge,(Q.V-1)*7),Q.y=ge.getFullYear(),Q.m=ge.getMonth(),Q.d=ge.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),Se="Z"in Q?wO(qp(Q.y,0,1)).getUTCDay():CO(qp(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(Se+5)%7:Q.w+Q.U*7-(Se+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,wO(Q)):CO(Q)}}function _(re,se,le,Q){for(var Ce=0,ge=se.length,Se=le.length,xe,W;Ce<ge;){if(Q>=Se)return-1;if(xe=se.charCodeAt(Ce++),xe===37){if(xe=se.charAt(Ce++),W=P[xe in _B?se.charAt(Ce++):xe],!W||(Q=W(re,le,Q))<0)return-1}else if(xe!=le.charCodeAt(Q++))return-1}return Q}function D(re,se,le){var Q=u.exec(se.slice(le));return Q?(re.p=d.get(Q[0].toLowerCase()),le+Q[0].length):-1}function A(re,se,le){var Q=h.exec(se.slice(le));return Q?(re.w=b.get(Q[0].toLowerCase()),le+Q[0].length):-1}function F(re,se,le){var Q=f.exec(se.slice(le));return Q?(re.w=p.get(Q[0].toLowerCase()),le+Q[0].length):-1}function I(re,se,le){var Q=v.exec(se.slice(le));return Q?(re.m=C.get(Q[0].toLowerCase()),le+Q[0].length):-1}function N(re,se,le){var Q=g.exec(se.slice(le));return Q?(re.m=y.get(Q[0].toLowerCase()),le+Q[0].length):-1}function j(re,se,le){return _(re,t,se,le)}function H(re,se,le){return _(re,r,se,le)}function $(re,se,le){return _(re,o,se,le)}function B(re){return a[re.getDay()]}function q(re){return s[re.getDay()]}function U(re){return c[re.getMonth()]}function V(re){return l[re.getMonth()]}function L(re){return i[+(re.getHours()>=12)]}function G(re){return 1+~~(re.getMonth()/3)}function Z(re){return a[re.getUTCDay()]}function X(re){return s[re.getUTCDay()]}function J(re){return c[re.getUTCMonth()]}function te(re){return l[re.getUTCMonth()]}function ce(re){return i[+(re.getUTCHours()>=12)]}function me(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var se=k(re+="",O);return se.toString=function(){return re},se},parse:function(re){var se=M(re+="",!1);return se.toString=function(){return re},se},utcFormat:function(re){var se=k(re+="",T);return se.toString=function(){return re},se},utcParse:function(re){var se=M(re+="",!0);return se.toString=function(){return re},se}}}var _B={"-":"",_:" ",0:"0"},bo=/^\s*\d+/,ODe=/^%/,PDe=/[\\^$*+?|[\]().{}]/g;function En(e,t,r){var o=e<0?"-":"",i=(o?-e:e)+"",s=i.length;return o+(s<r?new Array(r-s+1).join(t)+i:i)}function EDe(e){return e.replace(PDe,"\\$&")}function Up(e){return new RegExp("^(?:"+e.map(EDe).join("|")+")","i")}function Gp(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function IDe(e,t,r){var o=bo.exec(t.slice(r,r+1));return o?(e.w=+o[0],r+o[0].length):-1}function kDe(e,t,r){var o=bo.exec(t.slice(r,r+1));return o?(e.u=+o[0],r+o[0].length):-1}function RDe(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.U=+o[0],r+o[0].length):-1}function MDe(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.V=+o[0],r+o[0].length):-1}function ADe(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.W=+o[0],r+o[0].length):-1}function NB(e,t,r){var o=bo.exec(t.slice(r,r+4));return o?(e.y=+o[0],r+o[0].length):-1}function FB(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),r+o[0].length):-1}function DDe(e,t,r){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),r+o[0].length):-1}function _De(e,t,r){var o=bo.exec(t.slice(r,r+1));return o?(e.q=o[0]*3-3,r+o[0].length):-1}function NDe(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.m=o[0]-1,r+o[0].length):-1}function LB(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.d=+o[0],r+o[0].length):-1}function FDe(e,t,r){var o=bo.exec(t.slice(r,r+3));return o?(e.m=0,e.d=+o[0],r+o[0].length):-1}function $B(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.H=+o[0],r+o[0].length):-1}function LDe(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.M=+o[0],r+o[0].length):-1}function $De(e,t,r){var o=bo.exec(t.slice(r,r+2));return o?(e.S=+o[0],r+o[0].length):-1}function jDe(e,t,r){var o=bo.exec(t.slice(r,r+3));return o?(e.L=+o[0],r+o[0].length):-1}function BDe(e,t,r){var o=bo.exec(t.slice(r,r+6));return o?(e.L=Math.floor(o[0]/1e3),r+o[0].length):-1}function VDe(e,t,r){var o=ODe.exec(t.slice(r,r+1));return o?r+o[0].length:-1}function HDe(e,t,r){var o=bo.exec(t.slice(r));return o?(e.Q=+o[0],r+o[0].length):-1}function zDe(e,t,r){var o=bo.exec(t.slice(r));return o?(e.s=+o[0],r+o[0].length):-1}function jB(e,t){return En(e.getDate(),t,2)}function qDe(e,t){return En(e.getHours(),t,2)}function UDe(e,t){return En(e.getHours()%12||12,t,2)}function GDe(e,t){return En(1+Jm.count(al(e),e),t,3)}function L6(e,t){return En(e.getMilliseconds(),t,3)}function WDe(e,t){return L6(e,t)+"000"}function KDe(e,t){return En(e.getMonth()+1,t,2)}function YDe(e,t){return En(e.getMinutes(),t,2)}function ZDe(e,t){return En(e.getSeconds(),t,2)}function XDe(e){var t=e.getDay();return t===0?7:t}function QDe(e,t){return En(zS.count(al(e)-1,e),t,2)}function $6(e){var t=e.getDay();return t>=4||t===0?Mf(e):Mf.ceil(e)}function JDe(e,t){return e=$6(e),En(Mf.count(al(e),e)+(al(e).getDay()===4),t,2)}function e_e(e){return e.getDay()}function t_e(e,t){return En(zx.count(al(e)-1,e),t,2)}function n_e(e,t){return En(e.getFullYear()%100,t,2)}function r_e(e,t){return e=$6(e),En(e.getFullYear()%100,t,2)}function o_e(e,t){return En(e.getFullYear()%1e4,t,4)}function i_e(e,t){var r=e.getDay();return e=r>=4||r===0?Mf(e):Mf.ceil(e),En(e.getFullYear()%1e4,t,4)}function s_e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+En(t/60|0,"0",2)+En(t%60,"0",2)}function BB(e,t){return En(e.getUTCDate(),t,2)}function a_e(e,t){return En(e.getUTCHours(),t,2)}function l_e(e,t){return En(e.getUTCHours()%12||12,t,2)}function c_e(e,t){return En(1+HS.count(ll(e),e),t,3)}function j6(e,t){return En(e.getUTCMilliseconds(),t,3)}function u_e(e,t){return j6(e,t)+"000"}function d_e(e,t){return En(e.getUTCMonth()+1,t,2)}function f_e(e,t){return En(e.getUTCMinutes(),t,2)}function p_e(e,t){return En(e.getUTCSeconds(),t,2)}function h_e(e){var t=e.getUTCDay();return t===0?7:t}function m_e(e,t){return En(qS.count(ll(e)-1,e),t,2)}function B6(e){var t=e.getUTCDay();return t>=4||t===0?Af(e):Af.ceil(e)}function g_e(e,t){return e=B6(e),En(Af.count(ll(e),e)+(ll(e).getUTCDay()===4),t,2)}function b_e(e){return e.getUTCDay()}function y_e(e,t){return En(qx.count(ll(e)-1,e),t,2)}function v_e(e,t){return En(e.getUTCFullYear()%100,t,2)}function x_e(e,t){return e=B6(e),En(e.getUTCFullYear()%100,t,2)}function S_e(e,t){return En(e.getUTCFullYear()%1e4,t,4)}function C_e(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Af(e):Af.ceil(e),En(e.getUTCFullYear()%1e4,t,4)}function w_e(){return"+0000"}function VB(){return"%"}function HB(e){return+e}function zB(e){return Math.floor(+e/1e3)}var Ad,V6,H6;T_e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function T_e(e){return Ad=TDe(e),V6=Ad.format,Ad.parse,H6=Ad.utcFormat,Ad.utcParse,Ad}function O_e(e){return new Date(e)}function P_e(e){return e instanceof Date?+e:+new Date(+e)}function RR(e,t,r,o,i,s,a,l,c,u){var d=R6(),f=d.invert,p=d.domain,h=u(".%L"),b=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),C=u("%b %d"),O=u("%B"),T=u("%Y");function P(k){return(c(k)<k?h:l(k)<k?b:a(k)<k?g:s(k)<k?y:o(k)<k?i(k)<k?v:C:r(k)<k?O:T)(k)}return d.invert=function(k){return new Date(f(k))},d.domain=function(k){return arguments.length?p(Array.from(k,P_e)):p().map(O_e)},d.ticks=function(k){var M=p();return e(M[0],M[M.length-1],k??10)},d.tickFormat=function(k,M){return M==null?P:u(M)},d.nice=function(k){var M=p();return(!k||typeof k.range!="function")&&(k=t(M[0],M[M.length-1],k??10)),k?p(A6(M,k)):d},d.copy=function(){return Qm(d,RR(e,t,r,o,i,s,a,l,c,u))},d}function z6(){return gc.apply(RR(CDe,wDe,al,IR,zS,Jm,PR,TR,Xc,V6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function E_e(){return gc.apply(RR(xDe,SDe,ll,kR,qS,HS,ER,OR,Xc,H6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function I_e(){var e=0,t=1,r,o,i,s,a=ws,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:a(i===0?.5:(f=(s(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=s(e=+e),o=s(t=+t),i=r===o?0:1/(o-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(a=f,u):a};function d(f){return function(p){var h,b;return arguments.length?([h,b]=p,a=f(h,b),u):[a(0),a(1)]}}return u.range=d(jS),u.rangeRound=d(k6),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,r=f(e),o=f(t),i=r===o?0:1/(o-r),u}}function k_e(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function q6(){var e=VS(I_e()(ws));return e.copy=function(){return k_e(e,q6())},gAe.apply(e,arguments)}function U6(e){return e.type==="piecewise"?_6(e.thresholds,e.colors):q6([e.min??0,e.max??100],e.color)}function Df(e){return e.values?SP(e.values,e.colors).unknown(e.unknownColor??null):SP(e.colors.map((t,r)=>r),e.colors).unknown(e.unknownColor??null)}function ff(e){return e.type==="ordinal"?Df(e):U6(e)}function US(e,t,r){const{tickMaxStep:o,tickMinStep:i,tickNumber:s}=e,a=i===void 0?999:Math.floor(Math.abs(t[1]-t[0])/i),l=o===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/o);return Math.min(a,Math.max(l,s??r))}function G6(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function MR(e){return Math.floor(Math.abs(e)/50)}function qB(e){return Array.isArray(e)?JSON.stringify(e):typeof e=="object"&&e!==null?e.valueOf():e}function GS(...e){let t=new Nx(void 0,qB),r=[],o=[],i=0,s=1,a,l,c=!1,u=0,d=0,f=.5;const p=y=>{const v=t.get(y);if(v!==void 0)return o[v%o.length]},h=()=>{const y=r.length,v=s<i,C=v?s:i,O=v?i:s;a=(O-C)/Math.max(1,y-u+d*2),c&&(a=Math.floor(a));const T=C+(O-C-a*(y-u))*f;l=a*(1-u);const P=c?Math.round(T):T;l=c?Math.round(l):l;const M=mAe(y).map(_=>P+a*_);return o=v?M.reverse():M,p};p.domain=function(y){if(!arguments.length)return r.slice();r=[],t=new Nx(void 0,qB);for(const v of y)t.has(v)||t.set(v,r.push(v)-1);return h()},p.range=function(y){if(!arguments.length)return[i,s];const[v,C]=y;return i=+v,s=+C,h()},p.rangeRound=function(y){const[v,C]=y;return i=+v,s=+C,c=!0,h()},p.bandwidth=function(){return l},p.step=function(){return a},p.round=function(y){return arguments.length?(c=!!y,h()):c},p.padding=function(y){return arguments.length?(u=Math.min(1,d=+y),h()):u},p.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),h()):u},p.paddingOuter=function(y){return arguments.length?(d=+y,h()):d},p.align=function(y){return arguments.length?(f=Math.max(0,Math.min(1,y)),h()):f},p.copy=()=>GS(r,[i,s]).round(c).paddingInner(u).paddingOuter(d).align(f);const[b,g]=e;return e.length>1?(p.domain(b),p.range(g)):b?p.range(b):h(),p}function W6(...e){const t=GS(...e).paddingInner(1),r=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const o=r();return o.padding=o.paddingOuter,delete o.paddingInner,delete o.paddingOuter,o.copy=t.copy,o},t}function K6(...e){const t=D6(...e),r=t.ticks,{negativeScale:o,linearScale:i,positiveScale:s}=R_e(t);return t.ticks=a=>{const l=r(a),c=t.constant();let u=0,d=0,f=0;l.forEach(h=>{h>-c&&h<c&&(d+=1),h<=-c&&(u+=1),h>=c&&(f+=1)});const p=[];if(u>0&&p.push(...o.ticks(u)),d>0){const h=i.ticks(d);p.at(-1)===h[0]?p.push(...h.slice(1)):p.push(...h)}if(f>0){const h=s.ticks(f);p.at(-1)===h[0]?p.push(...h.slice(1)):p.push(...h)}return p},t.tickFormat=(a=10,l)=>{const c=t.constant(),[u,d]=t.domain(),f=d-u,p=o.domain(),h=p[1]-p[0],g=(f===0?0:h/f)*a,y=i.domain(),v=y[1]-y[0],O=(f===0?0:v/f)*a,T=s.domain(),P=T[1]-T[0],M=(f===0?0:P/f)*a,_=o.tickFormat(g,l),D=i.tickFormat(O,l),A=s.tickFormat(M,l);return F=>(F.valueOf()<=-c?_:F.valueOf()>=c?A:D)(F)},t.copy=()=>K6(t.domain(),t.range()).constant(t.constant()),t}function R_e(e){const t=e.constant(),r=e.domain(),o=[r[0],Math.min(r[1],-t)],i=Vx(o,e.range()),s=[Math.max(r[0],-t),Math.min(r[1],t)],a=SR(s,e.range()),l=[Math.max(r[0],t),r[1]],c=Vx(l,e.range());return{negativeScale:i,linearScale:a,positiveScale:c}}function WS(e,t,r){switch(e){case"log":return Vx(t,r);case"pow":return CR(t,r);case"sqrt":return dDe(t,r);case"time":return z6(t,r);case"utc":return E_e(t,r);case"symlog":return K6(t,r);default:return SR(t,r)}}const Ux=e=>e?.[0]instanceof Date;function OP(e,t,r){const o=z6(e,t);return(i,{location:s})=>s==="tick"?o.tickFormat(r)(i):`${i.toLocaleString()}`}let UB,GB;class M_e{types=new Set;constructor(){if(UB)throw new Error("You can only create one instance!");UB=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}class A_e{types=new Set;constructor(){if(GB)throw new Error("You can only create one instance!");GB=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const KS=new M_e;KS.addType("bar");KS.addType("line");KS.addType("scatter");const Y6=new A_e;Y6.addType("radar");function YS(e){return KS.getTypes().has(e)}function Gx(e){return YS(e.type)}const D_e=(e,t,r,o)=>{const i=new Set;return Object.keys(t).filter(YS).forEach(a=>{const l=r[a]?.series??{},c=t[a].axisTooltipGetter?.(l);c!==void 0&&c.forEach(({axisId:u,direction:d})=>{d===e&&i.add(u??o)})}),i};function so(e){return e.bandwidth!==void 0}function Z6(e){return so(e)&&e.paddingOuter!==void 0}function __e(e,t,r){const o=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return r?[o[1],o[0]]:o}function N_e(e,t){return e.step()*t<.1}const F_e=.2,L_e=.1;function X6({scales:e,drawingArea:t,formattedSeries:r,axis:o,seriesConfig:i,axisDirection:s,zoomMap:a,domains:l}){if(o===void 0)return{axis:{},axisIds:[]};const c=D_e(s,i,r,o[0].id),u={};return o.forEach(d=>{const f=d,p=e[f.id],h=a?.get(f.id),b=h?[h.start,h.end]:[0,100],g=__e(t,s,f.reverse??!1),y=l[f.id].tickNumber,v=!f.ignoreTooltip&&c.has(f.id),C=G6(y,b),O=f.data??[];if(so(p)){const k=s==="y"?[g[1],g[0]]:g;if(Z6(p)&&Du(f)){const M=f.categoryGapRatio??F_e,_=N_e(p,M),D=_?0:M,A=_?0:f.barGapRatio??L_e;u[f.id]=E({offset:0,height:0,categoryGapRatio:D,barGapRatio:A,triggerTooltip:v},f,{data:O,scale:_?p.copy().padding(0):p,tickNumber:C,colorScale:f.colorMap&&(f.colorMap.type==="ordinal"?Df(E({values:f.data},f.colorMap)):ff(f.colorMap))})}if(_u(f)&&(u[f.id]=E({offset:0,height:0,triggerTooltip:v},f,{data:O,scale:p,tickNumber:C,colorScale:f.colorMap&&(f.colorMap.type==="ordinal"?Df(E({values:f.data},f.colorMap)):ff(f.colorMap))})),Ux(f.data)){const M=OP(f.data,k,f.tickNumber);u[f.id].valueFormatter=f.valueFormatter??M}return}if(f.scaleType==="band"||f.scaleType==="point")return;const T=f,P=T.scaleType??"linear";u[f.id]=E({offset:0,height:0,triggerTooltip:v},T,{data:O,scaleType:P,scale:p,tickNumber:C,colorScale:T.colorMap&&U6(T.colorMap),valueFormatter:f.valueFormatter??nAe(C,WS(P,g.map(k=>p.invert(k)),g))})}),{axis:u,axisIds:o.map(({id:d})=>d)}}function $_e(e){return e!=null}function j_e(e,t,r,o){const i=e?.length??0,s=Math.floor(t*i/100),a=Math.ceil(r*i/100);return function(c,u){return(c[o]??e?.[u])==null?!0:u>=s&&u<a}}function B_e(e,t,r,o,i){const s=e[0].valueOf(),a=e[1].valueOf(),l=s+t*(a-s)/100,c=s+r*(a-s)/100;return function(d,f){const p=d[o]??i?.[f];return p==null?!0:p>=l&&p<=c}}const V_e=e=>({currentAxisId:t,seriesXAxisId:r,seriesYAxisId:o,isDefaultAxis:i})=>(s,a)=>!(t===r?o:r)||i?Object.values(e??{})[0]?.(s,a)??!0:[o,r].filter(u=>u!==t).map(u=>e[u??""]).filter($_e).every(u=>u(s,a)),WB=e=>(t=[])=>t.reduce((r,o)=>{const{zoom:i,id:s,reverse:a}=o,l=pR(i,s,e,a);return l&&(r[s]=l),r},{}),H_e=.2;function Q6(e,t,r){const o=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return r.reverse?[o[1],o[0]]:o}function J6(e,t){const r=[0,1];if(Du(e)){const s=e.categoryGapRatio??H_e;return GS(t,r).paddingInner(s).paddingOuter(s/2)}if(_u(e))return W6(t,r);const o=e.scaleType??"linear",i=WS(o,t,r);return oAe(e)&&e.constant!=null&&i.constant(e.constant),i}const eG=(e,t)=>{const r=e[1]-e[0],o=t[1]-t[0],i=e[0]-t[0]*r/o,s=e[1]+(100-t[1])*r/o;return[i,s]},z_e=(e,t,r,o,i,s,a)=>{const l=r==="x"?o[e].xExtremumGetter:o[e].yExtremumGetter,c=s[e]?.series??{};return l?.({series:c,axis:t,axisIndex:i,isDefaultAxis:i===0,getFilters:a})??[1/0,-1/0]};function ZS(e,t,r,o,i,s){const a=Object.keys(r).filter(YS);let l=[1/0,-1/0];for(const c of a){const[u,d]=z_e(c,e,t,r,o,i,s);l=[Math.min(l[0],u),Math.max(l[1],d)]}return Number.isNaN(l[0])||Number.isNaN(l[1])?[1/0,-1/0]:l}const q_e=(e,t,r,o)=>{if(e.domainLimit!==void 0)return e.domainLimit;if(t==="x")for(const i of o.line?.seriesOrder??[]){const s=o.line.series[i];if(s.xAxisId===e.id||s.xAxisId===void 0&&r===0)return"strict"}return"nice"};function tG(e,t,r){return WS(e??"linear",t,[0,1]).nice(r).domain()}function nG(e,t,r,o,[i,s],a,l){const c=oG(e,t,r,o,l);let u=iG(e,i,s);if(typeof c=="function"){const{min:f,max:p}=c(i.valueOf(),s.valueOf());u[0]=f,u[1]=p}const d=US(e,u,a);return c==="nice"&&(u=tG(e.scaleType,u,d)),u=["min"in e?e.min??u[0]:u[0],"max"in e?e.max??u[1]:u[1]],{domain:u,tickNumber:d}}function rG(e,t,r,o,[i,s],a,l){const c=oG(e,t,r,o,l);let u=iG(e,i,s);if(typeof c=="function"){const{min:d,max:f}=c(i.valueOf(),s.valueOf());u[0]=d,u[1]=f}return c==="nice"&&(u=tG(e.scaleType,u,a)),[e.min??u[0],e.max??u[1]]}function oG(e,t,r,o,i){return i?q_e(e,t,r,o):e.domainLimit??"nice"}function iG(e,t,r){let o=t,i=r;return"max"in e&&e.max!=null&&e.max<t&&(o=e.max),"min"in e&&e.min!=null&&e.min>t&&(i=e.min),!("min"in e)&&!("max"in e)?[o,i]:[e.min??o,e.max??i]}class U_e{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,r){let o=this.length++;for(;o>0;){const i=o-1>>1,s=this.values[i];if(r>=s)break;this.ids[o]=this.ids[i],this.values[o]=s,o=i}this.ids[o]=t,this.values[o]=r}pop(){if(this.length===0)return;const t=this.ids,r=this.values,o=t[0],i=--this.length;if(i>0){const s=t[i],a=r[i];let l=0;const c=i>>1;for(;l<c;){const u=(l<<1)+1,d=u+1,f=u+(+(d<i)&+(r[d]<r[u]));if(r[f]>=a)break;t[l]=t[f],r[l]=r[f],l=f}t[l]=s,r[l]=a}return o}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const KB=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],TO=3;class AR{static from(t,r=0){if(r%8!==0)throw new Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[o,i]=new Uint8Array(t,r+0,2);if(o!==251)throw new Error("Data does not appear to be in a Flatbush format.");const s=i>>4;if(s!==TO)throw new Error(`Got v${s} data when expected v${TO}.`);const a=KB[i&15];if(!a)throw new Error("Unrecognized array type.");const[l]=new Uint16Array(t,r+2,1),[c]=new Uint32Array(t,r+4,1);return new AR(c,l,a,void 0,t,r)}constructor(t,r=16,o=Float64Array,i=ArrayBuffer,s,a=0){if(t===void 0)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.byteOffset=a;let l=t,c=l;this._levelBounds=[l*4];do l=Math.ceil(l/this.nodeSize),c+=l,this._levelBounds.push(c*4);while(l!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;const u=KB.indexOf(o),d=c*4*o.BYTES_PER_ELEMENT;if(u<0)throw new Error(`Unexpected typed array class: ${o}.`);if(s)this.data=s,this._boxes=new o(s,a+8,c*4),this._indices=new this.IndexArrayType(s,a+8+d,c),this._pos=c*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const f=this.data=new i(8+d+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new o(f,8,c*4),this._indices=new this.IndexArrayType(f,8+d,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(f,0,2).set([251,(TO<<4)+u]),new Uint16Array(f,2,1)[0]=r,new Uint32Array(f,4,1)[0]=t}this._queue=new U_e}add(t,r,o=t,i=r){const s=this._pos>>2,a=this._boxes;return this._indices[s]=s,a[this._pos++]=t,a[this._pos++]=r,a[this._pos++]=o,a[this._pos++]=i,t<this.minX&&(this.minX=t),r<this.minY&&(this.minY=r),o>this.maxX&&(this.maxX=o),i>this.maxY&&(this.maxY=i),s}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}const r=this.maxX-this.minX||1,o=this.maxY-this.minY||1,i=new Uint32Array(this.numItems),s=65535;for(let a=0,l=0;a<this.numItems;a++){const c=t[l++],u=t[l++],d=t[l++],f=t[l++],p=Math.floor(s*((c+d)/2-this.minX)/r),h=Math.floor(s*((u+f)/2-this.minY)/o);i[a]=K_e(p,h)}PP(i,t,this._indices,0,this.numItems-1,this.nodeSize);for(let a=0,l=0;a<this._levelBounds.length-1;a++){const c=this._levelBounds[a];for(;l<c;){const u=l;let d=t[l++],f=t[l++],p=t[l++],h=t[l++];for(let b=1;b<this.nodeSize&&l<c;b++)d=Math.min(d,t[l++]),f=Math.min(f,t[l++]),p=Math.max(p,t[l++]),h=Math.max(h,t[l++]);this._indices[this._pos>>2]=u,t[this._pos++]=d,t[this._pos++]=f,t[this._pos++]=p,t[this._pos++]=h}}}search(t,r,o,i,s){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let a=this._boxes.length-4;const l=[],c=[];for(;a!==void 0;){const u=Math.min(a+this.nodeSize*4,YB(a,this._levelBounds));for(let d=a;d<u;d+=4){if(o<this._boxes[d]||i<this._boxes[d+1]||t>this._boxes[d+2]||r>this._boxes[d+3])continue;const f=this._indices[d>>2]|0;a>=this.numItems*4?l.push(f):(s===void 0||s(f))&&(c.push(f),c.push(this._boxes[d]),c.push(this._boxes[d+1]))}a=l.pop()}return c}neighbors(t,r,o=1/0,i=1/0,s,a=G_e){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let l=this._boxes.length-4;const c=this._queue,u=[];e:for(;l!==void 0;){const d=Math.min(l+this.nodeSize*4,YB(l,this._levelBounds));for(let f=l;f<d;f+=4){const p=this._indices[f>>2]|0,h=this._boxes[f],b=this._boxes[f+1],g=this._boxes[f+2],y=this._boxes[f+3],v=t<h?h-t:t>g?t-g:0,C=r<b?b-r:r>y?r-y:0,O=a(v,C);O>i||(l>=this.numItems*4?c.push(p<<1,O):(s===void 0||s(p))&&c.push((p<<1)+1,O))}for(;c.length&&c.peek()&1;)if(c.peekValue()>i||(u.push(c.pop()>>1),u.length===o))break e;l=c.length?c.pop()>>1:void 0}return c.clear(),u}}function G_e(e,t){return e*e+t*t}function YB(e,t){let r=0,o=t.length-1;for(;r<o;){const i=r+o>>1;t[i]>e?o=i:r=i+1}return t[r]}function PP(e,t,r,o,i,s){if(Math.floor(o/s)>=Math.floor(i/s))return;const a=e[o],l=e[o+i>>1],c=e[i];let u=c;const d=Math.max(a,l);c>d?u=d:d===a?u=Math.max(l,c):d===l&&(u=Math.max(a,c));let f=o-1,p=i+1;for(;;){do f++;while(e[f]<u);do p--;while(e[p]>u);if(f>=p)break;W_e(e,t,r,f,p)}PP(e,t,r,o,p,s),PP(e,t,r,p+1,i,s)}function W_e(e,t,r,o,i){const s=e[o];e[o]=e[i],e[i]=s;const a=4*o,l=4*i,c=t[a],u=t[a+1],d=t[a+2],f=t[a+3];t[a]=t[l],t[a+1]=t[l+1],t[a+2]=t[l+2],t[a+3]=t[l+3],t[l]=c,t[l+1]=u,t[l+2]=d,t[l+3]=f;const p=r[o];r[o]=r[i],r[i]=p}function K_e(e,t){let r=e^t,o=65535^r,i=65535^(e|t),s=e&(t^65535),a=r|o>>1,l=r>>1^r,c=i>>1^o&s>>1^i,u=r&i>>1^s>>1^s;r=a,o=l,i=c,s=u,a=r&r>>2^o&o>>2,l=r&o>>2^o&(r^o)>>2,c^=r&i>>2^o&s>>2,u^=o&i>>2^(r^o)&s>>2,r=a,o=l,i=c,s=u,a=r&r>>4^o&o>>4,l=r&o>>4^o&(r^o)>>4,c^=r&i>>4^o&s>>4,u^=o&i>>4^(r^o)&s>>4,r=a,o=l,i=c,s=u,c^=r&i>>8^o&s>>8,u^=o&i>>8^(r^o)&s>>8,r=c^c>>1,o=u^u>>1;let d=e^t,f=o|65535^(d|r);return d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,(f<<1|d)>>>0}const Y_e=e=>{const t=new Map;return e.forEach(r=>{t.set(r.axisId,r)}),t},sG=e=>e.zoom,aG=it(sG,e=>e?.isInteracting),bc=Yt(sG,function(t){return t?.zoomData&&Y_e(t?.zoomData)}),ZB=it(bc,(e,t)=>e?.get(t)),eg=Yt(hl,mc,function(t,r){return E({},WB("x")(t),WB("y")(r))});it(eg,(e,t)=>e[t]);const Z_e=it(ci,function(t){return MR(t.width)}),X_e=it(ci,function(t){return MR(t.height)}),DR=Yt(hl,sr,ui,FS,Z_e,function(t,r,o,i,s){const l={};return t?.forEach((c,u)=>{const d=c;if(Du(d)||_u(d)){l[d.id]={domain:d.data},d.ordinalTimeTicks!==void 0&&(l[d.id].tickNumber=US(d,[d.data?.find(p=>p!==null),d.data?.findLast(p=>p!==null)],s));return}const f=ZS(d,"x",o,u,r);l[d.id]=nG(d,"x",u,r,f,s,i)}),{axes:t,domains:l}}),_R=Yt(mc,sr,ui,FS,X_e,function(t,r,o,i,s){const l={};return t?.forEach((c,u)=>{const d=c;if(Du(d)||_u(d)){l[d.id]={domain:d.data},d.ordinalTimeTicks!==void 0&&(l[d.id].tickNumber=US(d,[d.data?.find(p=>p!==null),d.data?.findLast(p=>p!==null)],s));return}const f=ZS(d,"y",o,u,r);l[d.id]=nG(d,"y",u,r,f,s,i)}),{axes:t,domains:l}}),lG=Yt(bc,eg,DR,_R,function(t,r,{axes:o,domains:i},{axes:s,domains:a}){if(!t||!r)return;let l=!1;const c={},u=[...o??[],...s??[]];for(let d=0;d<u.length;d+=1){const f=u[d];if(!r[f.id]||r[f.id].filterMode!=="discard")continue;const p=t.get(f.id);if(p===void 0||p.start<=0&&p.end>=100)continue;const h=d<(o?.length??0)?"x":"y";if(f.scaleType==="band"||f.scaleType==="point")c[f.id]=j_e(f.data,p.start,p.end,h);else{const{domain:b}=h==="x"?i[f.id]:a[f.id];c[f.id]=B_e(b,p.start,p.end,h,f.data)}l=!0}if(l)return V_e(c)}),Q_e=Yt(sr,ui,bc,eg,lG,FS,DR,function(t,r,o,i,s,a,{axes:l,domains:c}){const u={};return l?.forEach((d,f)=>{const p=c[d.id].domain;if(Du(d)||_u(d)){u[d.id]=p;return}const h=o?.get(d.id),b=i?.[d.id],g=h===void 0&&!b?s:void 0;if(!g){u[d.id]=p;return}const y=c[d.id].tickNumber,v=ZS(d,"x",r,f,t,g);u[d.id]=rG(d,"x",f,t,v,y,a)}),u}),J_e=Yt(sr,ui,bc,eg,lG,FS,_R,function(t,r,o,i,s,a,{axes:l,domains:c}){const u={};return l?.forEach((d,f)=>{const p=c[d.id].domain;if(Du(d)||_u(d)){u[d.id]=p;return}const h=o?.get(d.id),b=i?.[d.id],g=h===void 0&&!b?s:void 0;if(!g){u[d.id]=p;return}const y=c[d.id].tickNumber,v=ZS(d,"y",r,f,t,g);u[d.id]=rG(d,"y",f,t,v,y,a)}),u}),cG=Yt(hl,Q_e,function(t,r){const o={};return t?.forEach(i=>{const s=i,a=r[s.id];o[s.id]=J6(s,a)}),o}),uG=Yt(mc,J_e,function(t,r){const o={};return t?.forEach(i=>{const s=i,a=r[s.id];o[s.id]=J6(s,a)}),o}),eNe=Yt(hl,cG,ci,bc,function(t,r,o,i){const s={};return t?.forEach(a=>{const l=a,c=i?.get(l.id),u=c?[c.start,c.end]:[0,100],d=Q6(o,"x",l),f=r[l.id].copy(),p=eG(d,u);f.range(p),s[l.id]=f}),s}),tNe=Yt(mc,uG,ci,bc,function(t,r,o,i){const s={};return t?.forEach(a=>{const l=a,c=i?.get(l.id),u=c?[c.start,c.end]:[0,100],d=Q6(o,"y",l),f=r[l.id].copy(),p=so(f)?d.reverse():d,h=eG(p,u);f.range(h),s[l.id]=f}),s}),qo=Yt(ci,sr,ui,bc,DR,eNe,function(t,r,o,i,{axes:s,domains:a},l){return X6({scales:l,drawingArea:t,formattedSeries:r,axis:s,seriesConfig:o,axisDirection:"x",zoomMap:i,domains:a})}),Uo=Yt(ci,sr,ui,bc,_R,tNe,function(t,r,o,i,{axes:s,domains:a},l){return X6({scales:l,drawingArea:t,formattedSeries:r,axis:s,seriesConfig:o,axisDirection:"y",zoomMap:i,domains:a})});it(qo,Uo,(e,t,r)=>e?.axis[r]??t?.axis[r]);it(hl,mc,(e,t,r)=>{const o=e?.find(i=>i.id===r)??t?.find(i=>i.id===r)??null;if(o)return o});const nNe=it(hl,e=>e[0].id),rNe=it(mc,e=>e[0].id),oNe=new Map,iNe=()=>oNe,sNe=Yt(sr,cG,uG,nNe,rNe,function(t,r,o,i,s){const a=t.scatter,l=new Map;return a&&a.seriesOrder.forEach(c=>{const{data:u,xAxisId:d=i,yAxisId:f=s}=a.series[c],p=new AR(u.length),h=r[d],b=o[f];for(const g of u)p.add(h(g.x),b(g.y));p.finish(),l.set(c,p)}),l});function Dd(e){return e instanceof Date?e.getTime():e}function _f(e,t){const{scale:r,data:o,reverse:i}=e;if(!so(r)){const a=r.invert(t);if(o===void 0)return-1;const l=Dd(a);return o?.findIndex((u,d)=>{const f=Dd(u);return f>l&&(d===0||Math.abs(l-f)<=Math.abs(l-Dd(o[d-1])))||f<=l&&(d===o.length-1||Math.abs(Dd(a)-f)<Math.abs(Dd(a)-Dd(o[d+1])))})}const s=r.bandwidth()===0?Math.floor((t-Math.min(...r.range())+r.step()/2)/r.step()):Math.floor((t-Math.min(...r.range()))/r.step());return s<0||s>=o.length?-1:i?o.length-1-s:s}function XB(e,t,r,o){if(!so(e)){if(o===null){const i=e.invert(r);return Number.isNaN(i)?null:i}return t[o]}return o===null||o<0||o>=t.length?null:t[o]}function xu(e,t){const r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r.matrixTransform(e.getScreenCTM().inverse())}const Lu=({store:e})=>{const t=Ee(function(){e.update({interaction:E({},e.state.interaction,{pointer:null})})}),r=Ee(function(l){e.state.interaction.lastUpdate!==l&&e.set("interaction",E({},e.state.interaction,{lastUpdate:l}))}),o=Ee(function(l){e.set("interaction",E({},e.state.interaction,{pointer:l,lastUpdate:l!==null?"pointer":e.state.interaction.lastUpdate}))}),i=Ee(function(l){e.set("interaction",E({},e.state.interaction,{pointerType:l.pointerType}))}),s=Ee(function(){e.set("interaction",E({},e.state.interaction,{pointerType:null}))});return{instance:{cleanInteraction:t,setLastUpdateSource:r,setPointerCoordinate:o,handlePointerEnter:i,handlePointerLeave:s}}};Lu.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer",pointerType:null}});Lu.params={};const XS=e=>e.interaction,aNe=it(XS,e=>e!==void 0),dG=it(XS,e=>e?.pointer??null),tg=it(dG,e=>e&&e.x),ng=it(dG,e=>e&&e.y),$u=it(XS,e=>e?.lastUpdate),lNe=it(XS,e=>e?.pointerType??null);function EP(e,t,r=t.axisIds[0]){return Array.isArray(r)?r.map(o=>_f(t.axis[o],e)):_f(t.axis[r],e)}const fG=(e,t,r)=>{if(e===null)return null;const o=EP(e,t,r);return o===-1?null:o},NR=it(tg,qo,fG),FR=it(ng,Uo,fG),cNe=it(tg,ng,qo,Uo,(e,t,r,o)=>[...e===null?[]:r.axisIds.map(i=>({axisId:i,dataIndex:EP(e,r,i)})),...t===null?[]:o.axisIds.map(i=>({axisId:i,dataIndex:EP(t,o,i)}))].filter(i=>i.dataIndex!==null&&i.dataIndex>=0));function pG(e,t,r,o=t.axisIds[0]){return Array.isArray(o)?o.map((i,s)=>{const a=t.axis[i];return XB(a.scale,a.data,e,r[s])}):XB(t.axis[o].scale,t.axis[o].data,e,r)}const uNe=it(tg,qo,NR,(e,t,r,o)=>e===null||t.axisIds.length===0?null:pG(e,t,r,o)),dNe=it(ng,Uo,FR,(e,t,r,o)=>e===null||t.axisIds.length===0?null:pG(e,t,r,o)),hG=[],mG=yS({memoizeOptions:{resultEqualityCheck:si}})(tg,qo,(e,t)=>e===null?hG:t.axisIds.filter(r=>t.axis[r].triggerTooltip).map(r=>({axisId:r,dataIndex:_f(t.axis[r],e)})).filter(({dataIndex:r})=>r>=0)),gG=yS({memoizeOptions:{resultEqualityCheck:si}})(ng,Uo,(e,t)=>e===null?hG:t.axisIds.filter(r=>t.axis[r].triggerTooltip).map(r=>({axisId:r,dataIndex:_f(t.axis[r],e)})).filter(({dataIndex:r})=>r>=0)),fNe=it(mG,gG,(e,t)=>e.length>0||t.length>0);function pNe(e){return e.setPointerCoordinate!==void 0}const hNe=new Set(["bar","rangeBar","line"]),ju=({params:e,store:t,seriesConfig:r,svgRef:o,instance:i})=>{const{xAxis:s,yAxis:a,dataset:l,onHighlightedAxisChange:c}=e;if(process.env.NODE_ENV!=="production"){const T=[...s??[],...a??[]].filter(k=>k.id).map(k=>k.id),P=new Set(T.filter((k,M)=>T.indexOf(k)!==M));P.size>0&&er([`MUI X Charts: The following axis ids are duplicated: ${Array.from(P).join(", ")}.`,"Please make sure that each axis has a unique id."].join(`
404
404
  `),"error")}const u=t.use(ci),d=t.use(sr),f=t.use(aNe),{axis:p,axisIds:h}=t.use(qo),{axis:b,axisIds:g}=t.use(Uo);fR({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedAxis",controlled:e.highlightedAxis,defaultValue:void 0}),Mt(()=>{e.highlightedAxis!==void 0&&t.set("controlledCartesianAxisHighlight",e.highlightedAxis)},[t,e.highlightedAxis]);const y=S.useRef(!0);S.useEffect(()=>{if(y.current){y.current=!1;return}t.set("cartesianAxis",{x:w6(s,l),y:T6(a,l)})},[r,u,s,a,l,t]);const v=h[0],C=g[0];Zl(t,cNe,(T,P)=>{if(c&&!Object.is(T,P)){if(T.length!==P.length){c(P);return}T?.some(({axisId:k,dataIndex:M},_)=>P[_].axisId!==k||P[_].dataIndex!==M)&&c(P)}});const O=pNe(i);return S.useEffect(()=>{const T=o.current;if(!f||!O||!T||e.disableAxisListener)return()=>{};const P=i.addInteractionListener("moveEnd",I=>{I.detail.activeGestures.pan||i.cleanInteraction()}),k=i.addInteractionListener("panEnd",I=>{I.detail.activeGestures.move||i.cleanInteraction()}),M=i.addInteractionListener("quickPressEnd",I=>{!I.detail.activeGestures.move&&!I.detail.activeGestures.pan&&i.cleanInteraction()}),_=I=>{const N=I.detail.srcEvent,j=I.detail.target,H=xu(T,N);if(I.detail.srcEvent.buttons>=1&&j?.hasPointerCapture(I.detail.srcEvent.pointerId)&&!j?.closest("[data-charts-zoom-slider]")&&j?.releasePointerCapture(I.detail.srcEvent.pointerId),!i.isPointInside(H.x,H.y,j)){i.cleanInteraction?.();return}i.setPointerCoordinate(H)},D=i.addInteractionListener("move",_),A=i.addInteractionListener("pan",_),F=i.addInteractionListener("quickPress",_);return()=>{D.cleanup(),P.cleanup(),A.cleanup(),k.cleanup(),F.cleanup(),M.cleanup()}},[o,t,p,v,b,C,i,e.disableAxisListener,f,O]),S.useEffect(()=>{const T=o.current,P=e.onAxisClick;if(T===null||!P)return()=>{};const k=i.addInteractionListener("tap",M=>{let _=null,D=!1;const A=xu(T,M.detail.srcEvent),F=_f(p[v],A.x);D=F!==-1,_=D?F:_f(b[C],A.y);const I=D?h[0]:g[0];if(_==null||_===-1)return;const N=(D?p:b)[I].data[_],j={};Object.keys(d).filter(H=>hNe.has(H)).forEach(H=>{const $=d[H];$?.seriesOrder.forEach(B=>{const q=$.series[B],U=q.xAxisId,V=q.yAxisId,L=D?U:V;(L===void 0||L===I)&&(j[B]=q.data[_])})}),P(M.detail.srcEvent,{dataIndex:_,axisValue:N,seriesValues:j})});return()=>{k.cleanup()}},[e.onAxisClick,d,o,p,h,b,g,v,C,i]),{}};ju.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0};ju.getDefaultizedParams=({params:e})=>E({},e,{colors:e.colors??p6,theme:e.theme??"light",defaultizedXAxis:w6(e.xAxis,e.dataset),defaultizedYAxis:T6(e.yAxis,e.dataset)});ju.getInitialState=e=>E({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},e.highlightedAxis===void 0?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});const rg=e=>e.keyboardNavigation,mNe=it(rg,(e,t)=>e?.item!=null&&hu(e.item,t)),bG=it(rg,e=>e?.item!=null),LR=it(rg,e=>e?.item??null),gNe=it(rg,e=>!!e?.enableKeyboardNavigation),yG=e=>(t,r,o)=>{if(t==null||!("dataIndex"in t)||t.dataIndex===void 0)return;const i=o[t.type]?.series[t.seriesId];if(!i)return;let s=e==="x"?"xAxisId"in i&&i.xAxisId:"yAxisId"in i&&i.yAxisId;return(s===void 0||s===!1)&&(s=r.axisIds[0]),{axisId:s,dataIndex:t.dataIndex}},vG=it(LR,qo,sr,yG("x")),xG=it(LR,Uo,sr,yG("y")),SG=it(rg,function(t){if(t?.item==null)return null;const{type:r,seriesId:o}=t.item;return r===void 0||o===void 0?null:t.item}),Ra=e=>e.brush;it(Ra,e=>e?.start);it(Ra,e=>e?.current);const bNe=it(Ra,e=>e?.start?.x??null),yNe=it(Ra,e=>e?.start?.y??null),vNe=it(Ra,e=>e?.current?.x??null),xNe=it(Ra,e=>e?.current?.y??null);Yt(bNe,yNe,vNe,xNe,(e,t,r,o)=>e===null||t===null||r===null||o===null?null:{start:{x:e,y:t},current:{x:r,y:o}});const SNe=it(sr,e=>{let t=!1,r=!1;return e&&Object.entries(e).forEach(([o,i])=>{Object.values(i.series).some(s=>s.layout==="horizontal")&&(t=!0),o==="scatter"&&i.seriesOrder.length>0&&(r=!0)}),r?"xy":t?"y":"x"}),CNe=it(eg,function(t){let r=!1,o=!1;return Object.values(t).forEach(i=>{i.axisDirection==="y"&&(o=!0),i.axisDirection==="x"&&(r=!0)}),r&&o?"xy":o?"y":r?"x":null});it(SNe,CNe,(e,t)=>t??e);const CG=it(Ra,e=>e?.enabled||e?.isZoomBrushEnabled),wG=it(CG,Ra,(e,t)=>e&&t?.start!==null&&t?.current!==null),QS=it(Ra,wG,(e,t)=>t&&e?.preventHighlight),wNe=it(Ra,wG,(e,t)=>t&&e?.preventTooltip),ip=({store:e,svgRef:t,instance:r,params:o})=>{const i=e.use(CG);Mt(()=>{e.set("brush",E({},e.state.brush,{enabled:o.brushConfig.enabled,preventTooltip:o.brushConfig.preventTooltip,preventHighlight:o.brushConfig.preventHighlight}))},[e,o.brushConfig.enabled,o.brushConfig.preventTooltip,o.brushConfig.preventHighlight]);const s=Ee(function(u){e.set("brush",E({},e.state.brush,{start:e.state.brush.start??u,current:u}))}),a=Ee(function(){e.set("brush",E({},e.state.brush,{start:null,current:null}))}),l=Ee(function(u){e.state.brush.isZoomBrushEnabled!==u&&e.set("brush",E({},e.state.brush,{isZoomBrushEnabled:u}))});return S.useEffect(()=>{const c=t.current;if(c===null||!i)return()=>{};const u=g=>{if(g.detail.target?.closest("[data-charts-zoom-slider]"))return;const y=xu(c,{clientX:g.detail.initialCentroid.x,clientY:g.detail.initialCentroid.y});s(y)},d=g=>{const y=xu(c,{clientX:g.detail.centroid.x,clientY:g.detail.centroid.y});s(y)},f=r.addInteractionListener("brushStart",u),p=r.addInteractionListener("brush",d),h=r.addInteractionListener("brushCancel",a),b=r.addInteractionListener("brushEnd",a);return()=>{f.cleanup(),p.cleanup(),b.cleanup(),h.cleanup()}},[t,r,e,a,s,i]),{instance:{setBrushCoordinates:s,clearBrush:a,setZoomBrushEnabled:l}}};ip.params={brushConfig:!0};ip.getDefaultizedParams=({params:e})=>E({},e,{brushConfig:{enabled:e?.brushConfig?.enabled??!1,preventTooltip:e?.brushConfig?.preventTooltip??!0,preventHighlight:e?.brushConfig?.preventHighlight??!0}});ip.getInitialState=e=>({brush:{enabled:e.brushConfig.enabled,isZoomBrushEnabled:!1,preventTooltip:e.brushConfig.preventTooltip,preventHighlight:e.brushConfig.preventHighlight,start:null,current:null}});function TG(e,t,r){if(e==="pointer"){if(t)return[t];if(r)return[r]}if(e==="keyboard"){if(r)return[r];if(t)return[t]}return[]}const sp=e=>e.controlledCartesianAxisHighlight,OG=(e,t,r,o,i,s)=>{if(s)return[];if(r!==void 0)return r.filter(c=>t.axis[c.axisId]!==void 0).map(c=>c);const a=e!==null&&{axisId:t.axisIds[0],dataIndex:e},l=o!=null&&o;return TG(i,a,l)},PG=Yt(NR,qo,sp,vG,$u,QS,OG);Yt(FR,Uo,sp,xG,$u,QS,OG);const EG=(e,t,r,o,i,s,a)=>{if(a)return[];if(o!==void 0)return o.map(d=>E({},d,{value:r.axis[d.axisId]?.data?.[d.dataIndex]})).filter(({value:d})=>d!==void 0);const l=t!=null&&{axisId:r.axisIds[0],value:t};l&&e!=null&&(l.dataIndex=e);const c=i!=null&&r.axis[i.axisId]?.data?.[i.dataIndex],u=i!=null&&c!=null&&E({},i,{value:c});return TG(s,l,u)},TNe=Yt(NR,uNe,qo,sp,vG,$u,QS,EG),ONe=Yt(FR,dNe,Uo,sp,xG,$u,QS,EG),IG=(e,t)=>e===void 0?[t.axis[t.axisIds[0]]]:e.map(o=>t.axis[o.axisId]??null).filter(o=>o!==null);it(sp,qo,IG);it(sp,Uo,IG);const Bu=({store:e,params:t})=>{fR({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"tooltipItem",controlled:t.tooltipItem,defaultValue:null}),Mt(()=>{e.state.tooltip.item!==t.tooltipItem&&e.set("tooltip",E({},e.state.tooltip,{item:t.tooltipItem}))},[e,t.tooltipItem]);const r=Ee(function(s){const a=e.state.tooltip.item;if(a!==null&&(!s||hu(a,s))){t.onTooltipItemChange?.(null),e.state.tooltip.itemIsControlled||e.set("tooltip",E({},e.state.tooltip,{item:null}));return}});return{instance:{setTooltipItem:Ee(function(s){hu(e.state.tooltip.item,s)||(t.onTooltipItemChange?.(s),e.state.tooltip.itemIsControlled||e.set("tooltip",E({},e.state.tooltip,{item:s})))}),removeTooltipItem:r}}};Bu.getInitialState=e=>({tooltip:{itemIsControlled:e.tooltipItem!==void 0,item:e.tooltipItem??null}});Bu.params={tooltipItem:!0,onTooltipItemChange:!0};const ap=({params:e,store:t,svgRef:r})=>{const o=Ee(function(){t.state.keyboardNavigation.item!==null&&t.set("keyboardNavigation",E({},t.state.keyboardNavigation,{item:null}))});return S.useEffect(()=>{const i=r.current;if(!i||!e.enableKeyboardNavigation)return;function s(a){let l=t.state.keyboardNavigation.item,c=l?.type;if(!c&&(c=Object.keys(y6(t.state)).find(d=>t.state.series.seriesConfig[d]!==void 0),c===void 0))return;const u=t.state.series.seriesConfig[c]?.keyboardFocusHandler?.(a);u&&(l=u(l,t.state),l!==t.state.keyboardNavigation.item&&(a.preventDefault(),t.update(E({},t.state.highlight&&{highlight:E({},t.state.highlight,{lastUpdate:"keyboard"})},t.state.interaction&&{interaction:E({},t.state.interaction,{lastUpdate:"keyboard"})},{keyboardNavigation:E({},t.state.keyboardNavigation,{item:l})}))))}return i.addEventListener("keydown",s),i.addEventListener("blur",o),()=>{i.removeEventListener("keydown",s),i.removeEventListener("blur",o)}},[r,o,e.enableKeyboardNavigation,t]),Mt(()=>{t.state.keyboardNavigation.enableKeyboardNavigation!==e.enableKeyboardNavigation&&t.set("keyboardNavigation",E({},t.state.keyboardNavigation,{enableKeyboardNavigation:!!e.enableKeyboardNavigation}))},[t,e.enableKeyboardNavigation]),{}};ap.getInitialState=e=>({keyboardNavigation:{item:null,enableKeyboardNavigation:!!e.enableKeyboardNavigation}});ap.params={enableKeyboardNavigation:!0};function $R(e){return Y6.getTypes().has(e)}const PNe=(e,t,r,o,i,s,a)=>{const l=o==="rotation"?i[t].rotationExtremumGetter:i[t].radiusExtremumGetter,c=a[t]?.series??{},[u,d]=l?.({series:c,axis:r,axisIndex:s,isDefaultAxis:s===0})??[1/0,-1/0],[f,p]=e;return[Math.min(u,f),Math.max(d,p)]},ENe=(e,t,r,o,i)=>{const a=Object.keys(r).filter($R).reduce((l,c)=>PNe(l,c,e,t,r,o,i),[1/0,-1/0]);return Number.isNaN(a[0])||Number.isNaN(a[1])?[1/0,-1/0]:a},ba=(e,t)=>e===void 0?t:Math.PI*e/180,INe=(e,t,r,o)=>{const i=new Set;return Object.keys(t).filter($R).forEach(a=>{const l=r[a]?.series??{},c=t[a].axisTooltipGetter?.(l);c!==void 0&&c.forEach(({axisId:u,direction:d})=>{d===e&&i.add(u??o)})}),i};function kNe(e,t,r){if(t==="rotation"){if(r.scaleType==="point"){const o=[ba(r.startAngle,0),ba(r.endAngle,2*Math.PI)],i=o[1]-o[0];return i>Math.PI*2-.1&&(o[1]-=i/r.data.length),o}return[ba(r.startAngle,0),ba(r.endAngle,2*Math.PI)]}return[0,Math.min(e.height,e.width)/2]}const RNe=.2,MNe=.1;function kG({drawingArea:e,formattedSeries:t,axis:r,seriesConfig:o,axisDirection:i}){if(r===void 0)return{axis:{},axisIds:[]};const s=INe(i,o,t,r[0].id),a={};return r.forEach((l,c)=>{const u=l,d=kNe(e,i,u),[f,p]=ENe(u,i,o,c,t),h=!u.ignoreTooltip&&s.has(u.id),b=u.data??[];if(Du(u)){const D=u.categoryGapRatio??RNe,A=u.barGapRatio??MNe;if(a[u.id]=E({offset:0,categoryGapRatio:D,barGapRatio:A,triggerTooltip:h},u,{data:b,scale:GS(u.data,d).paddingInner(D).paddingOuter(D/2),tickNumber:u.data.length,colorScale:u.colorMap&&(u.colorMap.type==="ordinal"?Df(E({values:u.data},u.colorMap)):ff(u.colorMap))}),Ux(u.data)){const F=OP(u.data,d,u.tickNumber);a[u.id].valueFormatter=u.valueFormatter??F}}if(_u(u)&&(a[u.id]=E({offset:0,triggerTooltip:h},u,{data:b,scale:W6(u.data,d),tickNumber:u.data.length,colorScale:u.colorMap&&(u.colorMap.type==="ordinal"?Df(E({values:u.data},u.colorMap)):ff(u.colorMap))}),Ux(u.data))){const D=OP(u.data,d,u.tickNumber);a[u.id].valueFormatter=u.valueFormatter??D}if(!rAe(u))return;const g=u.scaleType??"linear",y=u.domainLimit??"nice",v=[u.min??f,u.max??p];if(typeof y=="function"){const{min:D,max:A}=y(f,p);v[0]=D,v[1]=A}const C=US(u,v,MR(Math.abs(d[1]-d[0]))),O=G6(C,d),T=WS(g,v,d),P=y==="nice"?T.nice(C):T,[k,M]=P.domain(),_=[u.min??k,u.max??M];a[u.id]=E({offset:0,triggerTooltip:h},u,{data:b,scaleType:g,scale:P.domain(_),tickNumber:O,colorScale:u.colorMap&&ff(u.colorMap)})}),{axis:a,axisIds:r.map(({id:l})=>l)}}const RG=e=>e.polarAxis,MG=it(RG,e=>e?.rotation),ANe=it(RG,e=>e?.radius),yc=Yt(MG,ci,sr,ui,(e,t,r,o)=>kG({drawingArea:t,formattedSeries:r,axis:e,seriesConfig:o,axisDirection:"rotation"})),DNe=Yt(ANe,ci,sr,ui,(e,t,r,o)=>kG({drawingArea:t,formattedSeries:r,axis:e,seriesConfig:o,axisDirection:"radius"}));function _Ne(e){return{cx:e.left+e.width/2,cy:e.top+e.height/2}}const NNe=Yt(ci,_Ne),FNe=e=>e.tooltip,AG=it(FNe,e=>e?.item??null),LNe=it(AG,e=>e!==null),jR=it($u,AG,SG,(e,t,r)=>e==="keyboard"?r:t??null),$Ne=it($u,LNe,bG,(e,t,r)=>e==="keyboard"?r:t),jNe=Yt(jR,qo,Uo,yc,DNe,sr,function(t,{axis:r,axisIds:o},{axis:i,axisIds:s},a,l,c){if(!t)return{};const u=c[t.type]?.series[t.seriesId];if(!u)return{};const d={rotationAxes:a,radiusAxes:l},f=Gx(u)?u.xAxisId??o[0]:void 0,p=Gx(u)?u.yAxisId??s[0]:void 0;return f!==void 0&&(d.x=r[f]),p!==void 0&&(d.y=i[p]),d}),BNe=Yt(jR,ci,ui,sr,v6,jNe,function(t,r,o,i,s,a,l="top"){if(!t)return null;const c=i[t.type]?.series[t.seriesId];return c?o[c.type].tooltipItemPositionGetter?.({series:i,seriesLayout:s,drawingArea:r,axesConfig:a,identifier:t,placement:l})??null:null});function QB(e,t){return e.id!==void 0?e:E({id:t},e)}function JB(e){return e.colorMap?E({},e,{colorScale:e.colorMap.type==="ordinal"&&e.data?Df(E({values:e.data},e.colorMap)):ff(e.colorMap.type==="continuous"?E({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function DG(e,t){if(!e||e.length===0)return{axis:{},axisIds:[]};const r={},o=[];return e.forEach((i,s)=>{const a=i.dataKey,l=i.id??`defaultized-z-axis-${s}`;if(a===void 0||i.data!==void 0){r[l]=JB(QB(i,l)),o.push(l);return}if(t===void 0)throw new Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");r[l]=JB(QB(E({},i,{data:t.map(c=>c[a])}),l)),o.push(l)}),{axis:r,axisIds:o}}const lp=({params:e,store:t})=>{const{zAxis:r,dataset:o}=e,i=S.useRef(!0);return S.useEffect(()=>{if(i.current){i.current=!1;return}t.set("zAxis",DG(r,o))},[r,o,t]),{}};lp.params={zAxis:!0,dataset:!0};lp.getInitialState=e=>({zAxis:DG(e.zAxis,e.dataset)});const VNe=e=>e,HNe=it(VNe,e=>e.zAxis),Vu=({store:e,params:t})=>{fR({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedItem",controlled:t.highlightedItem,defaultValue:null}),Mt(()=>{e.state.highlight.item!==t.highlightedItem&&e.set("highlight",E({},e.state.highlight,{item:t.highlightedItem})),process.env.NODE_ENV!=="production"&&t.highlightedItem!==void 0&&!e.state.highlight.isControlled&&er(["MUI X Charts: The `highlightedItem` switched between controlled and uncontrolled state.","To remove the highlight when using controlled state, you must provide `null` to the `highlightedItem` prop instead of `undefined`."].join(`
405
405
  `))},[e,t.highlightedItem]);const r=Ee(()=>{t.onHighlightChange?.(null);const i=e.state.highlight;i.item===null||i.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),o=Ee(i=>{const s=e.state.highlight;hu(s.item,i)||(t.onHighlightChange?.(i),!s.isControlled&&e.set("highlight",{item:i,lastUpdate:"pointer",isControlled:!1}))});return{instance:{clearHighlight:r,setHighlight:o}}};Vu.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:e.highlightedItem!==void 0}});Vu.params={highlightedItem:!0,onHighlightChange:!0};function om(e){let t=1/0,r=-1/0;for(const o of e??[])o<t&&(t=o),o>r&&(r=o);return[t,r]}const eV=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},_G=e=>{const{axis:t,getFilters:r,isDefaultAxis:o}=e,i=r?.({currentAxisId:t.id,isDefaultAxis:o}),s=i?t.data?.filter((a,l)=>i({x:null,y:null},l)):t.data;return om(s??[])},NG=e=>t=>{const{series:r,axis:o,getFilters:i,isDefaultAxis:s}=t;return Object.keys(r).filter(a=>{const l=e==="x"?r[a].xAxisId:r[a].yAxisId;return l===o.id||s&&l===void 0}).reduce((a,l)=>{const{stackedData:c}=r[l],u=i?.({currentAxisId:o.id,isDefaultAxis:s,seriesXAxisId:r[l].xAxisId,seriesYAxisId:r[l].yAxisId}),[d,f]=c?.reduce((p,h,b)=>u&&(!u(eV(h[0],e),b)||!u(eV(h[1],e),b))?p:[Math.min(...h,p[0]),Math.max(...h,p[1])],[1/0,-1/0])??[1/0,-1/0];return[Math.min(d,a[0]),Math.max(f,a[1])]},[1/0,-1/0])},zNe=e=>Object.keys(e.series).some(r=>e.series[r].layout==="horizontal")?NG("x")(e):_G(e),qNe=e=>Object.keys(e.series).some(r=>e.series[r].layout==="horizontal")?_G(e):NG("y")(e);function on(e){return function(){return e}}const tV=Math.abs,Mo=Math.atan2,Ga=Math.cos,UNe=Math.max,OO=Math.min,vi=Math.sin,Po=Math.sqrt,Lo=1e-12,rc=Math.PI,Wx=rc/2,Xl=2*rc;function GNe(e){return e>1?0:e<-1?rc:Math.acos(e)}function nV(e){return e>=1?Wx:e<=-1?-Wx:Math.asin(e)}const IP=Math.PI,kP=2*IP,Hc=1e-6,WNe=kP-Hc;function FG(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function KNe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return FG;const r=10**t;return function(o){this._+=o[0];for(let i=1,s=o.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+o[i]}}class YNe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?FG:KNe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,o,i){this._append`Q${+t},${+r},${this._x1=+o},${this._y1=+i}`}bezierCurveTo(t,r,o,i,s,a){this._append`C${+t},${+r},${+o},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,o,i,s){if(t=+t,r=+r,o=+o,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,l=this._y1,c=o-t,u=i-r,d=a-t,f=l-r,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>Hc)if(!(Math.abs(f*c-u*d)>Hc)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let h=o-a,b=i-l,g=c*c+u*u,y=h*h+b*b,v=Math.sqrt(g),C=Math.sqrt(p),O=s*Math.tan((IP-Math.acos((g+p-y)/(2*v*C)))/2),T=O/C,P=O/v;Math.abs(T-1)>Hc&&this._append`L${t+T*d},${r+T*f}`,this._append`A${s},${s},0,0,${+(f*h>d*b)},${this._x1=t+P*c},${this._y1=r+P*u}`}}arc(t,r,o,i,s,a){if(t=+t,r=+r,o=+o,a=!!a,o<0)throw new Error(`negative radius: ${o}`);let l=o*Math.cos(i),c=o*Math.sin(i),u=t+l,d=r+c,f=1^a,p=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Hc||Math.abs(this._y1-d)>Hc)&&this._append`L${u},${d}`,o&&(p<0&&(p=p%kP+kP),p>WNe?this._append`A${o},${o},0,1,${f},${t-l},${r-c}A${o},${o},0,1,${f},${this._x1=u},${this._y1=d}`:p>Hc&&this._append`A${o},${o},0,${+(p>=IP)},${f},${this._x1=t+o*Math.cos(s)},${this._y1=r+o*Math.sin(s)}`)}rect(t,r,o,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${o=+o}v${+i}h${-o}Z`}toString(){return this._}}function JS(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const o=Math.floor(r);if(!(o>=0))throw new RangeError(`invalid digits: ${r}`);t=o}return e},()=>new YNe(t)}function ZNe(e){return e.innerRadius}function XNe(e){return e.outerRadius}function QNe(e){return e.startAngle}function JNe(e){return e.endAngle}function eFe(e){return e&&e.padAngle}function tFe(e,t,r,o,i,s,a,l){var c=r-e,u=o-t,d=a-i,f=l-s,p=f*c-d*u;if(!(p*p<Lo))return p=(d*(t-s)-f*(e-i))/p,[e+p*c,t+p*u]}function yv(e,t,r,o,i,s,a){var l=e-r,c=t-o,u=(a?s:-s)/Po(l*l+c*c),d=u*c,f=-u*l,p=e+d,h=t+f,b=r+d,g=o+f,y=(p+b)/2,v=(h+g)/2,C=b-p,O=g-h,T=C*C+O*O,P=i-s,k=p*g-b*h,M=(O<0?-1:1)*Po(UNe(0,P*P*T-k*k)),_=(k*O-C*M)/T,D=(-k*C-O*M)/T,A=(k*O+C*M)/T,F=(-k*C+O*M)/T,I=_-y,N=D-v,j=A-y,H=F-v;return I*I+N*N>j*j+H*H&&(_=A,D=F),{cx:_,cy:D,x01:-d,y01:-f,x11:_*(i/P-1),y11:D*(i/P-1)}}function LG(){var e=ZNe,t=XNe,r=on(0),o=null,i=QNe,s=JNe,a=eFe,l=null,c=JS(u);function u(){var d,f,p=+e.apply(this,arguments),h=+t.apply(this,arguments),b=i.apply(this,arguments)-Wx,g=s.apply(this,arguments)-Wx,y=tV(g-b),v=g>b;if(l||(l=d=c()),h<p&&(f=h,h=p,p=f),!(h>Lo))l.moveTo(0,0);else if(y>Xl-Lo)l.moveTo(h*Ga(b),h*vi(b)),l.arc(0,0,h,b,g,!v),p>Lo&&(l.moveTo(p*Ga(g),p*vi(g)),l.arc(0,0,p,g,b,v));else{var C=b,O=g,T=b,P=g,k=y,M=y,_=a.apply(this,arguments)/2,D=_>Lo&&(o?+o.apply(this,arguments):Po(p*p+h*h)),A=OO(tV(h-p)/2,+r.apply(this,arguments)),F=A,I=A,N,j;if(D>Lo){var H=nV(D/p*vi(_)),$=nV(D/h*vi(_));(k-=H*2)>Lo?(H*=v?1:-1,T+=H,P-=H):(k=0,T=P=(b+g)/2),(M-=$*2)>Lo?($*=v?1:-1,C+=$,O-=$):(M=0,C=O=(b+g)/2)}var B=h*Ga(C),q=h*vi(C),U=p*Ga(P),V=p*vi(P);if(A>Lo){var L=h*Ga(O),G=h*vi(O),Z=p*Ga(T),X=p*vi(T),J;if(y<rc)if(J=tFe(B,q,Z,X,L,G,U,V)){var te=B-J[0],ce=q-J[1],me=L-J[0],re=G-J[1],se=1/vi(GNe((te*me+ce*re)/(Po(te*te+ce*ce)*Po(me*me+re*re)))/2),le=Po(J[0]*J[0]+J[1]*J[1]);F=OO(A,(p-le)/(se-1)),I=OO(A,(h-le)/(se+1))}else F=I=0}M>Lo?I>Lo?(N=yv(Z,X,B,q,h,I,v),j=yv(L,G,U,V,h,I,v),l.moveTo(N.cx+N.x01,N.cy+N.y01),I<A?l.arc(N.cx,N.cy,I,Mo(N.y01,N.x01),Mo(j.y01,j.x01),!v):(l.arc(N.cx,N.cy,I,Mo(N.y01,N.x01),Mo(N.y11,N.x11),!v),l.arc(0,0,h,Mo(N.cy+N.y11,N.cx+N.x11),Mo(j.cy+j.y11,j.cx+j.x11),!v),l.arc(j.cx,j.cy,I,Mo(j.y11,j.x11),Mo(j.y01,j.x01),!v))):(l.moveTo(B,q),l.arc(0,0,h,C,O,!v)):l.moveTo(B,q),!(p>Lo)||!(k>Lo)?l.lineTo(U,V):F>Lo?(N=yv(U,V,L,G,p,-F,v),j=yv(B,q,Z,X,p,-F,v),l.lineTo(N.cx+N.x01,N.cy+N.y01),F<A?l.arc(N.cx,N.cy,F,Mo(N.y01,N.x01),Mo(j.y01,j.x01),!v):(l.arc(N.cx,N.cy,F,Mo(N.y01,N.x01),Mo(N.y11,N.x11),!v),l.arc(0,0,p,Mo(N.cy+N.y11,N.cx+N.x11),Mo(j.cy+j.y11,j.cx+j.x11),v),l.arc(j.cx,j.cy,F,Mo(j.y11,j.x11),Mo(j.y01,j.x01),!v))):l.arc(0,0,p,P,T,v)}if(l.closePath(),d)return l=null,d+""||null}return u.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-rc/2;return[Ga(f)*d,vi(f)*d]},u.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:on(+d),u):e},u.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:on(+d),u):t},u.cornerRadius=function(d){return arguments.length?(r=typeof d=="function"?d:on(+d),u):r},u.padRadius=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:on(+d),u):o},u.startAngle=function(d){return arguments.length?(i=typeof d=="function"?d:on(+d),u):i},u.endAngle=function(d){return arguments.length?(s=typeof d=="function"?d:on(+d),u):s},u.padAngle=function(d){return arguments.length?(a=typeof d=="function"?d:on(+d),u):a},u.context=function(d){return arguments.length?(l=d??null,u):l},u}function eC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $G(e){this._context=e}$G.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function BR(e){return new $G(e)}function jG(e){return e[0]}function BG(e){return e[1]}function VG(e,t){var r=on(!0),o=null,i=BR,s=null,a=JS(l);e=typeof e=="function"?e:e===void 0?jG:on(e),t=typeof t=="function"?t:t===void 0?BG:on(t);function l(c){var u,d=(c=eC(c)).length,f,p=!1,h;for(o==null&&(s=i(h=a())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+e(f,u,c),+t(f,u,c));if(h)return s=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:on(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:on(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:on(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,o!=null&&(s=i(o)),l):i},l.context=function(c){return arguments.length?(c==null?o=s=null:s=i(o=c),l):o},l}function nFe(e,t,r){var o=null,i=on(!0),s=null,a=BR,l=null,c=JS(u);e=typeof e=="function"?e:e===void 0?jG:on(+e),t=typeof t=="function"?t:on(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?BG:on(+r);function u(f){var p,h,b,g=(f=eC(f)).length,y,v=!1,C,O=new Array(g),T=new Array(g);for(s==null&&(l=a(C=c())),p=0;p<=g;++p){if(!(p<g&&i(y=f[p],p,f))===v)if(v=!v)h=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=p-1;b>=h;--b)l.point(O[b],T[b]);l.lineEnd(),l.areaEnd()}v&&(O[p]=+e(y,p,f),T[p]=+t(y,p,f),l.point(o?+o(y,p,f):O[p],r?+r(y,p,f):T[p]))}if(C)return l=null,C+""||null}function d(){return VG().defined(i).curve(a).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:on(+f),o=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:on(+f),u):e},u.x1=function(f){return arguments.length?(o=f==null?null:typeof f=="function"?f:on(+f),u):o},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:on(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:on(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:on(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(o).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:on(!!f),u):i},u.curve=function(f){return arguments.length?(a=f,s!=null&&(l=a(s)),u):a},u.context=function(f){return arguments.length?(f==null?s=l=null:l=a(s=f),u):s},u}function rFe(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function oFe(e){return e}function iFe(){var e=oFe,t=rFe,r=null,o=on(0),i=on(Xl),s=on(0);function a(l){var c,u=(l=eC(l)).length,d,f,p=0,h=new Array(u),b=new Array(u),g=+o.apply(this,arguments),y=Math.min(Xl,Math.max(-Xl,i.apply(this,arguments)-g)),v,C=Math.min(Math.abs(y)/u,s.apply(this,arguments)),O=C*(y<0?-1:1),T;for(c=0;c<u;++c)(T=b[h[c]=c]=+e(l[c],c,l))>0&&(p+=T);for(t!=null?h.sort(function(P,k){return t(b[P],b[k])}):r!=null&&h.sort(function(P,k){return r(l[P],l[k])}),c=0,f=p?(y-u*O)/p:0;c<u;++c,g=v)d=h[c],T=b[d],v=g+(T>0?T*f:0)+O,b[d]={data:l[d],index:c,value:T,startAngle:g,endAngle:v,padAngle:C};return b}return a.value=function(l){return arguments.length?(e=typeof l=="function"?l:on(+l),a):e},a.sortValues=function(l){return arguments.length?(t=l,r=null,a):t},a.sort=function(l){return arguments.length?(r=l,t=null,a):r},a.startAngle=function(l){return arguments.length?(o=typeof l=="function"?l:on(+l),a):o},a.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:on(+l),a):i},a.padAngle=function(l){return arguments.length?(s=typeof l=="function"?l:on(+l),a):s},a}class HG{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function sFe(e){return new HG(e,!0)}function aFe(e){return new HG(e,!1)}const zG={draw(e,t){const r=Po(t/rc);e.moveTo(r,0),e.arc(0,0,r,0,Xl)}},lFe={draw(e,t){const r=Po(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},qG=Po(1/3),cFe=qG*2,uFe={draw(e,t){const r=Po(t/cFe),o=r*qG;e.moveTo(0,-r),e.lineTo(o,0),e.lineTo(0,r),e.lineTo(-o,0),e.closePath()}},dFe={draw(e,t){const r=Po(t),o=-r/2;e.rect(o,o,r,r)}},fFe=.8908130915292852,UG=vi(rc/10)/vi(7*rc/10),pFe=vi(Xl/10)*UG,hFe=-Ga(Xl/10)*UG,mFe={draw(e,t){const r=Po(t*fFe),o=pFe*r,i=hFe*r;e.moveTo(0,-r),e.lineTo(o,i);for(let s=1;s<5;++s){const a=Xl*s/5,l=Ga(a),c=vi(a);e.lineTo(c*r,-l*r),e.lineTo(l*o-c*i,c*o+l*i)}e.closePath()}},PO=Po(3),gFe={draw(e,t){const r=-Po(t/(PO*3));e.moveTo(0,r*2),e.lineTo(-PO*r,-r),e.lineTo(PO*r,-r),e.closePath()}},fs=-.5,ps=Po(3)/2,RP=1/Po(12),bFe=(RP/2+1)*3,yFe={draw(e,t){const r=Po(t/bFe),o=r/2,i=r*RP,s=o,a=r*RP+r,l=-s,c=a;e.moveTo(o,i),e.lineTo(s,a),e.lineTo(l,c),e.lineTo(fs*o-ps*i,ps*o+fs*i),e.lineTo(fs*s-ps*a,ps*s+fs*a),e.lineTo(fs*l-ps*c,ps*l+fs*c),e.lineTo(fs*o+ps*i,fs*i-ps*o),e.lineTo(fs*s+ps*a,fs*a-ps*s),e.lineTo(fs*l+ps*c,fs*c-ps*l),e.closePath()}},GG=[zG,lFe,uFe,dFe,mFe,gFe,yFe];function WG(e,t){let r=null,o=JS(i);e=typeof e=="function"?e:on(e||zG),t=typeof t=="function"?t:on(t===void 0?64:+t);function i(){let s;if(r||(r=s=o()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:on(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:on(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function rV(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function VR(e,t){this._context=e,this._k=(1-t)/6}VR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rV(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:rV(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(o){return new VR(o,t)}return r.tension=function(o){return e(+o)},r})(0);function vFe(e,t,r){var o=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Lo){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);o=(o*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Lo){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/d,a=(a*u+e._y1*e._l23_2a-r*e._l12_2a)/d}e._context.bezierCurveTo(o,i,s,a,e._x2,e._y2)}function KG(e,t){this._context=e,this._alpha=t}KG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,o=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:vFe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const xFe=(function e(t){function r(o){return t?new KG(o,t):new VR(o,0)}return r.alpha=function(o){return e(+o)},r})(.5);function oV(e){return e<0?-1:1}function iV(e,t,r){var o=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(o||i<0&&-0),a=(r-e._y1)/(i||o<0&&-0),l=(s*i+a*o)/(o+i);return(oV(s)+oV(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(l))||0}function sV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function EO(e,t,r){var o=e._x0,i=e._y0,s=e._x1,a=e._y1,l=(s-o)/3;e._context.bezierCurveTo(o+l,i+l*t,s-l,a-l*r,s,a)}function Kx(e){this._context=e}Kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:EO(this,this._t0,sV(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,EO(this,sV(this,r=iV(this,e,t)),r);break;default:EO(this,this._t0,r=iV(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function YG(e){this._context=new ZG(e)}(YG.prototype=Object.create(Kx.prototype)).point=function(e,t){Kx.prototype.point.call(this,t,e)};function ZG(e){this._context=e}ZG.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,o,i,s){this._context.bezierCurveTo(t,e,o,r,s,i)}};function aV(e){return new Kx(e)}function SFe(e){return new YG(e)}function XG(e){this._context=e}XG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var o=lV(e),i=lV(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(o[0][s],i[0][s],o[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function lV(e){var t,r=e.length-1,o,i=new Array(r),s=new Array(r),a=new Array(r);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)o=i[t]/s[t-1],s[t]-=o,a[t]-=o*a[t-1];for(i[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function CFe(e){return new XG(e)}function tC(e,t){this._context=e,this._t=t}tC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function wFe(e){return new tC(e,.5)}function TFe(e){return new tC(e,0)}function OFe(e){return new tC(e,1)}function Nf(e,t){if((a=e.length)>1)for(var r=1,o,i,s=e[t[0]],a,l=s.length;r<a;++r)for(i=s,s=e[t[r]],o=0;o<l;++o)s[o][1]+=s[o][0]=isNaN(i[o][1])?i[o][0]:i[o][1]}function Ff(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function PFe(e,t){return e[t]}function EFe(e){const t=[];return t.key=e,t}function Yx(){var e=on([]),t=Ff,r=Nf,o=PFe;function i(s){var a=Array.from(e.apply(this,arguments),EFe),l,c=a.length,u=-1,d;for(const f of s)for(l=0,++u;l<c;++l)(a[l][u]=[0,+o(f,a[l].key,u,s)]).data=f;for(l=0,d=eC(t(a));l<c;++l)a[d[l]].index=l;return r(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:on(Array.from(s)),i):e},i.value=function(s){return arguments.length?(o=typeof s=="function"?s:on(+s),i):o},i.order=function(s){return arguments.length?(t=s==null?Ff:typeof s=="function"?s:on(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(r=s??Nf,i):r},i}function IFe(e,t){if((o=e.length)>0){for(var r,o,i=0,s=e[0].length,a;i<s;++i){for(a=r=0;r<o;++r)a+=e[r][i][1]||0;if(a)for(r=0;r<o;++r)e[r][i][1]/=a}Nf(e,t)}}function kFe(e,t){if((i=e.length)>0){for(var r=0,o=e[t[0]],i,s=o.length;r<s;++r){for(var a=0,l=0;a<i;++a)l+=e[a][r][1]||0;o[r][1]+=o[r][0]=-l/2}Nf(e,t)}}function RFe(e,t){if(!(!((a=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,o=1,i,s,a;o<s;++o){for(var l=0,c=0,u=0;l<a;++l){for(var d=e[t[l]],f=d[o][1]||0,p=d[o-1][1]||0,h=(f-p)/2,b=0;b<l;++b){var g=e[t[b]],y=g[o][1]||0,v=g[o-1][1]||0;h+=y-v}c+=f,u+=h*f}i[o-1][1]+=i[o-1][0]=r,c&&(r-=u/c)}i[o-1][1]+=i[o-1][0]=r,Nf(e,t)}}function QG(e){var t=e.map(MFe);return Ff(e).sort(function(r,o){return t[r]-t[o]})}function MFe(e){for(var t=-1,r=0,o=e.length,i,s=-1/0;++t<o;)(i=+e[t][1])>s&&(s=i,r=t);return r}function JG(e){var t=e.map(e8);return Ff(e).sort(function(r,o){return t[r]-t[o]})}function e8(e){for(var t=0,r=-1,o=e.length,i;++r<o;)(i=+e[r][1])&&(t+=i);return t}function AFe(e){return JG(e).reverse()}function DFe(e){var t=e.length,r,o,i=e.map(e8),s=QG(e),a=0,l=0,c=[],u=[];for(r=0;r<t;++r)o=s[r],a<l?(a+=i[o],c.push(o)):(l+=i[o],u.push(o));return u.reverse().concat(c)}function _Fe(e){return Ff(e).reverse()}function NFe(e,t){if(e.length===0)return;const r=e.length,o=t,i=e[o[0]].length;for(let s=0;s<i;s+=1){let a=0,l=0;for(let c=0;c<r;c+=1){const u=e[o[c]],d=u[s],f=d[1]-d[0];f>0?(d[0]=a,a+=f,d[1]=a):f<0?(d[1]=l,l+=f,d[0]=l):d.data[u.key]>0?(d[0]=a,d[1]=a):d.data[u.key]<0?(d[1]=l,d[0]=l):(d[0]=0,d[1]=0)}}}const IO={appearance:QG,ascending:JG,descending:AFe,insideOut:DFe,none:Ff,reverse:_Fe},kO={expand:IFe,diverging:NFe,none:Nf,silhouette:kFe,wiggle:RFe},t8=e=>{const{series:t,seriesOrder:r,defaultStrategy:o}=e,i=[],s={};return r.forEach(a=>{const{stack:l,stackOrder:c,stackOffset:u}=t[a];l===void 0?i.push({ids:[a],stackingOrder:IO.none,stackingOffset:kO.none}):s[l]===void 0?(s[l]=i.length,i.push({ids:[a],stackingOrder:IO[c??o?.stackOrder??"none"],stackingOffset:kO[u??o?.stackOffset??"diverging"]})):(i[s[l]].ids.push(a),c!==void 0&&(i[s[l]].stackingOrder=IO[c]),u!==void 0&&(i[s[l]].stackingOffset=kO[u]))}),i},FFe=e=>e==null?"":e.toLocaleString(),LFe=(e,t,r)=>{const{seriesOrder:o,series:i}=e,s=t8(e),a=t??[];o.forEach(c=>{const u=i[c].data;if(u!==void 0)u.forEach((d,f)=>{a.length<=f?a.push({[c]:d}):a[f][c]=d});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${c}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
@@ -449,7 +449,7 @@ ${f}\r
449
449
  If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async i=>{const s=await r();if(i==="base64")return oc(s);if(i==="hex")return Ci(s);if(i===void 0||i==="utf8"||i==="utf-8")return zu(s);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error($V);if(t=!0,jV(e))return o(e);if(VP(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},jV=e=>typeof Blob=="function"&&e instanceof Blob;async function cze(e){return typeof e.stream=="function"&&(e=e.stream()),e.tee()}const fh=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return iu.mutate(e);if(!e)return iu.mutate(new Uint8Array);const r=t.streamCollector(e);return iu.mutate(await r)};function BV(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const Xv=e=>typeof e=="function"?e():e,YW=(e,t,r,o,i)=>({name:t,namespace:e,traits:r,input:o,output:i}),uze=e=>(t,r)=>async o=>{const{response:i}=await t(o),{operationSchema:s}=gl(r),[,a,l,c,u,d]=s??[];try{const f=await e.protocol.deserializeResponse(YW(a,l,c,u,d),{...e,...r},i);return{response:i,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){const p="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{f.message+=`
450
450
  `+p}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(p):r.logger?.warn?.(p)}typeof f.$responseBodyText<"u"&&f.$response&&(f.$response.body=f.$responseBodyText);try{if(wu.isInstance(i)){const{headers:h={}}=i,b=Object.entries(h);f.$metadata={httpStatusCode:i.statusCode,requestId:VO(/^x-[\w-]+-request-?id$/,b),extendedRequestId:VO(/^x-[\w-]+-id-2$/,b),cfId:VO(/^x-[\w-]+-cf-id$/,b)}}}catch{}}throw f}},VO=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1],dze=e=>(t,r)=>async o=>{const{operationSchema:i}=gl(r),[,s,a,l,c,u]=i??[],d=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint,f=await e.protocol.serializeRequest(YW(s,a,l,c,u),o.input,{...e,...r,endpoint:d});return t({...o,request:f})},fze={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},pze={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function ZW(e){return{applyToStack:t=>{t.add(dze(e),pze),t.add(uze(e),fze),e.protocol.setSerdeContext(e)}}}function Jd(e){if(typeof e=="object")return e;e=e|0;const t={};let r=0;for(const o of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(e>>r++&1)===1&&(t[o]=1);return t}const VV={it:Symbol.for("@smithy/nor-struct-it")};class or{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=or.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,r){this.ref=t,this.memberName=r;const o=[];let i=t,s=t;for(this._isMemberSchema=!1;HO(i);)o.push(i[1]),i=i[0],s=Xv(i),this._isMemberSchema=!0;if(o.length>0){this.memberTraits={};for(let a=o.length-1;a>=0;--a){const l=o[a];Object.assign(this.memberTraits,Jd(l))}}else this.memberTraits=0;if(s instanceof or){const a=this.memberTraits;Object.assign(this,s),this.memberTraits=Object.assign({},a,s.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??s.memberName;return}if(this.schema=Xv(s),hze(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(s),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){const r=this.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===this.symbol:r}static of(t){const r=Xv(t);if(r instanceof or)return r;if(HO(r)){const[o,i]=r;if(o instanceof or)return Object.assign(o.getMergedTraits(),Jd(i)),o;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}return new or(r)}getSchema(){const t=this.schema;return Array.isArray(t)&&t[0]===0?t[4]:t}getName(t=!1){const{name:r}=this;return!t&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const t=this.getSchema();return typeof t=="number"?t>=64&&t<128:t[0]===1}isMapSchema(){const t=this.getSchema();return typeof t=="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){const t=this.getSchema();if(typeof t!="object")return!1;const r=t[0];return r===3||r===-3||r===4}isUnionSchema(){const t=this.getSchema();return typeof t!="object"?!1:t[0]===4}isBlobSchema(){const t=this.getSchema();return t===21||t===42}isTimestampSchema(){const t=this.getSchema();return typeof t=="number"&&t>=4&&t<=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:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Jd(this.memberTraits)}getOwnTraits(){return Jd(this.traits)}getKeySchema(){const[t,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const o=this.getSchema(),i=t?15:o[4]??0;return Zp([i,0],"key")}getValueSchema(){const t=this.getSchema(),[r,o,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],s=typeof t=="number"?63&t:t&&typeof t=="object"&&(o||i)?t[3+t[0]]:r?15:void 0;if(s!=null)return Zp([s,0],o?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(t)){const o=r[4].indexOf(t),i=r[5][o];return Zp(HO(i)?i:[i,0],t)}if(this.isDocumentSchema())return Zp([15,0],t);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${t}.`)}getMemberSchemas(){const t={};try{for(const[r,o]of this.structIterator())t[r]=o}catch{}return t}getEventStreamMember(){if(this.isStructSchema()){for(const[t,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const t=this.getSchema(),r=t[4].length;let o=t[VV.it];if(o&&r===o.length){yield*o;return}o=Array(r);for(let i=0;i<r;++i){const s=t[4][i],a=Zp([t[5][i],0],s);yield o[i]=[s,a]}t[VV.it]=o}}function Zp(e,t){if(e instanceof or)return Object.assign(e,{memberName:t,_isMemberSchema:!0});const r=or;return new r(e,t)}const HO=e=>Array.isArray(e)&&e.length===2,hze=e=>Array.isArray(e)&&e.length>=5;class ti{namespace;schemas;exceptions;static registries=new Map;constructor(t,r=new Map,o=new Map){this.namespace=t,this.schemas=r,this.exceptions=o}static for(t){return ti.registries.has(t)||ti.registries.set(t,new ti(t)),ti.registries.get(t)}copyFrom(t){const{schemas:r,exceptions:o}=this;for(const[i,s]of t.schemas)r.has(i)||r.set(i,s);for(const[i,s]of t.exceptions)o.has(i)||o.set(i,s)}register(t,r){const o=this.normalizeShapeId(t);for(const i of[this,ti.for(o.split("#")[0])])i.schemas.set(o,r)}getSchema(t){const r=this.normalizeShapeId(t);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}registerError(t,r){const o=t,i=o[1];for(const s of[this,ti.for(i)])s.schemas.set(i+"#"+o[2],o),s.exceptions.set(o,r)}getErrorCtor(t){const r=t;return this.exceptions.has(r)?this.exceptions.get(r):ti.for(r[1]).exceptions.get(r)}getBaseException(){for(const t of this.exceptions.keys())if(Array.isArray(t)){const[,r,o]=t,i=r+"#"+o;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return t}}find(t){return[...this.schemas.values()].find(t)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){return t.includes("#")?t:this.namespace+"#"+t}}const zP=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&wze.warn(Cze(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},mze=Math.ceil(2**127*(2-2**-23)),HV=e=>{const t=zP(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>mze)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},gze=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},zV=e=>XW(e,16),qV=e=>XW(e,8),XW=(e,t)=>{const r=gze(e);if(r!==void 0&&bze(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},bze=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},yze=e=>zP(typeof e=="string"?TC(e):e),vze=e=>HV(typeof e=="string"?TC(e):e),xze=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,TC=e=>{const t=e.match(xze);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},o0=e=>zV(typeof e=="string"?TC(e):e),Sze=e=>qV(typeof e=="string"?TC(e):e),Cze=e=>String(new TypeError(e).stack||e).split(`
451
451
  `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
452
- `),wze={warn:console.warn},Tze=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SM=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function i0(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),o=e.getUTCDay(),i=e.getUTCDate(),s=e.getUTCHours(),a=e.getUTCMinutes(),l=e.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,u=s<10?`0${s}`:`${s}`,d=a<10?`0${a}`:`${a}`,f=l<10?`0${l}`:`${l}`;return`${Tze[o]}, ${c} ${SM[r]} ${t} ${u}:${d}:${f} GMT`}const Oze=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Pze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Oze.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,o,i,s,a,l,c,u,d]=t,f=o0(um(o)),p=Ql(i,"month",1,12),h=Ql(s,"day",1,31),b=Qv(f,p,h,{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u});return d.toUpperCase()!="Z"&&b.setTime(b.getTime()-jze(d)),b},Eze=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$/),Ize=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$/),kze=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})$/),Rze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Eze.exec(e);if(t){const[r,o,i,s,a,l,c,u]=t;return Qv(o0(um(s)),zO(i),Ql(o,"day",1,31),{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u})}if(t=Ize.exec(e),t){const[r,o,i,s,a,l,c,u]=t;return _ze(Qv(Aze(s),zO(i),Ql(o,"day",1,31),{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u}))}if(t=kze.exec(e),t){const[r,o,i,s,a,l,c,u]=t;return Qv(o0(um(u)),zO(o),Ql(i.trimLeft(),"day",1,31),{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},Mze=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=yze(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},Qv=(e,t,r,o)=>{const i=t-1;return Fze(e,i,r),new Date(Date.UTC(e,i,r,Ql(o.hours,"hour",0,23),Ql(o.minutes,"minute",0,59),Ql(o.seconds,"seconds",0,60),$ze(o.fractionalMilliseconds)))},Aze=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+o0(um(e));return r<t?r+100:r},Dze=50*365*24*60*60*1e3,_ze=e=>e.getTime()-new Date().getTime()>Dze?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,zO=e=>{const t=SM.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Nze=[31,28,31,30,31,30,31,31,30,31,30,31],Fze=(e,t,r)=>{let o=Nze[t];if(t===1&&Lze(e)&&(o=29),r>o)throw new TypeError(`Invalid day for ${SM[t]} in ${e}: ${r}`)},Lze=e=>e%4===0&&(e%100!==0||e%400===0),Ql=(e,t,r,o)=>{const i=Sze(um(e));if(i<r||i>o)throw new TypeError(`${t} must be between ${r} and ${o}, inclusive`);return i},$ze=e=>e==null?0:vze("0."+e)*1e3,jze=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const o=Number(e.substring(1,3)),i=Number(e.substring(4,6));return r*(o*60+i)*60*1e3},um=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},UV=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ao=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),OC=()=>{if(UV)return UV();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Ao[e[0]]+Ao[e[1]]+Ao[e[2]]+Ao[e[3]]+"-"+Ao[e[4]]+Ao[e[5]]+"-"+Ao[e[6]]+Ao[e[7]]+"-"+Ao[e[8]]+Ao[e[9]]+"-"+Ao[e[10]]+Ao[e[11]]+Ao[e[12]]+Ao[e[13]]+Ao[e[14]]+Ao[e[15]]},Qa=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};Qa.from=e=>e&&typeof e=="object"&&(e instanceof Qa||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?Qa(String(e)):Qa(JSON.stringify(e));Qa.fromObject=Qa.from;function Bze(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}const CM="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",wM="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",TM="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",QW="(\\d?\\d)",JW="(\\d{4})",Vze=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Hze=new RegExp(`^${CM}, ${QW} ${wM} ${JW} ${TM} GMT$`),zze=new RegExp(`^${CM}, ${QW}-${wM}-(\\d\\d) ${TM} GMT$`),qze=new RegExp(`^${CM} ${wM} ( [1-9]|\\d\\d) ${TM} ${JW}$`),Uze=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Gze=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},Wze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");const t=Vze.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,o,i,s,a,l,,c,u]=t;Ya(o,1,12),Ya(i,1,31),Ya(s,0,23),Ya(a,0,59),Ya(l,0,60);const d=new Date(Date.UTC(Number(r),Number(o)-1,Number(i),Number(s),Number(a),Number(l),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(d.setUTCFullYear(Number(r)),u.toUpperCase()!="Z"){const[,f,p,h]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],b=f==="-"?1:-1;d.setTime(d.getTime()+b*(Number(p)*60*60*1e3+Number(h)*60*1e3))}return d},Kze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,r,o,i,s,a,l,c;if((c=Hze.exec(e))?[,t,r,o,i,s,a,l]=c:(c=zze.exec(e))?([,t,r,o,i,s,a,l]=c,o=(Number(o)+1900).toString()):(c=qze.exec(e))&&([,r,t,i,s,a,l,o]=c),o&&a){const u=Date.UTC(Number(o),Uze.indexOf(r),Number(t),Number(i),Number(s),Number(a),l?Math.round(parseFloat(`0.${l}`)*1e3):0);Ya(t,1,31),Ya(i,0,23),Ya(s,0,59),Ya(a,0,60);const d=new Date(u);return d.setUTCFullYear(Number(o)),d}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function Ya(e,t,r){const o=Number(e);if(o<t||o>r)throw new Error(`Value ${o} out of range [${t}, ${r}]`)}function Yze(e,t,r){if(!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const o=e.split(t),i=[];let s="";for(let a=0;a<o.length;a++)s===""?s=o[a]:s+=t+o[a],(a+1)%r===0&&(i.push(s),s="");return s!==""&&i.push(s),i}const e7=e=>{const t=e.length,r=[];let o=!1,i,s=0;for(let a=0;a<t;++a){const l=e[a];switch(l){case'"':i!=="\\"&&(o=!o);break;case",":o||(r.push(e.slice(s,a)),s=a+1);break}i=l}return r.push(e.slice(s)),r.map(a=>{a=a.trim();const l=a.length;return l<2?a:(a[0]==='"'&&a[l-1]==='"'&&(a=a.slice(1,l-1)),a.replace(/\\"/g,'"'))})},GV=/^-?\d*(\.\d+)?$/;class fg{string;type;constructor(t,r){if(this.string=t,this.type=r,!GV.test(t))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](t){if(!t||typeof t!="object")return!1;const r=t;return fg.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&GV.test(r.string)}}class PC{serdeContext;setSerdeContext(t){this.serdeContext=t}}class t7 extends PC{options;compositeErrorRegistry;constructor(t){super(),this.options=t,this.compositeErrorRegistry=ti.for(t.defaultNamespace);for(const r of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(r)}getRequestType(){return Br}getResponseType(){return wu}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0,t.query||(t.query={});for(const[o,i]of r.url.searchParams.entries())t.query[o]=i;return t}else return t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},t}setHostPrefix(t,r,o){if(this.serdeContext?.disableHostPrefix)return;const i=or.of(r.input),s=Jd(r.traits??{});if(s.endpoint){let a=s.endpoint?.[0];if(typeof a=="string"){const l=[...i.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(const[c]of l){const u=o[c];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);a=a.replace(`{${c}}`,u)}t.hostname=a+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:o}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:o})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:o}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:o})}async loadEventStreamCapability(){const{EventStreamSerde:t}=await Promise.resolve().then(()=>require("./index-BVFGRv_y.js"));return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,o,i,s){return[]}getEventStreamMarshaller(){const t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}class Zze extends t7{async serializeRequest(t,r,o){const i={...r??{}},s=this.serializer,a={},l={},c=await o.endpoint(),u=or.of(t?.input),d=u.getSchema();let f=!1,p;const h=new Br({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:a,headers:l,body:void 0});if(c){this.updateServiceEndpoint(h,c),this.setHostPrefix(h,t,i);const b=Jd(t.traits);if(b.http){h.method=b.http[0];const[g,y]=b.http[1].split("?");h.path=="/"?h.path=g:h.path+=g;const v=new URLSearchParams(y??"");Object.assign(a,Object.fromEntries(v))}}for(const[b,g]of u.structIterator()){const y=g.getMergedTraits()??{},v=i[b];if(v==null&&!g.isIdempotencyToken()){if(y.httpLabel&&(h.path.includes(`{${b}+}`)||h.path.includes(`{${b}}`)))throw new Error(`No value provided for input HTTP label: ${b}.`);continue}if(y.httpPayload)g.isStreaming()?g.isStructSchema()?i[b]&&(p=await this.serializeEventStream({eventStream:i[b],requestSchema:u})):p=v:(s.write(g,v),p=s.flush()),delete i[b];else if(y.httpLabel){s.write(g,v);const C=s.flush();h.path.includes(`{${b}+}`)?h.path=h.path.replace(`{${b}+}`,C.split("/").map(BV).join("/")):h.path.includes(`{${b}}`)&&(h.path=h.path.replace(`{${b}}`,BV(C))),delete i[b]}else if(y.httpHeader)s.write(g,v),l[y.httpHeader.toLowerCase()]=String(s.flush()),delete i[b];else if(typeof y.httpPrefixHeaders=="string"){for(const[C,O]of Object.entries(v)){const T=y.httpPrefixHeaders+C;s.write([g.getValueSchema(),{httpHeader:T}],O),l[T.toLowerCase()]=s.flush()}delete i[b]}else y.httpQuery||y.httpQueryParams?(this.serializeQuery(g,v,a),delete i[b]):f=!0}return f&&i&&(s.write(d,i),p=s.flush()),h.headers=l,h.query=a,h.body=p,h}serializeQuery(t,r,o){const i=this.serializer,s=t.getMergedTraits();if(s.httpQueryParams){for(const[a,l]of Object.entries(r))if(!(a in o)){const c=t.getValueSchema();Object.assign(c.getMergedTraits(),{...s,httpQuery:a,httpQueryParams:void 0}),this.serializeQuery(c,l,o)}return}if(t.isListSchema()){const a=!!t.getMergedTraits().sparse,l=[];for(const c of r){i.write([t.getValueSchema(),s],c);const u=i.flush();(a||u!==void 0)&&l.push(u)}o[s.httpQuery]=l}else i.write([t,s],r),o[s.httpQuery]=i.flush()}async deserializeResponse(t,r,o){const i=this.deserializer,s=or.of(t.output),a={};if(o.statusCode>=300){const c=await fh(o.body,r);throw c.byteLength>0&&Object.assign(a,await i.read(15,c)),await this.handleError(t,r,o,a,this.deserializeMetadata(o)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const c in o.headers){const u=o.headers[c];delete o.headers[c],o.headers[c.toLowerCase()]=u}const l=await this.deserializeHttpMessage(s,r,o,a);if(l.length){const c=await fh(o.body,r);if(c.byteLength>0){const u=await i.read(s,c);for(const d of l)u[d]!=null&&(a[d]=u[d])}}else l.discardResponseBody&&await fh(o.body,r);return a.$metadata=this.deserializeMetadata(o),a}async deserializeHttpMessage(t,r,o,i,s){let a;i instanceof Set?a=s:a=i;let l=!0;const c=this.deserializer,u=or.of(t),d=[];for(const[f,p]of u.structIterator()){const h=p.getMemberTraits();if(h.httpPayload){if(l=!1,p.isStreaming())p.isStructSchema()?a[f]=await this.deserializeEventStream({response:o,responseSchema:u}):a[f]=KW(o.body);else if(o.body){const g=await fh(o.body,r);g.byteLength>0&&(a[f]=await c.read(p,g))}}else if(h.httpHeader){const b=String(h.httpHeader).toLowerCase(),g=o.headers[b];if(g!=null)if(p.isListSchema()){const y=p.getValueSchema();y.getMergedTraits().httpHeader=b;let v;y.isTimestampSchema()&&y.getSchema()===4?v=Yze(g,",",2):v=e7(g);const C=[];for(const O of v)C.push(await c.read(y,O.trim()));a[f]=C}else a[f]=await c.read(p,g)}else if(h.httpPrefixHeaders!==void 0){a[f]={};for(const[b,g]of Object.entries(o.headers))if(b.startsWith(h.httpPrefixHeaders)){const y=p.getValueSchema();y.getMergedTraits().httpHeader=b,a[f][b.slice(h.httpPrefixHeaders.length)]=await c.read(y,g)}}else h.httpResponseCode?a[f]=o.statusCode:d.push(f)}return d.discardResponseBody=l,d}}function EC(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();const{httpLabel:r,httpPrefixHeaders:o,httpHeader:i,httpQuery:s}=e.getMergedTraits();return(t.httpBindings?typeof o=="string"||i?6:s||r?5:void 0:void 0)??t.timestampFormat.default}class n7 extends PC{settings;constructor(t){super(),this.settings=t}read(t,r){const o=or.of(t);if(o.isListSchema())return e7(r).map(i=>this.read(o.getValueSchema(),i));if(o.isBlobSchema())return(this.serdeContext?.base64Decoder??Tu)(r);if(o.isTimestampSchema())switch(EC(o,this.settings)){case 5:return Wze(r);case 6:return Kze(r);case 7:return Gze(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(o.isStringSchema()){const i=o.getMergedTraits().mediaType;let s=r;if(i)return o.getMergedTraits().httpHeader&&(s=this.base64ToUtf8(s)),(i==="application/json"||i.endsWith("+json"))&&(s=Qa.from(s)),s}return o.isNumericSchema()?Number(r):o.isBigIntegerSchema()?BigInt(r):o.isBigDecimalSchema()?new fg(r,"bigDecimal"):o.isBooleanSchema()?String(r).toLowerCase()==="true":r}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??zu)((this.serdeContext?.base64Decoder??Tu)(t))}}class Xze extends PC{codecDeserializer;stringDeserializer;constructor(t,r){super(),this.codecDeserializer=t,this.stringDeserializer=new n7(r)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,r){const o=or.of(t),i=o.getMergedTraits(),s=this.serdeContext?.utf8Encoder??zu;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(o,s(r));if(i.httpPayload){if(o.isBlobSchema()){const a=this.serdeContext?.utf8Decoder??cl;return typeof r=="string"?a(r):r}else if(o.isStringSchema())return"byteLength"in r?s(r):r}return this.codecDeserializer.read(o,r)}}class Qze extends PC{settings;stringBuffer="";constructor(t){super(),this.settings=t}write(t,r){const o=or.of(t);switch(typeof r){case"object":if(r===null){this.stringBuffer="null";return}if(o.isTimestampSchema()){if(!(r instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${r} when schema expected Date in ${o.getName(!0)}`);switch(EC(o,this.settings)){case 5:this.stringBuffer=r.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=i0(r);break;case 7:this.stringBuffer=String(r.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",r),this.stringBuffer=String(r.getTime()/1e3)}return}if(o.isBlobSchema()&&"byteLength"in r){this.stringBuffer=(this.serdeContext?.base64Encoder??oc)(r);return}if(o.isListSchema()&&Array.isArray(r)){let a="";for(const l of r){this.write([o.getValueSchema(),o.getMergedTraits()],l);const c=this.flush(),u=o.getValueSchema().isTimestampSchema()?c:Bze(c);a!==""&&(a+=", "),a+=u}this.stringBuffer=a;return}this.stringBuffer=JSON.stringify(r,null,2);break;case"string":const i=o.getMergedTraits().mediaType;let s=r;if(i&&((i==="application/json"||i.endsWith("+json"))&&(s=Qa.from(s)),o.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??oc)(s.toString());return}this.stringBuffer=r;break;default:o.isIdempotencyToken()?this.stringBuffer=OC():this.stringBuffer=String(r)}}flush(){const t=this.stringBuffer;return this.stringBuffer="",t}}class Jze{codecSerializer;stringSerializer;buffer;constructor(t,r,o=new Qze(r)){this.codecSerializer=t,this.stringSerializer=o}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,r){const o=or.of(t),i=o.getMergedTraits();if(i.httpHeader||i.httpLabel||i.httpQuery){this.stringSerializer.write(o,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(o,r)}flush(){if(this.buffer!==void 0){const t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}function eqe(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r}class r7{authSchemes=new Map;constructor(t){for(const[r,o]of Object.entries(t))o!==void 0&&this.authSchemes.set(r,o)}getIdentityProvider(t){return this.authSchemes.get(t)}}const tqe=e=>function(r){return o7(r)&&r.expiration.getTime()-Date.now()<e},nqe=3e5,rqe=tqe(nqe),o7=e=>e.expiration!==void 0,oqe=(e,t,r)=>{if(e===void 0)return;const o=typeof e!="function"?async()=>Promise.resolve(e):e;let i,s,a,l=!1;const c=async u=>{s||(s=o(u));try{i=await s,a=!0,l=!1}finally{s=void 0}return i};return t===void 0?async u=>((!a||u?.forceRefresh)&&(i=await c(u)),i):async u=>((!a||u?.forceRefresh)&&(i=await c(u)),l?i:r(i)?(t(i)&&await c(u),i):(l=!0,i))};class OM extends Error{name="ProviderError";tryNextLink;constructor(t,r=!0){let o,i=!0;typeof r=="boolean"?(o=void 0,i=r):r!=null&&typeof r=="object"&&(o=r.logger,i=r.tryNextLink??!0),super(t),this.tryNextLink=i,Object.setPrototypeOf(this,OM.prototype),o?.debug?.(`@smithy/property-provider ${i?"->":"(!)"} ${t}`)}static from(t,r=!0){return Object.assign(new this(t.message,r),t)}}class fp extends OM{name="CredentialsProviderError";constructor(t,r=!0){super(t,r),Object.setPrototypeOf(this,fp.prototype)}}const iqe=(e,t,r)=>{let o,i,s,a=!1;const l=async()=>{i||(i=e());try{o=await i,s=!0,a=!1}finally{i=void 0}return o};return async c=>((!s||c?.forceRefresh)&&(o=await l()),o)},sqe=e=>(e.sigv4aSigningRegionSet=hf(e.sigv4aSigningRegionSet),e),aqe="X-Amz-Algorithm",lqe="X-Amz-Credential",i7="X-Amz-Date",cqe="X-Amz-SignedHeaders",uqe="X-Amz-Expires",s7="X-Amz-Signature",a7="X-Amz-Security-Token",l7="authorization",c7=i7.toLowerCase(),dqe="date",fqe=[l7,c7,dqe],pqe=s7.toLowerCase(),qP="x-amz-content-sha256",hqe=a7.toLowerCase(),mqe={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},gqe=/^proxy-/,bqe=/^sec-/,qO="AWS4-HMAC-SHA256",yqe="AWS4-HMAC-SHA256-PAYLOAD",vqe="UNSIGNED-PAYLOAD",xqe=50,u7="aws4_request",Sqe=3600*24*7,Pv={},UO=[],GO=(e,t,r)=>`${e}/${t}/${r}/${u7}`,Cqe=async(e,t,r,o,i)=>{const s=await WV(e,t.secretAccessKey,t.accessKeyId),a=`${r}:${o}:${i}:${Ci(s)}:${t.sessionToken}`;if(a in Pv)return Pv[a];for(UO.push(a);UO.length>xqe;)delete Pv[UO.shift()];let l=`AWS4${t.secretAccessKey}`;for(const c of[r,o,i,u7])l=await WV(e,l,c);return Pv[a]=l},WV=(e,t,r)=>{const o=new e(t);return o.update(Bf(r)),o.digest()},KV=({headers:e},t,r)=>{const o={};for(const i of Object.keys(e).sort()){if(e[i]==null)continue;const s=i.toLowerCase();(s in mqe||t?.has(s)||gqe.test(s)||bqe.test(s))&&(!r||r&&!r.has(s))||(o[s]=e[i].trim().replace(/\s+/g," "))}return o},d7=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",WO=async({headers:e,body:t},r)=>{for(const o of Object.keys(e))if(o.toLowerCase()===qP)return e[o];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||d7(t)){const o=new r;return o.update(Bf(t)),Ci(await o.digest())}return vqe};class wqe{format(t){const r=[];for(const s of Object.keys(t)){const a=cl(s);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(t[s]))}const o=new Uint8Array(r.reduce((s,a)=>s+a.byteLength,0));let i=0;for(const s of r)o.set(s,i),i+=s.byteLength;return o}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const o=new DataView(new ArrayBuffer(5));return o.setUint8(0,4),o.setInt32(1,t.value,!1),new Uint8Array(o.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+t.value.byteLength));s.setUint8(0,6),s.setUint16(1,t.value.byteLength,!1);const a=new Uint8Array(s.buffer);return a.set(t.value,3),a;case"string":const l=cl(t.value),c=new DataView(new ArrayBuffer(3+l.byteLength));c.setUint8(0,7),c.setUint16(1,l.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(l,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(Oqe.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!Tqe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(WW(t.value.replace(/\-/g,"")),1),f}}}var YV;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(YV||(YV={}));const Tqe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let Oqe=class f7{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let o=7,i=Math.abs(Math.round(t));o>-1&&i>0;o--,i/=256)r[o]=i;return t<0&&ZV(r),new f7(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&ZV(t),parseInt(Ci(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function ZV(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const Pqe=(e,t)=>{e=e.toLowerCase();for(const r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},Eqe=(e,t={})=>{const{headers:r,query:o={}}=Br.clone(e);for(const i of Object.keys(r)){const s=i.toLowerCase();(s.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(s)||t.hoistableHeaders?.has(s))&&(o[i]=r[i],delete r[i])}return{...e,headers:r,query:o}},XV=e=>{e=Br.clone(e);for(const t of Object.keys(e.headers))fqe.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},Iqe=({query:e={}})=>{const t=[],r={};for(const o of Object.keys(e)){if(o.toLowerCase()===pqe)continue;const i=su(o);t.push(i);const s=e[o];typeof s=="string"?r[i]=`${i}=${su(s)}`:Array.isArray(s)&&(r[i]=s.slice(0).reduce((a,l)=>a.concat([`${i}=${su(l)}`]),[]).sort().join("&"))}return t.sort().map(o=>r[o]).filter(o=>o).join("&")},kqe=e=>Rqe(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Rqe=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class Mqe{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:r,region:o,service:i,sha256:s,uriEscapePath:a=!0}){this.service=i,this.sha256=s,this.uriEscapePath=a,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=Rs(o),this.credentialProvider=Rs(r)}createCanonicalRequest(t,r,o){const i=Object.keys(r).sort();return`${t.method}
452
+ `),wze={warn:console.warn},Tze=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SM=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function i0(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),o=e.getUTCDay(),i=e.getUTCDate(),s=e.getUTCHours(),a=e.getUTCMinutes(),l=e.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,u=s<10?`0${s}`:`${s}`,d=a<10?`0${a}`:`${a}`,f=l<10?`0${l}`:`${l}`;return`${Tze[o]}, ${c} ${SM[r]} ${t} ${u}:${d}:${f} GMT`}const Oze=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Pze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Oze.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,o,i,s,a,l,c,u,d]=t,f=o0(um(o)),p=Ql(i,"month",1,12),h=Ql(s,"day",1,31),b=Qv(f,p,h,{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u});return d.toUpperCase()!="Z"&&b.setTime(b.getTime()-jze(d)),b},Eze=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$/),Ize=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$/),kze=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})$/),Rze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Eze.exec(e);if(t){const[r,o,i,s,a,l,c,u]=t;return Qv(o0(um(s)),zO(i),Ql(o,"day",1,31),{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u})}if(t=Ize.exec(e),t){const[r,o,i,s,a,l,c,u]=t;return _ze(Qv(Aze(s),zO(i),Ql(o,"day",1,31),{hours:a,minutes:l,seconds:c,fractionalMilliseconds:u}))}if(t=kze.exec(e),t){const[r,o,i,s,a,l,c,u]=t;return Qv(o0(um(u)),zO(o),Ql(i.trimLeft(),"day",1,31),{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},Mze=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=yze(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},Qv=(e,t,r,o)=>{const i=t-1;return Fze(e,i,r),new Date(Date.UTC(e,i,r,Ql(o.hours,"hour",0,23),Ql(o.minutes,"minute",0,59),Ql(o.seconds,"seconds",0,60),$ze(o.fractionalMilliseconds)))},Aze=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+o0(um(e));return r<t?r+100:r},Dze=50*365*24*60*60*1e3,_ze=e=>e.getTime()-new Date().getTime()>Dze?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,zO=e=>{const t=SM.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Nze=[31,28,31,30,31,30,31,31,30,31,30,31],Fze=(e,t,r)=>{let o=Nze[t];if(t===1&&Lze(e)&&(o=29),r>o)throw new TypeError(`Invalid day for ${SM[t]} in ${e}: ${r}`)},Lze=e=>e%4===0&&(e%100!==0||e%400===0),Ql=(e,t,r,o)=>{const i=Sze(um(e));if(i<r||i>o)throw new TypeError(`${t} must be between ${r} and ${o}, inclusive`);return i},$ze=e=>e==null?0:vze("0."+e)*1e3,jze=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const o=Number(e.substring(1,3)),i=Number(e.substring(4,6));return r*(o*60+i)*60*1e3},um=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},UV=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ao=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),OC=()=>{if(UV)return UV();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Ao[e[0]]+Ao[e[1]]+Ao[e[2]]+Ao[e[3]]+"-"+Ao[e[4]]+Ao[e[5]]+"-"+Ao[e[6]]+Ao[e[7]]+"-"+Ao[e[8]]+Ao[e[9]]+"-"+Ao[e[10]]+Ao[e[11]]+Ao[e[12]]+Ao[e[13]]+Ao[e[14]]+Ao[e[15]]},Qa=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};Qa.from=e=>e&&typeof e=="object"&&(e instanceof Qa||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?Qa(String(e)):Qa(JSON.stringify(e));Qa.fromObject=Qa.from;function Bze(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}const CM="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",wM="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",TM="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",QW="(\\d?\\d)",JW="(\\d{4})",Vze=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Hze=new RegExp(`^${CM}, ${QW} ${wM} ${JW} ${TM} GMT$`),zze=new RegExp(`^${CM}, ${QW}-${wM}-(\\d\\d) ${TM} GMT$`),qze=new RegExp(`^${CM} ${wM} ( [1-9]|\\d\\d) ${TM} ${JW}$`),Uze=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Gze=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},Wze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");const t=Vze.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,o,i,s,a,l,,c,u]=t;Ya(o,1,12),Ya(i,1,31),Ya(s,0,23),Ya(a,0,59),Ya(l,0,60);const d=new Date(Date.UTC(Number(r),Number(o)-1,Number(i),Number(s),Number(a),Number(l),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(d.setUTCFullYear(Number(r)),u.toUpperCase()!="Z"){const[,f,p,h]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],b=f==="-"?1:-1;d.setTime(d.getTime()+b*(Number(p)*60*60*1e3+Number(h)*60*1e3))}return d},Kze=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,r,o,i,s,a,l,c;if((c=Hze.exec(e))?[,t,r,o,i,s,a,l]=c:(c=zze.exec(e))?([,t,r,o,i,s,a,l]=c,o=(Number(o)+1900).toString()):(c=qze.exec(e))&&([,r,t,i,s,a,l,o]=c),o&&a){const u=Date.UTC(Number(o),Uze.indexOf(r),Number(t),Number(i),Number(s),Number(a),l?Math.round(parseFloat(`0.${l}`)*1e3):0);Ya(t,1,31),Ya(i,0,23),Ya(s,0,59),Ya(a,0,60);const d=new Date(u);return d.setUTCFullYear(Number(o)),d}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function Ya(e,t,r){const o=Number(e);if(o<t||o>r)throw new Error(`Value ${o} out of range [${t}, ${r}]`)}function Yze(e,t,r){if(!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const o=e.split(t),i=[];let s="";for(let a=0;a<o.length;a++)s===""?s=o[a]:s+=t+o[a],(a+1)%r===0&&(i.push(s),s="");return s!==""&&i.push(s),i}const e7=e=>{const t=e.length,r=[];let o=!1,i,s=0;for(let a=0;a<t;++a){const l=e[a];switch(l){case'"':i!=="\\"&&(o=!o);break;case",":o||(r.push(e.slice(s,a)),s=a+1);break}i=l}return r.push(e.slice(s)),r.map(a=>{a=a.trim();const l=a.length;return l<2?a:(a[0]==='"'&&a[l-1]==='"'&&(a=a.slice(1,l-1)),a.replace(/\\"/g,'"'))})},GV=/^-?\d*(\.\d+)?$/;class fg{string;type;constructor(t,r){if(this.string=t,this.type=r,!GV.test(t))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](t){if(!t||typeof t!="object")return!1;const r=t;return fg.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&GV.test(r.string)}}class PC{serdeContext;setSerdeContext(t){this.serdeContext=t}}class t7 extends PC{options;compositeErrorRegistry;constructor(t){super(),this.options=t,this.compositeErrorRegistry=ti.for(t.defaultNamespace);for(const r of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(r)}getRequestType(){return Br}getResponseType(){return wu}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0,t.query||(t.query={});for(const[o,i]of r.url.searchParams.entries())t.query[o]=i;return t}else return t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},t}setHostPrefix(t,r,o){if(this.serdeContext?.disableHostPrefix)return;const i=or.of(r.input),s=Jd(r.traits??{});if(s.endpoint){let a=s.endpoint?.[0];if(typeof a=="string"){const l=[...i.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(const[c]of l){const u=o[c];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);a=a.replace(`{${c}}`,u)}t.hostname=a+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:o}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:o})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:o}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:o})}async loadEventStreamCapability(){const{EventStreamSerde:t}=await Promise.resolve().then(()=>require("./index-Du-I4xgT.js"));return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,o,i,s){return[]}getEventStreamMarshaller(){const t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}class Zze extends t7{async serializeRequest(t,r,o){const i={...r??{}},s=this.serializer,a={},l={},c=await o.endpoint(),u=or.of(t?.input),d=u.getSchema();let f=!1,p;const h=new Br({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:a,headers:l,body:void 0});if(c){this.updateServiceEndpoint(h,c),this.setHostPrefix(h,t,i);const b=Jd(t.traits);if(b.http){h.method=b.http[0];const[g,y]=b.http[1].split("?");h.path=="/"?h.path=g:h.path+=g;const v=new URLSearchParams(y??"");Object.assign(a,Object.fromEntries(v))}}for(const[b,g]of u.structIterator()){const y=g.getMergedTraits()??{},v=i[b];if(v==null&&!g.isIdempotencyToken()){if(y.httpLabel&&(h.path.includes(`{${b}+}`)||h.path.includes(`{${b}}`)))throw new Error(`No value provided for input HTTP label: ${b}.`);continue}if(y.httpPayload)g.isStreaming()?g.isStructSchema()?i[b]&&(p=await this.serializeEventStream({eventStream:i[b],requestSchema:u})):p=v:(s.write(g,v),p=s.flush()),delete i[b];else if(y.httpLabel){s.write(g,v);const C=s.flush();h.path.includes(`{${b}+}`)?h.path=h.path.replace(`{${b}+}`,C.split("/").map(BV).join("/")):h.path.includes(`{${b}}`)&&(h.path=h.path.replace(`{${b}}`,BV(C))),delete i[b]}else if(y.httpHeader)s.write(g,v),l[y.httpHeader.toLowerCase()]=String(s.flush()),delete i[b];else if(typeof y.httpPrefixHeaders=="string"){for(const[C,O]of Object.entries(v)){const T=y.httpPrefixHeaders+C;s.write([g.getValueSchema(),{httpHeader:T}],O),l[T.toLowerCase()]=s.flush()}delete i[b]}else y.httpQuery||y.httpQueryParams?(this.serializeQuery(g,v,a),delete i[b]):f=!0}return f&&i&&(s.write(d,i),p=s.flush()),h.headers=l,h.query=a,h.body=p,h}serializeQuery(t,r,o){const i=this.serializer,s=t.getMergedTraits();if(s.httpQueryParams){for(const[a,l]of Object.entries(r))if(!(a in o)){const c=t.getValueSchema();Object.assign(c.getMergedTraits(),{...s,httpQuery:a,httpQueryParams:void 0}),this.serializeQuery(c,l,o)}return}if(t.isListSchema()){const a=!!t.getMergedTraits().sparse,l=[];for(const c of r){i.write([t.getValueSchema(),s],c);const u=i.flush();(a||u!==void 0)&&l.push(u)}o[s.httpQuery]=l}else i.write([t,s],r),o[s.httpQuery]=i.flush()}async deserializeResponse(t,r,o){const i=this.deserializer,s=or.of(t.output),a={};if(o.statusCode>=300){const c=await fh(o.body,r);throw c.byteLength>0&&Object.assign(a,await i.read(15,c)),await this.handleError(t,r,o,a,this.deserializeMetadata(o)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const c in o.headers){const u=o.headers[c];delete o.headers[c],o.headers[c.toLowerCase()]=u}const l=await this.deserializeHttpMessage(s,r,o,a);if(l.length){const c=await fh(o.body,r);if(c.byteLength>0){const u=await i.read(s,c);for(const d of l)u[d]!=null&&(a[d]=u[d])}}else l.discardResponseBody&&await fh(o.body,r);return a.$metadata=this.deserializeMetadata(o),a}async deserializeHttpMessage(t,r,o,i,s){let a;i instanceof Set?a=s:a=i;let l=!0;const c=this.deserializer,u=or.of(t),d=[];for(const[f,p]of u.structIterator()){const h=p.getMemberTraits();if(h.httpPayload){if(l=!1,p.isStreaming())p.isStructSchema()?a[f]=await this.deserializeEventStream({response:o,responseSchema:u}):a[f]=KW(o.body);else if(o.body){const g=await fh(o.body,r);g.byteLength>0&&(a[f]=await c.read(p,g))}}else if(h.httpHeader){const b=String(h.httpHeader).toLowerCase(),g=o.headers[b];if(g!=null)if(p.isListSchema()){const y=p.getValueSchema();y.getMergedTraits().httpHeader=b;let v;y.isTimestampSchema()&&y.getSchema()===4?v=Yze(g,",",2):v=e7(g);const C=[];for(const O of v)C.push(await c.read(y,O.trim()));a[f]=C}else a[f]=await c.read(p,g)}else if(h.httpPrefixHeaders!==void 0){a[f]={};for(const[b,g]of Object.entries(o.headers))if(b.startsWith(h.httpPrefixHeaders)){const y=p.getValueSchema();y.getMergedTraits().httpHeader=b,a[f][b.slice(h.httpPrefixHeaders.length)]=await c.read(y,g)}}else h.httpResponseCode?a[f]=o.statusCode:d.push(f)}return d.discardResponseBody=l,d}}function EC(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();const{httpLabel:r,httpPrefixHeaders:o,httpHeader:i,httpQuery:s}=e.getMergedTraits();return(t.httpBindings?typeof o=="string"||i?6:s||r?5:void 0:void 0)??t.timestampFormat.default}class n7 extends PC{settings;constructor(t){super(),this.settings=t}read(t,r){const o=or.of(t);if(o.isListSchema())return e7(r).map(i=>this.read(o.getValueSchema(),i));if(o.isBlobSchema())return(this.serdeContext?.base64Decoder??Tu)(r);if(o.isTimestampSchema())switch(EC(o,this.settings)){case 5:return Wze(r);case 6:return Kze(r);case 7:return Gze(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(o.isStringSchema()){const i=o.getMergedTraits().mediaType;let s=r;if(i)return o.getMergedTraits().httpHeader&&(s=this.base64ToUtf8(s)),(i==="application/json"||i.endsWith("+json"))&&(s=Qa.from(s)),s}return o.isNumericSchema()?Number(r):o.isBigIntegerSchema()?BigInt(r):o.isBigDecimalSchema()?new fg(r,"bigDecimal"):o.isBooleanSchema()?String(r).toLowerCase()==="true":r}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??zu)((this.serdeContext?.base64Decoder??Tu)(t))}}class Xze extends PC{codecDeserializer;stringDeserializer;constructor(t,r){super(),this.codecDeserializer=t,this.stringDeserializer=new n7(r)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,r){const o=or.of(t),i=o.getMergedTraits(),s=this.serdeContext?.utf8Encoder??zu;if(i.httpHeader||i.httpResponseCode)return this.stringDeserializer.read(o,s(r));if(i.httpPayload){if(o.isBlobSchema()){const a=this.serdeContext?.utf8Decoder??cl;return typeof r=="string"?a(r):r}else if(o.isStringSchema())return"byteLength"in r?s(r):r}return this.codecDeserializer.read(o,r)}}class Qze extends PC{settings;stringBuffer="";constructor(t){super(),this.settings=t}write(t,r){const o=or.of(t);switch(typeof r){case"object":if(r===null){this.stringBuffer="null";return}if(o.isTimestampSchema()){if(!(r instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${r} when schema expected Date in ${o.getName(!0)}`);switch(EC(o,this.settings)){case 5:this.stringBuffer=r.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=i0(r);break;case 7:this.stringBuffer=String(r.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",r),this.stringBuffer=String(r.getTime()/1e3)}return}if(o.isBlobSchema()&&"byteLength"in r){this.stringBuffer=(this.serdeContext?.base64Encoder??oc)(r);return}if(o.isListSchema()&&Array.isArray(r)){let a="";for(const l of r){this.write([o.getValueSchema(),o.getMergedTraits()],l);const c=this.flush(),u=o.getValueSchema().isTimestampSchema()?c:Bze(c);a!==""&&(a+=", "),a+=u}this.stringBuffer=a;return}this.stringBuffer=JSON.stringify(r,null,2);break;case"string":const i=o.getMergedTraits().mediaType;let s=r;if(i&&((i==="application/json"||i.endsWith("+json"))&&(s=Qa.from(s)),o.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??oc)(s.toString());return}this.stringBuffer=r;break;default:o.isIdempotencyToken()?this.stringBuffer=OC():this.stringBuffer=String(r)}}flush(){const t=this.stringBuffer;return this.stringBuffer="",t}}class Jze{codecSerializer;stringSerializer;buffer;constructor(t,r,o=new Qze(r)){this.codecSerializer=t,this.stringSerializer=o}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,r){const o=or.of(t),i=o.getMergedTraits();if(i.httpHeader||i.httpLabel||i.httpQuery){this.stringSerializer.write(o,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(o,r)}flush(){if(this.buffer!==void 0){const t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}function eqe(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r}class r7{authSchemes=new Map;constructor(t){for(const[r,o]of Object.entries(t))o!==void 0&&this.authSchemes.set(r,o)}getIdentityProvider(t){return this.authSchemes.get(t)}}const tqe=e=>function(r){return o7(r)&&r.expiration.getTime()-Date.now()<e},nqe=3e5,rqe=tqe(nqe),o7=e=>e.expiration!==void 0,oqe=(e,t,r)=>{if(e===void 0)return;const o=typeof e!="function"?async()=>Promise.resolve(e):e;let i,s,a,l=!1;const c=async u=>{s||(s=o(u));try{i=await s,a=!0,l=!1}finally{s=void 0}return i};return t===void 0?async u=>((!a||u?.forceRefresh)&&(i=await c(u)),i):async u=>((!a||u?.forceRefresh)&&(i=await c(u)),l?i:r(i)?(t(i)&&await c(u),i):(l=!0,i))};class OM extends Error{name="ProviderError";tryNextLink;constructor(t,r=!0){let o,i=!0;typeof r=="boolean"?(o=void 0,i=r):r!=null&&typeof r=="object"&&(o=r.logger,i=r.tryNextLink??!0),super(t),this.tryNextLink=i,Object.setPrototypeOf(this,OM.prototype),o?.debug?.(`@smithy/property-provider ${i?"->":"(!)"} ${t}`)}static from(t,r=!0){return Object.assign(new this(t.message,r),t)}}class fp extends OM{name="CredentialsProviderError";constructor(t,r=!0){super(t,r),Object.setPrototypeOf(this,fp.prototype)}}const iqe=(e,t,r)=>{let o,i,s,a=!1;const l=async()=>{i||(i=e());try{o=await i,s=!0,a=!1}finally{i=void 0}return o};return async c=>((!s||c?.forceRefresh)&&(o=await l()),o)},sqe=e=>(e.sigv4aSigningRegionSet=hf(e.sigv4aSigningRegionSet),e),aqe="X-Amz-Algorithm",lqe="X-Amz-Credential",i7="X-Amz-Date",cqe="X-Amz-SignedHeaders",uqe="X-Amz-Expires",s7="X-Amz-Signature",a7="X-Amz-Security-Token",l7="authorization",c7=i7.toLowerCase(),dqe="date",fqe=[l7,c7,dqe],pqe=s7.toLowerCase(),qP="x-amz-content-sha256",hqe=a7.toLowerCase(),mqe={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},gqe=/^proxy-/,bqe=/^sec-/,qO="AWS4-HMAC-SHA256",yqe="AWS4-HMAC-SHA256-PAYLOAD",vqe="UNSIGNED-PAYLOAD",xqe=50,u7="aws4_request",Sqe=3600*24*7,Pv={},UO=[],GO=(e,t,r)=>`${e}/${t}/${r}/${u7}`,Cqe=async(e,t,r,o,i)=>{const s=await WV(e,t.secretAccessKey,t.accessKeyId),a=`${r}:${o}:${i}:${Ci(s)}:${t.sessionToken}`;if(a in Pv)return Pv[a];for(UO.push(a);UO.length>xqe;)delete Pv[UO.shift()];let l=`AWS4${t.secretAccessKey}`;for(const c of[r,o,i,u7])l=await WV(e,l,c);return Pv[a]=l},WV=(e,t,r)=>{const o=new e(t);return o.update(Bf(r)),o.digest()},KV=({headers:e},t,r)=>{const o={};for(const i of Object.keys(e).sort()){if(e[i]==null)continue;const s=i.toLowerCase();(s in mqe||t?.has(s)||gqe.test(s)||bqe.test(s))&&(!r||r&&!r.has(s))||(o[s]=e[i].trim().replace(/\s+/g," "))}return o},d7=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",WO=async({headers:e,body:t},r)=>{for(const o of Object.keys(e))if(o.toLowerCase()===qP)return e[o];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||d7(t)){const o=new r;return o.update(Bf(t)),Ci(await o.digest())}return vqe};class wqe{format(t){const r=[];for(const s of Object.keys(t)){const a=cl(s);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(t[s]))}const o=new Uint8Array(r.reduce((s,a)=>s+a.byteLength,0));let i=0;for(const s of r)o.set(s,i),i+=s.byteLength;return o}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const o=new DataView(new ArrayBuffer(5));return o.setUint8(0,4),o.setInt32(1,t.value,!1),new Uint8Array(o.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+t.value.byteLength));s.setUint8(0,6),s.setUint16(1,t.value.byteLength,!1);const a=new Uint8Array(s.buffer);return a.set(t.value,3),a;case"string":const l=cl(t.value),c=new DataView(new ArrayBuffer(3+l.byteLength));c.setUint8(0,7),c.setUint16(1,l.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(l,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(Oqe.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!Tqe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(WW(t.value.replace(/\-/g,"")),1),f}}}var YV;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(YV||(YV={}));const Tqe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let Oqe=class f7{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let o=7,i=Math.abs(Math.round(t));o>-1&&i>0;o--,i/=256)r[o]=i;return t<0&&ZV(r),new f7(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&ZV(t),parseInt(Ci(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function ZV(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const Pqe=(e,t)=>{e=e.toLowerCase();for(const r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},Eqe=(e,t={})=>{const{headers:r,query:o={}}=Br.clone(e);for(const i of Object.keys(r)){const s=i.toLowerCase();(s.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(s)||t.hoistableHeaders?.has(s))&&(o[i]=r[i],delete r[i])}return{...e,headers:r,query:o}},XV=e=>{e=Br.clone(e);for(const t of Object.keys(e.headers))fqe.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},Iqe=({query:e={}})=>{const t=[],r={};for(const o of Object.keys(e)){if(o.toLowerCase()===pqe)continue;const i=su(o);t.push(i);const s=e[o];typeof s=="string"?r[i]=`${i}=${su(s)}`:Array.isArray(s)&&(r[i]=s.slice(0).reduce((a,l)=>a.concat([`${i}=${su(l)}`]),[]).sort().join("&"))}return t.sort().map(o=>r[o]).filter(o=>o).join("&")},kqe=e=>Rqe(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Rqe=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class Mqe{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:r,region:o,service:i,sha256:s,uriEscapePath:a=!0}){this.service=i,this.sha256=s,this.uriEscapePath=a,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=Rs(o),this.credentialProvider=Rs(r)}createCanonicalRequest(t,r,o){const i=Object.keys(r).sort();return`${t.method}
453
453
  ${this.getCanonicalPath(t)}
454
454
  ${Iqe(t)}
455
455
  ${i.map(s=>`${s}:${r[s]}`).join(`
@@ -461,5 +461,5 @@ ${t}
461
461
  ${r}
462
462
  ${Ci(a)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const r=[];for(const s of t.split("/"))s?.length!==0&&s!=="."&&(s===".."?r.pop():r.push(s));const o=`${t?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t?.endsWith("/")?"/":""}`;return su(o).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(t){const r=kqe(t).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}class UP extends Mqe{headerFormatter=new wqe;constructor({applyChecksum:t,credentials:r,region:o,service:i,sha256:s,uriEscapePath:a=!0}){super({applyChecksum:t,credentials:r,region:o,service:i,sha256:s,uriEscapePath:a})}async presign(t,r={}){const{signingDate:o=new Date,expiresIn:i=3600,unsignableHeaders:s,unhoistableHeaders:a,signableHeaders:l,hoistableHeaders:c,signingRegion:u,signingService:d}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);const p=u??await this.regionProvider(),{longDate:h,shortDate:b}=this.formatDate(o);if(i>Sqe)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const g=GO(b,p,d??this.service),y=Eqe(XV(t),{unhoistableHeaders:a,hoistableHeaders:c});f.sessionToken&&(y.query[a7]=f.sessionToken),y.query[aqe]=qO,y.query[lqe]=`${f.accessKeyId}/${g}`,y.query[i7]=h,y.query[uqe]=i.toString(10);const v=KV(y,s,l);return y.query[cqe]=this.getCanonicalHeaderList(v),y.query[s7]=await this.getSignature(h,g,this.getSigningKey(f,p,b,d),this.createCanonicalRequest(y,v,await WO(t,this.sha256))),y}async sign(t,r){return typeof t=="string"?this.signString(t,r):t.headers&&t.payload?this.signEvent(t,r):t.message?this.signMessage(t,r):this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:o=new Date,priorSignature:i,signingRegion:s,signingService:a}){const l=s??await this.regionProvider(),{shortDate:c,longDate:u}=this.formatDate(o),d=GO(c,l,a??this.service),f=await WO({headers:{},body:r},this.sha256),p=new this.sha256;p.update(t);const h=Ci(await p.digest()),b=[yqe,u,d,i,h,f].join(`
463
463
  `);return this.signString(b,{signingDate:o,signingRegion:l,signingService:a})}async signMessage(t,{signingDate:r=new Date,signingRegion:o,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:o,signingService:i,priorSignature:t.priorSignature}).then(a=>({message:t.message,signature:a}))}async signString(t,{signingDate:r=new Date,signingRegion:o,signingService:i}={}){const s=await this.credentialProvider();this.validateResolvedCredentials(s);const a=o??await this.regionProvider(),{shortDate:l}=this.formatDate(r),c=new this.sha256(await this.getSigningKey(s,a,l,i));return c.update(Bf(t)),Ci(await c.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:o,unsignableHeaders:i,signingRegion:s,signingService:a}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const c=s??await this.regionProvider(),u=XV(t),{longDate:d,shortDate:f}=this.formatDate(r),p=GO(f,c,a??this.service);u.headers[c7]=d,l.sessionToken&&(u.headers[hqe]=l.sessionToken);const h=await WO(u,this.sha256);!Pqe(qP,u.headers)&&this.applyChecksum&&(u.headers[qP]=h);const b=KV(u,i,o),g=await this.getSignature(d,p,this.getSigningKey(l,c,f,a),this.createCanonicalRequest(u,b,h));return u.headers[l7]=`${qO} Credential=${l.accessKeyId}/${p}, SignedHeaders=${this.getCanonicalHeaderList(b)}, Signature=${g}`,u}async getSignature(t,r,o,i){const s=await this.createStringToSign(t,r,i,qO),a=new this.sha256(await o);return a.update(Bf(s)),Ci(await a.digest())}getSigningKey(t,r,o,i){return Cqe(this.sha256,t,o,r,i||this.service)}}const p7=e=>{let t=e.credentials,r=!!e.credentials,o;Object.defineProperty(e,"credentials",{set(u){u&&u!==t&&u!==o&&(r=!0),t=u;const d=Aqe(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),f=Dqe(e,d);if(r&&!f.attributed){const p=typeof t=="object"&&t!==null;o=async h=>{const g=await f(h);return p&&(!g.$source||Object.keys(g.$source).length===0)?_He(g,"CREDENTIALS_CODE","e"):g},o.memoized=f.memoized,o.configBound=f.configBound,o.attributed=!0}else o=f},get(){return o},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:i=!0,systemClockOffset:s=e.systemClockOffset||0,sha256:a}=e;let l;return e.signer?l=hf(e.signer):e.regionInfoProvider?l=()=>hf(e.region)().then(async u=>[await e.regionInfoProvider(u,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},u]).then(([u,d])=>{const{signingRegion:f,signingService:p}=u;e.signingRegion=e.signingRegion||f||d,e.signingName=e.signingName||p||e.serviceId;const h={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i},b=e.signerConstructor||UP;return new b(h)}):l=async u=>{u=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await hf(e.region)(),properties:{}},u);const d=u.signingRegion,f=u.signingName;e.signingRegion=e.signingRegion||d,e.signingName=e.signingName||f||e.serviceId;const p={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i},h=e.signerConstructor||UP;return new h(p)},Object.assign(e,{systemClockOffset:s,signingEscapePath:i,signer:l})};function Aqe(e,{credentials:t,credentialDefaultProvider:r}){let o;return t?t?.memoized?o=t:o=oqe(t,rqe,o7):r?o=hf(r(Object.assign({},e,{parentClientConfig:e}))):o=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},o.memoized=!0,o}function Dqe(e,t){if(t.configBound)return t;const r=async o=>t({...o,callerClientConfig:e});return r.memoized=t.memoized,r.configBound=!0,r}const QV=typeof TextEncoder=="function"?new TextEncoder:null,h7=e=>{if(typeof e=="string"){if(QV)return QV.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){const o=e.charCodeAt(r);o>127&&o<=2047?t++:o>2047&&o<=65535&&(t+=2),o>=56320&&o<=57343&&r--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},$c=(e,t)=>{const r=[];if(e&&r.push(e),t)for(const o of t)r.push(o);return r},Al=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,s0=()=>{let e=[],t=[],r=!1;const o=new Set,i=f=>f.sort((p,h)=>JV[h.step]-JV[p.step]||eH[h.priority||"normal"]-eH[p.priority||"normal"]),s=f=>{let p=!1;const h=b=>{const g=$c(b.name,b.aliases);if(g.includes(f)){p=!0;for(const y of g)o.delete(y);return!1}return!0};return e=e.filter(h),t=t.filter(h),p},a=f=>{let p=!1;const h=b=>{if(b.middleware===f){p=!0;for(const g of $c(b.name,b.aliases))o.delete(g);return!1}return!0};return e=e.filter(h),t=t.filter(h),p},l=f=>(e.forEach(p=>{f.add(p.middleware,{...p})}),t.forEach(p=>{f.addRelativeTo(p.middleware,{...p})}),f.identifyOnResolve?.(d.identifyOnResolve()),f),c=f=>{const p=[];return f.before.forEach(h=>{h.before.length===0&&h.after.length===0?p.push(h):p.push(...c(h))}),p.push(f),f.after.reverse().forEach(h=>{h.before.length===0&&h.after.length===0?p.push(h):p.push(...c(h))}),p},u=(f=!1)=>{const p=[],h=[],b={};return e.forEach(y=>{const v={...y,before:[],after:[]};for(const C of $c(v.name,v.aliases))b[C]=v;p.push(v)}),t.forEach(y=>{const v={...y,before:[],after:[]};for(const C of $c(v.name,v.aliases))b[C]=v;h.push(v)}),h.forEach(y=>{if(y.toMiddleware){const v=b[y.toMiddleware];if(v===void 0){if(f)return;throw new Error(`${y.toMiddleware} is not found when adding ${Al(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&v.after.push(y),y.relation==="before"&&v.before.push(y)}}),i(p).map(c).reduce((y,v)=>(y.push(...v),y),[])},d={add:(f,p={})=>{const{name:h,override:b,aliases:g}=p,y={step:"initialize",priority:"normal",middleware:f,...p},v=$c(h,g);if(v.length>0){if(v.some(C=>o.has(C))){if(!b)throw new Error(`Duplicate middleware name '${Al(h,g)}'`);for(const C of v){const O=e.findIndex(P=>P.name===C||P.aliases?.some(k=>k===C));if(O===-1)continue;const T=e[O];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${Al(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${Al(h,g)}" middleware with ${y.priority} priority in ${y.step} step.`);e.splice(O,1)}}for(const C of v)o.add(C)}e.push(y)},addRelativeTo:(f,p)=>{const{name:h,override:b,aliases:g}=p,y={middleware:f,...p},v=$c(h,g);if(v.length>0){if(v.some(C=>o.has(C))){if(!b)throw new Error(`Duplicate middleware name '${Al(h,g)}'`);for(const C of v){const O=t.findIndex(P=>P.name===C||P.aliases?.some(k=>k===C));if(O===-1)continue;const T=t[O];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${Al(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${Al(h,g)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);t.splice(O,1)}}for(const C of v)o.add(C)}t.push(y)},clone:()=>l(s0()),use:f=>{f.applyToStack(d)},remove:f=>typeof f=="string"?s(f):a(f),removeByTag:f=>{let p=!1;const h=b=>{const{tags:g,name:y,aliases:v}=b;if(g&&g.includes(f)){const C=$c(y,v);for(const O of C)o.delete(O);return p=!0,!1}return!0};return e=e.filter(h),t=t.filter(h),p},concat:f=>{const p=l(s0());return p.use(f),p.identifyOnResolve(r||p.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),p},applyToStack:l,identify:()=>u(!0).map(f=>{const p=f.step??f.relation+" "+f.toMiddleware;return Al(f.name,f.aliases)+" - "+p}),identifyOnResolve(f){return typeof f=="boolean"&&(r=f),r},resolve:(f,p)=>{for(const h of u().map(b=>b.middleware).reverse())f=h(f,p);return r&&console.log(d.identify()),f}};return d},JV={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},eH={high:3,normal:2,low:1};class m7{config;middlewareStack=s0();initConfig;handlers;constructor(t){this.config=t;const{protocol:r,protocolSettings:o}=t;o&&typeof r=="function"&&(t.protocol=new r(o))}send(t,r,o){const i=typeof r!="function"?r:void 0,s=typeof r=="function"?r:o,a=i===void 0&&this.config.cacheMiddleware===!0;let l;if(a){this.handlers||(this.handlers=new WeakMap);const c=this.handlers;c.has(t.constructor)?l=c.get(t.constructor):(l=t.resolveMiddleware(this.middlewareStack,this.config,i),c.set(t.constructor,l))}else delete this.handlers,l=t.resolveMiddleware(this.middlewareStack,this.config,i);if(s)l(t).then(c=>s(null,c.output),c=>s(c)).catch(()=>{});else return l(t).then(c=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const KO="***SensitiveInformation***";function GP(e,t){if(t==null)return t;const r=or.of(e);if(r.getMergedTraits().sensitive)return KO;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return KO}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return KO}else if(r.isStructSchema()&&typeof t=="object"){const o=t,i={};for(const[s,a]of r.structIterator())o[s]!=null&&(i[s]=GP(a,o[s]));return i}return t}class IC{middlewareStack=s0();schema;static classBuilder(){return new _qe}resolveMiddlewareWithContext(t,r,o,{middlewareFn:i,clientName:s,commandName:a,inputFilterSensitiveLog:l,outputFilterSensitiveLog:c,smithyContext:u,additionalContext:d,CommandCtor:f}){for(const y of i.bind(this)(f,t,r,o))this.middlewareStack.use(y);const p=t.concat(this.middlewareStack),{logger:h}=r,b={logger:h,clientName:s,commandName:a,inputFilterSensitiveLog:l,outputFilterSensitiveLog:c,[jP]:{commandInstance:this,...u},...d},{requestHandler:g}=r;return p.resolve(y=>g.handle(y.request,o||{}),b)}}class _qe{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,o={}){return this._smithyContext={service:t,operation:r,...o},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=o=>o,r=o=>o){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){const t=this;let r;return r=class extends IC{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[o]){super(),this.input=o??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(o,i,s){const a=t._operationSchema,l=a?.[4]??a?.input,c=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(o,i,s,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(a?GP.bind(null,l):u=>u),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(a?GP.bind(null,c):u=>u),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}class Qc extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;const r=t;return Qc.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;const r=t;return this===Qc?Qc.isInstance(t):Qc.isInstance(t)?r.name&&this.name?this.prototype.isPrototypeOf(t)||r.name===this.name:this.prototype.isPrototypeOf(t):!1}}const tH=(e,t={})=>{Object.entries(t).filter(([,o])=>o!==void 0).forEach(([o,i])=>{(e[o]==null||e[o]==="")&&(e[o]=i)});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},g7=e=>{switch(e){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{}}},Nqe=e=>{const t=[];for(const r in r0){const o=r0[r];e[o]!==void 0&&t.push({algorithmId:()=>o,checksumConstructor:()=>e[o]})}return{addChecksumAlgorithm(r){t.push(r)},checksumAlgorithms(){return t}}},Fqe=e=>{const t={};return e.checksumAlgorithms().forEach(r=>{t[r.algorithmId()]=r.checksumConstructor()}),t},Lqe=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),$qe=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},b7=e=>Object.assign(Nqe(e),Lqe(e)),y7=e=>Object.assign(Fqe(e),$qe(e)),v7=e=>{const t="#text";for(const r in e)e.hasOwnProperty(r)&&e[r][t]!==void 0?e[r]=e[r][t]:typeof e[r]=="object"&&e[r]!==null&&(e[r]=v7(e[r]));return e};class kC{trace(){}debug(){}info(){}warn(){}error(){}}class x7{queryCompat;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,r){const o=r.getMemberSchemas(),i=Object.values(o).find(s=>!!s.getMergedTraits().httpPayload);if(i){const s=i.getMergedTraits().mediaType;return s||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":t)}else if(!r.isUnitSchema()&&Object.values(o).find(a=>{const{httpQuery:l,httpQueryParams:c,httpHeader:u,httpLabel:d,httpPrefixHeaders:f}=a.getMergedTraits();return!l&&!c&&!u&&!d&&f===void 0}))return t}async getErrorSchemaOrThrowBaseException(t,r,o,i,s,a){let l=r,c=t;t.includes("#")&&([l,c]=t.split("#"));const u={$metadata:s,$fault:o.statusCode<500?"client":"server"},d=ti.for(l);try{return{errorSchema:a?.(d,c)??d.getSchema(t),errorMetadata:u}}catch{i.message=i.message??i.Message??"UnknownError";const p=ti.for("smithy.ts.sdk.synthetic."+l),h=p.getBaseException();if(h){const b=p.getErrorCtor(h)??Error;throw this.decorateServiceException(Object.assign(new b({name:c}),u),i)}throw this.decorateServiceException(Object.assign(new Error(c),u),i)}}decorateServiceException(t,r={}){if(this.queryCompat){const o=t.Message??r.Message,i=tH(t,r);o&&(i.message=o),i.Error={...i.Error,Type:i.Error?.Type,Code:i.Error?.Code,Message:i.Error?.message??i.Error?.Message??o};const s=i.$metadata.requestId;return s&&(i.RequestId=s),i}return tH(t,r)}setQueryCompatError(t,r){const o=r.headers?.["x-amzn-query-error"];if(t!==void 0&&o!=null){const[i,s]=o.split(";"),a=Object.entries(t),l={Code:i,Type:s};Object.assign(t,l);for(const[c,u]of a)l[c==="message"?"Message":c]=u;delete l.__type,t.Error=l}}queryCompatOutput(t,r){t.Error&&(r.Error=t.Error),t.Type&&(r.Type=t.Type),t.Code&&(r.Code=t.Code)}findQueryCompatibleError(t,r){try{return t.getSchema(r)}catch{return t.find(i=>or.of(i).getMergedTraits().awsQueryError?.[0]===r)}}}class RC{serdeContext;setSerdeContext(t){this.serdeContext=t}}class S7{from;to;keys;constructor(t,r){this.from=t,this.to=r,this.keys=new Set(Object.keys(this.from).filter(o=>o!=="__type"))}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const t=this.keys.values().next().value,r=this.from[t];this.to.$unknown=[t,r]}}}function jqe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Bqe(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}class WP{value;constructor(t){this.value=t}toString(){return Bqe(""+this.value)}}class Jo{name;children;attributes={};static of(t,r,o){const i=new Jo(t);return r!==void 0&&i.addChildNode(new WP(r)),o!==void 0&&i.withName(o),i}constructor(t,r=[]){this.name=t,this.children=r}withName(t){return this.name=t,this}addAttribute(t,r){return this.attributes[t]=r,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,r){return r!=null&&(this.attributes[t]=r),this}cc(t,r,o=r){if(t[r]!=null){const i=Jo.of(r,t[r]).withName(o);this.c(i)}}l(t,r,o,i){t[r]!=null&&i().map(a=>{a.withName(o),this.c(a)})}lc(t,r,o,i){if(t[r]!=null){const s=i(),a=new Jo(o);s.map(l=>{a.c(l)}),this.c(a)}}toString(){const t=!!this.children.length;let r=`<${this.name}`;const o=this.attributes;for(const i of Object.keys(o)){const s=o[i];s!=null&&(r+=` ${i}="${jqe(""+s)}"`)}return r+=t?`>${this.children.map(i=>i.toString()).join("")}</${this.name}>`:"/>"}}let YO;function Vqe(e){YO||(YO=new DOMParser);const t=YO.parseFromString(e,"application/xml");if(t.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const r=o=>{if(o.nodeType===Node.TEXT_NODE&&o.textContent?.trim())return o.textContent;if(o.nodeType===Node.ELEMENT_NODE){const i=o;if(i.attributes.length===0&&i.childNodes.length===0)return"";const s={},a=Array.from(i.attributes);for(const c of a)s[`${c.name}`]=c.value;const l=Array.from(i.childNodes);for(const c of l){const u=r(c);if(u!=null){const d=c.nodeName;if(l.length===1&&a.length===0&&d==="#text")return u;s[d]?Array.isArray(s[d])?s[d].push(u):s[d]=[s[d],u]:s[d]=u}else if(l.length===1&&a.length===0)return i.textContent}return s}return null};return{[t.documentElement.nodeName]:r(t.documentElement)}}class Hqe extends RC{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new n7(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,r,o){const i=or.of(t),s=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(s).find(u=>!!u.getMemberTraits().eventPayload)){const u={},d=Object.keys(s)[0];return s[d].isBlobSchema()?u[d]=r:u[d]=this.read(s[d],r),u}const l=(this.serdeContext?.utf8Encoder??zu)(r),c=this.parseXml(l);return this.readSchema(t,o?c[o]:c)}readSchema(t,r){const o=or.of(t);if(o.isUnitSchema())return;const i=o.getMergedTraits();if(o.isListSchema()&&!Array.isArray(r))return this.readSchema(o,[r]);if(r==null)return r;if(typeof r=="object"){const s=!!i.sparse,a=!!i.xmlFlattened;if(o.isListSchema()){const c=o.getValueSchema(),u=[],d=c.getMergedTraits().xmlName??"member",f=a?r:(r[0]??r)[d],p=Array.isArray(f)?f:[f];for(const h of p)(h!=null||s)&&u.push(this.readSchema(c,h));return u}const l={};if(o.isMapSchema()){const c=o.getKeySchema(),u=o.getValueSchema();let d;a?d=Array.isArray(r)?r:[r]:d=Array.isArray(r.entry)?r.entry:[r.entry];const f=c.getMergedTraits().xmlName??"key",p=u.getMergedTraits().xmlName??"value";for(const h of d){const b=h[f],g=h[p];(g!=null||s)&&(l[b]=this.readSchema(u,g))}return l}if(o.isStructSchema()){const c=o.isUnionSchema();let u;c&&(u=new S7(r,l));for(const[d,f]of o.structIterator()){const p=f.getMergedTraits(),h=p.httpPayload?p.xmlName??f.getName():f.getMemberTraits().xmlName??d;c&&u.mark(h),r[h]!=null&&(l[d]=this.readSchema(f,r[h]))}return c&&u.writeUnknown(),l}if(o.isDocumentSchema())return r;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${o.getName(!0)}`)}return o.isListSchema()?[]:o.isMapSchema()||o.isStructSchema()?{}:this.stringDeserializer.read(o,r)}parseXml(t){if(t.length){let r;try{r=Vqe(t)}catch(a){throw a&&typeof a=="object"&&Object.defineProperty(a,"$responseBodyText",{value:t}),a}const o="#text",i=Object.keys(r)[0],s=r[i];return s[o]&&(s[i]=s[o],delete s[o]),v7(s)}return{}}}const zqe=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"};class qqe extends RC{settings;stringBuffer;byteBuffer;buffer;constructor(t){super(),this.settings=t}write(t,r){const o=or.of(t);if(o.isStringSchema()&&typeof r=="string")this.stringBuffer=r;else if(o.isBlobSchema())this.byteBuffer="byteLength"in r?r:(this.serdeContext?.base64Decoder??Tu)(r);else{this.buffer=this.writeStruct(o,r,void 0);const i=o.getMergedTraits();i.httpPayload&&!i.xmlName&&this.buffer.withName(o.getName())}}flush(){if(this.byteBuffer!==void 0){const r=this.byteBuffer;return delete this.byteBuffer,r}if(this.stringBuffer!==void 0){const r=this.stringBuffer;return delete this.stringBuffer,r}const t=this.buffer;return this.settings.xmlNamespace&&(t?.attributes?.xmlns||t.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,t.toString()}writeStruct(t,r,o){const i=t.getMergedTraits(),s=t.isMemberSchema()&&!i.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():i.xmlName??t.getName();if(!s||!t.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);const a=Jo.of(s),[l,c]=this.getXmlnsAttribute(t,o);for(const[d,f]of t.structIterator()){const p=r[d];if(p!=null||f.isIdempotencyToken()){if(f.getMergedTraits().xmlAttribute){a.addAttribute(f.getMergedTraits().xmlName??d,this.writeSimple(f,p));continue}if(f.isListSchema())this.writeList(f,p,a,c);else if(f.isMapSchema())this.writeMap(f,p,a,c);else if(f.isStructSchema())a.addChildNode(this.writeStruct(f,p,c));else{const h=Jo.of(f.getMergedTraits().xmlName??f.getMemberName());this.writeSimpleInto(f,p,h,c),a.addChildNode(h)}}}const{$unknown:u}=r;if(u&&t.isUnionSchema()&&Array.isArray(u)&&Object.keys(r).length===1){const[d,f]=u,p=Jo.of(d);if(typeof f!="string")if(r instanceof Jo||r instanceof WP)a.addChildNode(r);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,f,p,c),a.addChildNode(p)}return c&&a.addAttribute(l,c),a}writeList(t,r,o,i){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);const s=t.getMergedTraits(),a=t.getValueSchema(),l=a.getMergedTraits(),c=!!l.sparse,u=!!s.xmlFlattened,[d,f]=this.getXmlnsAttribute(t,i),p=(h,b)=>{if(a.isListSchema())this.writeList(a,Array.isArray(b)?b:[b],h,f);else if(a.isMapSchema())this.writeMap(a,b,h,f);else if(a.isStructSchema()){const g=this.writeStruct(a,b,f);h.addChildNode(g.withName(u?s.xmlName??t.getMemberName():l.xmlName??"member"))}else{const g=Jo.of(u?s.xmlName??t.getMemberName():l.xmlName??"member");this.writeSimpleInto(a,b,g,f),h.addChildNode(g)}};if(u)for(const h of r)(c||h!=null)&&p(o,h);else{const h=Jo.of(s.xmlName??t.getMemberName());f&&h.addAttribute(d,f);for(const b of r)(c||b!=null)&&p(h,b);o.addChildNode(h)}}writeMap(t,r,o,i,s=!1){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);const a=t.getMergedTraits(),l=t.getKeySchema(),u=l.getMergedTraits().xmlName??"key",d=t.getValueSchema(),f=d.getMergedTraits(),p=f.xmlName??"value",h=!!f.sparse,b=!!a.xmlFlattened,[g,y]=this.getXmlnsAttribute(t,i),v=(C,O,T)=>{const P=Jo.of(u,O),[k,M]=this.getXmlnsAttribute(l,y);M&&P.addAttribute(k,M),C.addChildNode(P);let _=Jo.of(p);d.isListSchema()?this.writeList(d,T,_,y):d.isMapSchema()?this.writeMap(d,T,_,y,!0):d.isStructSchema()?_=this.writeStruct(d,T,y):this.writeSimpleInto(d,T,_,y),C.addChildNode(_)};if(b){for(const[C,O]of Object.entries(r))if(h||O!=null){const T=Jo.of(a.xmlName??t.getMemberName());v(T,C,O),o.addChildNode(T)}}else{let C;s||(C=Jo.of(a.xmlName??t.getMemberName()),y&&C.addAttribute(g,y),o.addChildNode(C));for(const[O,T]of Object.entries(r))if(h||T!=null){const P=Jo.of("entry");v(P,O,T),(s?o:C).addChildNode(P)}}}writeSimple(t,r){if(r===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const o=or.of(t);let i=null;if(r&&typeof r=="object")if(o.isBlobSchema())i=(this.serdeContext?.base64Encoder??oc)(r);else if(o.isTimestampSchema()&&r instanceof Date)switch(EC(o,this.settings)){case 5:i=r.toISOString().replace(".000Z","Z");break;case 6:i=i0(r);break;case 7:i=String(r.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",r),i=i0(r);break}else{if(o.isBigDecimalSchema()&&r)return r instanceof fg?r.string:String(r);throw o.isMapSchema()||o.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${o.getName(!0)}`)}if((o.isBooleanSchema()||o.isNumericSchema()||o.isBigIntegerSchema()||o.isBigDecimalSchema())&&(i=String(r)),o.isStringSchema()&&(r===void 0&&o.isIdempotencyToken()?i=OC():i=String(r)),i===null)throw new Error(`Unhandled schema-value pair ${o.getName(!0)}=${r}`);return i}writeSimpleInto(t,r,o,i){const s=this.writeSimple(t,r),a=or.of(t),l=new WP(s),[c,u]=this.getXmlnsAttribute(a,i);u&&o.addAttribute(c,u),o.addChildNode(l)}getXmlnsAttribute(t,r){const o=t.getMergedTraits(),[i,s]=o.xmlNamespace??[];return s&&s!==r?[i?`xmlns:${i}`:"xmlns",s]:[void 0,void 0]}}class Uqe extends RC{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new qqe(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new Hqe(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Gqe extends Zze{codec;serializer;deserializer;mixin=new x7;constructor(t){super(t);const r={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new Uqe(r),this.serializer=new Jze(this.codec.createSerializer(),r),this.deserializer=new Xze(this.codec.createDeserializer(),r)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,r,o){const i=await super.serializeRequest(t,r,o),s=or.of(t.input);if(!i.headers["content-type"]){const a=this.mixin.resolveRestContentType(this.getDefaultContentType(),s);a&&(i.headers["content-type"]=a)}return typeof i.body=="string"&&i.headers["content-type"]===this.getDefaultContentType()&&!i.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(s)&&(i.body='<?xml version="1.0" encoding="UTF-8"?>'+i.body),i}async deserializeResponse(t,r,o){return super.deserializeResponse(t,r,o)}async handleError(t,r,o,i,s){const a=zqe(o,i)??"Unknown";if(i.Error&&typeof i.Error=="object")for(const b of Object.keys(i.Error))i[b]=i.Error[b],b.toLowerCase()==="message"&&(i.message=i.Error[b]);i.RequestId&&!s.requestId&&(s.requestId=i.RequestId);const{errorSchema:l,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,o,i,s),u=or.of(l),d=i.Error?.message??i.Error?.Message??i.message??i.Message??"Unknown",f=ti.for(l[1]).getErrorCtor(l)??Error,p=new f(d);await this.deserializeHttpMessage(l,r,o,i);const h={};for(const[b,g]of u.structIterator()){const y=g.getMergedTraits().xmlName??b,v=i.Error?.[y]??i[y];h[b]=this.codec.createDeserializer().readSchema(g,v)}throw this.mixin.decorateServiceException(Object.assign(p,c,{$fault:u.getMergedTraits().error,message:d},h),i)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(t){for(const[,r]of t.structIterator())if(r.getMergedTraits().httpPayload)return!(r.isStructSchema()||r.isMapSchema()||r.isListSchema());return!1}}const KP=[Jn.CRC32,Jn.CRC32C,Jn.CRC64NVME,Jn.SHA1,Jn.SHA256],Wqe=[Jn.SHA256,Jn.SHA1,Jn.CRC32,Jn.CRC32C,Jn.CRC64NVME],Kqe=(e,{requestChecksumRequired:t,requestAlgorithmMember:r,requestChecksumCalculation:o})=>{if(!r)return o===jf.WHEN_SUPPORTED||t?BP:void 0;if(!e[r])return;const i=e[r];if(!KP.includes(i))throw new Error(`The checksum algorithm "${i}" is not supported by the client. Select one of ${KP}.`);return i},PM=e=>e===Jn.MD5?"content-md5":`x-amz-checksum-${e.toLowerCase()}`,Yqe=(e,t)=>{const r=e.toLowerCase();for(const o of Object.keys(t))if(r===o.toLowerCase())return!0;return!1},Zqe=(e,t)=>{const r=e.toLowerCase();for(const o of Object.keys(t))if(o.toLowerCase().startsWith(r))return!0;return!1},C7=e=>e!==void 0&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!d7(e);function EM(e,t,r,o){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function l(d){try{u(o.next(d))}catch(f){a(f)}}function c(d){try{u(o.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((o=o.apply(e,t||[])).next())})}function IM(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(o=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],i=0}finally{o=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function w7(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}const Xqe=e=>new TextEncoder().encode(e);var Qqe=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:Xqe;function ic(e){return e instanceof Uint8Array?e:typeof e=="string"?Qqe(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function dm(e){return typeof e=="string"?e.length===0:e.byteLength===0}function T7(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}function O7(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),r=0;r<e.length;)t[r]=e[r],r+=1;return t}return Uint32Array.from(e)}var Jqe=(function(){function e(){this.crc32c=new nH}return e.prototype.update=function(t){dm(t)||this.crc32c.update(ic(t))},e.prototype.digest=function(){return EM(this,void 0,void 0,function(){return IM(this,function(t){return[2,T7(this.crc32c.digest())]})})},e.prototype.reset=function(){this.crc32c=new nH},e})(),nH=(function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var r,o;try{for(var i=w7(t),s=i.next();!s.done;s=i.next()){var a=s.value;this.checksum=this.checksum>>>8^t3e[(this.checksum^a)&255]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e})(),e3e=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],t3e=O7(e3e);const n3e=()=>{const t=new Array(8);for(let r=0;r<8;r++){const o=new Array(512);for(let i=0;i<256;i++){let s=BigInt(i);for(let a=0;a<8*(r+1);a++)s&1n?s=s>>1n^0x9a6c9329ac4bc9b5n:s=s>>1n;o[i*2]=Number(s>>32n&0xffffffffn),o[i*2+1]=Number(s&0xffffffffn)}t[r]=new Uint32Array(o)}return t};let ZO,ph,YP,ZP,XP,QP,JP,eE,tE;const r3e=()=>{ZO||(ZO=n3e(),[ph,YP,ZP,XP,QP,JP,eE,tE]=ZO)};class o3e{c1=0;c2=0;constructor(){r3e(),this.reset()}update(t){const r=t.length;let o=0,i=this.c1,s=this.c2;for(;o+8<=r;){const a=((s^t[o++])&255)<<1,l=((s>>>8^t[o++])&255)<<1,c=((s>>>16^t[o++])&255)<<1,u=((s>>>24^t[o++])&255)<<1,d=((i^t[o++])&255)<<1,f=((i>>>8^t[o++])&255)<<1,p=((i>>>16^t[o++])&255)<<1,h=((i>>>24^t[o++])&255)<<1;i=tE[a]^eE[l]^JP[c]^QP[u]^XP[d]^ZP[f]^YP[p]^ph[h],s=tE[a+1]^eE[l+1]^JP[c+1]^QP[u+1]^XP[d+1]^ZP[f+1]^YP[p+1]^ph[h+1]}for(;o<r;){const a=((s^t[o])&255)<<1;s=(s>>>8|(i&255)<<24)>>>0,i=i>>>8^ph[a],s^=ph[a+1],o++}this.c1=i,this.c2=s}async digest(){const t=this.c1^4294967295,r=this.c2^4294967295;return new Uint8Array([t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255])}reset(){this.c1=4294967295,this.c2=4294967295}}var i3e=(function(){function e(){this.crc32=new a0}return e.prototype.update=function(t){dm(t)||this.crc32.update(ic(t))},e.prototype.digest=function(){return EM(this,void 0,void 0,function(){return IM(this,function(t){return[2,T7(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new a0},e})(),a0=(function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var r,o;try{for(var i=w7(t),s=i.next();!s.done;s=i.next()){var a=s.value;this.checksum=this.checksum>>>8^a3e[(this.checksum^a)&255]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e})(),s3e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],a3e=O7(s3e);const l3e=()=>i3e,P7=(e,t)=>{switch(e){case Jn.MD5:return t.md5;case Jn.CRC32:return l3e();case Jn.CRC32C:return Jqe;case Jn.CRC64NVME:return o3e;case Jn.SHA1:return t.sha1;case Jn.SHA256:return t.sha256;default:throw new Error(`Unsupported checksum algorithm: ${e}`)}},E7=(e,t)=>{const r=new e;return r.update(Bf(t||"")),r.digest()},c3e={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},u3e=(e,t)=>(r,o)=>async i=>{if(!Br.isInstance(i.request)||Zqe("x-amz-checksum-",i.request.headers))return r(i);const{request:s,input:a}=i,{body:l,headers:c}=s,{base64Encoder:u,streamHasher:d}=e,{requestChecksumRequired:f,requestAlgorithmMember:p}=t,h=await e.requestChecksumCalculation(),b=p?.name,g=p?.httpHeader;b&&!a[b]&&(h===jf.WHEN_SUPPORTED||f)&&(a[b]=BP,g&&(c[g]=BP));const y=Kqe(a,{requestChecksumRequired:f,requestAlgorithmMember:p?.name,requestChecksumCalculation:h});let v=l,C=c;if(y){switch(y){case Jn.CRC32:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case Jn.CRC32C:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case Jn.CRC64NVME:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case Jn.SHA1:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case Jn.SHA256:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const O=PM(y),T=P7(y,e);if(C7(l)){const{getAwsChunkedEncodingStream:P,bodyLengthChecker:k}=e;v=P(typeof e.requestStreamBufferSize=="number"&&e.requestStreamBufferSize>=8*1024?QHe(l,e.requestStreamBufferSize,o.logger):l,{base64Encoder:u,bodyLengthChecker:k,checksumLocationName:O,checksumAlgorithmFn:T,streamHasher:d}),C={...c,"content-encoding":c["content-encoding"]?`${c["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":c["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":O},delete C["content-length"]}else if(!Yqe(O,c)){const P=await E7(T,l);C={...c,[O]:u(P)}}}try{return await r({...i,request:{...s,headers:C,body:v}})}catch(O){if(O instanceof Error&&O.name==="InvalidChunkSizeError")try{O.message.endsWith(".")||(O.message+="."),O.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch{}throw O}},d3e={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},f3e=(e,t)=>(r,o)=>async i=>{const s=i.input,{requestValidationModeMember:a}=t,l=await e.requestChecksumCalculation(),c=await e.responseChecksumValidation();switch(l){case jf.WHEN_REQUIRED:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case jf.WHEN_SUPPORTED:Gr(o,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(c){case $O.WHEN_REQUIRED:Gr(o,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case $O.WHEN_SUPPORTED:Gr(o,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return a&&!s[a]&&c===$O.WHEN_SUPPORTED&&(s[a]="ENABLED"),r(i)},I7=(e=[])=>{const t=[];for(const r of Wqe)!e.includes(r)||!KP.includes(r)||t.push(r);return t},p3e=e=>{const t=e.lastIndexOf("-");if(t!==-1){const r=e.slice(t+1);if(!r.startsWith("0")){const o=parseInt(r,10);if(!isNaN(o)&&o>=1&&o<=1e4)return!0}}return!1},h3e=async(e,{checksumAlgorithmFn:t,base64Encoder:r})=>r(await E7(t,e)),m3e=async(e,{config:t,responseAlgorithms:r,logger:o})=>{const i=I7(r),{body:s,headers:a}=e;for(const l of i){const c=PM(l),u=a[c];if(u){let d;try{d=P7(l,t)}catch(h){if(l===Jn.CRC64NVME){o?.warn(`Skipping ${Jn.CRC64NVME} checksum validation: ${h.message}`);continue}throw h}const{base64Encoder:f}=t;if(C7(s)){e.body=YHe({expectedChecksum:u,checksumSourceLocation:c,checksum:new d,source:s,base64Encoder:f});return}const p=await h3e(s,{checksumAlgorithmFn:d,base64Encoder:f});if(p===u)break;throw new Error(`Checksum mismatch: expected "${p}" but received "${u}" in response header "${c}".`)}}},g3e={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},b3e=(e,t)=>(r,o)=>async i=>{if(!Br.isInstance(i.request))return r(i);const s=i.input,a=await r(i),l=a.response,{requestValidationModeMember:c,responseAlgorithms:u}=t;if(c&&s[c]==="ENABLED"){const{clientName:d,commandName:f}=o;if(d==="S3Client"&&f==="GetObjectCommand"&&I7(u).every(h=>{const b=PM(h),g=l.headers[b];return!g||p3e(g)}))return a;await m3e(l,{config:e,responseAlgorithms:u,logger:o.logger})}return a},y3e=(e,t)=>({applyToStack:r=>{r.add(u3e(e,t),c3e),r.addRelativeTo(f3e(e,t),d3e),r.addRelativeTo(b3e(e,t),g3e)}}),v3e=e=>{const{requestChecksumCalculation:t,responseChecksumValidation:r,requestStreamBufferSize:o}=e;return Object.assign(e,{requestChecksumCalculation:Rs(t??AHe),responseChecksumValidation:Rs(r??DHe),requestStreamBufferSize:Number(o??0)})};function x3e(e){return e}const S3e=e=>t=>async r=>{if(!Br.isInstance(r.request))return t(r);const{request:o}=r,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!o.headers[":authority"])delete o.headers.host,o.headers[":authority"]=o.hostname+(o.port?":"+o.port:"");else if(!o.headers.host){let s=o.hostname;o.port!=null&&(s+=`:${o.port}`),o.headers.host=s}return t(r)},C3e={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},k7=e=>({applyToStack:t=>{t.add(S3e(e),C3e)}}),w3e=()=>(e,t)=>async r=>{try{const o=await e(r),{clientName:i,commandName:s,logger:a,dynamoDbDocumentClientOptions:l={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:u}=l,d=c??t.inputFilterSensitiveLog,f=u??t.outputFilterSensitiveLog,{$metadata:p,...h}=o.output;return a?.info?.({clientName:i,commandName:s,input:d(r.input),output:f(h),metadata:p}),o}catch(o){const{clientName:i,commandName:s,logger:a,dynamoDbDocumentClientOptions:l={}}=t,{overrideInputFilterSensitiveLog:c}=l,u=c??t.inputFilterSensitiveLog;throw a?.error?.({clientName:i,commandName:s,input:u(r.input),error:o,metadata:o.$metadata}),o}},T3e={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},R7=e=>({applyToStack:t=>{t.add(w3e(),T3e)}}),O3e={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},P3e=()=>e=>async t=>e(t),M7=e=>({applyToStack:t=>{t.add(P3e(),O3e)}}),E3e="content-length",I3e="x-amz-decoded-content-length";function k3e(){return(e,t)=>async r=>{const{request:o}=r;if(Br.isInstance(o)&&!(E3e in o.headers)&&!(I3e in o.headers)){const i="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof t?.logger?.warn=="function"&&!(t.logger instanceof kC)?t.logger.warn(i):console.warn(i)}return e({...r})}}const R3e={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},M3e=e=>({applyToStack:t=>{t.add(k3e(),R3e)}}),A3e=e=>(t,r)=>async o=>{const i=await e.region(),s=e.region;let a=()=>{};r.__s3RegionRedirect&&(Object.defineProperty(e,"region",{writable:!1,value:async()=>r.__s3RegionRedirect}),a=()=>Object.defineProperty(e,"region",{writable:!0,value:s}));try{const l=await t(o);if(r.__s3RegionRedirect){a();const c=await e.region();if(i!==c)throw new Error("Region was not restored following S3 region redirect.")}return l}catch(l){throw a(),l}},D3e={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function _3e(e){return(t,r)=>async o=>{try{return await t(o)}catch(i){if(e.followRegionRedirects){const s=i?.$metadata?.httpStatusCode,a=r.commandName==="HeadBucketCommand",l=i?.$response?.headers?.["x-amz-bucket-region"];if(l&&(s===301||s===400&&(i?.name==="IllegalLocationConstraintException"||a))){try{const c=l;r.logger?.debug(`Redirecting from ${await e.region()} to ${c}`),r.__s3RegionRedirect=c}catch(c){throw new Error("Region redirect failed: "+c)}return t(o)}}throw i}}}const N3e={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},F3e=e=>({applyToStack:t=>{t.add(_3e(e),N3e),t.addRelativeTo(A3e(e),D3e)}});class kM{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=3e4;constructor(t={}){this.data=t}get(t){const r=this.data[t];if(r)return r}set(t,r){return this.data[t]=r,r}delete(t){delete this.data[t]}async purgeExpired(){const t=Date.now();if(!(this.lastPurgeTime+kM.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>t))for(const r in this.data){const o=this.data[r];if(!o.isRefreshing){const i=await o.identity;i.expiration&&i.expiration.getTime()<t&&delete this.data[r]}}}}class XO{_identity;isRefreshing;accessed;constructor(t,r=!1,o=Date.now()){this._identity=t,this.isRefreshing=r,this.accessed=o}get identity(){return this.accessed=Date.now(),this._identity}}class RM{createSessionFn;cache;static REFRESH_WINDOW_MS=6e4;constructor(t,r=new kM){this.createSessionFn=t,this.cache=r}async getS3ExpressIdentity(t,r){const o=r.Bucket,{cache:i}=this,s=i.get(o);return s?s.identity.then(a=>(a.expiration?.getTime()??0)<Date.now()?i.set(o,new XO(this.getIdentity(o))).identity:((a.expiration?.getTime()??0)<Date.now()+RM.REFRESH_WINDOW_MS&&!s.isRefreshing&&(s.isRefreshing=!0,this.getIdentity(o).then(u=>{i.set(o,new XO(Promise.resolve(u)))})),a)):i.set(o,new XO(this.getIdentity(o))).identity}async getIdentity(t){await this.cache.purgeExpired().catch(i=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
464
- `+i)});const r=await this.createSessionFn(t);if(!r.Credentials?.AccessKeyId||!r.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretAccessKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration?new Date(r.Credentials.Expiration):void 0}}}const L3e="Directory",$3e="S3Express",j3e="sigv4-s3express",nE="X-Amz-S3session-Token",rE=nE.toLowerCase();class B3e extends UP{async signWithCredentials(t,r,o){const i=rH(r);t.headers[rE]=r.sessionToken;const s=this;return oH(s,i),s.signRequest(t,o??{})}async presignWithCredentials(t,r,o){const i=rH(r);return delete t.headers[rE],t.headers[nE]=r.sessionToken,t.query=t.query??{},t.query[nE]=r.sessionToken,oH(this,i),this.presign(t,o)}}function rH(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function oH(e,t){const r=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),o=e.credentialProvider,i=()=>(clearTimeout(r),e.credentialProvider=o,Promise.resolve(t));e.credentialProvider=i}const V3e=e=>(t,r)=>async o=>{if(r.endpointV2){const i=r.endpointV2,s=i.properties?.authSchemes?.[0]?.name===j3e;if((i.properties?.backend===$3e||i.properties?.bucketType===L3e)&&(Gr(r,"S3_EXPRESS_BUCKET","J"),r.isS3ExpressBucket=!0),s){const l=o.input.Bucket;if(l){const c=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:l});r.s3ExpressIdentity=c,Br.isInstance(o.request)&&c.sessionToken&&(o.request.headers[rE]=c.sessionToken)}}}return t(o)},H3e={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},z3e=e=>({applyToStack:t=>{t.add(V3e(e),H3e)}}),q3e=async(e,t,r,o)=>{const i=await o.signWithCredentials(r,e,{});if(i.headers["X-Amz-Security-Token"]||i.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return i},U3e=e=>t=>{throw t},G3e=(e,t)=>{},W3e=e=>(t,r)=>async o=>{if(!Br.isInstance(o.request))return t(o);const s=gl(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:l,signer:c}=s;let u;r.s3ExpressIdentity?u=await q3e(r.s3ExpressIdentity,a,o.request,await e.signer()):u=await c.sign(o.request,l,a);const d=await t({...o,request:u}).catch((c.errorHandler||U3e)(a));return(c.successHandler||G3e)(d.response,a),d},K3e=e=>({applyToStack:t=>{t.addRelativeTo(W3e(e),zW)}}),Y3e=(e,{session:t})=>{const[r,o]=t,{forcePathStyle:i,useAccelerateEndpoint:s,disableMultiregionAccessPoints:a,followRegionRedirects:l,s3ExpressIdentityProvider:c,bucketEndpoint:u,expectContinueHeader:d}=e;return Object.assign(e,{forcePathStyle:i??!1,useAccelerateEndpoint:s??!1,disableMultiregionAccessPoints:a??!1,followRegionRedirects:l??!1,s3ExpressIdentityProvider:c??new RM(async f=>r().send(new o({Bucket:f}))),bucketEndpoint:u??!1,expectContinueHeader:d??2097152})},Z3e={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},X3e=3e3,Q3e=e=>(t,r)=>async o=>{const i=await t(o),{response:s}=i;if(!wu.isInstance(s))return i;const{statusCode:a,body:l}=s;if(a<200||a>=300||!(typeof l?.stream=="function"||typeof l?.pipe=="function"||typeof l?.tee=="function"))return i;let u=l,d=l;l&&typeof l=="object"&&!(l instanceof Uint8Array)&&([u,d]=await cze(l)),s.body=d;const f=await J3e(u,{streamCollector:async h=>nze(h,X3e)});typeof u?.destroy=="function"&&u.destroy();const p=e.utf8Encoder(f.subarray(f.length-16));if(f.length===0&&Z3e[r.commandName]){const h=new Error("S3 aborted request");throw h.name="InternalError",h}return p&&p.endsWith("</Error>")&&(s.statusCode=400),i},J3e=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),e5e={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},A7=e=>({applyToStack:t=>{t.addRelativeTo(Q3e(e),e5e)}}),t5e=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function n5e(e){return(t,r)=>async o=>{if(e.bucketEndpoint){const i=r.endpointV2;if(i){const s=o.input.Bucket;if(typeof s=="string")try{const a=new URL(s);r.endpointV2={...i,url:a}}catch(a){const l=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${s} could not be parsed as URL.`;throw r.logger?.constructor?.name==="NoOpLogger"?console.warn(l):r.logger?.warn?.(l),a}}}return t(o)}}const r5e={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function o5e({bucketEndpoint:e}){return t=>async r=>{const{input:{Bucket:o}}=r;if(!e&&typeof o=="string"&&!t5e(o)&&o.indexOf("/")>=0){const i=new Error(`Bucket name shouldn't contain '/', received '${o}'`);throw i.name="InvalidBucketName",i}return t({...r})}}const i5e={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},s5e=e=>({applyToStack:t=>{t.add(o5e(e),i5e),t.addRelativeTo(n5e(e),r5e)}}),a5e=void 0;function l5e(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function D7(e){const t=hf(e.userAgentAppId??a5e),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{const o=await t();if(!l5e(o)){const i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof o!="string"?i?.warn("userAgentAppId must be a string or undefined."):o.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return o}})}class _7{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){this.capacity=t??50,r&&(this.parameters=r)}get(t,r){const o=this.hash(t);if(o===!1)return r();if(!this.data.has(o)){if(this.data.size>this.capacity+10){const i=this.data.keys();let s=0;for(;;){const{value:a,done:l}=i.next();if(this.data.delete(a),l||++s>10)break}}this.data.set(o,r())}return this.data.get(o)}size(){return this.data.size}hash(t){let r="";const{parameters:o}=this;if(o.length===0)return!1;for(const i of o){const s=String(t[i]??"");if(s.includes("|;"))return!1;r+=s+"|;"}return r}}const c5e=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}$"),MM=e=>c5e.test(e)||e.startsWith("[")&&e.endsWith("]"),u5e=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),pg=(e,t=!1)=>{if(!t)return u5e.test(e);const r=e.split(".");for(const o of r)if(!pg(o))return!1;return!0},fm={},pm="endpoints";function sc(e){return typeof e!="object"||e==null?e:"ref"in e?`$${sc(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(sc).join(", ")})`:JSON.stringify(e,null,2)}class Xi extends Error{constructor(t){super(t),this.name="EndpointError"}}const d5e=(e,t)=>e===t,f5e=e=>{const t=e.split("."),r=[];for(const o of t){const i=o.indexOf("[");if(i!==-1){if(o.indexOf("]")!==o.length-1)throw new Xi(`Path: '${e}' does not end with ']'`);const s=o.slice(i+1,-1);if(Number.isNaN(parseInt(s)))throw new Xi(`Invalid array index: '${s}' in path: '${e}'`);i!==0&&r.push(o.slice(0,i)),r.push(s)}else r.push(o)}return r},N7=(e,t)=>f5e(t).reduce((r,o)=>{if(typeof r!="object")throw new Xi(`Index '${o}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(r)?r[parseInt(o)]:r[o]},e),p5e=e=>e!=null,h5e=e=>!e,QO={[cm.HTTP]:80,[cm.HTTPS]:443},m5e=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:p,port:h,protocol:b="",path:g="",query:y={}}=e,v=new URL(`${b}//${p}${h?`:${h}`:""}${g}`);return v.search=Object.entries(y).map(([C,O])=>`${C}=${O}`).join("&"),v}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const r=t.href,{host:o,hostname:i,pathname:s,protocol:a,search:l}=t;if(l)return null;const c=a.slice(0,-1);if(!Object.values(cm).includes(c))return null;const u=MM(i),d=r.includes(`${o}:${QO[c]}`)||typeof e=="string"&&e.includes(`${o}:${QO[c]}`),f=`${o}${d?`:${QO[c]}`:""}`;return{scheme:c,authority:f,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:u}},g5e=(e,t)=>e===t,b5e=(e,t,r,o)=>t>=r||e.length<r?null:o?e.substring(e.length-r,e.length-t):e.substring(t,r),y5e=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),v5e={booleanEquals:d5e,getAttr:N7,isSet:p5e,isValidHostLabel:pg,not:h5e,parseURL:m5e,stringEquals:g5e,substring:b5e,uriEncode:y5e},F7=(e,t)=>{const r=[],o={...t.endpointParams,...t.referenceRecord};let i=0;for(;i<e.length;){const s=e.indexOf("{",i);if(s===-1){r.push(e.slice(i));break}r.push(e.slice(i,s));const a=e.indexOf("}",s);if(a===-1){r.push(e.slice(s));break}e[s+1]==="{"&&e[a+1]==="}"&&(r.push(e.slice(s+1,a)),i=a+2);const l=e.substring(s+1,a);if(l.includes("#")){const[c,u]=l.split("#");r.push(N7(o[c],u))}else r.push(o[l]);i=a+1}return r.join("")},x5e=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],MC=(e,t,r)=>{if(typeof e=="string")return F7(e,r);if(e.fn)return $7.callFunction(e,r);if(e.ref)return x5e(e,r);throw new Xi(`'${t}': ${String(e)} is not a string, function or reference.`)},L7=({fn:e,argv:t},r)=>{const o=t.map(s=>["boolean","number"].includes(typeof s)?s:$7.evaluateExpression(s,"arg",r)),i=e.split(".");return i[0]in fm&&i[1]!=null?fm[i[0]][i[1]](...o):v5e[e](...o)},$7={evaluateExpression:MC,callFunction:L7},S5e=({assign:e,...t},r)=>{if(e&&e in r.referenceRecord)throw new Xi(`'${e}' is already defined in Reference Record.`);const o=L7(t,r);return r.logger?.debug?.(`${pm} evaluateCondition: ${sc(t)} = ${sc(o)}`),{result:o===""?!0:!!o,...e!=null&&{toAssign:{name:e,value:o}}}},AM=(e=[],t)=>{const r={};for(const o of e){const{result:i,toAssign:s}=S5e(o,{...t,referenceRecord:{...t.referenceRecord,...r}});if(!i)return{result:i};s&&(r[s.name]=s.value,t.logger?.debug?.(`${pm} assign: ${s.name} := ${sc(s.value)}`))}return{result:!0,referenceRecord:r}},C5e=(e,t)=>Object.entries(e).reduce((r,[o,i])=>({...r,[o]:i.map(s=>{const a=MC(s,"Header value entry",t);if(typeof a!="string")throw new Xi(`Header '${o}' value '${a}' is not a string`);return a})}),{}),j7=(e,t)=>Object.entries(e).reduce((r,[o,i])=>({...r,[o]:V7.getEndpointProperty(i,t)}),{}),B7=(e,t)=>{if(Array.isArray(e))return e.map(r=>B7(r,t));switch(typeof e){case"string":return F7(e,t);case"object":if(e===null)throw new Xi(`Unexpected endpoint property: ${e}`);return V7.getEndpointProperties(e,t);case"boolean":return e;default:throw new Xi(`Unexpected endpoint property type: ${typeof e}`)}},V7={getEndpointProperty:B7,getEndpointProperties:j7},w5e=(e,t)=>{const r=MC(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(o){throw console.error(`Failed to construct URL with ${r}`,o),o}throw new Xi(`Endpoint URL must be a string, got ${typeof r}`)},T5e=(e,t)=>{const{conditions:r,endpoint:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(!i)return;const a={...t,referenceRecord:{...t.referenceRecord,...s}},{url:l,properties:c,headers:u}=o;return t.logger?.debug?.(`${pm} Resolving endpoint from template: ${sc(o)}`),{...u!=null&&{headers:C5e(u,a)},...c!=null&&{properties:j7(c,a)},url:w5e(l,a)}},O5e=(e,t)=>{const{conditions:r,error:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(i)throw new Xi(MC(o,"Error",{...t,referenceRecord:{...t.referenceRecord,...s}}))},H7=(e,t)=>{for(const r of e)if(r.type==="endpoint"){const o=T5e(r,t);if(o)return o}else if(r.type==="error")O5e(r,t);else if(r.type==="tree"){const o=z7.evaluateTreeRule(r,t);if(o)return o}else throw new Xi(`Unknown endpoint rule: ${r}`);throw new Xi("Rules evaluation failed")},P5e=(e,t)=>{const{conditions:r,rules:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(i)return z7.evaluateRules(o,{...t,referenceRecord:{...t.referenceRecord,...s}})},z7={evaluateRules:H7,evaluateTreeRule:P5e},q7=(e,t)=>{const{endpointParams:r,logger:o}=t,{parameters:i,rules:s}=e;t.logger?.debug?.(`${pm} Initial EndpointParams: ${sc(r)}`);const a=Object.entries(i).filter(([,u])=>u.default!=null).map(([u,d])=>[u,d.default]);if(a.length>0)for(const[u,d]of a)r[u]=r[u]??d;const l=Object.entries(i).filter(([,u])=>u.required).map(([u])=>u);for(const u of l)if(r[u]==null)throw new Xi(`Missing required parameter: '${u}'`);const c=H7(s,{endpointParams:r,logger:o,referenceRecord:{}});return t.logger?.debug?.(`${pm} Resolved endpoint: ${sc(c)}`),c},U7=(e,t=!1)=>{if(t){for(const r of e.split("."))if(!U7(r))return!1;return!0}return!(!pg(e)||e.length<3||e.length>63||e!==e.toLowerCase()||MM(e))},iH=":",E5e="/",I5e=e=>{const t=e.split(iH);if(t.length<6)return null;const[r,o,i,s,a,...l]=t;if(r!=="arn"||o===""||i===""||l.join(iH)==="")return null;const c=l.map(u=>u.split(E5e)).flat();return{partition:o,service:i,region:s,accountId:a,resourceId:c}},k5e=[{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)"}}}],R5e={partitions:k5e};let M5e=R5e;const A5e=e=>{const{partitions:t}=M5e;for(const o of t){const{regions:i,outputs:s}=o;for(const[a,l]of Object.entries(i))if(a===e)return{...s,...l}}for(const o of t){const{regionRegex:i,outputs:s}=o;if(new RegExp(i).test(e))return{...s}}const r=t.find(o=>o.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},G7={isVirtualHostableS3Bucket:U7,parseArn:I5e,partition:A5e};fm.aws=G7;function D5e(e){const t={};if(e=e.replace(/^\?/,""),e)for(const r of e.split("&")){let[o,i=null]=r.split("=");o=decodeURIComponent(o),i&&(i=decodeURIComponent(i)),o in t?Array.isArray(t[o])?t[o].push(i):t[o]=[t[o],i]:t[o]=i}return t}const hm=e=>{if(typeof e=="string")return hm(new URL(e));const{hostname:t,pathname:r,port:o,protocol:i,search:s}=e;let a;return s&&(a=D5e(s)),{hostname:t,port:o?parseInt(o):void 0,protocol:i,path:r,query:a}},_5e=/\d{12}\.ddb/;async function N5e(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Gr(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const s=await t.retryStrategy();typeof s.acquireInitialRetryToken=="function"?s.constructor?.name?.includes("Adaptive")?Gr(e,"RETRY_MODE_ADAPTIVE","F"):Gr(e,"RETRY_MODE_STANDARD","E"):Gr(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const s=e.endpointV2;switch(String(s?.url?.hostname).match(_5e)&&Gr(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":Gr(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Gr(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Gr(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const s=i;s.accountId&&Gr(e,"RESOLVED_ACCOUNT_ID","T");for(const[a,l]of Object.entries(s.$source??{}))Gr(e,a,l)}}const sH="user-agent",JO="x-amz-user-agent",aH=" ",e1="/",F5e=/[^!$%&'*+\-.^_`|~\w]/g,L5e=/[^!$%&'*+\-.^_`|~\w#]/g,lH="-",$5e=1024;function j5e(e){let t="";for(const r in e){const o=e[r];if(t.length+o.length+1<=$5e){t.length?t+=","+o:t+=o;continue}break}return t}const B5e=e=>(t,r)=>async o=>{const{request:i}=o;if(!Br.isInstance(i))return t(o);const{headers:s}=i,a=r?.userAgent?.map(Ev)||[],l=(await e.defaultUserAgentProvider()).map(Ev);await N5e(r,e,o);const c=r;l.push(`m/${j5e(Object.assign({},r.__smithy_context?.features,c.__aws_sdk_context?.features))}`);const u=e?.customUserAgent?.map(Ev)||[],d=await e.userAgentAppId();d&&l.push(Ev(["app",`${d}`]));const f=[].concat([...l,...a,...u]).join(aH),p=[...l.filter(h=>h.startsWith("aws-sdk-")),...u].join(aH);return e.runtime!=="browser"?(p&&(s[JO]=s[JO]?`${s[sH]} ${p}`:p),s[sH]=f):s[JO]=f,t({...o,request:i})},Ev=e=>{const t=e[0].split(e1).map(a=>a.replace(F5e,lH)).join(e1),r=e[1]?.replace(L5e,lH),o=t.indexOf(e1),i=t.substring(0,o);let s=t.substring(o+1);return i==="api"&&(s=s.toLowerCase()),[i,s,r].filter(a=>a&&a.length>0).reduce((a,l,c)=>{switch(c){case 0:return l;case 1:return`${a}/${l}`;default:return`${a}#${l}`}},"")},V5e={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},W7=e=>({applyToStack:t=>{t.add(B5e(e),V5e)}}),K7=!1,Y7=!1,cH=new Set,H5e=(e,t=pg)=>{if(!cH.has(e)&&!t(e))if(e==="*")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="${e}" is not a valid hostname component.`);else cH.add(e)},Z7=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),z5e=e=>Z7(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,X7=e=>{const{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const o=typeof t=="function"?await t():t,i=z5e(o);return H5e(i),i},useFipsEndpoint:async()=>{const o=typeof t=="string"?t:await t();return Z7(o)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},q5e=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)}),uH="content-length";function U5e(e){return t=>async r=>{const o=r.request;if(Br.isInstance(o)){const{body:i,headers:s}=o;if(i&&Object.keys(s).map(a=>a.toLowerCase()).indexOf(uH)===-1)try{const a=e(i);o.headers={...o.headers,[uH]:String(a)}}catch{}}return t({...r,request:o})}}const G5e={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Q7=e=>({applyToStack:t=>{t.add(U5e(e.bodyLengthChecker),G5e)}}),W5e=async e=>{const t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Q5e(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!X5e(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},K5e=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Y5e=/(\d+\.){3}\d+/,Z5e=/\.\./,X5e=e=>K5e.test(e)&&!Y5e.test(e)&&!Z5e.test(e),Q5e=e=>{const[t,r,o,,,i]=e.split(":"),s=t==="arn"&&e.split(":").length>=6,a=!!(s&&r&&o&&i);if(s&&!a)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return a},J5e=(e,t,r,o=!1)=>{const i=async()=>{let s;return o?s=r.clientContextParams?.[e]??r[e]??r[t]:s=r[e]??r[t],typeof s=="function"?s():s};return e==="credentialScope"||t==="CredentialScope"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.credentialScope??s?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.accountId??s?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const s=await i();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){const{protocol:a,hostname:l,port:c,path:u}=s;return`${a}//${l}${c?":"+c:""}${u}`}}return s}:i},J7=async e=>{},eK=e=>typeof e=="object"?"url"in e?hm(e.url):e:hm(e),e4e=async(e,t,r,o)=>{if(!r.isCustomEndpoint){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await J7(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(eK(a)),r.isCustomEndpoint=!0)}const i=await tK(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(i,o)},tK=async(e,t,r)=>{const o={},i=t?.getEndpointParameterInstructions?.()||{};for(const[s,a]of Object.entries(i))switch(a.type){case"staticContextParams":o[s]=a.value;break;case"contextParams":o[s]=e[a.name];break;case"clientContextParams":case"builtInParams":o[s]=await J5e(a.name,s,r,a.type!=="builtInParams")();break;case"operationContextParams":o[s]=a.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(o,r),String(r.serviceId).toLowerCase()==="s3"&&await W5e(o),o},t4e=({config:e,instructions:t})=>(r,o)=>async i=>{e.isCustomEndpoint&&eqe(o,"ENDPOINT_OVERRIDE","N");const s=await e4e(i.input,{getEndpointParameterInstructions(){return t}},{...e},o);o.endpointV2=s,o.authSchemes=s.properties?.authSchemes;const a=o.authSchemes?.[0];if(a){o.signing_region=a.signingRegion,o.signing_service=a.signingName;const c=gl(o)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return r({...i})},n4e={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:VHe.name},DM=(e,t)=>({applyToStack:r=>{r.addRelativeTo(t4e({config:e,instructions:t}),n4e)}}),nK=e=>{const t=e.tls??!0,{endpoint:r,useDualstackEndpoint:o,useFipsEndpoint:i}=e,s=r!=null?async()=>eK(await Rs(r)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:Rs(o??!1),useFipsEndpoint:Rs(i??!1)});let c;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=J7(e.serviceId)),c),l};var Vf;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(Vf||(Vf={}));const mm=3,rK=Vf.STANDARD,r4e=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],o4e=["TimeoutError","RequestTimeout","RequestTimeoutException"],i4e=[500,502,503,504],s4e=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],a4e=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],l4e=e=>e?.$retryable!==void 0,c4e=e=>e.$metadata?.clockSkewCorrected,u4e=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},oK=e=>e.$metadata?.httpStatusCode===429||r4e.includes(e.name)||e.$retryable?.throttling==!0,_M=(e,t=0)=>l4e(e)||c4e(e)||o4e.includes(e.name)||s4e.includes(e?.code||"")||a4e.includes(e?.code||"")||i4e.includes(e.$metadata?.httpStatusCode||0)||u4e(e)||e.cause!==void 0&&t<=10&&_M(e.cause,t+1),d4e=e=>{if(e.$metadata?.httpStatusCode!==void 0){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!_M(e)}return!1};class NM{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const r=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(o=>NM.setTimeoutFn(o,r))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const r=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=t}updateClientSendingRate(t){let r;if(this.updateMeasuredRate(),oK(t)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const o=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(o)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const o=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(o*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}const oE=100,iK=20*1e3,f4e=500,dH=500,p4e=5,h4e=10,m4e=1,g4e="amz-sdk-invocation-id",b4e="amz-sdk-request",y4e=()=>{let e=oE;return{computeNextBackoffDelay:o=>Math.floor(Math.min(iK,Math.random()*2**o*e)),setDelayBase:o=>{e=o}}},fH=({retryDelay:e,retryCount:t,retryCost:r})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(iK,e),getRetryCost:()=>r});class sK{maxAttempts;mode=Vf.STANDARD;capacity=dH;retryBackoffStrategy=y4e();maxAttemptsProvider;constructor(t){this.maxAttempts=t,this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return fH({retryDelay:oE,retryCount:0})}async refreshRetryTokenForRetry(t,r){const o=await this.getMaxAttempts();if(this.shouldRetry(t,r,o)){const i=r.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?f4e:oE);const s=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),a=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,s):s,l=this.getCapacityCost(i);return this.capacity-=l,fH({retryDelay:a,retryCount:t.getRetryCount()+1,retryCost:l})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max(dH,this.capacity+(t.getRetryCost()??m4e))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${mm}`),mm}}shouldRetry(t,r,o){return t.getRetryCount()+1<o&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(t){return t==="TRANSIENT"?h4e:p4e}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class v4e{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=Vf.ADAPTIVE;constructor(t,r){this.maxAttemptsProvider=t;const{rateLimiter:o}=r??{};this.rateLimiter=o??new NM,this.standardRetryStrategy=new sK(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(t,r)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}const x4e=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),aK=e=>{const{retryStrategy:t,retryMode:r,maxAttempts:o}=e,i=Rs(o??mm);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await Rs(r)()===Vf.ADAPTIVE?new v4e(i):new sK(i))})},S4e=e=>e?.body instanceof ReadableStream,C4e=e=>(t,r)=>async o=>{let i=await e.retryStrategy();const s=await e.maxAttempts();if(w4e(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),l=new Error,c=0,u=0;const{request:d}=o,f=Br.isInstance(d);for(f&&(d.headers[g4e]=OC());;)try{f&&(d.headers[b4e]=`attempt=${c+1}; max=${s}`);const{response:p,output:h}=await t(o);return i.recordSuccess(a),h.$metadata.attempts=c+1,h.$metadata.totalRetryDelay=u,{response:p,output:h}}catch(p){const h=T4e(p);if(l=x4e(p),f&&S4e(d))throw(r.logger instanceof kC?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,h)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=u,l}c=a.getRetryCount();const b=a.getRetryDelay();u+=b,await new Promise(g=>setTimeout(g,b))}}else return i=i,i?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,o)},w4e=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",T4e=e=>{const t={error:e,errorType:O4e(e)},r=E4e(e.$response);return r&&(t.retryAfterHint=r),t},O4e=e=>oK(e)?"THROTTLING":_M(e)?"TRANSIENT":d4e(e)?"SERVER_ERROR":"CLIENT_ERROR",P4e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},lK=e=>({applyToStack:t=>{t.add(C4e(e),P4e)}}),E4e=e=>{if(!wu.isInstance(e))return;const t=Object.keys(e.headers).find(s=>s.toLowerCase()==="retry-after");if(!t)return;const r=e.headers[t],o=Number(r);return Number.isNaN(o)?new Date(r):new Date(o*1e3)};class cK{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return"none"}constructor(t){this.sigv4Signer=new B3e(t),this.signerOptions=t}async sign(t,r={}){return r.signingRegion==="*"?this.getSigv4aSigner().sign(t,r):this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,o={}){if(o.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(t,r,o)}async presign(t,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(t,r)}async presignWithCredentials(t,r,o={}){if(o.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,o)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const FM="required",ue="type",Be="rules",be="conditions",ke="fn",Re="argv",Et="ref",tn="assign",dt="url",ft="properties",Ja="backend",go="authSchemes",Wr="disableDoubleEncoding",Kr="signingName",Eo="signingRegion",pt="headers",LM="signingRegionSet",I4e=6,k4e=!1,ua=!0,qi="isSet",jr="booleanEquals",xt="error",l0="aws.partition",wn="stringEquals",wr="getAttr",Or="name",Qn="substring",pH="bucketSuffix",$M="parseURL",Ye="endpoint",Ve="tree",c0="aws.isVirtualHostableS3Bucket",u0="{url#scheme}://{Bucket}.{url#authority}{url#path}",Ca="not",hH="accessPointSuffix",Jv="{url#scheme}://{url#authority}{url#path}",uK="hardwareType",dK="regionPrefix",mH="bucketAliasSuffix",iE="outpostId",qu="isValidHostLabel",jM="sigv4a",gm="s3-outposts",Hf="s3",fK="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",pK="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",gH="https://{Bucket}.s3.{partitionResult#dnsSuffix}",hK="aws.parseArn",mK="bucketArn",gK="arnType",d0="",BM="s3-object-lambda",bK="accesspoint",VM="accessPointName",bH="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",yH="mrapPartition",vH="outpostType",xH="arnPrefix",yK="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",SH="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",CH="https://s3.{partitionResult#dnsSuffix}",Fd={[FM]:!1,[ue]:"string"},Ld={[FM]:!0,default:!1,[ue]:"boolean"},Xp={[FM]:!1,[ue]:"boolean"},gs={[ke]:jr,[Re]:[{[Et]:"Accelerate"},!0]},rr={[ke]:jr,[Re]:[{[Et]:"UseFIPS"},!0]},Yn={[ke]:jr,[Re]:[{[Et]:"UseDualStack"},!0]},Lr={[ke]:qi,[Re]:[{[Et]:"Endpoint"}]},vK={[ke]:l0,[Re]:[{[Et]:"Region"}],[tn]:"partitionResult"},wH={[ke]:wn,[Re]:[{[ke]:wr,[Re]:[{[Et]:"partitionResult"},Or]},"aws-cn"]},Mh={[ke]:qi,[Re]:[{[Et]:"Bucket"}]},xn={[Et]:"Bucket"},TH={[be]:[gs],[xt]:"S3Express does not support S3 Accelerate.",[ue]:xt},OH={[be]:[Lr,{[ke]:$M,[Re]:[{[Et]:"Endpoint"}],[tn]:"url"}],[Be]:[{[be]:[{[ke]:qi,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"}]},{[ke]:jr,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"},!0]}],[Be]:[{[be]:[{[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]}],[Be]:[{[be]:[{[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"}],[Be]:[{[Ye]:{[dt]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:c0,[Re]:[xn,!1]}],[Be]:[{[Ye]:{[dt]:u0,[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve},{[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt}],[ue]:Ve},{[be]:[{[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]}],[Be]:[{[be]:[{[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"}],[Be]:[{[Ye]:{[dt]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:c0,[Re]:[xn,!1]}],[Be]:[{[Ye]:{[dt]:u0,[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve},{[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt}],[ue]:Ve},Xo={[ke]:$M,[Re]:[{[Et]:"Endpoint"}],[tn]:"url"},t1={[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]},xK={[Et]:"url"},SK={[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"},ji={[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},qt={},CK={[ke]:c0,[Re]:[xn,!1]},PH={[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt},EH={[ke]:qi,[Re]:[{[Et]:"UseS3ExpressControlEndpoint"}]},IH={[ke]:jr,[Re]:[{[Et]:"UseS3ExpressControlEndpoint"},!0]},Qt={[ke]:Ca,[Re]:[Lr]},hn={[ke]:jr,[Re]:[{[Et]:"UseDualStack"},!1]},an={[ke]:jr,[Re]:[{[Et]:"UseFIPS"},!1]},Iv={[xt]:"Unrecognized S3Express bucket name format.",[ue]:xt},kH={[ke]:Ca,[Re]:[Mh]},RH={[Et]:uK},MH={[be]:[Qt],[xt]:"Expected a endpoint to be specified but no endpoint was found",[ue]:xt},kv={[go]:[{[Wr]:!0,[Or]:jM,[Kr]:gm,[LM]:["*"]},{[Wr]:!0,[Or]:"sigv4",[Kr]:gm,[Eo]:"{Region}"}]},n1={[ke]:jr,[Re]:[{[Et]:"ForcePathStyle"},!1]},R4e={[Et]:"ForcePathStyle"},Ur={[ke]:jr,[Re]:[{[Et]:"Accelerate"},!1]},to={[ke]:wn,[Re]:[{[Et]:"Region"},"aws-global"]},fo={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"us-east-1"}]},bn={[ke]:Ca,[Re]:[to]},po={[ke]:jr,[Re]:[{[Et]:"UseGlobalEndpoint"},!0]},AH={[dt]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{Region}"}]},[pt]:{}},Yr={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{Region}"}]},ho={[ke]:jr,[Re]:[{[Et]:"UseGlobalEndpoint"},!1]},DH={[dt]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},_H={[dt]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},NH={[dt]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},r1={[ke]:jr,[Re]:[{[ke]:wr,[Re]:[xK,"isIp"]},!1]},o1={[dt]:fK,[ft]:Yr,[pt]:{}},sE={[dt]:u0,[ft]:Yr,[pt]:{}},FH={[Ye]:sE,[ue]:Ye},i1={[dt]:pK,[ft]:Yr,[pt]:{}},LH={[dt]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},Rv={[xt]:"Invalid region: region was not a valid DNS name.",[ue]:xt},Ti={[Et]:mK},wK={[Et]:gK},s1={[ke]:wr,[Re]:[Ti,"service"]},HM={[Et]:VM},$H={[be]:[Yn],[xt]:"S3 Object Lambda does not support Dual-stack",[ue]:xt},jH={[be]:[gs],[xt]:"S3 Object Lambda does not support S3 Accelerate",[ue]:xt},BH={[be]:[{[ke]:qi,[Re]:[{[Et]:"DisableAccessPoints"}]},{[ke]:jr,[Re]:[{[Et]:"DisableAccessPoints"},!0]}],[xt]:"Access points are not supported for this operation",[ue]:xt},a1={[be]:[{[ke]:qi,[Re]:[{[Et]:"UseArnRegion"}]},{[ke]:jr,[Re]:[{[Et]:"UseArnRegion"},!1]},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},"{Region}"]}]}],[xt]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[ue]:xt},TK={[ke]:wr,[Re]:[{[Et]:"bucketPartition"},Or]},OK={[ke]:wr,[Re]:[Ti,"accountId"]},l1={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:BM,[Eo]:"{bucketArn#region}"}]},VH={[xt]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[ue]:xt},c1={[xt]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[ue]:xt},u1={[xt]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[ue]:xt},d1={[xt]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[ue]:xt},HH={[xt]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[ue]:xt},zH={[xt]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",[ue]:xt},Qp={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{bucketArn#region}"}]},qH={[go]:[{[Wr]:!0,[Or]:jM,[Kr]:gm,[LM]:["*"]},{[Wr]:!0,[Or]:"sigv4",[Kr]:gm,[Eo]:"{bucketArn#region}"}]},UH={[ke]:hK,[Re]:[xn]},GH={[dt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},WH={[dt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},KH={[dt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},f1={[dt]:yK,[ft]:Yr,[pt]:{}},YH={[dt]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},ZH={[Et]:"UseObjectLambdaEndpoint"},p1={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:BM,[Eo]:"{Region}"}]},XH={[dt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},QH={[dt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},JH={[dt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},h1={[dt]:Jv,[ft]:Yr,[pt]:{}},ez={[dt]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},m1=[{[Et]:"Region"}],M4e=[{[Et]:"Endpoint"}],A4e=[xn],g1=[gs],$d=[Lr,Xo],tz=[{[ke]:qi,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"}]},{[ke]:jr,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"},!0]}],D4e=[SK],b1=[CK],hs=[vK],y1=[rr,Yn],Ah=[rr,hn],Dh=[an,Yn],_h=[an,hn],nz=[{[ke]:Qn,[Re]:[xn,6,14,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,14,16,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],da=[{[be]:[rr,Yn],[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:Ah,[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:Dh,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:_h,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye}],rz=[{[ke]:Qn,[Re]:[xn,6,15,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,15,17,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],oz=[{[ke]:Qn,[Re]:[xn,6,19,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,19,21,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],iz=[{[ke]:Qn,[Re]:[xn,6,20,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,20,22,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],sz=[{[ke]:Qn,[Re]:[xn,6,26,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,26,28,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],fa=[{[be]:[rr,Yn],[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:Ah,[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:Dh,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:_h,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],az=[xn,0,7,!0],lz=[{[ke]:Qn,[Re]:[xn,7,15,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,15,17,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],cz=[{[ke]:Qn,[Re]:[xn,7,16,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,16,18,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],uz=[{[ke]:Qn,[Re]:[xn,7,20,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,20,22,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],dz=[{[ke]:Qn,[Re]:[xn,7,21,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,21,23,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],fz=[{[ke]:Qn,[Re]:[xn,7,27,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,27,29,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],_4e=[Mh],pz=[{[ke]:qu,[Re]:[{[Et]:iE},!1]}],hz=[{[ke]:wn,[Re]:[{[Et]:dK},"beta"]}],N4e=["*"],mz=[{[ke]:qu,[Re]:[{[Et]:"Region"},!1]}],Dl=[{[ke]:wn,[Re]:[{[Et]:"Region"},"us-east-1"]}],v1=[{[ke]:wn,[Re]:[wK,bK]}],gz=[{[ke]:wr,[Re]:[Ti,"resourceId[1]"],[tn]:VM},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[HM,d0]}]}],F4e=[Ti,"resourceId[1]"],bz=[Yn],x1=[{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},d0]}]}],yz=[{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[{[ke]:wr,[Re]:[Ti,"resourceId[2]"]}]}]}],L4e=[Ti,"resourceId[2]"],S1=[{[ke]:l0,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]}],[tn]:"bucketPartition"}],vz=[{[ke]:wn,[Re]:[TK,{[ke]:wr,[Re]:[{[Et]:"partitionResult"},Or]}]}],C1=[{[ke]:qu,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},!0]}],w1=[{[ke]:qu,[Re]:[OK,!1]}],xz=[{[ke]:qu,[Re]:[HM,!1]}],Mv=[rr],Sz=[{[ke]:qu,[Re]:[{[Et]:"Region"},!0]}],$4e={parameters:{Bucket:Fd,Region:Fd,UseFIPS:Ld,UseDualStack:Ld,Endpoint:Fd,ForcePathStyle:Ld,Accelerate:Ld,UseGlobalEndpoint:Ld,UseObjectLambdaEndpoint:Xp,Key:Fd,Prefix:Fd,CopySource:Fd,DisableAccessPoints:Xp,DisableMultiRegionAccessPoints:Ld,UseArnRegion:Xp,UseS3ExpressControlEndpoint:Xp,DisableS3ExpressSessionAuth:Xp},[Be]:[{[be]:[{[ke]:qi,[Re]:m1}],[Be]:[{[be]:[gs,rr],error:"Accelerate cannot be used with FIPS",[ue]:xt},{[be]:[Yn,Lr],error:"Cannot set dual-stack in combination with a custom endpoint.",[ue]:xt},{[be]:[Lr,rr],error:"A custom endpoint cannot be combined with FIPS",[ue]:xt},{[be]:[Lr,gs],error:"A custom endpoint cannot be combined with S3 Accelerate",[ue]:xt},{[be]:[rr,vK,wH],error:"Partition does not support FIPS",[ue]:xt},{[be]:[Mh,{[ke]:Qn,[Re]:[xn,0,I4e,ua],[tn]:pH},{[ke]:wn,[Re]:[{[Et]:pH},"--x-s3"]}],[Be]:[TH,OH,{[be]:[EH,IH],[Be]:[{[be]:hs,[Be]:[{[be]:[SK,Qt],[Be]:[{[be]:y1,endpoint:{[dt]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye}],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:b1,[Be]:[{[be]:hs,[Be]:[{[be]:tz,[Be]:[{[be]:nz,[Be]:da,[ue]:Ve},{[be]:rz,[Be]:da,[ue]:Ve},{[be]:oz,[Be]:da,[ue]:Ve},{[be]:iz,[Be]:da,[ue]:Ve},{[be]:sz,[Be]:da,[ue]:Ve},Iv],[ue]:Ve},{[be]:nz,[Be]:fa,[ue]:Ve},{[be]:rz,[Be]:fa,[ue]:Ve},{[be]:oz,[Be]:fa,[ue]:Ve},{[be]:iz,[Be]:fa,[ue]:Ve},{[be]:sz,[Be]:fa,[ue]:Ve},Iv],[ue]:Ve}],[ue]:Ve},PH],[ue]:Ve},{[be]:[Mh,{[ke]:Qn,[Re]:az,[tn]:hH},{[ke]:wn,[Re]:[{[Et]:hH},"--xa-s3"]}],[Be]:[TH,OH,{[be]:b1,[Be]:[{[be]:hs,[Be]:[{[be]:tz,[Be]:[{[be]:lz,[Be]:da,[ue]:Ve},{[be]:cz,[Be]:da,[ue]:Ve},{[be]:uz,[Be]:da,[ue]:Ve},{[be]:dz,[Be]:da,[ue]:Ve},{[be]:fz,[Be]:da,[ue]:Ve},Iv],[ue]:Ve},{[be]:lz,[Be]:fa,[ue]:Ve},{[be]:cz,[Be]:fa,[ue]:Ve},{[be]:uz,[Be]:fa,[ue]:Ve},{[be]:dz,[Be]:fa,[ue]:Ve},{[be]:fz,[Be]:fa,[ue]:Ve},Iv],[ue]:Ve}],[ue]:Ve},PH],[ue]:Ve},{[be]:[kH,EH,IH],[Be]:[{[be]:hs,[Be]:[{[be]:$d,endpoint:{[dt]:Jv,[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:y1,endpoint:{[dt]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[Mh,{[ke]:Qn,[Re]:[xn,49,50,ua],[tn]:uK},{[ke]:Qn,[Re]:[xn,8,12,ua],[tn]:dK},{[ke]:Qn,[Re]:az,[tn]:mH},{[ke]:Qn,[Re]:[xn,32,49,ua],[tn]:iE},{[ke]:l0,[Re]:m1,[tn]:"regionPartition"},{[ke]:wn,[Re]:[{[Et]:mH},"--op-s3"]}],[Be]:[{[be]:pz,[Be]:[{[be]:b1,[Be]:[{[be]:[{[ke]:wn,[Re]:[RH,"e"]}],[Be]:[{[be]:hz,[Be]:[MH,{[be]:$d,endpoint:{[dt]:"https://{Bucket}.ec2.{url#authority}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{endpoint:{[dt]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{[be]:[{[ke]:wn,[Re]:[RH,"o"]}],[Be]:[{[be]:hz,[Be]:[MH,{[be]:$d,endpoint:{[dt]:"https://{Bucket}.op-{outpostId}.{url#authority}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{endpoint:{[dt]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[ue]:xt}],[ue]:Ve},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[ue]:xt}],[ue]:Ve},{[be]:_4e,[Be]:[{[be]:[Lr,{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[{[ke]:$M,[Re]:M4e}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[ue]:xt},{[be]:[n1,CK],[Be]:[{[be]:hs,[Be]:[{[be]:mz,[Be]:[{[be]:[gs,wH],error:"S3 Accelerate cannot be used in this region",[ue]:xt},{[be]:[Yn,rr,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,rr,Ur,Qt,bn,po],[Be]:[{endpoint:AH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,rr,Ur,Qt,bn,ho],endpoint:AH,[ue]:Ye},{[be]:[hn,rr,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,rr,Ur,Qt,bn,po],[Be]:[{endpoint:DH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,rr,Ur,Qt,bn,ho],endpoint:DH,[ue]:Ye},{[be]:[Yn,an,gs,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,an,gs,Qt,bn,po],[Be]:[{endpoint:_H,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,an,gs,Qt,bn,ho],endpoint:_H,[ue]:Ye},{[be]:[Yn,an,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,an,Ur,Qt,bn,po],[Be]:[{endpoint:NH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,an,Ur,Qt,bn,ho],endpoint:NH,[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,t1,to],endpoint:{[dt]:fK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,r1,to],endpoint:{[dt]:u0,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,t1,bn,po],[Be]:[{[be]:Dl,endpoint:o1,[ue]:Ye},{endpoint:o1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,Ur,Lr,Xo,r1,bn,po],[Be]:[{[be]:Dl,endpoint:sE,[ue]:Ye},FH],[ue]:Ve},{[be]:[hn,an,Ur,Lr,Xo,t1,bn,ho],endpoint:o1,[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,r1,bn,ho],endpoint:sE,[ue]:Ye},{[be]:[hn,an,gs,Qt,to],endpoint:{[dt]:pK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,gs,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:i1,[ue]:Ye},{endpoint:i1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,gs,Qt,bn,ho],endpoint:i1,[ue]:Ye},{[be]:[hn,an,Ur,Qt,to],endpoint:{[dt]:gH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:gH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:LH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,Ur,Qt,bn,ho],endpoint:LH,[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[Lr,Xo,{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[xK,"scheme"]},"http"]},{[ke]:c0,[Re]:[xn,ua]},n1,an,hn,Ur],[Be]:[{[be]:hs,[Be]:[{[be]:mz,[Be]:[FH],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[n1,{[ke]:hK,[Re]:A4e,[tn]:mK}],[Be]:[{[be]:[{[ke]:wr,[Re]:[Ti,"resourceId[0]"],[tn]:gK},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[wK,d0]}]}],[Be]:[{[be]:[{[ke]:wn,[Re]:[s1,BM]}],[Be]:[{[be]:v1,[Be]:[{[be]:gz,[Be]:[$H,jH,{[be]:x1,[Be]:[BH,{[be]:yz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:vz,[Be]:[{[be]:C1,[Be]:[{[be]:[{[ke]:wn,[Re]:[OK,d0]}],error:"Invalid ARN: Missing account id",[ue]:xt},{[be]:w1,[Be]:[{[be]:xz,[Be]:[{[be]:$d,endpoint:{[dt]:bH,[ft]:l1,[pt]:qt},[ue]:Ye},{[be]:Mv,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:l1,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:l1,[pt]:qt},[ue]:Ye}],[ue]:Ve},VH],[ue]:Ve},c1],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},HH],[ue]:Ve},{error:"Invalid ARN: bucket ARN is missing a region",[ue]:xt}],[ue]:Ve},zH],[ue]:Ve},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[ue]:xt}],[ue]:Ve},{[be]:v1,[Be]:[{[be]:gz,[Be]:[{[be]:x1,[Be]:[{[be]:v1,[Be]:[{[be]:x1,[Be]:[BH,{[be]:yz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:[{[ke]:wn,[Re]:[TK,"{partitionResult#name}"]}],[Be]:[{[be]:C1,[Be]:[{[be]:[{[ke]:wn,[Re]:[s1,Hf]}],[Be]:[{[be]:w1,[Be]:[{[be]:xz,[Be]:[{[be]:g1,error:"Access Points do not support S3 Accelerate",[ue]:xt},{[be]:y1,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Lr,Xo],endpoint:{[dt]:bH,[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye}],[ue]:Ve},VH],[ue]:Ve},c1],[ue]:Ve},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[ue]:xt}],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},HH],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:qu,[Re]:[HM,ua]}],[Be]:[{[be]:bz,error:"S3 MRAP does not support dual-stack",[ue]:xt},{[be]:Mv,error:"S3 MRAP does not support FIPS",[ue]:xt},{[be]:g1,error:"S3 MRAP does not support S3 Accelerate",[ue]:xt},{[be]:[{[ke]:jr,[Re]:[{[Et]:"DisableMultiRegionAccessPoints"},ua]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[ue]:xt},{[be]:[{[ke]:l0,[Re]:m1,[tn]:yH}],[Be]:[{[be]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[{[Et]:yH},Or]},{[ke]:wr,[Re]:[Ti,"partition"]}]}],[Be]:[{endpoint:{[dt]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[ft]:{[go]:[{[Wr]:ua,name:jM,[Kr]:Hf,[LM]:N4e}]},[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[ue]:xt}],[ue]:Ve}],[ue]:Ve},{error:"Invalid Access Point Name",[ue]:xt}],[ue]:Ve},zH],[ue]:Ve},{[be]:[{[ke]:wn,[Re]:[s1,gm]}],[Be]:[{[be]:bz,error:"S3 Outposts does not support Dual-stack",[ue]:xt},{[be]:Mv,error:"S3 Outposts does not support FIPS",[ue]:xt},{[be]:g1,error:"S3 Outposts does not support S3 Accelerate",[ue]:xt},{[be]:[{[ke]:qi,[Re]:[{[ke]:wr,[Re]:[Ti,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[ue]:xt},{[be]:[{[ke]:wr,[Re]:F4e,[tn]:iE}],[Be]:[{[be]:pz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:vz,[Be]:[{[be]:C1,[Be]:[{[be]:w1,[Be]:[{[be]:[{[ke]:wr,[Re]:L4e,[tn]:vH}],[Be]:[{[be]:[{[ke]:wr,[Re]:[Ti,"resourceId[3]"],[tn]:VM}],[Be]:[{[be]:[{[ke]:wn,[Re]:[{[Et]:vH},bK]}],[Be]:[{[be]:$d,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[ft]:qH,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:qH,[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: expected an access point name",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: Expected a 4-component resource",[ue]:xt}],[ue]:Ve},c1],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: The Outpost Id was not set",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: No ARN type specified",[ue]:xt}],[ue]:Ve},{[be]:[{[ke]:Qn,[Re]:[xn,0,4,k4e],[tn]:xH},{[ke]:wn,[Re]:[{[Et]:xH},"arn:"]},{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[UH]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[ue]:xt},{[be]:[{[ke]:jr,[Re]:[R4e,ua]},UH],error:"Path-style addressing cannot be used with ARN buckets",[ue]:xt},{[be]:D4e,[Be]:[{[be]:hs,[Be]:[{[be]:[Ur],[Be]:[{[be]:[Yn,Qt,rr,to],endpoint:{[dt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,Qt,rr,bn,po],[Be]:[{endpoint:GH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,Qt,rr,bn,ho],endpoint:GH,[ue]:Ye},{[be]:[hn,Qt,rr,to],endpoint:{[dt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Qt,rr,bn,po],[Be]:[{endpoint:WH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Qt,rr,bn,ho],endpoint:WH,[ue]:Ye},{[be]:[Yn,Qt,an,to],endpoint:{[dt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,Qt,an,bn,po],[Be]:[{endpoint:KH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,Qt,an,bn,ho],endpoint:KH,[ue]:Ye},{[be]:[hn,Lr,Xo,an,to],endpoint:{[dt]:yK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Lr,Xo,an,bn,po],[Be]:[{[be]:Dl,endpoint:f1,[ue]:Ye},{endpoint:f1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Lr,Xo,an,bn,ho],endpoint:f1,[ue]:Ye},{[be]:[hn,Qt,an,to],endpoint:{[dt]:SH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Qt,an,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:SH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:YH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Qt,an,bn,ho],endpoint:YH,[ue]:Ye}],[ue]:Ve},{error:"Path-style addressing cannot be used with S3 Accelerate",[ue]:xt}],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:qi,[Re]:[ZH]},{[ke]:jr,[Re]:[ZH,ua]}],[Be]:[{[be]:hs,[Be]:[{[be]:Sz,[Be]:[$H,jH,{[be]:$d,endpoint:{[dt]:Jv,[ft]:p1,[pt]:qt},[ue]:Ye},{[be]:Mv,endpoint:{[dt]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:p1,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[ft]:p1,[pt]:qt},[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[kH],[Be]:[{[be]:hs,[Be]:[{[be]:Sz,[Be]:[{[be]:[rr,Yn,Qt,to],endpoint:{[dt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[rr,Yn,Qt,bn,po],[Be]:[{endpoint:XH,[ue]:Ye}],[ue]:Ve},{[be]:[rr,Yn,Qt,bn,ho],endpoint:XH,[ue]:Ye},{[be]:[rr,hn,Qt,to],endpoint:{[dt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[rr,hn,Qt,bn,po],[Be]:[{endpoint:QH,[ue]:Ye}],[ue]:Ve},{[be]:[rr,hn,Qt,bn,ho],endpoint:QH,[ue]:Ye},{[be]:[an,Yn,Qt,to],endpoint:{[dt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,Yn,Qt,bn,po],[Be]:[{endpoint:JH,[ue]:Ye}],[ue]:Ve},{[be]:[an,Yn,Qt,bn,ho],endpoint:JH,[ue]:Ye},{[be]:[an,hn,Lr,Xo,to],endpoint:{[dt]:Jv,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Lr,Xo,bn,po],[Be]:[{[be]:Dl,endpoint:h1,[ue]:Ye},{endpoint:h1,[ue]:Ye}],[ue]:Ve},{[be]:[an,hn,Lr,Xo,bn,ho],endpoint:h1,[ue]:Ye},{[be]:[an,hn,Qt,to],endpoint:{[dt]:CH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:CH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:ez,[ue]:Ye}],[ue]:Ve},{[be]:[an,hn,Qt,bn,ho],endpoint:ez,[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{error:"A region must be set when sending requests to S3.",[ue]:xt}]},j4e=$4e,B4e=new _7({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),PK=(e,t={})=>B4e.get(e,()=>q7(j4e,{endpointParams:e,logger:t.logger}));fm.aws=G7;const V4e=e=>async(t,r,o)=>{if(!o)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const i=await e(t,r,o),s=gl(r)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!s)throw new Error(`getEndpointParameterInstructions() is not defined on '${r.commandName}'`);const a=await tK(o,{getEndpointParameterInstructions:s},t);return Object.assign(i,a)},H4e=async(e,t,r)=>({operation:gl(t).operation,region:await Rs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),z4e=V4e(H4e);function EK(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function IK(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}const q4e=(e,t,r)=>i=>{const a=e(i).properties?.authSchemes;if(!a)return t(i);const l=[];for(const c of a){const{name:u,properties:d={},...f}=c,p=u.toLowerCase();u!==p&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${u}' to '${p}'`);let h;if(p==="sigv4a"){h="aws.auth#sigv4a";const y=a.find(v=>{const C=v.name.toLowerCase();return C!=="sigv4a"&&C.startsWith("sigv4")});if(cK.sigv4aDependency()==="none"&&y)continue}else if(p.startsWith("sigv4"))h="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);const b=r[h];if(!b)throw new Error(`Could not find HttpAuthOption create function for '${h}'`);const g=b(i);g.schemeId=h,g.signingProperties={...g.signingProperties||{},...f,...d},l.push(g)}return l},U4e=e=>{const t=[];switch(e.operation){default:t.push(EK(e)),t.push(IK(e))}return t},G4e=q4e(PK,U4e,{"aws.auth#sigv4":EK,"aws.auth#sigv4a":IK}),W4e=e=>{const t=p7(e),r=sqe(t);return Object.assign(r,{authSchemePreference:Rs(e.authSchemePreference??[])})},K4e=e=>Object.assign(e,{useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:e.clientContextParams??{}}),kK={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class xo extends Qc{constructor(t){super(t),Object.setPrototypeOf(this,xo.prototype)}}class zM extends xo{name="NoSuchUpload";$fault="client";constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),Object.setPrototypeOf(this,zM.prototype)}}class qM extends xo{name="AccessDenied";$fault="client";constructor(t){super({name:"AccessDenied",$fault:"client",...t}),Object.setPrototypeOf(this,qM.prototype)}}class UM extends xo{name="ObjectNotInActiveTierError";$fault="client";constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,UM.prototype)}}class GM extends xo{name="BucketAlreadyExists";$fault="client";constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),Object.setPrototypeOf(this,GM.prototype)}}class WM extends xo{name="BucketAlreadyOwnedByYou";$fault="client";constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),Object.setPrototypeOf(this,WM.prototype)}}class KM extends xo{name="NoSuchBucket";$fault="client";constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),Object.setPrototypeOf(this,KM.prototype)}}class YM extends xo{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),Object.setPrototypeOf(this,YM.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class ZM extends xo{name="NoSuchKey";$fault="client";constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),Object.setPrototypeOf(this,ZM.prototype)}}class XM extends xo{name="NotFound";$fault="client";constructor(t){super({name:"NotFound",$fault:"client",...t}),Object.setPrototypeOf(this,XM.prototype)}}class QM extends xo{name="EncryptionTypeMismatch";$fault="client";constructor(t){super({name:"EncryptionTypeMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,QM.prototype)}}class JM extends xo{name="InvalidRequest";$fault="client";constructor(t){super({name:"InvalidRequest",$fault:"client",...t}),Object.setPrototypeOf(this,JM.prototype)}}class eA extends xo{name="InvalidWriteOffset";$fault="client";constructor(t){super({name:"InvalidWriteOffset",$fault:"client",...t}),Object.setPrototypeOf(this,eA.prototype)}}class tA extends xo{name="TooManyParts";$fault="client";constructor(t){super({name:"TooManyParts",$fault:"client",...t}),Object.setPrototypeOf(this,tA.prototype)}}class nA extends xo{name="IdempotencyParameterMismatch";$fault="client";constructor(t){super({name:"IdempotencyParameterMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,nA.prototype)}}class rA extends xo{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,rA.prototype)}}const Y4e="ACL",Z4e="AccessDenied",Cz="AccessKeyId",X4e="AccessTier",RK="Bucket",Q4e="BucketAlreadyExists",J4e="BucketAlreadyOwnedByYou",AC="BucketKeyEnabled",eUe="Body",tUe="ChecksumAlgorithm",nUe="CacheControl",MK="ChecksumCRC32",AK="ChecksumCRC32C",DK="ChecksumCRC64NVME",rUe="Cache-Control",oUe="Content-Disposition",iUe="ContentDisposition",sUe="Content-Encoding",aUe="ContentEncoding",lUe="ContentLanguage",cUe="Content-Language",uUe="Content-Length",dUe="ContentLength",fUe="Content-MD5",pUe="ContentMD5",_K="ChecksumSHA1",NK="ChecksumSHA256",hUe="CreateSessionOutput",mUe="CreateSessionResult",gUe="CreateSessionRequest",bUe="CreateSession",yUe="ChecksumType",vUe="Content-Type",xUe="ContentType",wz="Credentials",aE="Expiration",SUe="ExpectedBucketOwner",CUe="EncryptionTypeMismatch",Tz="ETag",Oz="Expires",wUe="GrantFullControl",TUe="GrantRead",OUe="GrantReadACP",PUe="GrantWriteACP",EUe="IfMatch",IUe="If-Match",kUe="IfNoneMatch",RUe="If-None-Match",MUe="InvalidObjectState",AUe="IdempotencyParameterMismatch",DUe="InvalidRequest",_Ue="InvalidWriteOffset",NUe="Key",FUe="Metadata",LUe="NotFound",$Ue="NoSuchBucket",jUe="NoSuchKey",BUe="NoSuchUpload",VUe="ObjectAlreadyInActiveTierError",HUe="ObjectLockLegalHoldStatus",zUe="ObjectLockMode",qUe="ObjectLockRetainUntilDate",UUe="ObjectNotInActiveTierError",GUe="PutObject",WUe="PutObjectOutput",KUe="PutObjectRequest",YUe="RequestCharged",ZUe="RequestPayer",Pz="SecretAccessKey",XUe="StreamingBlob",FK="StorageClass",QUe="SessionCredentialValue",JUe="SessionCredentials",e9e="SessionMode",DC="ServerSideEncryption",LK="SSECustomerAlgorithm",$K="SSECustomerKey",jK="SSECustomerKeyMD5",hg="SSEKMSEncryptionContext",mg="SSEKMSKeyId",Ez="SessionToken",t9e="Size",n9e="TooManyParts",r9e="Tagging",o9e="VersionId",i9e="WriteOffsetBytes",s9e="WebsiteRedirectLocation",di="client",fi="error",BK="http",a9e="httpChecksum",Ii="httpError",Pt="httpHeader",l9e="httpPrefixHeaders",VK="smithy.ts.sdk.synthetic.com.amazonaws.s3",c9e="streaming",ef="xmlName",u9e="x-amz-acl",HK="x-amz-checksum-crc32",zK="x-amz-checksum-crc32c",qK="x-amz-checksum-crc64nvme",UK="x-amz-checksum-sha1",GK="x-amz-checksum-sha256",d9e="x-amz-create-session-mode",f9e="x-amz-checksum-type",p9e="x-amz-expiration",h9e="x-amz-expected-bucket-owner",m9e="x-amz-grant-full-control",g9e="x-amz-grant-read",b9e="x-amz-grant-read-acp",y9e="x-amz-grant-write-acp",v9e="x-amz-meta-",x9e="x-amz-object-lock-legal-hold",S9e="x-amz-object-lock-mode",C9e="x-amz-object-lock-retain-until-date",w9e="x-amz-object-size",T9e="x-amz-request-charged",O9e="x-amz-request-payer",P9e="x-amz-storage-class",E9e="x-amz-sdk-checksum-algorithm",_C="x-amz-server-side-encryption",NC="x-amz-server-side-encryption-aws-kms-key-id",FC="x-amz-server-side-encryption-bucket-key-enabled",LC="x-amz-server-side-encryption-context",WK="x-amz-server-side-encryption-customer-algorithm",I9e="x-amz-server-side-encryption-customer-key",KK="x-amz-server-side-encryption-customer-key-MD5",k9e="x-amz-tagging",R9e="x-amz-version-id",M9e="x-amz-write-offset-bytes",A9e="x-amz-website-redirect-location",Zn="com.amazonaws.s3",YK=ti.for(VK);var D9e=[-3,VK,"S3ServiceException",0,[],[]];YK.registerError(D9e,xo);const Go=ti.for(Zn);var _9e=[-3,Zn,Z4e,{[fi]:di,[Ii]:403},[],[]];Go.registerError(_9e,qM);var N9e=[-3,Zn,Q4e,{[fi]:di,[Ii]:409},[],[]];Go.registerError(N9e,GM);var F9e=[-3,Zn,J4e,{[fi]:di,[Ii]:409},[],[]];Go.registerError(F9e,WM);var L9e=[-3,Zn,CUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError(L9e,QM);var $9e=[-3,Zn,AUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError($9e,nA);var j9e=[-3,Zn,MUe,{[fi]:di,[Ii]:403},[FK,X4e],[0,0]];Go.registerError(j9e,YM);var B9e=[-3,Zn,DUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError(B9e,JM);var V9e=[-3,Zn,_Ue,{[fi]:di,[Ii]:400},[],[]];Go.registerError(V9e,eA);var H9e=[-3,Zn,$Ue,{[fi]:di,[Ii]:404},[],[]];Go.registerError(H9e,KM);var z9e=[-3,Zn,jUe,{[fi]:di,[Ii]:404},[],[]];Go.registerError(z9e,ZM);var q9e=[-3,Zn,BUe,{[fi]:di,[Ii]:404},[],[]];Go.registerError(q9e,zM);var U9e=[-3,Zn,LUe,{[fi]:di},[],[]];Go.registerError(U9e,XM);var G9e=[-3,Zn,VUe,{[fi]:di,[Ii]:403},[],[]];Go.registerError(G9e,rA);var W9e=[-3,Zn,UUe,{[fi]:di,[Ii]:403},[],[]];Go.registerError(W9e,UM);var K9e=[-3,Zn,n9e,{[fi]:di,[Ii]:400},[],[]];Go.registerError(K9e,tA);const Y9e=[YK,Go];var Iz=[0,Zn,QUe,8,0],Z9e=[0,Zn,$K,8,0],$C=[0,Zn,hg,8,0],jC=[0,Zn,mg,8,0],X9e=[0,Zn,XUe,{[c9e]:1},42],Q9e=[3,Zn,hUe,{[ef]:mUe},[wz,DC,mg,hg,AC],[[()=>n6e,{[ef]:wz}],[0,{[Pt]:_C}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}]],1],J9e=[3,Zn,gUe,0,[RK,e9e,DC,mg,hg,AC],[[0,1],[0,{[Pt]:d9e}],[0,{[Pt]:_C}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}]],1],e6e=[3,Zn,WUe,0,[aE,Tz,MK,AK,DK,_K,NK,yUe,DC,o9e,LK,jK,mg,hg,AC,t9e,YUe],[[0,{[Pt]:p9e}],[0,{[Pt]:Tz}],[0,{[Pt]:HK}],[0,{[Pt]:zK}],[0,{[Pt]:qK}],[0,{[Pt]:UK}],[0,{[Pt]:GK}],[0,{[Pt]:f9e}],[0,{[Pt]:_C}],[0,{[Pt]:R9e}],[0,{[Pt]:WK}],[0,{[Pt]:KK}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}],[1,{[Pt]:w9e}],[0,{[Pt]:T9e}]]],t6e=[3,Zn,KUe,0,[RK,NUe,Y4e,eUe,nUe,iUe,aUe,lUe,dUe,pUe,xUe,tUe,MK,AK,DK,_K,NK,Oz,EUe,kUe,wUe,TUe,OUe,PUe,i9e,FUe,DC,FK,s9e,LK,$K,jK,mg,hg,AC,ZUe,r9e,zUe,qUe,HUe,SUe],[[0,1],[0,1],[0,{[Pt]:u9e}],[()=>X9e,16],[0,{[Pt]:rUe}],[0,{[Pt]:oUe}],[0,{[Pt]:sUe}],[0,{[Pt]:cUe}],[1,{[Pt]:uUe}],[0,{[Pt]:fUe}],[0,{[Pt]:vUe}],[0,{[Pt]:E9e}],[0,{[Pt]:HK}],[0,{[Pt]:zK}],[0,{[Pt]:qK}],[0,{[Pt]:UK}],[0,{[Pt]:GK}],[4,{[Pt]:Oz}],[0,{[Pt]:IUe}],[0,{[Pt]:RUe}],[0,{[Pt]:m9e}],[0,{[Pt]:g9e}],[0,{[Pt]:b9e}],[0,{[Pt]:y9e}],[1,{[Pt]:M9e}],[128,{[l9e]:v9e}],[0,{[Pt]:_C}],[0,{[Pt]:P9e}],[0,{[Pt]:A9e}],[0,{[Pt]:WK}],[()=>Z9e,{[Pt]:I9e}],[0,{[Pt]:KK}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}],[0,{[Pt]:O9e}],[0,{[Pt]:k9e}],[0,{[Pt]:S9e}],[5,{[Pt]:C9e}],[0,{[Pt]:x9e}],[0,{[Pt]:h9e}]],2],n6e=[3,Zn,JUe,0,[Cz,Pz,Ez,aE],[[0,{[ef]:Cz}],[()=>Iz,{[ef]:Pz}],[()=>Iz,{[ef]:Ez}],[4,{[ef]:aE}]],4],r6e=[9,Zn,bUe,{[BK]:["GET","/?session",200]},()=>J9e,()=>Q9e],o6e=[9,Zn,GUe,{[a9e]:"-",[BK]:["PUT","/{Key+}?x-id=PutObject",200]},()=>t6e,()=>e6e];class i6e extends IC.classBuilder().ep({...kK,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,r,o,i){return[DM(o,t.getEndpointParameterInstructions()),A7(o)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(r6e).build(){}const s6e="3.996.0",a6e={version:s6e},l6e=e=>new TextEncoder().encode(e);function kz(e){return typeof e=="string"?e.length===0:e.byteLength===0}var ZK={name:"SHA-1"},Rz={name:"HMAC",hash:ZK},c6e=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);const u6e={};function Jl(){return typeof window<"u"?window:typeof self<"u"?self:u6e}var d6e=(function(){function e(t){this.toHash=new Uint8Array(0),t!==void 0&&(this.key=new Promise(function(r,o){Jl().crypto.subtle.importKey("raw",Mz(t),Rz,!1,["sign"]).then(r,o)}),this.key.catch(function(){}))}return e.prototype.update=function(t){if(!kz(t)){var r=Mz(t),o=new Uint8Array(this.toHash.byteLength+r.byteLength);o.set(this.toHash,0),o.set(r,this.toHash.byteLength),this.toHash=o}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return Jl().crypto.subtle.sign(Rz,r,t.toHash).then(function(o){return new Uint8Array(o)})}):kz(this.toHash)?Promise.resolve(c6e):Promise.resolve().then(function(){return Jl().crypto.subtle.digest(ZK,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){this.toHash=new Uint8Array(0)},e})();function Mz(e){return typeof e=="string"?l6e(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var f6e=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function XK(e){if(p6e(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return h6e(t)}return!1}function p6e(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function h6e(e){return e&&f6e.every(function(t){return typeof e[t]=="function"})}var m6e=(function(){function e(t){if(XK(Jl()))this.hash=new d6e(t);else throw new Error("SHA1 not supported")}return e.prototype.update=function(t,r){this.hash.update(ic(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})(),QK={name:"SHA-256"},Az={name:"HMAC",hash:QK},g6e=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]),b6e=(function(){function e(t){this.toHash=new Uint8Array(0),this.secret=t,this.reset()}return e.prototype.update=function(t){if(!dm(t)){var r=ic(t),o=new Uint8Array(this.toHash.byteLength+r.byteLength);o.set(this.toHash,0),o.set(r,this.toHash.byteLength),this.toHash=o}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return Jl().crypto.subtle.sign(Az,r,t.toHash).then(function(o){return new Uint8Array(o)})}):dm(this.toHash)?Promise.resolve(g6e):Promise.resolve().then(function(){return Jl().crypto.subtle.digest(QK,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){var t=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,o){Jl().crypto.subtle.importKey("raw",ic(t.secret),Az,!1,["sign"]).then(r,o)}),this.key.catch(function(){}))},e})(),ys=64,y6e=32,v6e=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]),x6e=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],S6e=Math.pow(2,53)-1,ex=(function(){function e(){this.state=Int32Array.from(x6e),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,o=t.byteLength;if(this.bytesHashed+=o,this.bytesHashed*8>S6e)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;o>0;)this.buffer[this.bufferLength++]=t[r++],o--,this.bufferLength===ys&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),o=this.bufferLength;if(r.setUint8(this.bufferLength++,128),o%ys>=ys-8){for(var i=this.bufferLength;i<ys;i++)r.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ys-8;i++)r.setUint8(i,0);r.setUint32(ys-8,Math.floor(t/4294967296),!0),r.setUint32(ys-4,t),this.hashBuffer(),this.finished=!0}for(var s=new Uint8Array(y6e),i=0;i<8;i++)s[i*4]=this.state[i]>>>24&255,s[i*4+1]=this.state[i]>>>16&255,s[i*4+2]=this.state[i]>>>8&255,s[i*4+3]=this.state[i]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var t=this,r=t.buffer,o=t.state,i=o[0],s=o[1],a=o[2],l=o[3],c=o[4],u=o[5],d=o[6],f=o[7],p=0;p<ys;p++){if(p<16)this.temp[p]=(r[p*4]&255)<<24|(r[p*4+1]&255)<<16|(r[p*4+2]&255)<<8|r[p*4+3]&255;else{var h=this.temp[p-2],b=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=this.temp[p-15];var g=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[p]=(b+this.temp[p-7]|0)+(g+this.temp[p-16]|0)}var y=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&d)|0)+(f+(v6e[p]+this.temp[p]|0)|0)|0,v=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&s^i&a^s&a)|0;f=d,d=u,u=c,c=l+y|0,l=a,a=s,s=i,i=y+v|0}o[0]+=i,o[1]+=s,o[2]+=a,o[3]+=l,o[4]+=c,o[5]+=u,o[6]+=d,o[7]+=f},e})(),C6e=(function(){function e(t){this.secret=t,this.hash=new ex,this.reset()}return e.prototype.update=function(t){if(!(dm(t)||this.error))try{this.hash.update(ic(t))}catch(r){this.error=r}},e.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()},e.prototype.digest=function(){return EM(this,void 0,void 0,function(){return IM(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new ex,this.secret){this.outer=new ex;var t=w6e(this.secret),r=new Uint8Array(ys);r.set(t);for(var o=0;o<ys;o++)t[o]^=54,r[o]^=92;this.hash.update(t),this.outer.update(r);for(var o=0;o<t.byteLength;o++)t[o]=0}},e})();function w6e(e){var t=ic(e);if(t.byteLength>ys){var r=new ex;r.update(t),t=r.digest()}var o=new Uint8Array(ys);return o.set(t),o}var JK=(function(){function e(t){XK(Jl())?this.hash=new b6e(t):this.hash=new C6e(t)}return e.prototype.update=function(t,r){this.hash.update(ic(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();const eY=({serviceId:e,clientVersion:t})=>async r=>{const o=typeof window<"u"?window.navigator:void 0,i=o?.userAgent??"",s=o?.userAgentData?.platform??Dz.os(i)??"other",a=void 0,l=o?.userAgentData?.brands??[],c=l[l.length-1],u=c?.brand??Dz.browser(i)??"unknown",d=c?.version??"unknown",f=[["aws-sdk-js",t],["ua","2.1"],[`os/${s}`,a],["lang/js"],["md/browser",`${u}_${d}`]];e&&f.push([`api/${e}`,t]);const p=await r?.userAgentAppId?.();return p&&f.push([`app/${p}`]),f},Dz={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}};class Nh{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let o=7,i=Math.abs(Math.round(t));o>-1&&i>0;o--,i/=256)r[o]=i;return t<0&&_z(r),new Nh(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&_z(t),parseInt(Ci(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function _z(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class T6e{toUtf8;fromUtf8;constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){const r=[];for(const s of Object.keys(t)){const a=this.fromUtf8(s);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(t[s]))}const o=new Uint8Array(r.reduce((s,a)=>s+a.byteLength,0));let i=0;for(const s of r)o.set(s,i),i+=s.byteLength;return o}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const o=new DataView(new ArrayBuffer(5));return o.setUint8(0,4),o.setInt32(1,t.value,!1),new Uint8Array(o.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+t.value.byteLength));s.setUint8(0,6),s.setUint16(1,t.value.byteLength,!1);const a=new Uint8Array(s.buffer);return a.set(t.value,3),a;case"string":const l=this.fromUtf8(t.value),c=new DataView(new ArrayBuffer(3+l.byteLength));c.setUint8(0,7),c.setUint16(1,l.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(l,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(Nh.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!D6e.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(WW(t.value.replace(/\-/g,"")),1),f}}parse(t){const r={};let o=0;for(;o<t.byteLength;){const i=t.getUint8(o++),s=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+o,i));switch(o+=i,t.getUint8(o++)){case 0:r[s]={type:Fz,value:!0};break;case 1:r[s]={type:Fz,value:!1};break;case 2:r[s]={type:O6e,value:t.getInt8(o++)};break;case 3:r[s]={type:P6e,value:t.getInt16(o,!1)},o+=2;break;case 4:r[s]={type:E6e,value:t.getInt32(o,!1)},o+=4;break;case 5:r[s]={type:I6e,value:new Nh(new Uint8Array(t.buffer,t.byteOffset+o,8))},o+=8;break;case 6:const a=t.getUint16(o,!1);o+=2,r[s]={type:k6e,value:new Uint8Array(t.buffer,t.byteOffset+o,a)},o+=a;break;case 7:const l=t.getUint16(o,!1);o+=2,r[s]={type:R6e,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+o,l))},o+=l;break;case 8:r[s]={type:M6e,value:new Date(new Nh(new Uint8Array(t.buffer,t.byteOffset+o,8)).valueOf())},o+=8;break;case 9:const c=new Uint8Array(t.buffer,t.byteOffset+o,16);o+=16,r[s]={type:A6e,value:`${Ci(c.subarray(0,4))}-${Ci(c.subarray(4,6))}-${Ci(c.subarray(6,8))}-${Ci(c.subarray(8,10))}-${Ci(c.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var Nz;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(Nz||(Nz={}));const Fz="boolean",O6e="byte",P6e="short",E6e="integer",I6e="long",k6e="binary",R6e="string",M6e="timestamp",A6e="uuid",D6e=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,tY=4,Fl=tY*2,zc=4,_6e=Fl+zc*2;function N6e({byteLength:e,byteOffset:t,buffer:r}){if(e<_6e)throw new Error("Provided message too short to accommodate event stream message overhead");const o=new DataView(r,t,e),i=o.getUint32(0,!1);if(e!==i)throw new Error("Reported message length does not match received message length");const s=o.getUint32(tY,!1),a=o.getUint32(Fl,!1),l=o.getUint32(e-zc,!1),c=new a0().update(new Uint8Array(r,t,Fl));if(a!==c.digest())throw new Error(`The prelude checksum specified in the message (${a}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(r,t+Fl,e-(Fl+zc))),l!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${l}`);return{headers:new DataView(r,t+Fl+zc,s),body:new Uint8Array(r,t+Fl+zc+s,i-s-(Fl+zc+zc))}}class F6e{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,r){this.headerMarshaller=new T6e(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){const t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){const t=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){const o=this.headerMarshaller.format(t),i=o.byteLength+r.byteLength+16,s=new Uint8Array(i),a=new DataView(s.buffer,s.byteOffset,s.byteLength),l=new a0;return a.setUint32(0,i,!1),a.setUint32(4,o.byteLength,!1),a.setUint32(8,l.update(s.subarray(0,8)).digest(),!1),s.set(o,12),s.set(r,o.byteLength+12),a.setUint32(i-4,l.update(s.subarray(8,i-4)).digest(),!1),s}decode(t){const{headers:r,body:o}=N6e(t);return{headers:this.headerMarshaller.parse(r),body:o}}formatHeaders(t){return this.headerMarshaller.format(t)}}class L6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.decoder.decode(t)}}class $6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream)yield this.options.encoder.encode(t);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class j6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream){const r=await this.options.deserializer(t);r!==void 0&&(yield r)}}}class B6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.serializer(t)}}function V6e(e){let t=0,r=0,o=null,i=null;const s=l=>{if(typeof l!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+l);t=l,r=4,o=new Uint8Array(l),new DataView(o.buffer).setUint32(0,l,!1)},a=async function*(){const l=e[Symbol.asyncIterator]();for(;;){const{value:c,done:u}=await l.next();if(u){if(t)if(t===r)yield o;else throw new Error("Truncated event message received.");else return;return}const d=c.length;let f=0;for(;f<d;){if(!o){const h=d-f;i||(i=new Uint8Array(4));const b=Math.min(4-r,h);if(i.set(c.slice(f,f+b),r),r+=b,f+=b,r<4)break;s(new DataView(i.buffer).getUint32(0,!1)),i=null}const p=Math.min(t-r,d-f);o.set(c.slice(f,f+p),r),r+=p,f+=p,t&&t===r&&(yield o,o=null,t=0,r=0)}}};return{[Symbol.asyncIterator]:a}}function H6e(e,t){return async function(r){const{value:o}=r.headers[":message-type"];if(o==="error"){const i=new Error(r.headers[":error-message"].value||"UnknownError");throw i.name=r.headers[":error-code"].value,i}else if(o==="exception"){const i=r.headers[":exception-type"].value,s={[i]:r},a=await e(s);if(a.$unknown){const l=new Error(t(r.body));throw l.name=i,l}throw a[i]}else if(o==="event"){const i={[r.headers[":event-type"].value]:r},s=await e(i);return s.$unknown?void 0:s}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let z6e=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:t,utf8Decoder:r}){this.eventStreamCodec=new F6e(t,r),this.utfEncoder=t}deserialize(t,r){const o=V6e(t);return new j6e({messageStream:new L6e({inputStream:o,decoder:this.eventStreamCodec}),deserializer:H6e(r,this.utfEncoder)})}serialize(t,r){return new $6e({messageStream:new B6e({inputStream:t,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const q6e=e=>({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:r,value:o}=await t.read();if(r)return;yield o}}finally{t.releaseLock()}}}),U6e=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:o,value:i}=await t.next();if(o)return r.close();r.enqueue(i)}})};class G6e{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new z6e({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){const o=W6e(t)?q6e(t):t;return this.universalMarshaller.deserialize(o,r)}serialize(t,r){const o=this.universalMarshaller.serialize(t,r);return typeof ReadableStream=="function"?U6e(o):o}}const W6e=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,K6e=e=>new G6e(e);async function Y6e(e,t,r=1024*1024){const o=e.size;let i=0;for(;i<o;){const s=e.slice(i,Math.min(o,i+r));t(new Uint8Array(await s.arrayBuffer())),i+=s.size}}const Z6e=async function(t,r){const o=new t;return await Y6e(r,i=>{o.update(i)}),o.digest()},nY=e=>()=>Promise.reject(e),_l=64,X6e=16,Q6e=[1732584193,4023233417,2562383102,271733878];class J6e{state;buffer;bufferLength;bytesHashed;finished;constructor(){this.reset()}update(t){if(eGe(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=tGe(t);let o=0,{byteLength:i}=r;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,r[o++]),i--,this.bufferLength===_l&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:o,bytesHashed:i}=this,s=i*8;if(r.setUint8(this.bufferLength++,128),o%_l>=_l-8){for(let a=this.bufferLength;a<_l;a++)r.setUint8(a,0);this.hashBuffer(),this.bufferLength=0}for(let a=this.bufferLength;a<_l-8;a++)r.setUint8(a,0);r.setUint32(_l-8,s>>>0,!0),r.setUint32(_l-4,Math.floor(s/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(X6e));for(let r=0;r<4;r++)t.setUint32(r*4,this.state[r],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:r}=this;let o=r[0],i=r[1],s=r[2],a=r[3];o=Do(o,i,s,a,t.getUint32(0,!0),7,3614090360),a=Do(a,o,i,s,t.getUint32(4,!0),12,3905402710),s=Do(s,a,o,i,t.getUint32(8,!0),17,606105819),i=Do(i,s,a,o,t.getUint32(12,!0),22,3250441966),o=Do(o,i,s,a,t.getUint32(16,!0),7,4118548399),a=Do(a,o,i,s,t.getUint32(20,!0),12,1200080426),s=Do(s,a,o,i,t.getUint32(24,!0),17,2821735955),i=Do(i,s,a,o,t.getUint32(28,!0),22,4249261313),o=Do(o,i,s,a,t.getUint32(32,!0),7,1770035416),a=Do(a,o,i,s,t.getUint32(36,!0),12,2336552879),s=Do(s,a,o,i,t.getUint32(40,!0),17,4294925233),i=Do(i,s,a,o,t.getUint32(44,!0),22,2304563134),o=Do(o,i,s,a,t.getUint32(48,!0),7,1804603682),a=Do(a,o,i,s,t.getUint32(52,!0),12,4254626195),s=Do(s,a,o,i,t.getUint32(56,!0),17,2792965006),i=Do(i,s,a,o,t.getUint32(60,!0),22,1236535329),o=_o(o,i,s,a,t.getUint32(4,!0),5,4129170786),a=_o(a,o,i,s,t.getUint32(24,!0),9,3225465664),s=_o(s,a,o,i,t.getUint32(44,!0),14,643717713),i=_o(i,s,a,o,t.getUint32(0,!0),20,3921069994),o=_o(o,i,s,a,t.getUint32(20,!0),5,3593408605),a=_o(a,o,i,s,t.getUint32(40,!0),9,38016083),s=_o(s,a,o,i,t.getUint32(60,!0),14,3634488961),i=_o(i,s,a,o,t.getUint32(16,!0),20,3889429448),o=_o(o,i,s,a,t.getUint32(36,!0),5,568446438),a=_o(a,o,i,s,t.getUint32(56,!0),9,3275163606),s=_o(s,a,o,i,t.getUint32(12,!0),14,4107603335),i=_o(i,s,a,o,t.getUint32(32,!0),20,1163531501),o=_o(o,i,s,a,t.getUint32(52,!0),5,2850285829),a=_o(a,o,i,s,t.getUint32(8,!0),9,4243563512),s=_o(s,a,o,i,t.getUint32(28,!0),14,1735328473),i=_o(i,s,a,o,t.getUint32(48,!0),20,2368359562),o=No(o,i,s,a,t.getUint32(20,!0),4,4294588738),a=No(a,o,i,s,t.getUint32(32,!0),11,2272392833),s=No(s,a,o,i,t.getUint32(44,!0),16,1839030562),i=No(i,s,a,o,t.getUint32(56,!0),23,4259657740),o=No(o,i,s,a,t.getUint32(4,!0),4,2763975236),a=No(a,o,i,s,t.getUint32(16,!0),11,1272893353),s=No(s,a,o,i,t.getUint32(28,!0),16,4139469664),i=No(i,s,a,o,t.getUint32(40,!0),23,3200236656),o=No(o,i,s,a,t.getUint32(52,!0),4,681279174),a=No(a,o,i,s,t.getUint32(0,!0),11,3936430074),s=No(s,a,o,i,t.getUint32(12,!0),16,3572445317),i=No(i,s,a,o,t.getUint32(24,!0),23,76029189),o=No(o,i,s,a,t.getUint32(36,!0),4,3654602809),a=No(a,o,i,s,t.getUint32(48,!0),11,3873151461),s=No(s,a,o,i,t.getUint32(60,!0),16,530742520),i=No(i,s,a,o,t.getUint32(8,!0),23,3299628645),o=Fo(o,i,s,a,t.getUint32(0,!0),6,4096336452),a=Fo(a,o,i,s,t.getUint32(28,!0),10,1126891415),s=Fo(s,a,o,i,t.getUint32(56,!0),15,2878612391),i=Fo(i,s,a,o,t.getUint32(20,!0),21,4237533241),o=Fo(o,i,s,a,t.getUint32(48,!0),6,1700485571),a=Fo(a,o,i,s,t.getUint32(12,!0),10,2399980690),s=Fo(s,a,o,i,t.getUint32(40,!0),15,4293915773),i=Fo(i,s,a,o,t.getUint32(4,!0),21,2240044497),o=Fo(o,i,s,a,t.getUint32(32,!0),6,1873313359),a=Fo(a,o,i,s,t.getUint32(60,!0),10,4264355552),s=Fo(s,a,o,i,t.getUint32(24,!0),15,2734768916),i=Fo(i,s,a,o,t.getUint32(52,!0),21,1309151649),o=Fo(o,i,s,a,t.getUint32(16,!0),6,4149444226),a=Fo(a,o,i,s,t.getUint32(44,!0),10,3174756917),s=Fo(s,a,o,i,t.getUint32(8,!0),15,718787259),i=Fo(i,s,a,o,t.getUint32(36,!0),21,3951481745),r[0]=o+r[0]&4294967295,r[1]=i+r[1]&4294967295,r[2]=s+r[2]&4294967295,r[3]=a+r[3]&4294967295}reset(){this.state=Uint32Array.from(Q6e),this.buffer=new DataView(new ArrayBuffer(_l)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function BC(e,t,r,o,i,s){return t=(t+e&4294967295)+(o+s&4294967295)&4294967295,(t<<i|t>>>32-i)+r&4294967295}function Do(e,t,r,o,i,s,a){return BC(t&r|~t&o,e,t,i,s,a)}function _o(e,t,r,o,i,s,a){return BC(t&o|r&~o,e,t,i,s,a)}function No(e,t,r,o,i,s,a){return BC(t^r^o,e,t,i,s,a)}function Fo(e,t,r,o,i,s,a){return BC(r^(t|~o),e,t,i,s,a)}function eGe(e){return typeof e=="string"?e.length===0:e.byteLength===0}function tGe(e){return typeof e=="string"?cl(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const nGe=["in-region","cross-region","mobile","standard","legacy"],rY=({defaultsMode:e}={})=>iqe(async()=>{const t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(rGe()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${nGe.join(", ")}, got ${t}`)}}),rGe=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:r,downlink:o}=e?.connection;if(typeof t=="string"&&t!=="4g"||Number(r)>100||Number(o)<10)return!0}return e?.userAgentData?.mobile||typeof e?.maxTouchPoints=="number"&&e?.maxTouchPoints>1},oGe=e=>({apiVersion:"2006-03-01",base64Decoder:e?.base64Decoder??Tu,base64Encoder:e?.base64Encoder??oc,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??PK,extensions:e?.extensions??[],getAwsChunkedEncodingStream:e?.getAwsChunkedEncodingStream??tze,httpAuthSchemeProvider:e?.httpAuthSchemeProvider??G4e,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new vM},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new FHe}],logger:e?.logger??new kC,protocol:e?.protocol??Gqe,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:Y9e,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:e?.sdkStreamMixin??KW,serviceId:e?.serviceId??"S3",signerConstructor:e?.signerConstructor??cK,signingEscapePath:e?.signingEscapePath??!1,urlParser:e?.urlParser??hm,useArnRegion:e?.useArnRegion??void 0,utf8Decoder:e?.utf8Decoder??cl,utf8Encoder:e?.utf8Encoder??zu}),iGe=e=>{const t=rY(e),r=()=>t().then(g7),o=oGe(e);return{...o,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??h7,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??eY({serviceId:o.serviceId,clientVersion:a6e.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??K6e,maxAttempts:e?.maxAttempts??mm,md5:e?.md5??J6e,region:e?.region??nY("Region is missing"),requestHandler:wC.create(e?.requestHandler??r),retryMode:e?.retryMode??(async()=>(await r()).retryMode||rK),sha1:e?.sha1??m6e,sha256:e?.sha256??JK,streamCollector:e?.streamCollector??xM,streamHasher:e?.streamHasher??Z6e,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(K7)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Y7))}},oY=e=>({setRegion(t){e.region=t},region(){return e.region}}),iY=e=>({region:e.region()}),sGe=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(i){const s=t.findIndex(a=>a.schemeId===i.schemeId);s===-1?t.push(i):t.splice(s,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){r=i},httpAuthSchemeProvider(){return r},setCredentials(i){o=i},credentials(){return o}}},aGe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),lGe=(e,t)=>{const r=Object.assign(oY(e),b7(e),jW(e),sGe(e));return t.forEach(o=>o.configure(r)),Object.assign(e,iY(r),y7(r),BW(r),aGe(r))};class cGe extends m7{config;constructor(...[t]){const r=iGe(t||{});super(r),this.initConfig=r;const o=K4e(r),i=D7(o),s=v3e(i),a=aK(s),l=X7(a),c=l,u=nK(c),d=q5e(u),f=W4e(d),p=Y3e(f,{session:[()=>this,i6e]}),h=lGe(p,t?.extensions||[]);this.config=h,this.middlewareStack.use(ZW(this.config)),this.middlewareStack.use(W7(this.config)),this.middlewareStack.use(lK(this.config)),this.middlewareStack.use(Q7(this.config)),this.middlewareStack.use(k7(this.config)),this.middlewareStack.use(R7(this.config)),this.middlewareStack.use(M7(this.config)),this.middlewareStack.use(HW(this.config,{httpAuthSchemeParametersProvider:z4e,identityProviderConfigProvider:async b=>new r7({"aws.auth#sigv4":b.credentials,"aws.auth#sigv4a":b.credentials})})),this.middlewareStack.use(qW(this.config)),this.middlewareStack.use(s5e(this.config)),this.middlewareStack.use(MHe(this.config)),this.middlewareStack.use(F3e(this.config)),this.middlewareStack.use(z3e(this.config)),this.middlewareStack.use(K3e(this.config))}destroy(){super.destroy()}}function uGe(e){return t=>async r=>{const o={...r.input},i=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const s of i){const a=o[s.target];if(a){let l;typeof a=="string"?pGe(a,e)?l=e.base64Decoder(a):(l=e.utf8Decoder(a),o[s.target]=e.base64Encoder(l)):(l=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a),o[s.target]=e.base64Encoder(l));const c=new e.md5;c.update(l),o[s.hash]=e.base64Encoder(await c.digest())}}return t({...r,input:o})}}const dGe={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},fGe=e=>({applyToStack:t=>{t.add(uGe(e),dGe)}});function pGe(e,t){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))return!1;try{return t.base64Decoder(e).length===32}catch{return!1}}class hGe extends IC.classBuilder().ep({...kK,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(t,r,o,i){return[DM(o,t.getEndpointParameterInstructions()),y3e(o,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),M3e(),A7(o),fGe(o)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(o6e).build(){}function sY(e){return Promise.all(Object.keys(e).reduce((t,r)=>{const o=e[r];return typeof o=="string"?t.push([r,o]):t.push(o().then(i=>[r,i])),t},[])).then(t=>t.reduce((r,[o,i])=>(r[o]=i,r),{}))}function mGe(e){return async t=>{e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:r,CognitoIdentityClient:o}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-D_07qOSj.js")),i=u=>e.clientConfig?.[u]??e.parentClientConfig?.[u]??t?.callerClientConfig?.[u],{Credentials:{AccessKeyId:s=gGe(e.logger),Expiration:a,SecretKey:l=yGe(e.logger),SessionToken:c}=bGe(e.logger)}=await(e.client??new o(Object.assign({},e.clientConfig??{},{region:i("region"),profile:i("profile"),userAgentAppId:i("userAgentAppId")}))).send(new r({CustomRoleArn:e.customRoleArn,IdentityId:e.identityId,Logins:e.logins?await sY(e.logins):void 0}));return{identityId:e.identityId,accessKeyId:s,secretAccessKey:l,sessionToken:c,expiration:a}}}function gGe(e){throw new fp("Response from Amazon Cognito contained no access key ID",{logger:e})}function bGe(e){throw new fp("Response from Amazon Cognito contained no credentials",{logger:e})}function yGe(e){throw new fp("Response from Amazon Cognito contained no secret key",{logger:e})}const T1="IdentityIds";class vGe{dbName;constructor(t="aws:cognito-identity-ids"){this.dbName=t}getItem(t){return this.withObjectStore("readonly",r=>{const o=r.get(t);return new Promise(i=>{o.onerror=()=>i(null),o.onsuccess=()=>i(o.result?o.result.value:null)})}).catch(()=>null)}removeItem(t){return this.withObjectStore("readwrite",r=>{const o=r.delete(t);return new Promise((i,s)=>{o.onerror=()=>s(o.error),o.onsuccess=()=>i()})})}setItem(t,r){return this.withObjectStore("readwrite",o=>{const i=o.put({id:t,value:r});return new Promise((s,a)=>{i.onerror=()=>a(i.error),i.onsuccess=()=>s()})})}getDb(){const t=self.indexedDB.open(this.dbName,1);return new Promise((r,o)=>{t.onsuccess=()=>{r(t.result)},t.onerror=()=>{o(t.error)},t.onblocked=()=>{o(new Error("Unable to access DB"))},t.onupgradeneeded=()=>{const i=t.result;i.onerror=()=>{o(new Error("Failed to create object store"))},i.createObjectStore(T1,{keyPath:"id"})}})}withObjectStore(t,r){return this.getDb().then(o=>{const i=o.transaction(T1,t);return i.oncomplete=()=>o.close(),new Promise((s,a)=>{i.onerror=()=>a(i.error),s(r(i.objectStore(T1)))}).catch(s=>{throw o.close(),s})})}}class xGe{store;constructor(t={}){this.store=t}getItem(t){return t in this.store?this.store[t]:null}removeItem(t){delete this.store[t]}setItem(t,r){this.store[t]=r}}const SGe=new xGe;function CGe(){return typeof self=="object"&&self.indexedDB?new vGe:typeof window=="object"&&window.localStorage?window.localStorage:SGe}function wGe({accountId:e,cache:t=CGe(),client:r,clientConfig:o,customRoleArn:i,identityPoolId:s,logins:a,userIdentifier:l=!a||Object.keys(a).length===0?"ANONYMOUS":void 0,logger:c,parentClientConfig:u}){c?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const d=l?`aws:cognito-identity-credentials:${s}:${l}`:void 0;let f=async p=>{const{GetIdCommand:h,CognitoIdentityClient:b}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-D_07qOSj.js")),g=C=>o?.[C]??u?.[C]??p?.callerClientConfig?.[C],y=r??new b(Object.assign({},o??{},{region:g("region"),profile:g("profile"),userAgentAppId:g("userAgentAppId")}));let v=d&&await t.getItem(d);if(!v){const{IdentityId:C=TGe(c)}=await y.send(new h({AccountId:e,IdentityPoolId:s,Logins:a?await sY(a):void 0}));v=C,d&&Promise.resolve(t.setItem(d,v)).catch(()=>{})}return f=mGe({client:y,customRoleArn:i,logins:a,identityId:v}),f(p)};return p=>f(p).catch(async h=>{throw d&&Promise.resolve(t.removeItem(d)).catch(()=>{}),h})}function TGe(e){throw new fp("Response from Amazon Cognito contained no identity ID",{logger:e})}const OGe=e=>wGe({...e});function PGe(e){const t=e.split(","),r=t[0].match(/:(.*?);/)[1],o=atob(t[1]);let i=o.length;const s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new Blob([s],{type:r})}async function EGe(e,t,r,o,i,s=""){if(!i||!r||!o)return console.warn("Missing AWS Config (Pool ID, Bucket, or Region). Returning data URL as fallback."),e;try{const a=new cGe({region:o,credentials:OGe({clientConfig:{region:o},identityPoolId:i}),requestChecksumCalculation:"WHEN_REQUIRED",forcePathStyle:!0}),l=PGe(e);let c=s.trim();c&&!c.endsWith("/")&&(c+="/");const u=c?`${c}${t}`:`signatures/${t}`,d=new hGe({Bucket:r,Key:u,Body:l,ContentType:l.type});return await a.send(d),`https://${r}/${u}`}catch(a){throw console.error("Error uploading to S3:",a),a}}function IGe({attributes:e={},rules:t={},onChange:r}){const{id:o="",MuiAttributes:i={},label:s="Signature",bucket:a="",region:l="",identityPoolId:c="",path:u="",disabled:d=!1,CanvasProps:f={}}=e,p=Ue.useRef(null),h=Ue.useRef(null),[b,g]=Ue.useState(!1),[y,v]=Ue.useState(e.value||null),[C,O]=Ue.useState(400),[T,P]=Ue.useState(!1),k=t?.validation?.some(A=>A.rule==="mandatory")||!1,M=f?.style?.height||150;Ue.useEffect(()=>{const A=h.current;if(!A)return;const F=new ResizeObserver(I=>{const N=I[0]?.contentRect?.width;N&&N>0&&O(Math.floor(N))});return F.observe(A),()=>F.disconnect()},[]),Ue.useEffect(()=>{e.value&&p.current&&p.current.fromDataURL(e.value,{width:C,height:M})},[e.value,C,M]);const _=()=>{p.current&&p.current.clear(),v(null),P(!1),r&&r({id:o,value:""})},D=async()=>{if(!p.current||p.current.isEmpty())return;g(!0);const A=p.current.getTrimmedCanvas().toDataURL("image/png"),F=`${o}-${Date.now()}.png`;try{const I=await EGe(A,F,a,l,c,u);v(I),P(!0),r&&r({id:o,value:I})}catch(I){console.error("Signature upload failed",I)}finally{g(!1)}};return w.jsxs(ht.Box,{sx:{width:"100%",...i.sx},children:[w.jsxs(ht.Typography,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[s,k&&w.jsx(ht.Box,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),w.jsx(ht.Box,{ref:h,sx:{border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",bgcolor:"background.paper"},children:w.jsx(CC,{ref:p,penColor:"black",canvasProps:{className:"sigCanvas",width:C,height:M,style:{display:"block",pointerEvents:d?"none":"auto",...f?.style,width:"100%",height:M}},backgroundColor:"transparent"})}),w.jsxs(ht.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1,alignItems:"center",mt:1},children:[w.jsx(ht.Button,{variant:"outlined",color:"secondary",onClick:_,size:"small",disabled:d||b,children:"Clear"}),w.jsx(ht.Button,{variant:"contained",color:"primary",onClick:D,size:"small",disabled:d||b||y!==null,startIcon:b?w.jsx(ht.CircularProgress,{size:16,color:"inherit"}):null,children:y?"Saved":"Save"}),T&&y&&w.jsx(ht.Typography,{variant:"caption",color:"success.main",children:"Signature Saved!"})]})]})}function kGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},label:i="Group",subFields:s=[]}=e,a=Ue.useMemo(()=>SC(),[]);return w.jsxs(ht.Paper,{elevation:1,sx:{p:2,mb:2,...o.sx},...o,children:[w.jsx(ht.Typography,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:600},children:i}),w.jsx(ht.Box,{children:w.jsx(pp,{guid:a,data:s,patch:t,onChange:r})})]})}function RGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},label:i="Accordion",subFields:s=[]}=e,a=Ue.useMemo(()=>SC(),[]);return w.jsxs(ht.Accordion,{...o,children:[w.jsx(ht.AccordionSummary,{expandIcon:w.jsx(ht.Icon,{children:"expand_more"}),children:w.jsx(ht.Typography,{children:i})}),w.jsx(ht.AccordionDetails,{children:w.jsx(pp,{guid:a,data:s,patch:t,onChange:r})})]})}function MGe(e){const{children:t,value:r,index:o,...i}=e;return w.jsx("div",{role:"tabpanel",hidden:r!==o,id:`simple-tabpanel-${o}`,"aria-labelledby":`simple-tab-${o}`,...i,children:r===o&&w.jsx(ht.Box,{sx:{p:3},children:t})})}function AGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},tabs:i=[]}=e,[s,a]=Ue.useState(0),l=Ue.useMemo(()=>i.map(()=>SC()),[i.length]),c=(u,d)=>{a(d)};return w.jsxs(ht.Box,{sx:{width:"100%"},children:[w.jsx(ht.Box,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsx(ht.Tabs,{value:s,onChange:c,...o,children:i.map((u,d)=>w.jsx(ht.Tab,{label:u.label},d))})}),i.map((u,d)=>w.jsx(MGe,{value:s,index:d,children:w.jsx(pp,{guid:l[d],data:u.subFields||[],patch:t,onChange:r})},d))]})}function DGe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},id:i="",options:s=[],label:a="Combo Box"}=e,[l,c]=Ue.useState(e.value||null),[u,d]=Ue.useState(!1),[f,p]=Ue.useState("");Ue.useEffect(()=>{e.value&&c(e.value)},[]),oa(()=>{c(e.value)},[e.value]);const h=v=>{let C=!0,O="";if(t?.validation){for(const T of t.validation)if(T.rule==="mandatory"&&!v){C=!1,O=T.message||"Required";break}}return{isValid:C,message:O}},b=(v,C)=>{c(C);const O=h(C);d(!O.isValid),p(O.message),r&&r({id:i,value:C})},g=()=>{const v=h(l);d(!v.isValid),p(v.message)},y=t?.validation?.some(v=>v.rule==="mandatory")||!1;return w.jsx(hS,{disablePortal:!0,id:i,options:s,value:l,onChange:b,fullWidth:!0,renderInput:v=>w.jsx(dl,{...v,label:a,required:y,error:u,helperText:f,onBlur:g}),...o})}function _Ge(e){return Je("MuiImageList",e)}Ze("MuiImageList",["root","masonry","quilted","standard","woven"]);const oA=S.createContext({});process.env.NODE_ENV!=="production"&&(oA.displayName="ImageListContext");const NGe=e=>{const{classes:t,variant:r}=e;return Ie({root:["root",r]},_Ge,t)},FGe=ie("ul",{name:"MuiImageList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant]]}})({display:"grid",overflowY:"auto",listStyle:"none",padding:0,WebkitOverflowScrolling:"touch",variants:[{props:{variant:"masonry"},style:{display:"block"}}]}),aY=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiImageList"}),{children:i,className:s,cols:a=2,component:l="ul",rowHeight:c="auto",gap:u=4,style:d,variant:f="standard",...p}=o,h=S.useMemo(()=>({rowHeight:c,gap:u,variant:f}),[c,u,f]),b=f==="masonry"?{columnCount:a,columnGap:u,...d}:{gridTemplateColumns:`repeat(${a}, 1fr)`,gap:u,...d},g={...o,component:l,gap:u,rowHeight:c,variant:f},y=NGe(g);return w.jsx(FGe,{as:l,className:Te(y.root,y[f],s),ref:r,style:b,ownerState:g,...p,children:w.jsx(oA.Provider,{value:h,children:i})})});process.env.NODE_ENV!=="production"&&(aY.propTypes={children:n.node.isRequired,classes:n.object,className:n.string,cols:el,component:n.elementType,gap:n.number,rowHeight:n.oneOfType([n.oneOf(["auto"]),n.number]),style:n.object,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object]),variant:n.oneOfType([n.oneOf(["masonry","quilted","standard","woven"]),n.string])});function LGe(e){return Je("MuiImageListItem",e)}const O1=Ze("MuiImageListItem",["root","img","standard","woven","masonry","quilted"]),$Ge=e=>{const{classes:t,variant:r}=e;return Ie({root:["root",r],img:["img"]},LGe,t)},jGe=ie("li",{name:"MuiImageListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${O1.img}`]:t.img},t.root,t[r.variant]]}})({display:"block",position:"relative",[`& .${O1.img}`]:{objectFit:"cover",width:"100%",height:"100%",display:"block"},variants:[{props:{variant:"standard"},style:{display:"flex",flexDirection:"column"}},{props:{variant:"woven"},style:{height:"100%",alignSelf:"center","&:nth-of-type(even)":{height:"70%"}}},{props:{variant:"standard"},style:{[`& .${O1.img}`]:{height:"auto",flexGrow:1}}}]}),lY=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiImageListItem"}),{children:i,className:s,cols:a=1,component:l="li",rows:c=1,style:u,...d}=o,{rowHeight:f="auto",gap:p,variant:h}=S.useContext(oA);let b="auto";h==="woven"?b=void 0:f!=="auto"&&(b=f*c+p*(c-1));const g={...o,cols:a,component:l,gap:p,rowHeight:f,rows:c,variant:h},y=$Ge(g);return w.jsx(jGe,{as:l,className:Te(y.root,y[h],s),ref:r,style:{height:b,gridColumnEnd:h!=="masonry"?`span ${a}`:void 0,gridRowEnd:h!=="masonry"?`span ${c}`:void 0,marginBottom:h==="masonry"?p:void 0,breakInside:h==="masonry"?"avoid":void 0,...u},ownerState:g,...d,children:S.Children.map(i,v=>S.isValidElement(v)?(process.env.NODE_ENV!=="production"&&Tm.isFragment(v)&&console.error(["MUI: The ImageListItem component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
464
+ `+i)});const r=await this.createSessionFn(t);if(!r.Credentials?.AccessKeyId||!r.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretAccessKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration?new Date(r.Credentials.Expiration):void 0}}}const L3e="Directory",$3e="S3Express",j3e="sigv4-s3express",nE="X-Amz-S3session-Token",rE=nE.toLowerCase();class B3e extends UP{async signWithCredentials(t,r,o){const i=rH(r);t.headers[rE]=r.sessionToken;const s=this;return oH(s,i),s.signRequest(t,o??{})}async presignWithCredentials(t,r,o){const i=rH(r);return delete t.headers[rE],t.headers[nE]=r.sessionToken,t.query=t.query??{},t.query[nE]=r.sessionToken,oH(this,i),this.presign(t,o)}}function rH(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function oH(e,t){const r=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),o=e.credentialProvider,i=()=>(clearTimeout(r),e.credentialProvider=o,Promise.resolve(t));e.credentialProvider=i}const V3e=e=>(t,r)=>async o=>{if(r.endpointV2){const i=r.endpointV2,s=i.properties?.authSchemes?.[0]?.name===j3e;if((i.properties?.backend===$3e||i.properties?.bucketType===L3e)&&(Gr(r,"S3_EXPRESS_BUCKET","J"),r.isS3ExpressBucket=!0),s){const l=o.input.Bucket;if(l){const c=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:l});r.s3ExpressIdentity=c,Br.isInstance(o.request)&&c.sessionToken&&(o.request.headers[rE]=c.sessionToken)}}}return t(o)},H3e={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},z3e=e=>({applyToStack:t=>{t.add(V3e(e),H3e)}}),q3e=async(e,t,r,o)=>{const i=await o.signWithCredentials(r,e,{});if(i.headers["X-Amz-Security-Token"]||i.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return i},U3e=e=>t=>{throw t},G3e=(e,t)=>{},W3e=e=>(t,r)=>async o=>{if(!Br.isInstance(o.request))return t(o);const s=gl(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:l,signer:c}=s;let u;r.s3ExpressIdentity?u=await q3e(r.s3ExpressIdentity,a,o.request,await e.signer()):u=await c.sign(o.request,l,a);const d=await t({...o,request:u}).catch((c.errorHandler||U3e)(a));return(c.successHandler||G3e)(d.response,a),d},K3e=e=>({applyToStack:t=>{t.addRelativeTo(W3e(e),zW)}}),Y3e=(e,{session:t})=>{const[r,o]=t,{forcePathStyle:i,useAccelerateEndpoint:s,disableMultiregionAccessPoints:a,followRegionRedirects:l,s3ExpressIdentityProvider:c,bucketEndpoint:u,expectContinueHeader:d}=e;return Object.assign(e,{forcePathStyle:i??!1,useAccelerateEndpoint:s??!1,disableMultiregionAccessPoints:a??!1,followRegionRedirects:l??!1,s3ExpressIdentityProvider:c??new RM(async f=>r().send(new o({Bucket:f}))),bucketEndpoint:u??!1,expectContinueHeader:d??2097152})},Z3e={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},X3e=3e3,Q3e=e=>(t,r)=>async o=>{const i=await t(o),{response:s}=i;if(!wu.isInstance(s))return i;const{statusCode:a,body:l}=s;if(a<200||a>=300||!(typeof l?.stream=="function"||typeof l?.pipe=="function"||typeof l?.tee=="function"))return i;let u=l,d=l;l&&typeof l=="object"&&!(l instanceof Uint8Array)&&([u,d]=await cze(l)),s.body=d;const f=await J3e(u,{streamCollector:async h=>nze(h,X3e)});typeof u?.destroy=="function"&&u.destroy();const p=e.utf8Encoder(f.subarray(f.length-16));if(f.length===0&&Z3e[r.commandName]){const h=new Error("S3 aborted request");throw h.name="InternalError",h}return p&&p.endsWith("</Error>")&&(s.statusCode=400),i},J3e=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),e5e={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},A7=e=>({applyToStack:t=>{t.addRelativeTo(Q3e(e),e5e)}}),t5e=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function n5e(e){return(t,r)=>async o=>{if(e.bucketEndpoint){const i=r.endpointV2;if(i){const s=o.input.Bucket;if(typeof s=="string")try{const a=new URL(s);r.endpointV2={...i,url:a}}catch(a){const l=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${s} could not be parsed as URL.`;throw r.logger?.constructor?.name==="NoOpLogger"?console.warn(l):r.logger?.warn?.(l),a}}}return t(o)}}const r5e={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function o5e({bucketEndpoint:e}){return t=>async r=>{const{input:{Bucket:o}}=r;if(!e&&typeof o=="string"&&!t5e(o)&&o.indexOf("/")>=0){const i=new Error(`Bucket name shouldn't contain '/', received '${o}'`);throw i.name="InvalidBucketName",i}return t({...r})}}const i5e={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},s5e=e=>({applyToStack:t=>{t.add(o5e(e),i5e),t.addRelativeTo(n5e(e),r5e)}}),a5e=void 0;function l5e(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function D7(e){const t=hf(e.userAgentAppId??a5e),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{const o=await t();if(!l5e(o)){const i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof o!="string"?i?.warn("userAgentAppId must be a string or undefined."):o.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return o}})}class _7{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){this.capacity=t??50,r&&(this.parameters=r)}get(t,r){const o=this.hash(t);if(o===!1)return r();if(!this.data.has(o)){if(this.data.size>this.capacity+10){const i=this.data.keys();let s=0;for(;;){const{value:a,done:l}=i.next();if(this.data.delete(a),l||++s>10)break}}this.data.set(o,r())}return this.data.get(o)}size(){return this.data.size}hash(t){let r="";const{parameters:o}=this;if(o.length===0)return!1;for(const i of o){const s=String(t[i]??"");if(s.includes("|;"))return!1;r+=s+"|;"}return r}}const c5e=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}$"),MM=e=>c5e.test(e)||e.startsWith("[")&&e.endsWith("]"),u5e=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),pg=(e,t=!1)=>{if(!t)return u5e.test(e);const r=e.split(".");for(const o of r)if(!pg(o))return!1;return!0},fm={},pm="endpoints";function sc(e){return typeof e!="object"||e==null?e:"ref"in e?`$${sc(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(sc).join(", ")})`:JSON.stringify(e,null,2)}class Xi extends Error{constructor(t){super(t),this.name="EndpointError"}}const d5e=(e,t)=>e===t,f5e=e=>{const t=e.split("."),r=[];for(const o of t){const i=o.indexOf("[");if(i!==-1){if(o.indexOf("]")!==o.length-1)throw new Xi(`Path: '${e}' does not end with ']'`);const s=o.slice(i+1,-1);if(Number.isNaN(parseInt(s)))throw new Xi(`Invalid array index: '${s}' in path: '${e}'`);i!==0&&r.push(o.slice(0,i)),r.push(s)}else r.push(o)}return r},N7=(e,t)=>f5e(t).reduce((r,o)=>{if(typeof r!="object")throw new Xi(`Index '${o}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(r)?r[parseInt(o)]:r[o]},e),p5e=e=>e!=null,h5e=e=>!e,QO={[cm.HTTP]:80,[cm.HTTPS]:443},m5e=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:p,port:h,protocol:b="",path:g="",query:y={}}=e,v=new URL(`${b}//${p}${h?`:${h}`:""}${g}`);return v.search=Object.entries(y).map(([C,O])=>`${C}=${O}`).join("&"),v}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const r=t.href,{host:o,hostname:i,pathname:s,protocol:a,search:l}=t;if(l)return null;const c=a.slice(0,-1);if(!Object.values(cm).includes(c))return null;const u=MM(i),d=r.includes(`${o}:${QO[c]}`)||typeof e=="string"&&e.includes(`${o}:${QO[c]}`),f=`${o}${d?`:${QO[c]}`:""}`;return{scheme:c,authority:f,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:u}},g5e=(e,t)=>e===t,b5e=(e,t,r,o)=>t>=r||e.length<r?null:o?e.substring(e.length-r,e.length-t):e.substring(t,r),y5e=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),v5e={booleanEquals:d5e,getAttr:N7,isSet:p5e,isValidHostLabel:pg,not:h5e,parseURL:m5e,stringEquals:g5e,substring:b5e,uriEncode:y5e},F7=(e,t)=>{const r=[],o={...t.endpointParams,...t.referenceRecord};let i=0;for(;i<e.length;){const s=e.indexOf("{",i);if(s===-1){r.push(e.slice(i));break}r.push(e.slice(i,s));const a=e.indexOf("}",s);if(a===-1){r.push(e.slice(s));break}e[s+1]==="{"&&e[a+1]==="}"&&(r.push(e.slice(s+1,a)),i=a+2);const l=e.substring(s+1,a);if(l.includes("#")){const[c,u]=l.split("#");r.push(N7(o[c],u))}else r.push(o[l]);i=a+1}return r.join("")},x5e=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],MC=(e,t,r)=>{if(typeof e=="string")return F7(e,r);if(e.fn)return $7.callFunction(e,r);if(e.ref)return x5e(e,r);throw new Xi(`'${t}': ${String(e)} is not a string, function or reference.`)},L7=({fn:e,argv:t},r)=>{const o=t.map(s=>["boolean","number"].includes(typeof s)?s:$7.evaluateExpression(s,"arg",r)),i=e.split(".");return i[0]in fm&&i[1]!=null?fm[i[0]][i[1]](...o):v5e[e](...o)},$7={evaluateExpression:MC,callFunction:L7},S5e=({assign:e,...t},r)=>{if(e&&e in r.referenceRecord)throw new Xi(`'${e}' is already defined in Reference Record.`);const o=L7(t,r);return r.logger?.debug?.(`${pm} evaluateCondition: ${sc(t)} = ${sc(o)}`),{result:o===""?!0:!!o,...e!=null&&{toAssign:{name:e,value:o}}}},AM=(e=[],t)=>{const r={};for(const o of e){const{result:i,toAssign:s}=S5e(o,{...t,referenceRecord:{...t.referenceRecord,...r}});if(!i)return{result:i};s&&(r[s.name]=s.value,t.logger?.debug?.(`${pm} assign: ${s.name} := ${sc(s.value)}`))}return{result:!0,referenceRecord:r}},C5e=(e,t)=>Object.entries(e).reduce((r,[o,i])=>({...r,[o]:i.map(s=>{const a=MC(s,"Header value entry",t);if(typeof a!="string")throw new Xi(`Header '${o}' value '${a}' is not a string`);return a})}),{}),j7=(e,t)=>Object.entries(e).reduce((r,[o,i])=>({...r,[o]:V7.getEndpointProperty(i,t)}),{}),B7=(e,t)=>{if(Array.isArray(e))return e.map(r=>B7(r,t));switch(typeof e){case"string":return F7(e,t);case"object":if(e===null)throw new Xi(`Unexpected endpoint property: ${e}`);return V7.getEndpointProperties(e,t);case"boolean":return e;default:throw new Xi(`Unexpected endpoint property type: ${typeof e}`)}},V7={getEndpointProperty:B7,getEndpointProperties:j7},w5e=(e,t)=>{const r=MC(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(o){throw console.error(`Failed to construct URL with ${r}`,o),o}throw new Xi(`Endpoint URL must be a string, got ${typeof r}`)},T5e=(e,t)=>{const{conditions:r,endpoint:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(!i)return;const a={...t,referenceRecord:{...t.referenceRecord,...s}},{url:l,properties:c,headers:u}=o;return t.logger?.debug?.(`${pm} Resolving endpoint from template: ${sc(o)}`),{...u!=null&&{headers:C5e(u,a)},...c!=null&&{properties:j7(c,a)},url:w5e(l,a)}},O5e=(e,t)=>{const{conditions:r,error:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(i)throw new Xi(MC(o,"Error",{...t,referenceRecord:{...t.referenceRecord,...s}}))},H7=(e,t)=>{for(const r of e)if(r.type==="endpoint"){const o=T5e(r,t);if(o)return o}else if(r.type==="error")O5e(r,t);else if(r.type==="tree"){const o=z7.evaluateTreeRule(r,t);if(o)return o}else throw new Xi(`Unknown endpoint rule: ${r}`);throw new Xi("Rules evaluation failed")},P5e=(e,t)=>{const{conditions:r,rules:o}=e,{result:i,referenceRecord:s}=AM(r,t);if(i)return z7.evaluateRules(o,{...t,referenceRecord:{...t.referenceRecord,...s}})},z7={evaluateRules:H7,evaluateTreeRule:P5e},q7=(e,t)=>{const{endpointParams:r,logger:o}=t,{parameters:i,rules:s}=e;t.logger?.debug?.(`${pm} Initial EndpointParams: ${sc(r)}`);const a=Object.entries(i).filter(([,u])=>u.default!=null).map(([u,d])=>[u,d.default]);if(a.length>0)for(const[u,d]of a)r[u]=r[u]??d;const l=Object.entries(i).filter(([,u])=>u.required).map(([u])=>u);for(const u of l)if(r[u]==null)throw new Xi(`Missing required parameter: '${u}'`);const c=H7(s,{endpointParams:r,logger:o,referenceRecord:{}});return t.logger?.debug?.(`${pm} Resolved endpoint: ${sc(c)}`),c},U7=(e,t=!1)=>{if(t){for(const r of e.split("."))if(!U7(r))return!1;return!0}return!(!pg(e)||e.length<3||e.length>63||e!==e.toLowerCase()||MM(e))},iH=":",E5e="/",I5e=e=>{const t=e.split(iH);if(t.length<6)return null;const[r,o,i,s,a,...l]=t;if(r!=="arn"||o===""||i===""||l.join(iH)==="")return null;const c=l.map(u=>u.split(E5e)).flat();return{partition:o,service:i,region:s,accountId:a,resourceId:c}},k5e=[{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)"}}}],R5e={partitions:k5e};let M5e=R5e;const A5e=e=>{const{partitions:t}=M5e;for(const o of t){const{regions:i,outputs:s}=o;for(const[a,l]of Object.entries(i))if(a===e)return{...s,...l}}for(const o of t){const{regionRegex:i,outputs:s}=o;if(new RegExp(i).test(e))return{...s}}const r=t.find(o=>o.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},G7={isVirtualHostableS3Bucket:U7,parseArn:I5e,partition:A5e};fm.aws=G7;function D5e(e){const t={};if(e=e.replace(/^\?/,""),e)for(const r of e.split("&")){let[o,i=null]=r.split("=");o=decodeURIComponent(o),i&&(i=decodeURIComponent(i)),o in t?Array.isArray(t[o])?t[o].push(i):t[o]=[t[o],i]:t[o]=i}return t}const hm=e=>{if(typeof e=="string")return hm(new URL(e));const{hostname:t,pathname:r,port:o,protocol:i,search:s}=e;let a;return s&&(a=D5e(s)),{hostname:t,port:o?parseInt(o):void 0,protocol:i,path:r,query:a}},_5e=/\d{12}\.ddb/;async function N5e(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Gr(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const s=await t.retryStrategy();typeof s.acquireInitialRetryToken=="function"?s.constructor?.name?.includes("Adaptive")?Gr(e,"RETRY_MODE_ADAPTIVE","F"):Gr(e,"RETRY_MODE_STANDARD","E"):Gr(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const s=e.endpointV2;switch(String(s?.url?.hostname).match(_5e)&&Gr(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":Gr(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Gr(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Gr(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const s=i;s.accountId&&Gr(e,"RESOLVED_ACCOUNT_ID","T");for(const[a,l]of Object.entries(s.$source??{}))Gr(e,a,l)}}const sH="user-agent",JO="x-amz-user-agent",aH=" ",e1="/",F5e=/[^!$%&'*+\-.^_`|~\w]/g,L5e=/[^!$%&'*+\-.^_`|~\w#]/g,lH="-",$5e=1024;function j5e(e){let t="";for(const r in e){const o=e[r];if(t.length+o.length+1<=$5e){t.length?t+=","+o:t+=o;continue}break}return t}const B5e=e=>(t,r)=>async o=>{const{request:i}=o;if(!Br.isInstance(i))return t(o);const{headers:s}=i,a=r?.userAgent?.map(Ev)||[],l=(await e.defaultUserAgentProvider()).map(Ev);await N5e(r,e,o);const c=r;l.push(`m/${j5e(Object.assign({},r.__smithy_context?.features,c.__aws_sdk_context?.features))}`);const u=e?.customUserAgent?.map(Ev)||[],d=await e.userAgentAppId();d&&l.push(Ev(["app",`${d}`]));const f=[].concat([...l,...a,...u]).join(aH),p=[...l.filter(h=>h.startsWith("aws-sdk-")),...u].join(aH);return e.runtime!=="browser"?(p&&(s[JO]=s[JO]?`${s[sH]} ${p}`:p),s[sH]=f):s[JO]=f,t({...o,request:i})},Ev=e=>{const t=e[0].split(e1).map(a=>a.replace(F5e,lH)).join(e1),r=e[1]?.replace(L5e,lH),o=t.indexOf(e1),i=t.substring(0,o);let s=t.substring(o+1);return i==="api"&&(s=s.toLowerCase()),[i,s,r].filter(a=>a&&a.length>0).reduce((a,l,c)=>{switch(c){case 0:return l;case 1:return`${a}/${l}`;default:return`${a}#${l}`}},"")},V5e={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},W7=e=>({applyToStack:t=>{t.add(B5e(e),V5e)}}),K7=!1,Y7=!1,cH=new Set,H5e=(e,t=pg)=>{if(!cH.has(e)&&!t(e))if(e==="*")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="${e}" is not a valid hostname component.`);else cH.add(e)},Z7=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),z5e=e=>Z7(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,X7=e=>{const{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const o=typeof t=="function"?await t():t,i=z5e(o);return H5e(i),i},useFipsEndpoint:async()=>{const o=typeof t=="string"?t:await t();return Z7(o)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},q5e=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)}),uH="content-length";function U5e(e){return t=>async r=>{const o=r.request;if(Br.isInstance(o)){const{body:i,headers:s}=o;if(i&&Object.keys(s).map(a=>a.toLowerCase()).indexOf(uH)===-1)try{const a=e(i);o.headers={...o.headers,[uH]:String(a)}}catch{}}return t({...r,request:o})}}const G5e={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Q7=e=>({applyToStack:t=>{t.add(U5e(e.bodyLengthChecker),G5e)}}),W5e=async e=>{const t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Q5e(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!X5e(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},K5e=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Y5e=/(\d+\.){3}\d+/,Z5e=/\.\./,X5e=e=>K5e.test(e)&&!Y5e.test(e)&&!Z5e.test(e),Q5e=e=>{const[t,r,o,,,i]=e.split(":"),s=t==="arn"&&e.split(":").length>=6,a=!!(s&&r&&o&&i);if(s&&!a)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return a},J5e=(e,t,r,o=!1)=>{const i=async()=>{let s;return o?s=r.clientContextParams?.[e]??r[e]??r[t]:s=r[e]??r[t],typeof s=="function"?s():s};return e==="credentialScope"||t==="CredentialScope"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.credentialScope??s?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.accountId??s?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const s=await i();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){const{protocol:a,hostname:l,port:c,path:u}=s;return`${a}//${l}${c?":"+c:""}${u}`}}return s}:i},J7=async e=>{},eK=e=>typeof e=="object"?"url"in e?hm(e.url):e:hm(e),e4e=async(e,t,r,o)=>{if(!r.isCustomEndpoint){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await J7(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(eK(a)),r.isCustomEndpoint=!0)}const i=await tK(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(i,o)},tK=async(e,t,r)=>{const o={},i=t?.getEndpointParameterInstructions?.()||{};for(const[s,a]of Object.entries(i))switch(a.type){case"staticContextParams":o[s]=a.value;break;case"contextParams":o[s]=e[a.name];break;case"clientContextParams":case"builtInParams":o[s]=await J5e(a.name,s,r,a.type!=="builtInParams")();break;case"operationContextParams":o[s]=a.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(o,r),String(r.serviceId).toLowerCase()==="s3"&&await W5e(o),o},t4e=({config:e,instructions:t})=>(r,o)=>async i=>{e.isCustomEndpoint&&eqe(o,"ENDPOINT_OVERRIDE","N");const s=await e4e(i.input,{getEndpointParameterInstructions(){return t}},{...e},o);o.endpointV2=s,o.authSchemes=s.properties?.authSchemes;const a=o.authSchemes?.[0];if(a){o.signing_region=a.signingRegion,o.signing_service=a.signingName;const c=gl(o)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return r({...i})},n4e={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:VHe.name},DM=(e,t)=>({applyToStack:r=>{r.addRelativeTo(t4e({config:e,instructions:t}),n4e)}}),nK=e=>{const t=e.tls??!0,{endpoint:r,useDualstackEndpoint:o,useFipsEndpoint:i}=e,s=r!=null?async()=>eK(await Rs(r)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:Rs(o??!1),useFipsEndpoint:Rs(i??!1)});let c;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=J7(e.serviceId)),c),l};var Vf;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(Vf||(Vf={}));const mm=3,rK=Vf.STANDARD,r4e=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],o4e=["TimeoutError","RequestTimeout","RequestTimeoutException"],i4e=[500,502,503,504],s4e=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],a4e=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],l4e=e=>e?.$retryable!==void 0,c4e=e=>e.$metadata?.clockSkewCorrected,u4e=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},oK=e=>e.$metadata?.httpStatusCode===429||r4e.includes(e.name)||e.$retryable?.throttling==!0,_M=(e,t=0)=>l4e(e)||c4e(e)||o4e.includes(e.name)||s4e.includes(e?.code||"")||a4e.includes(e?.code||"")||i4e.includes(e.$metadata?.httpStatusCode||0)||u4e(e)||e.cause!==void 0&&t<=10&&_M(e.cause,t+1),d4e=e=>{if(e.$metadata?.httpStatusCode!==void 0){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!_M(e)}return!1};class NM{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const r=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(o=>NM.setTimeoutFn(o,r))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const r=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=t}updateClientSendingRate(t){let r;if(this.updateMeasuredRate(),oK(t)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const o=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(o)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const o=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(o*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}const oE=100,iK=20*1e3,f4e=500,dH=500,p4e=5,h4e=10,m4e=1,g4e="amz-sdk-invocation-id",b4e="amz-sdk-request",y4e=()=>{let e=oE;return{computeNextBackoffDelay:o=>Math.floor(Math.min(iK,Math.random()*2**o*e)),setDelayBase:o=>{e=o}}},fH=({retryDelay:e,retryCount:t,retryCost:r})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(iK,e),getRetryCost:()=>r});class sK{maxAttempts;mode=Vf.STANDARD;capacity=dH;retryBackoffStrategy=y4e();maxAttemptsProvider;constructor(t){this.maxAttempts=t,this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return fH({retryDelay:oE,retryCount:0})}async refreshRetryTokenForRetry(t,r){const o=await this.getMaxAttempts();if(this.shouldRetry(t,r,o)){const i=r.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?f4e:oE);const s=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),a=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,s):s,l=this.getCapacityCost(i);return this.capacity-=l,fH({retryDelay:a,retryCount:t.getRetryCount()+1,retryCost:l})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max(dH,this.capacity+(t.getRetryCost()??m4e))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${mm}`),mm}}shouldRetry(t,r,o){return t.getRetryCount()+1<o&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(t){return t==="TRANSIENT"?h4e:p4e}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class v4e{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=Vf.ADAPTIVE;constructor(t,r){this.maxAttemptsProvider=t;const{rateLimiter:o}=r??{};this.rateLimiter=o??new NM,this.standardRetryStrategy=new sK(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(t,r)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}const x4e=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),aK=e=>{const{retryStrategy:t,retryMode:r,maxAttempts:o}=e,i=Rs(o??mm);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await Rs(r)()===Vf.ADAPTIVE?new v4e(i):new sK(i))})},S4e=e=>e?.body instanceof ReadableStream,C4e=e=>(t,r)=>async o=>{let i=await e.retryStrategy();const s=await e.maxAttempts();if(w4e(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),l=new Error,c=0,u=0;const{request:d}=o,f=Br.isInstance(d);for(f&&(d.headers[g4e]=OC());;)try{f&&(d.headers[b4e]=`attempt=${c+1}; max=${s}`);const{response:p,output:h}=await t(o);return i.recordSuccess(a),h.$metadata.attempts=c+1,h.$metadata.totalRetryDelay=u,{response:p,output:h}}catch(p){const h=T4e(p);if(l=x4e(p),f&&S4e(d))throw(r.logger instanceof kC?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,h)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=u,l}c=a.getRetryCount();const b=a.getRetryDelay();u+=b,await new Promise(g=>setTimeout(g,b))}}else return i=i,i?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,o)},w4e=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",T4e=e=>{const t={error:e,errorType:O4e(e)},r=E4e(e.$response);return r&&(t.retryAfterHint=r),t},O4e=e=>oK(e)?"THROTTLING":_M(e)?"TRANSIENT":d4e(e)?"SERVER_ERROR":"CLIENT_ERROR",P4e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},lK=e=>({applyToStack:t=>{t.add(C4e(e),P4e)}}),E4e=e=>{if(!wu.isInstance(e))return;const t=Object.keys(e.headers).find(s=>s.toLowerCase()==="retry-after");if(!t)return;const r=e.headers[t],o=Number(r);return Number.isNaN(o)?new Date(r):new Date(o*1e3)};class cK{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return"none"}constructor(t){this.sigv4Signer=new B3e(t),this.signerOptions=t}async sign(t,r={}){return r.signingRegion==="*"?this.getSigv4aSigner().sign(t,r):this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,o={}){if(o.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.signWithCredentials(t,r,o)}async presign(t,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);return this.sigv4Signer.presign(t,r)}async presignWithCredentials(t,r,o={}){if(o.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,o)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"):new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");return this.sigv4aSigner}}const FM="required",ue="type",Be="rules",be="conditions",ke="fn",Re="argv",Et="ref",tn="assign",dt="url",ft="properties",Ja="backend",go="authSchemes",Wr="disableDoubleEncoding",Kr="signingName",Eo="signingRegion",pt="headers",LM="signingRegionSet",I4e=6,k4e=!1,ua=!0,qi="isSet",jr="booleanEquals",xt="error",l0="aws.partition",wn="stringEquals",wr="getAttr",Or="name",Qn="substring",pH="bucketSuffix",$M="parseURL",Ye="endpoint",Ve="tree",c0="aws.isVirtualHostableS3Bucket",u0="{url#scheme}://{Bucket}.{url#authority}{url#path}",Ca="not",hH="accessPointSuffix",Jv="{url#scheme}://{url#authority}{url#path}",uK="hardwareType",dK="regionPrefix",mH="bucketAliasSuffix",iE="outpostId",qu="isValidHostLabel",jM="sigv4a",gm="s3-outposts",Hf="s3",fK="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",pK="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",gH="https://{Bucket}.s3.{partitionResult#dnsSuffix}",hK="aws.parseArn",mK="bucketArn",gK="arnType",d0="",BM="s3-object-lambda",bK="accesspoint",VM="accessPointName",bH="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",yH="mrapPartition",vH="outpostType",xH="arnPrefix",yK="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",SH="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",CH="https://s3.{partitionResult#dnsSuffix}",Fd={[FM]:!1,[ue]:"string"},Ld={[FM]:!0,default:!1,[ue]:"boolean"},Xp={[FM]:!1,[ue]:"boolean"},gs={[ke]:jr,[Re]:[{[Et]:"Accelerate"},!0]},rr={[ke]:jr,[Re]:[{[Et]:"UseFIPS"},!0]},Yn={[ke]:jr,[Re]:[{[Et]:"UseDualStack"},!0]},Lr={[ke]:qi,[Re]:[{[Et]:"Endpoint"}]},vK={[ke]:l0,[Re]:[{[Et]:"Region"}],[tn]:"partitionResult"},wH={[ke]:wn,[Re]:[{[ke]:wr,[Re]:[{[Et]:"partitionResult"},Or]},"aws-cn"]},Mh={[ke]:qi,[Re]:[{[Et]:"Bucket"}]},xn={[Et]:"Bucket"},TH={[be]:[gs],[xt]:"S3Express does not support S3 Accelerate.",[ue]:xt},OH={[be]:[Lr,{[ke]:$M,[Re]:[{[Et]:"Endpoint"}],[tn]:"url"}],[Be]:[{[be]:[{[ke]:qi,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"}]},{[ke]:jr,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"},!0]}],[Be]:[{[be]:[{[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]}],[Be]:[{[be]:[{[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"}],[Be]:[{[Ye]:{[dt]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:c0,[Re]:[xn,!1]}],[Be]:[{[Ye]:{[dt]:u0,[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve},{[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt}],[ue]:Ve},{[be]:[{[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]}],[Be]:[{[be]:[{[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"}],[Be]:[{[Ye]:{[dt]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:c0,[Re]:[xn,!1]}],[Be]:[{[Ye]:{[dt]:u0,[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],[ue]:Ve},{[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt}],[ue]:Ve},Xo={[ke]:$M,[Re]:[{[Et]:"Endpoint"}],[tn]:"url"},t1={[ke]:jr,[Re]:[{[ke]:wr,[Re]:[{[Et]:"url"},"isIp"]},!0]},xK={[Et]:"url"},SK={[ke]:"uriEncode",[Re]:[xn],[tn]:"uri_encoded_bucket"},ji={[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:"s3express",[Eo]:"{Region}"}]},qt={},CK={[ke]:c0,[Re]:[xn,!1]},PH={[xt]:"S3Express bucket name is not a valid virtual hostable name.",[ue]:xt},EH={[ke]:qi,[Re]:[{[Et]:"UseS3ExpressControlEndpoint"}]},IH={[ke]:jr,[Re]:[{[Et]:"UseS3ExpressControlEndpoint"},!0]},Qt={[ke]:Ca,[Re]:[Lr]},hn={[ke]:jr,[Re]:[{[Et]:"UseDualStack"},!1]},an={[ke]:jr,[Re]:[{[Et]:"UseFIPS"},!1]},Iv={[xt]:"Unrecognized S3Express bucket name format.",[ue]:xt},kH={[ke]:Ca,[Re]:[Mh]},RH={[Et]:uK},MH={[be]:[Qt],[xt]:"Expected a endpoint to be specified but no endpoint was found",[ue]:xt},kv={[go]:[{[Wr]:!0,[Or]:jM,[Kr]:gm,[LM]:["*"]},{[Wr]:!0,[Or]:"sigv4",[Kr]:gm,[Eo]:"{Region}"}]},n1={[ke]:jr,[Re]:[{[Et]:"ForcePathStyle"},!1]},R4e={[Et]:"ForcePathStyle"},Ur={[ke]:jr,[Re]:[{[Et]:"Accelerate"},!1]},to={[ke]:wn,[Re]:[{[Et]:"Region"},"aws-global"]},fo={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"us-east-1"}]},bn={[ke]:Ca,[Re]:[to]},po={[ke]:jr,[Re]:[{[Et]:"UseGlobalEndpoint"},!0]},AH={[dt]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{Region}"}]},[pt]:{}},Yr={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{Region}"}]},ho={[ke]:jr,[Re]:[{[Et]:"UseGlobalEndpoint"},!1]},DH={[dt]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},_H={[dt]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},NH={[dt]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},r1={[ke]:jr,[Re]:[{[ke]:wr,[Re]:[xK,"isIp"]},!1]},o1={[dt]:fK,[ft]:Yr,[pt]:{}},sE={[dt]:u0,[ft]:Yr,[pt]:{}},FH={[Ye]:sE,[ue]:Ye},i1={[dt]:pK,[ft]:Yr,[pt]:{}},LH={[dt]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},Rv={[xt]:"Invalid region: region was not a valid DNS name.",[ue]:xt},Ti={[Et]:mK},wK={[Et]:gK},s1={[ke]:wr,[Re]:[Ti,"service"]},HM={[Et]:VM},$H={[be]:[Yn],[xt]:"S3 Object Lambda does not support Dual-stack",[ue]:xt},jH={[be]:[gs],[xt]:"S3 Object Lambda does not support S3 Accelerate",[ue]:xt},BH={[be]:[{[ke]:qi,[Re]:[{[Et]:"DisableAccessPoints"}]},{[ke]:jr,[Re]:[{[Et]:"DisableAccessPoints"},!0]}],[xt]:"Access points are not supported for this operation",[ue]:xt},a1={[be]:[{[ke]:qi,[Re]:[{[Et]:"UseArnRegion"}]},{[ke]:jr,[Re]:[{[Et]:"UseArnRegion"},!1]},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},"{Region}"]}]}],[xt]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[ue]:xt},TK={[ke]:wr,[Re]:[{[Et]:"bucketPartition"},Or]},OK={[ke]:wr,[Re]:[Ti,"accountId"]},l1={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:BM,[Eo]:"{bucketArn#region}"}]},VH={[xt]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[ue]:xt},c1={[xt]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[ue]:xt},u1={[xt]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[ue]:xt},d1={[xt]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[ue]:xt},HH={[xt]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[ue]:xt},zH={[xt]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",[ue]:xt},Qp={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:Hf,[Eo]:"{bucketArn#region}"}]},qH={[go]:[{[Wr]:!0,[Or]:jM,[Kr]:gm,[LM]:["*"]},{[Wr]:!0,[Or]:"sigv4",[Kr]:gm,[Eo]:"{bucketArn#region}"}]},UH={[ke]:hK,[Re]:[xn]},GH={[dt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},WH={[dt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},KH={[dt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},f1={[dt]:yK,[ft]:Yr,[pt]:{}},YH={[dt]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:Yr,[pt]:{}},ZH={[Et]:"UseObjectLambdaEndpoint"},p1={[go]:[{[Wr]:!0,[Or]:"sigv4",[Kr]:BM,[Eo]:"{Region}"}]},XH={[dt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},QH={[dt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},JH={[dt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},h1={[dt]:Jv,[ft]:Yr,[pt]:{}},ez={[dt]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[ft]:Yr,[pt]:{}},m1=[{[Et]:"Region"}],M4e=[{[Et]:"Endpoint"}],A4e=[xn],g1=[gs],$d=[Lr,Xo],tz=[{[ke]:qi,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"}]},{[ke]:jr,[Re]:[{[Et]:"DisableS3ExpressSessionAuth"},!0]}],D4e=[SK],b1=[CK],hs=[vK],y1=[rr,Yn],Ah=[rr,hn],Dh=[an,Yn],_h=[an,hn],nz=[{[ke]:Qn,[Re]:[xn,6,14,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,14,16,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],da=[{[be]:[rr,Yn],[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:Ah,[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:Dh,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye},{[be]:_h,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:{}},[ue]:Ye}],rz=[{[ke]:Qn,[Re]:[xn,6,15,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,15,17,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],oz=[{[ke]:Qn,[Re]:[xn,6,19,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,19,21,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],iz=[{[ke]:Qn,[Re]:[xn,6,20,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,20,22,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],sz=[{[ke]:Qn,[Re]:[xn,6,26,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,26,28,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],fa=[{[be]:[rr,Yn],[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:Ah,[Ye]:{[dt]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:Dh,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye},{[be]:_h,[Ye]:{[dt]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[ft]:{[Ja]:"S3Express",[go]:[{[Wr]:!0,[Or]:"sigv4-s3express",[Kr]:"s3express",[Eo]:"{Region}"}]},[pt]:{}},[ue]:Ye}],az=[xn,0,7,!0],lz=[{[ke]:Qn,[Re]:[xn,7,15,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,15,17,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],cz=[{[ke]:Qn,[Re]:[xn,7,16,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,16,18,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],uz=[{[ke]:Qn,[Re]:[xn,7,20,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,20,22,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],dz=[{[ke]:Qn,[Re]:[xn,7,21,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,21,23,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],fz=[{[ke]:Qn,[Re]:[xn,7,27,!0],[tn]:"s3expressAvailabilityZoneId"},{[ke]:Qn,[Re]:[xn,27,29,!0],[tn]:"s3expressAvailabilityZoneDelim"},{[ke]:wn,[Re]:[{[Et]:"s3expressAvailabilityZoneDelim"},"--"]}],_4e=[Mh],pz=[{[ke]:qu,[Re]:[{[Et]:iE},!1]}],hz=[{[ke]:wn,[Re]:[{[Et]:dK},"beta"]}],N4e=["*"],mz=[{[ke]:qu,[Re]:[{[Et]:"Region"},!1]}],Dl=[{[ke]:wn,[Re]:[{[Et]:"Region"},"us-east-1"]}],v1=[{[ke]:wn,[Re]:[wK,bK]}],gz=[{[ke]:wr,[Re]:[Ti,"resourceId[1]"],[tn]:VM},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[HM,d0]}]}],F4e=[Ti,"resourceId[1]"],bz=[Yn],x1=[{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},d0]}]}],yz=[{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[{[ke]:wr,[Re]:[Ti,"resourceId[2]"]}]}]}],L4e=[Ti,"resourceId[2]"],S1=[{[ke]:l0,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]}],[tn]:"bucketPartition"}],vz=[{[ke]:wn,[Re]:[TK,{[ke]:wr,[Re]:[{[Et]:"partitionResult"},Or]}]}],C1=[{[ke]:qu,[Re]:[{[ke]:wr,[Re]:[Ti,"region"]},!0]}],w1=[{[ke]:qu,[Re]:[OK,!1]}],xz=[{[ke]:qu,[Re]:[HM,!1]}],Mv=[rr],Sz=[{[ke]:qu,[Re]:[{[Et]:"Region"},!0]}],$4e={parameters:{Bucket:Fd,Region:Fd,UseFIPS:Ld,UseDualStack:Ld,Endpoint:Fd,ForcePathStyle:Ld,Accelerate:Ld,UseGlobalEndpoint:Ld,UseObjectLambdaEndpoint:Xp,Key:Fd,Prefix:Fd,CopySource:Fd,DisableAccessPoints:Xp,DisableMultiRegionAccessPoints:Ld,UseArnRegion:Xp,UseS3ExpressControlEndpoint:Xp,DisableS3ExpressSessionAuth:Xp},[Be]:[{[be]:[{[ke]:qi,[Re]:m1}],[Be]:[{[be]:[gs,rr],error:"Accelerate cannot be used with FIPS",[ue]:xt},{[be]:[Yn,Lr],error:"Cannot set dual-stack in combination with a custom endpoint.",[ue]:xt},{[be]:[Lr,rr],error:"A custom endpoint cannot be combined with FIPS",[ue]:xt},{[be]:[Lr,gs],error:"A custom endpoint cannot be combined with S3 Accelerate",[ue]:xt},{[be]:[rr,vK,wH],error:"Partition does not support FIPS",[ue]:xt},{[be]:[Mh,{[ke]:Qn,[Re]:[xn,0,I4e,ua],[tn]:pH},{[ke]:wn,[Re]:[{[Et]:pH},"--x-s3"]}],[Be]:[TH,OH,{[be]:[EH,IH],[Be]:[{[be]:hs,[Be]:[{[be]:[SK,Qt],[Be]:[{[be]:y1,endpoint:{[dt]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:ji,[pt]:qt},[ue]:Ye}],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:b1,[Be]:[{[be]:hs,[Be]:[{[be]:tz,[Be]:[{[be]:nz,[Be]:da,[ue]:Ve},{[be]:rz,[Be]:da,[ue]:Ve},{[be]:oz,[Be]:da,[ue]:Ve},{[be]:iz,[Be]:da,[ue]:Ve},{[be]:sz,[Be]:da,[ue]:Ve},Iv],[ue]:Ve},{[be]:nz,[Be]:fa,[ue]:Ve},{[be]:rz,[Be]:fa,[ue]:Ve},{[be]:oz,[Be]:fa,[ue]:Ve},{[be]:iz,[Be]:fa,[ue]:Ve},{[be]:sz,[Be]:fa,[ue]:Ve},Iv],[ue]:Ve}],[ue]:Ve},PH],[ue]:Ve},{[be]:[Mh,{[ke]:Qn,[Re]:az,[tn]:hH},{[ke]:wn,[Re]:[{[Et]:hH},"--xa-s3"]}],[Be]:[TH,OH,{[be]:b1,[Be]:[{[be]:hs,[Be]:[{[be]:tz,[Be]:[{[be]:lz,[Be]:da,[ue]:Ve},{[be]:cz,[Be]:da,[ue]:Ve},{[be]:uz,[Be]:da,[ue]:Ve},{[be]:dz,[Be]:da,[ue]:Ve},{[be]:fz,[Be]:da,[ue]:Ve},Iv],[ue]:Ve},{[be]:lz,[Be]:fa,[ue]:Ve},{[be]:cz,[Be]:fa,[ue]:Ve},{[be]:uz,[Be]:fa,[ue]:Ve},{[be]:dz,[Be]:fa,[ue]:Ve},{[be]:fz,[Be]:fa,[ue]:Ve},Iv],[ue]:Ve}],[ue]:Ve},PH],[ue]:Ve},{[be]:[kH,EH,IH],[Be]:[{[be]:hs,[Be]:[{[be]:$d,endpoint:{[dt]:Jv,[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:y1,endpoint:{[dt]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[ft]:ji,[pt]:qt},[ue]:Ye}],[ue]:Ve}],[ue]:Ve},{[be]:[Mh,{[ke]:Qn,[Re]:[xn,49,50,ua],[tn]:uK},{[ke]:Qn,[Re]:[xn,8,12,ua],[tn]:dK},{[ke]:Qn,[Re]:az,[tn]:mH},{[ke]:Qn,[Re]:[xn,32,49,ua],[tn]:iE},{[ke]:l0,[Re]:m1,[tn]:"regionPartition"},{[ke]:wn,[Re]:[{[Et]:mH},"--op-s3"]}],[Be]:[{[be]:pz,[Be]:[{[be]:b1,[Be]:[{[be]:[{[ke]:wn,[Re]:[RH,"e"]}],[Be]:[{[be]:hz,[Be]:[MH,{[be]:$d,endpoint:{[dt]:"https://{Bucket}.ec2.{url#authority}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{endpoint:{[dt]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{[be]:[{[ke]:wn,[Re]:[RH,"o"]}],[Be]:[{[be]:hz,[Be]:[MH,{[be]:$d,endpoint:{[dt]:"https://{Bucket}.op-{outpostId}.{url#authority}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{endpoint:{[dt]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[ft]:kv,[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[ue]:xt}],[ue]:Ve},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[ue]:xt}],[ue]:Ve},{[be]:_4e,[Be]:[{[be]:[Lr,{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[{[ke]:$M,[Re]:M4e}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[ue]:xt},{[be]:[n1,CK],[Be]:[{[be]:hs,[Be]:[{[be]:mz,[Be]:[{[be]:[gs,wH],error:"S3 Accelerate cannot be used in this region",[ue]:xt},{[be]:[Yn,rr,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,rr,Ur,Qt,bn,po],[Be]:[{endpoint:AH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,rr,Ur,Qt,bn,ho],endpoint:AH,[ue]:Ye},{[be]:[hn,rr,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,rr,Ur,Qt,bn,po],[Be]:[{endpoint:DH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,rr,Ur,Qt,bn,ho],endpoint:DH,[ue]:Ye},{[be]:[Yn,an,gs,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,an,gs,Qt,bn,po],[Be]:[{endpoint:_H,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,an,gs,Qt,bn,ho],endpoint:_H,[ue]:Ye},{[be]:[Yn,an,Ur,Qt,to],endpoint:{[dt]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,an,Ur,Qt,bn,po],[Be]:[{endpoint:NH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,an,Ur,Qt,bn,ho],endpoint:NH,[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,t1,to],endpoint:{[dt]:fK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,r1,to],endpoint:{[dt]:u0,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,t1,bn,po],[Be]:[{[be]:Dl,endpoint:o1,[ue]:Ye},{endpoint:o1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,Ur,Lr,Xo,r1,bn,po],[Be]:[{[be]:Dl,endpoint:sE,[ue]:Ye},FH],[ue]:Ve},{[be]:[hn,an,Ur,Lr,Xo,t1,bn,ho],endpoint:o1,[ue]:Ye},{[be]:[hn,an,Ur,Lr,Xo,r1,bn,ho],endpoint:sE,[ue]:Ye},{[be]:[hn,an,gs,Qt,to],endpoint:{[dt]:pK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,gs,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:i1,[ue]:Ye},{endpoint:i1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,gs,Qt,bn,ho],endpoint:i1,[ue]:Ye},{[be]:[hn,an,Ur,Qt,to],endpoint:{[dt]:gH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,an,Ur,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:gH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:LH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,an,Ur,Qt,bn,ho],endpoint:LH,[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[Lr,Xo,{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[xK,"scheme"]},"http"]},{[ke]:c0,[Re]:[xn,ua]},n1,an,hn,Ur],[Be]:[{[be]:hs,[Be]:[{[be]:mz,[Be]:[FH],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[n1,{[ke]:hK,[Re]:A4e,[tn]:mK}],[Be]:[{[be]:[{[ke]:wr,[Re]:[Ti,"resourceId[0]"],[tn]:gK},{[ke]:Ca,[Re]:[{[ke]:wn,[Re]:[wK,d0]}]}],[Be]:[{[be]:[{[ke]:wn,[Re]:[s1,BM]}],[Be]:[{[be]:v1,[Be]:[{[be]:gz,[Be]:[$H,jH,{[be]:x1,[Be]:[BH,{[be]:yz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:vz,[Be]:[{[be]:C1,[Be]:[{[be]:[{[ke]:wn,[Re]:[OK,d0]}],error:"Invalid ARN: Missing account id",[ue]:xt},{[be]:w1,[Be]:[{[be]:xz,[Be]:[{[be]:$d,endpoint:{[dt]:bH,[ft]:l1,[pt]:qt},[ue]:Ye},{[be]:Mv,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:l1,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:l1,[pt]:qt},[ue]:Ye}],[ue]:Ve},VH],[ue]:Ve},c1],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},HH],[ue]:Ve},{error:"Invalid ARN: bucket ARN is missing a region",[ue]:xt}],[ue]:Ve},zH],[ue]:Ve},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[ue]:xt}],[ue]:Ve},{[be]:v1,[Be]:[{[be]:gz,[Be]:[{[be]:x1,[Be]:[{[be]:v1,[Be]:[{[be]:x1,[Be]:[BH,{[be]:yz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:[{[ke]:wn,[Re]:[TK,"{partitionResult#name}"]}],[Be]:[{[be]:C1,[Be]:[{[be]:[{[ke]:wn,[Re]:[s1,Hf]}],[Be]:[{[be]:w1,[Be]:[{[be]:xz,[Be]:[{[be]:g1,error:"Access Points do not support S3 Accelerate",[ue]:xt},{[be]:y1,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:Ah,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:Dh,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Lr,Xo],endpoint:{[dt]:bH,[ft]:Qp,[pt]:qt},[ue]:Ye},{[be]:_h,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:Qp,[pt]:qt},[ue]:Ye}],[ue]:Ve},VH],[ue]:Ve},c1],[ue]:Ve},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[ue]:xt}],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},HH],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:qu,[Re]:[HM,ua]}],[Be]:[{[be]:bz,error:"S3 MRAP does not support dual-stack",[ue]:xt},{[be]:Mv,error:"S3 MRAP does not support FIPS",[ue]:xt},{[be]:g1,error:"S3 MRAP does not support S3 Accelerate",[ue]:xt},{[be]:[{[ke]:jr,[Re]:[{[Et]:"DisableMultiRegionAccessPoints"},ua]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[ue]:xt},{[be]:[{[ke]:l0,[Re]:m1,[tn]:yH}],[Be]:[{[be]:[{[ke]:wn,[Re]:[{[ke]:wr,[Re]:[{[Et]:yH},Or]},{[ke]:wr,[Re]:[Ti,"partition"]}]}],[Be]:[{endpoint:{[dt]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[ft]:{[go]:[{[Wr]:ua,name:jM,[Kr]:Hf,[LM]:N4e}]},[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[ue]:xt}],[ue]:Ve}],[ue]:Ve},{error:"Invalid Access Point Name",[ue]:xt}],[ue]:Ve},zH],[ue]:Ve},{[be]:[{[ke]:wn,[Re]:[s1,gm]}],[Be]:[{[be]:bz,error:"S3 Outposts does not support Dual-stack",[ue]:xt},{[be]:Mv,error:"S3 Outposts does not support FIPS",[ue]:xt},{[be]:g1,error:"S3 Outposts does not support S3 Accelerate",[ue]:xt},{[be]:[{[ke]:qi,[Re]:[{[ke]:wr,[Re]:[Ti,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[ue]:xt},{[be]:[{[ke]:wr,[Re]:F4e,[tn]:iE}],[Be]:[{[be]:pz,[Be]:[a1,{[be]:S1,[Be]:[{[be]:hs,[Be]:[{[be]:vz,[Be]:[{[be]:C1,[Be]:[{[be]:w1,[Be]:[{[be]:[{[ke]:wr,[Re]:L4e,[tn]:vH}],[Be]:[{[be]:[{[ke]:wr,[Re]:[Ti,"resourceId[3]"],[tn]:VM}],[Be]:[{[be]:[{[ke]:wn,[Re]:[{[Et]:vH},bK]}],[Be]:[{[be]:$d,endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[ft]:qH,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[ft]:qH,[pt]:qt},[ue]:Ye}],[ue]:Ve},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: expected an access point name",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: Expected a 4-component resource",[ue]:xt}],[ue]:Ve},c1],[ue]:Ve},u1],[ue]:Ve},d1],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: The Outpost Id was not set",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[ue]:xt}],[ue]:Ve},{error:"Invalid ARN: No ARN type specified",[ue]:xt}],[ue]:Ve},{[be]:[{[ke]:Qn,[Re]:[xn,0,4,k4e],[tn]:xH},{[ke]:wn,[Re]:[{[Et]:xH},"arn:"]},{[ke]:Ca,[Re]:[{[ke]:qi,[Re]:[UH]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[ue]:xt},{[be]:[{[ke]:jr,[Re]:[R4e,ua]},UH],error:"Path-style addressing cannot be used with ARN buckets",[ue]:xt},{[be]:D4e,[Be]:[{[be]:hs,[Be]:[{[be]:[Ur],[Be]:[{[be]:[Yn,Qt,rr,to],endpoint:{[dt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,Qt,rr,bn,po],[Be]:[{endpoint:GH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,Qt,rr,bn,ho],endpoint:GH,[ue]:Ye},{[be]:[hn,Qt,rr,to],endpoint:{[dt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Qt,rr,bn,po],[Be]:[{endpoint:WH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Qt,rr,bn,ho],endpoint:WH,[ue]:Ye},{[be]:[Yn,Qt,an,to],endpoint:{[dt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[Yn,Qt,an,bn,po],[Be]:[{endpoint:KH,[ue]:Ye}],[ue]:Ve},{[be]:[Yn,Qt,an,bn,ho],endpoint:KH,[ue]:Ye},{[be]:[hn,Lr,Xo,an,to],endpoint:{[dt]:yK,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Lr,Xo,an,bn,po],[Be]:[{[be]:Dl,endpoint:f1,[ue]:Ye},{endpoint:f1,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Lr,Xo,an,bn,ho],endpoint:f1,[ue]:Ye},{[be]:[hn,Qt,an,to],endpoint:{[dt]:SH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[hn,Qt,an,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:SH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:YH,[ue]:Ye}],[ue]:Ve},{[be]:[hn,Qt,an,bn,ho],endpoint:YH,[ue]:Ye}],[ue]:Ve},{error:"Path-style addressing cannot be used with S3 Accelerate",[ue]:xt}],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{[be]:[{[ke]:qi,[Re]:[ZH]},{[ke]:jr,[Re]:[ZH,ua]}],[Be]:[{[be]:hs,[Be]:[{[be]:Sz,[Be]:[$H,jH,{[be]:$d,endpoint:{[dt]:Jv,[ft]:p1,[pt]:qt},[ue]:Ye},{[be]:Mv,endpoint:{[dt]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[ft]:p1,[pt]:qt},[ue]:Ye},{endpoint:{[dt]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[ft]:p1,[pt]:qt},[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve},{[be]:[kH],[Be]:[{[be]:hs,[Be]:[{[be]:Sz,[Be]:[{[be]:[rr,Yn,Qt,to],endpoint:{[dt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[rr,Yn,Qt,bn,po],[Be]:[{endpoint:XH,[ue]:Ye}],[ue]:Ve},{[be]:[rr,Yn,Qt,bn,ho],endpoint:XH,[ue]:Ye},{[be]:[rr,hn,Qt,to],endpoint:{[dt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[rr,hn,Qt,bn,po],[Be]:[{endpoint:QH,[ue]:Ye}],[ue]:Ve},{[be]:[rr,hn,Qt,bn,ho],endpoint:QH,[ue]:Ye},{[be]:[an,Yn,Qt,to],endpoint:{[dt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,Yn,Qt,bn,po],[Be]:[{endpoint:JH,[ue]:Ye}],[ue]:Ve},{[be]:[an,Yn,Qt,bn,ho],endpoint:JH,[ue]:Ye},{[be]:[an,hn,Lr,Xo,to],endpoint:{[dt]:Jv,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Lr,Xo,bn,po],[Be]:[{[be]:Dl,endpoint:h1,[ue]:Ye},{endpoint:h1,[ue]:Ye}],[ue]:Ve},{[be]:[an,hn,Lr,Xo,bn,ho],endpoint:h1,[ue]:Ye},{[be]:[an,hn,Qt,to],endpoint:{[dt]:CH,[ft]:fo,[pt]:qt},[ue]:Ye},{[be]:[an,hn,Qt,bn,po],[Be]:[{[be]:Dl,endpoint:{[dt]:CH,[ft]:Yr,[pt]:qt},[ue]:Ye},{endpoint:ez,[ue]:Ye}],[ue]:Ve},{[be]:[an,hn,Qt,bn,ho],endpoint:ez,[ue]:Ye}],[ue]:Ve},Rv],[ue]:Ve}],[ue]:Ve}],[ue]:Ve},{error:"A region must be set when sending requests to S3.",[ue]:xt}]},j4e=$4e,B4e=new _7({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),PK=(e,t={})=>B4e.get(e,()=>q7(j4e,{endpointParams:e,logger:t.logger}));fm.aws=G7;const V4e=e=>async(t,r,o)=>{if(!o)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const i=await e(t,r,o),s=gl(r)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!s)throw new Error(`getEndpointParameterInstructions() is not defined on '${r.commandName}'`);const a=await tK(o,{getEndpointParameterInstructions:s},t);return Object.assign(i,a)},H4e=async(e,t,r)=>({operation:gl(t).operation,region:await Rs(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),z4e=V4e(H4e);function EK(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function IK(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}const q4e=(e,t,r)=>i=>{const a=e(i).properties?.authSchemes;if(!a)return t(i);const l=[];for(const c of a){const{name:u,properties:d={},...f}=c,p=u.toLowerCase();u!==p&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${u}' to '${p}'`);let h;if(p==="sigv4a"){h="aws.auth#sigv4a";const y=a.find(v=>{const C=v.name.toLowerCase();return C!=="sigv4a"&&C.startsWith("sigv4")});if(cK.sigv4aDependency()==="none"&&y)continue}else if(p.startsWith("sigv4"))h="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);const b=r[h];if(!b)throw new Error(`Could not find HttpAuthOption create function for '${h}'`);const g=b(i);g.schemeId=h,g.signingProperties={...g.signingProperties||{},...f,...d},l.push(g)}return l},U4e=e=>{const t=[];switch(e.operation){default:t.push(EK(e)),t.push(IK(e))}return t},G4e=q4e(PK,U4e,{"aws.auth#sigv4":EK,"aws.auth#sigv4a":IK}),W4e=e=>{const t=p7(e),r=sqe(t);return Object.assign(r,{authSchemePreference:Rs(e.authSchemePreference??[])})},K4e=e=>Object.assign(e,{useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:e.clientContextParams??{}}),kK={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class xo extends Qc{constructor(t){super(t),Object.setPrototypeOf(this,xo.prototype)}}class zM extends xo{name="NoSuchUpload";$fault="client";constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),Object.setPrototypeOf(this,zM.prototype)}}class qM extends xo{name="AccessDenied";$fault="client";constructor(t){super({name:"AccessDenied",$fault:"client",...t}),Object.setPrototypeOf(this,qM.prototype)}}class UM extends xo{name="ObjectNotInActiveTierError";$fault="client";constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,UM.prototype)}}class GM extends xo{name="BucketAlreadyExists";$fault="client";constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),Object.setPrototypeOf(this,GM.prototype)}}class WM extends xo{name="BucketAlreadyOwnedByYou";$fault="client";constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),Object.setPrototypeOf(this,WM.prototype)}}class KM extends xo{name="NoSuchBucket";$fault="client";constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),Object.setPrototypeOf(this,KM.prototype)}}class YM extends xo{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),Object.setPrototypeOf(this,YM.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class ZM extends xo{name="NoSuchKey";$fault="client";constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),Object.setPrototypeOf(this,ZM.prototype)}}class XM extends xo{name="NotFound";$fault="client";constructor(t){super({name:"NotFound",$fault:"client",...t}),Object.setPrototypeOf(this,XM.prototype)}}class QM extends xo{name="EncryptionTypeMismatch";$fault="client";constructor(t){super({name:"EncryptionTypeMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,QM.prototype)}}class JM extends xo{name="InvalidRequest";$fault="client";constructor(t){super({name:"InvalidRequest",$fault:"client",...t}),Object.setPrototypeOf(this,JM.prototype)}}class eA extends xo{name="InvalidWriteOffset";$fault="client";constructor(t){super({name:"InvalidWriteOffset",$fault:"client",...t}),Object.setPrototypeOf(this,eA.prototype)}}class tA extends xo{name="TooManyParts";$fault="client";constructor(t){super({name:"TooManyParts",$fault:"client",...t}),Object.setPrototypeOf(this,tA.prototype)}}class nA extends xo{name="IdempotencyParameterMismatch";$fault="client";constructor(t){super({name:"IdempotencyParameterMismatch",$fault:"client",...t}),Object.setPrototypeOf(this,nA.prototype)}}class rA extends xo{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),Object.setPrototypeOf(this,rA.prototype)}}const Y4e="ACL",Z4e="AccessDenied",Cz="AccessKeyId",X4e="AccessTier",RK="Bucket",Q4e="BucketAlreadyExists",J4e="BucketAlreadyOwnedByYou",AC="BucketKeyEnabled",eUe="Body",tUe="ChecksumAlgorithm",nUe="CacheControl",MK="ChecksumCRC32",AK="ChecksumCRC32C",DK="ChecksumCRC64NVME",rUe="Cache-Control",oUe="Content-Disposition",iUe="ContentDisposition",sUe="Content-Encoding",aUe="ContentEncoding",lUe="ContentLanguage",cUe="Content-Language",uUe="Content-Length",dUe="ContentLength",fUe="Content-MD5",pUe="ContentMD5",_K="ChecksumSHA1",NK="ChecksumSHA256",hUe="CreateSessionOutput",mUe="CreateSessionResult",gUe="CreateSessionRequest",bUe="CreateSession",yUe="ChecksumType",vUe="Content-Type",xUe="ContentType",wz="Credentials",aE="Expiration",SUe="ExpectedBucketOwner",CUe="EncryptionTypeMismatch",Tz="ETag",Oz="Expires",wUe="GrantFullControl",TUe="GrantRead",OUe="GrantReadACP",PUe="GrantWriteACP",EUe="IfMatch",IUe="If-Match",kUe="IfNoneMatch",RUe="If-None-Match",MUe="InvalidObjectState",AUe="IdempotencyParameterMismatch",DUe="InvalidRequest",_Ue="InvalidWriteOffset",NUe="Key",FUe="Metadata",LUe="NotFound",$Ue="NoSuchBucket",jUe="NoSuchKey",BUe="NoSuchUpload",VUe="ObjectAlreadyInActiveTierError",HUe="ObjectLockLegalHoldStatus",zUe="ObjectLockMode",qUe="ObjectLockRetainUntilDate",UUe="ObjectNotInActiveTierError",GUe="PutObject",WUe="PutObjectOutput",KUe="PutObjectRequest",YUe="RequestCharged",ZUe="RequestPayer",Pz="SecretAccessKey",XUe="StreamingBlob",FK="StorageClass",QUe="SessionCredentialValue",JUe="SessionCredentials",e9e="SessionMode",DC="ServerSideEncryption",LK="SSECustomerAlgorithm",$K="SSECustomerKey",jK="SSECustomerKeyMD5",hg="SSEKMSEncryptionContext",mg="SSEKMSKeyId",Ez="SessionToken",t9e="Size",n9e="TooManyParts",r9e="Tagging",o9e="VersionId",i9e="WriteOffsetBytes",s9e="WebsiteRedirectLocation",di="client",fi="error",BK="http",a9e="httpChecksum",Ii="httpError",Pt="httpHeader",l9e="httpPrefixHeaders",VK="smithy.ts.sdk.synthetic.com.amazonaws.s3",c9e="streaming",ef="xmlName",u9e="x-amz-acl",HK="x-amz-checksum-crc32",zK="x-amz-checksum-crc32c",qK="x-amz-checksum-crc64nvme",UK="x-amz-checksum-sha1",GK="x-amz-checksum-sha256",d9e="x-amz-create-session-mode",f9e="x-amz-checksum-type",p9e="x-amz-expiration",h9e="x-amz-expected-bucket-owner",m9e="x-amz-grant-full-control",g9e="x-amz-grant-read",b9e="x-amz-grant-read-acp",y9e="x-amz-grant-write-acp",v9e="x-amz-meta-",x9e="x-amz-object-lock-legal-hold",S9e="x-amz-object-lock-mode",C9e="x-amz-object-lock-retain-until-date",w9e="x-amz-object-size",T9e="x-amz-request-charged",O9e="x-amz-request-payer",P9e="x-amz-storage-class",E9e="x-amz-sdk-checksum-algorithm",_C="x-amz-server-side-encryption",NC="x-amz-server-side-encryption-aws-kms-key-id",FC="x-amz-server-side-encryption-bucket-key-enabled",LC="x-amz-server-side-encryption-context",WK="x-amz-server-side-encryption-customer-algorithm",I9e="x-amz-server-side-encryption-customer-key",KK="x-amz-server-side-encryption-customer-key-MD5",k9e="x-amz-tagging",R9e="x-amz-version-id",M9e="x-amz-write-offset-bytes",A9e="x-amz-website-redirect-location",Zn="com.amazonaws.s3",YK=ti.for(VK);var D9e=[-3,VK,"S3ServiceException",0,[],[]];YK.registerError(D9e,xo);const Go=ti.for(Zn);var _9e=[-3,Zn,Z4e,{[fi]:di,[Ii]:403},[],[]];Go.registerError(_9e,qM);var N9e=[-3,Zn,Q4e,{[fi]:di,[Ii]:409},[],[]];Go.registerError(N9e,GM);var F9e=[-3,Zn,J4e,{[fi]:di,[Ii]:409},[],[]];Go.registerError(F9e,WM);var L9e=[-3,Zn,CUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError(L9e,QM);var $9e=[-3,Zn,AUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError($9e,nA);var j9e=[-3,Zn,MUe,{[fi]:di,[Ii]:403},[FK,X4e],[0,0]];Go.registerError(j9e,YM);var B9e=[-3,Zn,DUe,{[fi]:di,[Ii]:400},[],[]];Go.registerError(B9e,JM);var V9e=[-3,Zn,_Ue,{[fi]:di,[Ii]:400},[],[]];Go.registerError(V9e,eA);var H9e=[-3,Zn,$Ue,{[fi]:di,[Ii]:404},[],[]];Go.registerError(H9e,KM);var z9e=[-3,Zn,jUe,{[fi]:di,[Ii]:404},[],[]];Go.registerError(z9e,ZM);var q9e=[-3,Zn,BUe,{[fi]:di,[Ii]:404},[],[]];Go.registerError(q9e,zM);var U9e=[-3,Zn,LUe,{[fi]:di},[],[]];Go.registerError(U9e,XM);var G9e=[-3,Zn,VUe,{[fi]:di,[Ii]:403},[],[]];Go.registerError(G9e,rA);var W9e=[-3,Zn,UUe,{[fi]:di,[Ii]:403},[],[]];Go.registerError(W9e,UM);var K9e=[-3,Zn,n9e,{[fi]:di,[Ii]:400},[],[]];Go.registerError(K9e,tA);const Y9e=[YK,Go];var Iz=[0,Zn,QUe,8,0],Z9e=[0,Zn,$K,8,0],$C=[0,Zn,hg,8,0],jC=[0,Zn,mg,8,0],X9e=[0,Zn,XUe,{[c9e]:1},42],Q9e=[3,Zn,hUe,{[ef]:mUe},[wz,DC,mg,hg,AC],[[()=>n6e,{[ef]:wz}],[0,{[Pt]:_C}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}]],1],J9e=[3,Zn,gUe,0,[RK,e9e,DC,mg,hg,AC],[[0,1],[0,{[Pt]:d9e}],[0,{[Pt]:_C}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}]],1],e6e=[3,Zn,WUe,0,[aE,Tz,MK,AK,DK,_K,NK,yUe,DC,o9e,LK,jK,mg,hg,AC,t9e,YUe],[[0,{[Pt]:p9e}],[0,{[Pt]:Tz}],[0,{[Pt]:HK}],[0,{[Pt]:zK}],[0,{[Pt]:qK}],[0,{[Pt]:UK}],[0,{[Pt]:GK}],[0,{[Pt]:f9e}],[0,{[Pt]:_C}],[0,{[Pt]:R9e}],[0,{[Pt]:WK}],[0,{[Pt]:KK}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}],[1,{[Pt]:w9e}],[0,{[Pt]:T9e}]]],t6e=[3,Zn,KUe,0,[RK,NUe,Y4e,eUe,nUe,iUe,aUe,lUe,dUe,pUe,xUe,tUe,MK,AK,DK,_K,NK,Oz,EUe,kUe,wUe,TUe,OUe,PUe,i9e,FUe,DC,FK,s9e,LK,$K,jK,mg,hg,AC,ZUe,r9e,zUe,qUe,HUe,SUe],[[0,1],[0,1],[0,{[Pt]:u9e}],[()=>X9e,16],[0,{[Pt]:rUe}],[0,{[Pt]:oUe}],[0,{[Pt]:sUe}],[0,{[Pt]:cUe}],[1,{[Pt]:uUe}],[0,{[Pt]:fUe}],[0,{[Pt]:vUe}],[0,{[Pt]:E9e}],[0,{[Pt]:HK}],[0,{[Pt]:zK}],[0,{[Pt]:qK}],[0,{[Pt]:UK}],[0,{[Pt]:GK}],[4,{[Pt]:Oz}],[0,{[Pt]:IUe}],[0,{[Pt]:RUe}],[0,{[Pt]:m9e}],[0,{[Pt]:g9e}],[0,{[Pt]:b9e}],[0,{[Pt]:y9e}],[1,{[Pt]:M9e}],[128,{[l9e]:v9e}],[0,{[Pt]:_C}],[0,{[Pt]:P9e}],[0,{[Pt]:A9e}],[0,{[Pt]:WK}],[()=>Z9e,{[Pt]:I9e}],[0,{[Pt]:KK}],[()=>jC,{[Pt]:NC}],[()=>$C,{[Pt]:LC}],[2,{[Pt]:FC}],[0,{[Pt]:O9e}],[0,{[Pt]:k9e}],[0,{[Pt]:S9e}],[5,{[Pt]:C9e}],[0,{[Pt]:x9e}],[0,{[Pt]:h9e}]],2],n6e=[3,Zn,JUe,0,[Cz,Pz,Ez,aE],[[0,{[ef]:Cz}],[()=>Iz,{[ef]:Pz}],[()=>Iz,{[ef]:Ez}],[4,{[ef]:aE}]],4],r6e=[9,Zn,bUe,{[BK]:["GET","/?session",200]},()=>J9e,()=>Q9e],o6e=[9,Zn,GUe,{[a9e]:"-",[BK]:["PUT","/{Key+}?x-id=PutObject",200]},()=>t6e,()=>e6e];class i6e extends IC.classBuilder().ep({...kK,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,r,o,i){return[DM(o,t.getEndpointParameterInstructions()),A7(o)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(r6e).build(){}const s6e="3.996.0",a6e={version:s6e},l6e=e=>new TextEncoder().encode(e);function kz(e){return typeof e=="string"?e.length===0:e.byteLength===0}var ZK={name:"SHA-1"},Rz={name:"HMAC",hash:ZK},c6e=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);const u6e={};function Jl(){return typeof window<"u"?window:typeof self<"u"?self:u6e}var d6e=(function(){function e(t){this.toHash=new Uint8Array(0),t!==void 0&&(this.key=new Promise(function(r,o){Jl().crypto.subtle.importKey("raw",Mz(t),Rz,!1,["sign"]).then(r,o)}),this.key.catch(function(){}))}return e.prototype.update=function(t){if(!kz(t)){var r=Mz(t),o=new Uint8Array(this.toHash.byteLength+r.byteLength);o.set(this.toHash,0),o.set(r,this.toHash.byteLength),this.toHash=o}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return Jl().crypto.subtle.sign(Rz,r,t.toHash).then(function(o){return new Uint8Array(o)})}):kz(this.toHash)?Promise.resolve(c6e):Promise.resolve().then(function(){return Jl().crypto.subtle.digest(ZK,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){this.toHash=new Uint8Array(0)},e})();function Mz(e){return typeof e=="string"?l6e(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var f6e=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function XK(e){if(p6e(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return h6e(t)}return!1}function p6e(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function h6e(e){return e&&f6e.every(function(t){return typeof e[t]=="function"})}var m6e=(function(){function e(t){if(XK(Jl()))this.hash=new d6e(t);else throw new Error("SHA1 not supported")}return e.prototype.update=function(t,r){this.hash.update(ic(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})(),QK={name:"SHA-256"},Az={name:"HMAC",hash:QK},g6e=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]),b6e=(function(){function e(t){this.toHash=new Uint8Array(0),this.secret=t,this.reset()}return e.prototype.update=function(t){if(!dm(t)){var r=ic(t),o=new Uint8Array(this.toHash.byteLength+r.byteLength);o.set(this.toHash,0),o.set(r,this.toHash.byteLength),this.toHash=o}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return Jl().crypto.subtle.sign(Az,r,t.toHash).then(function(o){return new Uint8Array(o)})}):dm(this.toHash)?Promise.resolve(g6e):Promise.resolve().then(function(){return Jl().crypto.subtle.digest(QK,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){var t=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,o){Jl().crypto.subtle.importKey("raw",ic(t.secret),Az,!1,["sign"]).then(r,o)}),this.key.catch(function(){}))},e})(),ys=64,y6e=32,v6e=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]),x6e=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],S6e=Math.pow(2,53)-1,ex=(function(){function e(){this.state=Int32Array.from(x6e),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,o=t.byteLength;if(this.bytesHashed+=o,this.bytesHashed*8>S6e)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;o>0;)this.buffer[this.bufferLength++]=t[r++],o--,this.bufferLength===ys&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),o=this.bufferLength;if(r.setUint8(this.bufferLength++,128),o%ys>=ys-8){for(var i=this.bufferLength;i<ys;i++)r.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ys-8;i++)r.setUint8(i,0);r.setUint32(ys-8,Math.floor(t/4294967296),!0),r.setUint32(ys-4,t),this.hashBuffer(),this.finished=!0}for(var s=new Uint8Array(y6e),i=0;i<8;i++)s[i*4]=this.state[i]>>>24&255,s[i*4+1]=this.state[i]>>>16&255,s[i*4+2]=this.state[i]>>>8&255,s[i*4+3]=this.state[i]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var t=this,r=t.buffer,o=t.state,i=o[0],s=o[1],a=o[2],l=o[3],c=o[4],u=o[5],d=o[6],f=o[7],p=0;p<ys;p++){if(p<16)this.temp[p]=(r[p*4]&255)<<24|(r[p*4+1]&255)<<16|(r[p*4+2]&255)<<8|r[p*4+3]&255;else{var h=this.temp[p-2],b=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=this.temp[p-15];var g=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[p]=(b+this.temp[p-7]|0)+(g+this.temp[p-16]|0)}var y=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&d)|0)+(f+(v6e[p]+this.temp[p]|0)|0)|0,v=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&s^i&a^s&a)|0;f=d,d=u,u=c,c=l+y|0,l=a,a=s,s=i,i=y+v|0}o[0]+=i,o[1]+=s,o[2]+=a,o[3]+=l,o[4]+=c,o[5]+=u,o[6]+=d,o[7]+=f},e})(),C6e=(function(){function e(t){this.secret=t,this.hash=new ex,this.reset()}return e.prototype.update=function(t){if(!(dm(t)||this.error))try{this.hash.update(ic(t))}catch(r){this.error=r}},e.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()},e.prototype.digest=function(){return EM(this,void 0,void 0,function(){return IM(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new ex,this.secret){this.outer=new ex;var t=w6e(this.secret),r=new Uint8Array(ys);r.set(t);for(var o=0;o<ys;o++)t[o]^=54,r[o]^=92;this.hash.update(t),this.outer.update(r);for(var o=0;o<t.byteLength;o++)t[o]=0}},e})();function w6e(e){var t=ic(e);if(t.byteLength>ys){var r=new ex;r.update(t),t=r.digest()}var o=new Uint8Array(ys);return o.set(t),o}var JK=(function(){function e(t){XK(Jl())?this.hash=new b6e(t):this.hash=new C6e(t)}return e.prototype.update=function(t,r){this.hash.update(ic(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();const eY=({serviceId:e,clientVersion:t})=>async r=>{const o=typeof window<"u"?window.navigator:void 0,i=o?.userAgent??"",s=o?.userAgentData?.platform??Dz.os(i)??"other",a=void 0,l=o?.userAgentData?.brands??[],c=l[l.length-1],u=c?.brand??Dz.browser(i)??"unknown",d=c?.version??"unknown",f=[["aws-sdk-js",t],["ua","2.1"],[`os/${s}`,a],["lang/js"],["md/browser",`${u}_${d}`]];e&&f.push([`api/${e}`,t]);const p=await r?.userAgentAppId?.();return p&&f.push([`app/${p}`]),f},Dz={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}};class Nh{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let o=7,i=Math.abs(Math.round(t));o>-1&&i>0;o--,i/=256)r[o]=i;return t<0&&_z(r),new Nh(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&_z(t),parseInt(Ci(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function _z(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class T6e{toUtf8;fromUtf8;constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){const r=[];for(const s of Object.keys(t)){const a=this.fromUtf8(s);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(t[s]))}const o=new Uint8Array(r.reduce((s,a)=>s+a.byteLength,0));let i=0;for(const s of r)o.set(s,i),i+=s.byteLength;return o}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const o=new DataView(new ArrayBuffer(5));return o.setUint8(0,4),o.setInt32(1,t.value,!1),new Uint8Array(o.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+t.value.byteLength));s.setUint8(0,6),s.setUint16(1,t.value.byteLength,!1);const a=new Uint8Array(s.buffer);return a.set(t.value,3),a;case"string":const l=this.fromUtf8(t.value),c=new DataView(new ArrayBuffer(3+l.byteLength));c.setUint8(0,7),c.setUint16(1,l.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(l,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(Nh.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!D6e.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(WW(t.value.replace(/\-/g,"")),1),f}}parse(t){const r={};let o=0;for(;o<t.byteLength;){const i=t.getUint8(o++),s=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+o,i));switch(o+=i,t.getUint8(o++)){case 0:r[s]={type:Fz,value:!0};break;case 1:r[s]={type:Fz,value:!1};break;case 2:r[s]={type:O6e,value:t.getInt8(o++)};break;case 3:r[s]={type:P6e,value:t.getInt16(o,!1)},o+=2;break;case 4:r[s]={type:E6e,value:t.getInt32(o,!1)},o+=4;break;case 5:r[s]={type:I6e,value:new Nh(new Uint8Array(t.buffer,t.byteOffset+o,8))},o+=8;break;case 6:const a=t.getUint16(o,!1);o+=2,r[s]={type:k6e,value:new Uint8Array(t.buffer,t.byteOffset+o,a)},o+=a;break;case 7:const l=t.getUint16(o,!1);o+=2,r[s]={type:R6e,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+o,l))},o+=l;break;case 8:r[s]={type:M6e,value:new Date(new Nh(new Uint8Array(t.buffer,t.byteOffset+o,8)).valueOf())},o+=8;break;case 9:const c=new Uint8Array(t.buffer,t.byteOffset+o,16);o+=16,r[s]={type:A6e,value:`${Ci(c.subarray(0,4))}-${Ci(c.subarray(4,6))}-${Ci(c.subarray(6,8))}-${Ci(c.subarray(8,10))}-${Ci(c.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var Nz;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(Nz||(Nz={}));const Fz="boolean",O6e="byte",P6e="short",E6e="integer",I6e="long",k6e="binary",R6e="string",M6e="timestamp",A6e="uuid",D6e=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,tY=4,Fl=tY*2,zc=4,_6e=Fl+zc*2;function N6e({byteLength:e,byteOffset:t,buffer:r}){if(e<_6e)throw new Error("Provided message too short to accommodate event stream message overhead");const o=new DataView(r,t,e),i=o.getUint32(0,!1);if(e!==i)throw new Error("Reported message length does not match received message length");const s=o.getUint32(tY,!1),a=o.getUint32(Fl,!1),l=o.getUint32(e-zc,!1),c=new a0().update(new Uint8Array(r,t,Fl));if(a!==c.digest())throw new Error(`The prelude checksum specified in the message (${a}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(r,t+Fl,e-(Fl+zc))),l!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${l}`);return{headers:new DataView(r,t+Fl+zc,s),body:new Uint8Array(r,t+Fl+zc+s,i-s-(Fl+zc+zc))}}class F6e{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,r){this.headerMarshaller=new T6e(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){const t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){const t=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){const o=this.headerMarshaller.format(t),i=o.byteLength+r.byteLength+16,s=new Uint8Array(i),a=new DataView(s.buffer,s.byteOffset,s.byteLength),l=new a0;return a.setUint32(0,i,!1),a.setUint32(4,o.byteLength,!1),a.setUint32(8,l.update(s.subarray(0,8)).digest(),!1),s.set(o,12),s.set(r,o.byteLength+12),a.setUint32(i-4,l.update(s.subarray(8,i-4)).digest(),!1),s}decode(t){const{headers:r,body:o}=N6e(t);return{headers:this.headerMarshaller.parse(r),body:o}}formatHeaders(t){return this.headerMarshaller.format(t)}}class L6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.decoder.decode(t)}}class $6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream)yield this.options.encoder.encode(t);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class j6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream){const r=await this.options.deserializer(t);r!==void 0&&(yield r)}}}class B6e{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.serializer(t)}}function V6e(e){let t=0,r=0,o=null,i=null;const s=l=>{if(typeof l!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+l);t=l,r=4,o=new Uint8Array(l),new DataView(o.buffer).setUint32(0,l,!1)},a=async function*(){const l=e[Symbol.asyncIterator]();for(;;){const{value:c,done:u}=await l.next();if(u){if(t)if(t===r)yield o;else throw new Error("Truncated event message received.");else return;return}const d=c.length;let f=0;for(;f<d;){if(!o){const h=d-f;i||(i=new Uint8Array(4));const b=Math.min(4-r,h);if(i.set(c.slice(f,f+b),r),r+=b,f+=b,r<4)break;s(new DataView(i.buffer).getUint32(0,!1)),i=null}const p=Math.min(t-r,d-f);o.set(c.slice(f,f+p),r),r+=p,f+=p,t&&t===r&&(yield o,o=null,t=0,r=0)}}};return{[Symbol.asyncIterator]:a}}function H6e(e,t){return async function(r){const{value:o}=r.headers[":message-type"];if(o==="error"){const i=new Error(r.headers[":error-message"].value||"UnknownError");throw i.name=r.headers[":error-code"].value,i}else if(o==="exception"){const i=r.headers[":exception-type"].value,s={[i]:r},a=await e(s);if(a.$unknown){const l=new Error(t(r.body));throw l.name=i,l}throw a[i]}else if(o==="event"){const i={[r.headers[":event-type"].value]:r},s=await e(i);return s.$unknown?void 0:s}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let z6e=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:t,utf8Decoder:r}){this.eventStreamCodec=new F6e(t,r),this.utfEncoder=t}deserialize(t,r){const o=V6e(t);return new j6e({messageStream:new L6e({inputStream:o,decoder:this.eventStreamCodec}),deserializer:H6e(r,this.utfEncoder)})}serialize(t,r){return new $6e({messageStream:new B6e({inputStream:t,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const q6e=e=>({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:r,value:o}=await t.read();if(r)return;yield o}}finally{t.releaseLock()}}}),U6e=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:o,value:i}=await t.next();if(o)return r.close();r.enqueue(i)}})};class G6e{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new z6e({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){const o=W6e(t)?q6e(t):t;return this.universalMarshaller.deserialize(o,r)}serialize(t,r){const o=this.universalMarshaller.serialize(t,r);return typeof ReadableStream=="function"?U6e(o):o}}const W6e=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,K6e=e=>new G6e(e);async function Y6e(e,t,r=1024*1024){const o=e.size;let i=0;for(;i<o;){const s=e.slice(i,Math.min(o,i+r));t(new Uint8Array(await s.arrayBuffer())),i+=s.size}}const Z6e=async function(t,r){const o=new t;return await Y6e(r,i=>{o.update(i)}),o.digest()},nY=e=>()=>Promise.reject(e),_l=64,X6e=16,Q6e=[1732584193,4023233417,2562383102,271733878];class J6e{state;buffer;bufferLength;bytesHashed;finished;constructor(){this.reset()}update(t){if(eGe(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=tGe(t);let o=0,{byteLength:i}=r;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,r[o++]),i--,this.bufferLength===_l&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:o,bytesHashed:i}=this,s=i*8;if(r.setUint8(this.bufferLength++,128),o%_l>=_l-8){for(let a=this.bufferLength;a<_l;a++)r.setUint8(a,0);this.hashBuffer(),this.bufferLength=0}for(let a=this.bufferLength;a<_l-8;a++)r.setUint8(a,0);r.setUint32(_l-8,s>>>0,!0),r.setUint32(_l-4,Math.floor(s/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(X6e));for(let r=0;r<4;r++)t.setUint32(r*4,this.state[r],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:r}=this;let o=r[0],i=r[1],s=r[2],a=r[3];o=Do(o,i,s,a,t.getUint32(0,!0),7,3614090360),a=Do(a,o,i,s,t.getUint32(4,!0),12,3905402710),s=Do(s,a,o,i,t.getUint32(8,!0),17,606105819),i=Do(i,s,a,o,t.getUint32(12,!0),22,3250441966),o=Do(o,i,s,a,t.getUint32(16,!0),7,4118548399),a=Do(a,o,i,s,t.getUint32(20,!0),12,1200080426),s=Do(s,a,o,i,t.getUint32(24,!0),17,2821735955),i=Do(i,s,a,o,t.getUint32(28,!0),22,4249261313),o=Do(o,i,s,a,t.getUint32(32,!0),7,1770035416),a=Do(a,o,i,s,t.getUint32(36,!0),12,2336552879),s=Do(s,a,o,i,t.getUint32(40,!0),17,4294925233),i=Do(i,s,a,o,t.getUint32(44,!0),22,2304563134),o=Do(o,i,s,a,t.getUint32(48,!0),7,1804603682),a=Do(a,o,i,s,t.getUint32(52,!0),12,4254626195),s=Do(s,a,o,i,t.getUint32(56,!0),17,2792965006),i=Do(i,s,a,o,t.getUint32(60,!0),22,1236535329),o=_o(o,i,s,a,t.getUint32(4,!0),5,4129170786),a=_o(a,o,i,s,t.getUint32(24,!0),9,3225465664),s=_o(s,a,o,i,t.getUint32(44,!0),14,643717713),i=_o(i,s,a,o,t.getUint32(0,!0),20,3921069994),o=_o(o,i,s,a,t.getUint32(20,!0),5,3593408605),a=_o(a,o,i,s,t.getUint32(40,!0),9,38016083),s=_o(s,a,o,i,t.getUint32(60,!0),14,3634488961),i=_o(i,s,a,o,t.getUint32(16,!0),20,3889429448),o=_o(o,i,s,a,t.getUint32(36,!0),5,568446438),a=_o(a,o,i,s,t.getUint32(56,!0),9,3275163606),s=_o(s,a,o,i,t.getUint32(12,!0),14,4107603335),i=_o(i,s,a,o,t.getUint32(32,!0),20,1163531501),o=_o(o,i,s,a,t.getUint32(52,!0),5,2850285829),a=_o(a,o,i,s,t.getUint32(8,!0),9,4243563512),s=_o(s,a,o,i,t.getUint32(28,!0),14,1735328473),i=_o(i,s,a,o,t.getUint32(48,!0),20,2368359562),o=No(o,i,s,a,t.getUint32(20,!0),4,4294588738),a=No(a,o,i,s,t.getUint32(32,!0),11,2272392833),s=No(s,a,o,i,t.getUint32(44,!0),16,1839030562),i=No(i,s,a,o,t.getUint32(56,!0),23,4259657740),o=No(o,i,s,a,t.getUint32(4,!0),4,2763975236),a=No(a,o,i,s,t.getUint32(16,!0),11,1272893353),s=No(s,a,o,i,t.getUint32(28,!0),16,4139469664),i=No(i,s,a,o,t.getUint32(40,!0),23,3200236656),o=No(o,i,s,a,t.getUint32(52,!0),4,681279174),a=No(a,o,i,s,t.getUint32(0,!0),11,3936430074),s=No(s,a,o,i,t.getUint32(12,!0),16,3572445317),i=No(i,s,a,o,t.getUint32(24,!0),23,76029189),o=No(o,i,s,a,t.getUint32(36,!0),4,3654602809),a=No(a,o,i,s,t.getUint32(48,!0),11,3873151461),s=No(s,a,o,i,t.getUint32(60,!0),16,530742520),i=No(i,s,a,o,t.getUint32(8,!0),23,3299628645),o=Fo(o,i,s,a,t.getUint32(0,!0),6,4096336452),a=Fo(a,o,i,s,t.getUint32(28,!0),10,1126891415),s=Fo(s,a,o,i,t.getUint32(56,!0),15,2878612391),i=Fo(i,s,a,o,t.getUint32(20,!0),21,4237533241),o=Fo(o,i,s,a,t.getUint32(48,!0),6,1700485571),a=Fo(a,o,i,s,t.getUint32(12,!0),10,2399980690),s=Fo(s,a,o,i,t.getUint32(40,!0),15,4293915773),i=Fo(i,s,a,o,t.getUint32(4,!0),21,2240044497),o=Fo(o,i,s,a,t.getUint32(32,!0),6,1873313359),a=Fo(a,o,i,s,t.getUint32(60,!0),10,4264355552),s=Fo(s,a,o,i,t.getUint32(24,!0),15,2734768916),i=Fo(i,s,a,o,t.getUint32(52,!0),21,1309151649),o=Fo(o,i,s,a,t.getUint32(16,!0),6,4149444226),a=Fo(a,o,i,s,t.getUint32(44,!0),10,3174756917),s=Fo(s,a,o,i,t.getUint32(8,!0),15,718787259),i=Fo(i,s,a,o,t.getUint32(36,!0),21,3951481745),r[0]=o+r[0]&4294967295,r[1]=i+r[1]&4294967295,r[2]=s+r[2]&4294967295,r[3]=a+r[3]&4294967295}reset(){this.state=Uint32Array.from(Q6e),this.buffer=new DataView(new ArrayBuffer(_l)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function BC(e,t,r,o,i,s){return t=(t+e&4294967295)+(o+s&4294967295)&4294967295,(t<<i|t>>>32-i)+r&4294967295}function Do(e,t,r,o,i,s,a){return BC(t&r|~t&o,e,t,i,s,a)}function _o(e,t,r,o,i,s,a){return BC(t&o|r&~o,e,t,i,s,a)}function No(e,t,r,o,i,s,a){return BC(t^r^o,e,t,i,s,a)}function Fo(e,t,r,o,i,s,a){return BC(r^(t|~o),e,t,i,s,a)}function eGe(e){return typeof e=="string"?e.length===0:e.byteLength===0}function tGe(e){return typeof e=="string"?cl(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const nGe=["in-region","cross-region","mobile","standard","legacy"],rY=({defaultsMode:e}={})=>iqe(async()=>{const t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(rGe()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${nGe.join(", ")}, got ${t}`)}}),rGe=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:r,downlink:o}=e?.connection;if(typeof t=="string"&&t!=="4g"||Number(r)>100||Number(o)<10)return!0}return e?.userAgentData?.mobile||typeof e?.maxTouchPoints=="number"&&e?.maxTouchPoints>1},oGe=e=>({apiVersion:"2006-03-01",base64Decoder:e?.base64Decoder??Tu,base64Encoder:e?.base64Encoder??oc,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??PK,extensions:e?.extensions??[],getAwsChunkedEncodingStream:e?.getAwsChunkedEncodingStream??tze,httpAuthSchemeProvider:e?.httpAuthSchemeProvider??G4e,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new vM},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new FHe}],logger:e?.logger??new kC,protocol:e?.protocol??Gqe,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:Y9e,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:e?.sdkStreamMixin??KW,serviceId:e?.serviceId??"S3",signerConstructor:e?.signerConstructor??cK,signingEscapePath:e?.signingEscapePath??!1,urlParser:e?.urlParser??hm,useArnRegion:e?.useArnRegion??void 0,utf8Decoder:e?.utf8Decoder??cl,utf8Encoder:e?.utf8Encoder??zu}),iGe=e=>{const t=rY(e),r=()=>t().then(g7),o=oGe(e);return{...o,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??h7,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??eY({serviceId:o.serviceId,clientVersion:a6e.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??K6e,maxAttempts:e?.maxAttempts??mm,md5:e?.md5??J6e,region:e?.region??nY("Region is missing"),requestHandler:wC.create(e?.requestHandler??r),retryMode:e?.retryMode??(async()=>(await r()).retryMode||rK),sha1:e?.sha1??m6e,sha256:e?.sha256??JK,streamCollector:e?.streamCollector??xM,streamHasher:e?.streamHasher??Z6e,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(K7)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Y7))}},oY=e=>({setRegion(t){e.region=t},region(){return e.region}}),iY=e=>({region:e.region()}),sGe=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(i){const s=t.findIndex(a=>a.schemeId===i.schemeId);s===-1?t.push(i):t.splice(s,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){r=i},httpAuthSchemeProvider(){return r},setCredentials(i){o=i},credentials(){return o}}},aGe=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),lGe=(e,t)=>{const r=Object.assign(oY(e),b7(e),jW(e),sGe(e));return t.forEach(o=>o.configure(r)),Object.assign(e,iY(r),y7(r),BW(r),aGe(r))};class cGe extends m7{config;constructor(...[t]){const r=iGe(t||{});super(r),this.initConfig=r;const o=K4e(r),i=D7(o),s=v3e(i),a=aK(s),l=X7(a),c=l,u=nK(c),d=q5e(u),f=W4e(d),p=Y3e(f,{session:[()=>this,i6e]}),h=lGe(p,t?.extensions||[]);this.config=h,this.middlewareStack.use(ZW(this.config)),this.middlewareStack.use(W7(this.config)),this.middlewareStack.use(lK(this.config)),this.middlewareStack.use(Q7(this.config)),this.middlewareStack.use(k7(this.config)),this.middlewareStack.use(R7(this.config)),this.middlewareStack.use(M7(this.config)),this.middlewareStack.use(HW(this.config,{httpAuthSchemeParametersProvider:z4e,identityProviderConfigProvider:async b=>new r7({"aws.auth#sigv4":b.credentials,"aws.auth#sigv4a":b.credentials})})),this.middlewareStack.use(qW(this.config)),this.middlewareStack.use(s5e(this.config)),this.middlewareStack.use(MHe(this.config)),this.middlewareStack.use(F3e(this.config)),this.middlewareStack.use(z3e(this.config)),this.middlewareStack.use(K3e(this.config))}destroy(){super.destroy()}}function uGe(e){return t=>async r=>{const o={...r.input},i=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const s of i){const a=o[s.target];if(a){let l;typeof a=="string"?pGe(a,e)?l=e.base64Decoder(a):(l=e.utf8Decoder(a),o[s.target]=e.base64Encoder(l)):(l=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a),o[s.target]=e.base64Encoder(l));const c=new e.md5;c.update(l),o[s.hash]=e.base64Encoder(await c.digest())}}return t({...r,input:o})}}const dGe={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},fGe=e=>({applyToStack:t=>{t.add(uGe(e),dGe)}});function pGe(e,t){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))return!1;try{return t.base64Decoder(e).length===32}catch{return!1}}class hGe extends IC.classBuilder().ep({...kK,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(t,r,o,i){return[DM(o,t.getEndpointParameterInstructions()),y3e(o,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),M3e(),A7(o),fGe(o)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(o6e).build(){}function sY(e){return Promise.all(Object.keys(e).reduce((t,r)=>{const o=e[r];return typeof o=="string"?t.push([r,o]):t.push(o().then(i=>[r,i])),t},[])).then(t=>t.reduce((r,[o,i])=>(r[o]=i,r),{}))}function mGe(e){return async t=>{e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:r,CognitoIdentityClient:o}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DrcsByX4.js")),i=u=>e.clientConfig?.[u]??e.parentClientConfig?.[u]??t?.callerClientConfig?.[u],{Credentials:{AccessKeyId:s=gGe(e.logger),Expiration:a,SecretKey:l=yGe(e.logger),SessionToken:c}=bGe(e.logger)}=await(e.client??new o(Object.assign({},e.clientConfig??{},{region:i("region"),profile:i("profile"),userAgentAppId:i("userAgentAppId")}))).send(new r({CustomRoleArn:e.customRoleArn,IdentityId:e.identityId,Logins:e.logins?await sY(e.logins):void 0}));return{identityId:e.identityId,accessKeyId:s,secretAccessKey:l,sessionToken:c,expiration:a}}}function gGe(e){throw new fp("Response from Amazon Cognito contained no access key ID",{logger:e})}function bGe(e){throw new fp("Response from Amazon Cognito contained no credentials",{logger:e})}function yGe(e){throw new fp("Response from Amazon Cognito contained no secret key",{logger:e})}const T1="IdentityIds";class vGe{dbName;constructor(t="aws:cognito-identity-ids"){this.dbName=t}getItem(t){return this.withObjectStore("readonly",r=>{const o=r.get(t);return new Promise(i=>{o.onerror=()=>i(null),o.onsuccess=()=>i(o.result?o.result.value:null)})}).catch(()=>null)}removeItem(t){return this.withObjectStore("readwrite",r=>{const o=r.delete(t);return new Promise((i,s)=>{o.onerror=()=>s(o.error),o.onsuccess=()=>i()})})}setItem(t,r){return this.withObjectStore("readwrite",o=>{const i=o.put({id:t,value:r});return new Promise((s,a)=>{i.onerror=()=>a(i.error),i.onsuccess=()=>s()})})}getDb(){const t=self.indexedDB.open(this.dbName,1);return new Promise((r,o)=>{t.onsuccess=()=>{r(t.result)},t.onerror=()=>{o(t.error)},t.onblocked=()=>{o(new Error("Unable to access DB"))},t.onupgradeneeded=()=>{const i=t.result;i.onerror=()=>{o(new Error("Failed to create object store"))},i.createObjectStore(T1,{keyPath:"id"})}})}withObjectStore(t,r){return this.getDb().then(o=>{const i=o.transaction(T1,t);return i.oncomplete=()=>o.close(),new Promise((s,a)=>{i.onerror=()=>a(i.error),s(r(i.objectStore(T1)))}).catch(s=>{throw o.close(),s})})}}class xGe{store;constructor(t={}){this.store=t}getItem(t){return t in this.store?this.store[t]:null}removeItem(t){delete this.store[t]}setItem(t,r){this.store[t]=r}}const SGe=new xGe;function CGe(){return typeof self=="object"&&self.indexedDB?new vGe:typeof window=="object"&&window.localStorage?window.localStorage:SGe}function wGe({accountId:e,cache:t=CGe(),client:r,clientConfig:o,customRoleArn:i,identityPoolId:s,logins:a,userIdentifier:l=!a||Object.keys(a).length===0?"ANONYMOUS":void 0,logger:c,parentClientConfig:u}){c?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const d=l?`aws:cognito-identity-credentials:${s}:${l}`:void 0;let f=async p=>{const{GetIdCommand:h,CognitoIdentityClient:b}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DrcsByX4.js")),g=C=>o?.[C]??u?.[C]??p?.callerClientConfig?.[C],y=r??new b(Object.assign({},o??{},{region:g("region"),profile:g("profile"),userAgentAppId:g("userAgentAppId")}));let v=d&&await t.getItem(d);if(!v){const{IdentityId:C=TGe(c)}=await y.send(new h({AccountId:e,IdentityPoolId:s,Logins:a?await sY(a):void 0}));v=C,d&&Promise.resolve(t.setItem(d,v)).catch(()=>{})}return f=mGe({client:y,customRoleArn:i,logins:a,identityId:v}),f(p)};return p=>f(p).catch(async h=>{throw d&&Promise.resolve(t.removeItem(d)).catch(()=>{}),h})}function TGe(e){throw new fp("Response from Amazon Cognito contained no identity ID",{logger:e})}const OGe=e=>wGe({...e});function PGe(e){const t=e.split(","),r=t[0].match(/:(.*?);/)[1],o=atob(t[1]);let i=o.length;const s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new Blob([s],{type:r})}async function EGe(e,t,r,o,i,s=""){if(!i||!r||!o)return console.warn("Missing AWS Config (Pool ID, Bucket, or Region). Returning data URL as fallback."),e;try{const a=new cGe({region:o,credentials:OGe({clientConfig:{region:o},identityPoolId:i}),requestChecksumCalculation:"WHEN_REQUIRED",forcePathStyle:!0}),l=PGe(e);let c=s.trim();c&&!c.endsWith("/")&&(c+="/");const u=c?`${c}${t}`:`signatures/${t}`,d=new hGe({Bucket:r,Key:u,Body:l,ContentType:l.type});return await a.send(d),`https://${r}/${u}`}catch(a){throw console.error("Error uploading to S3:",a),a}}function IGe({attributes:e={},rules:t={},onChange:r}){const{id:o="",MuiAttributes:i={},label:s="Signature",bucket:a="",region:l="",identityPoolId:c="",path:u="",disabled:d=!1,CanvasProps:f={}}=e,p=Ue.useRef(null),h=Ue.useRef(null),[b,g]=Ue.useState(!1),[y,v]=Ue.useState(e.value||null),[C,O]=Ue.useState(400),[T,P]=Ue.useState(!1),k=t?.validation?.some(A=>A.rule==="mandatory")||!1,M=f?.style?.height||150;Ue.useEffect(()=>{const A=h.current;if(!A)return;const F=new ResizeObserver(I=>{const N=I[0]?.contentRect?.width;N&&N>0&&O(Math.floor(N))});return F.observe(A),()=>F.disconnect()},[]),Ue.useEffect(()=>{e.value&&p.current&&p.current.fromDataURL(e.value,{width:C,height:M})},[e.value,C,M]);const _=()=>{p.current&&p.current.clear(),v(null),P(!1),r&&r({id:o,value:""})},D=async()=>{if(!p.current||p.current.isEmpty())return;g(!0);const A=p.current.getTrimmedCanvas().toDataURL("image/png"),F=`${o}-${Date.now()}.png`;try{const I=await EGe(A,F,a,l,c,u);v(I),P(!0),r&&r({id:o,value:I})}catch(I){console.error("Signature upload failed",I)}finally{g(!1)}};return w.jsxs(ht.Box,{sx:{width:"100%",...i.sx},children:[w.jsxs(ht.Typography,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[s,k&&w.jsx(ht.Box,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),w.jsx(ht.Box,{ref:h,sx:{border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",bgcolor:"background.paper"},children:w.jsx(CC,{ref:p,penColor:"black",canvasProps:{className:"sigCanvas",width:C,height:M,style:{display:"block",pointerEvents:d?"none":"auto",...f?.style,width:"100%",height:M}},backgroundColor:"transparent"})}),w.jsxs(ht.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1,alignItems:"center",mt:1},children:[w.jsx(ht.Button,{variant:"outlined",color:"secondary",onClick:_,size:"small",disabled:d||b,children:"Clear"}),w.jsx(ht.Button,{variant:"contained",color:"primary",onClick:D,size:"small",disabled:d||b||y!==null,startIcon:b?w.jsx(ht.CircularProgress,{size:16,color:"inherit"}):null,children:y?"Saved":"Save"}),T&&y&&w.jsx(ht.Typography,{variant:"caption",color:"success.main",children:"Signature Saved!"})]})]})}function kGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},label:i="Group",subFields:s=[]}=e,a=Ue.useMemo(()=>SC(),[]);return w.jsxs(ht.Paper,{elevation:1,sx:{p:2,mb:2,...o.sx},...o,children:[w.jsx(ht.Typography,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:600},children:i}),w.jsx(ht.Box,{children:w.jsx(pp,{guid:a,data:s,patch:t,onChange:r})})]})}function RGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},label:i="Accordion",subFields:s=[]}=e,a=Ue.useMemo(()=>SC(),[]);return w.jsxs(ht.Accordion,{...o,children:[w.jsx(ht.AccordionSummary,{expandIcon:w.jsx(ht.Icon,{children:"expand_more"}),children:w.jsx(ht.Typography,{children:i})}),w.jsx(ht.AccordionDetails,{children:w.jsx(pp,{guid:a,data:s,patch:t,onChange:r})})]})}function MGe(e){const{children:t,value:r,index:o,...i}=e;return w.jsx("div",{role:"tabpanel",hidden:r!==o,id:`simple-tabpanel-${o}`,"aria-labelledby":`simple-tab-${o}`,...i,children:r===o&&w.jsx(ht.Box,{sx:{p:3},children:t})})}function AGe({attributes:e={},patch:t,onChange:r}){const{MuiAttributes:o={},tabs:i=[]}=e,[s,a]=Ue.useState(0),l=Ue.useMemo(()=>i.map(()=>SC()),[i.length]),c=(u,d)=>{a(d)};return w.jsxs(ht.Box,{sx:{width:"100%"},children:[w.jsx(ht.Box,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsx(ht.Tabs,{value:s,onChange:c,...o,children:i.map((u,d)=>w.jsx(ht.Tab,{label:u.label},d))})}),i.map((u,d)=>w.jsx(MGe,{value:s,index:d,children:w.jsx(pp,{guid:l[d],data:u.subFields||[],patch:t,onChange:r})},d))]})}function DGe({attributes:e={},rules:t={},onChange:r}){const{MuiAttributes:o={},id:i="",options:s=[],label:a="Combo Box"}=e,[l,c]=Ue.useState(e.value||null),[u,d]=Ue.useState(!1),[f,p]=Ue.useState("");Ue.useEffect(()=>{e.value&&c(e.value)},[]),oa(()=>{c(e.value)},[e.value]);const h=v=>{let C=!0,O="";if(t?.validation){for(const T of t.validation)if(T.rule==="mandatory"&&!v){C=!1,O=T.message||"Required";break}}return{isValid:C,message:O}},b=(v,C)=>{c(C);const O=h(C);d(!O.isValid),p(O.message),r&&r({id:i,value:C})},g=()=>{const v=h(l);d(!v.isValid),p(v.message)},y=t?.validation?.some(v=>v.rule==="mandatory")||!1;return w.jsx(hS,{disablePortal:!0,id:i,options:s,value:l,onChange:b,fullWidth:!0,renderInput:v=>w.jsx(dl,{...v,label:a,required:y,error:u,helperText:f,onBlur:g}),...o})}function _Ge(e){return Je("MuiImageList",e)}Ze("MuiImageList",["root","masonry","quilted","standard","woven"]);const oA=S.createContext({});process.env.NODE_ENV!=="production"&&(oA.displayName="ImageListContext");const NGe=e=>{const{classes:t,variant:r}=e;return Ie({root:["root",r]},_Ge,t)},FGe=ie("ul",{name:"MuiImageList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant]]}})({display:"grid",overflowY:"auto",listStyle:"none",padding:0,WebkitOverflowScrolling:"touch",variants:[{props:{variant:"masonry"},style:{display:"block"}}]}),aY=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiImageList"}),{children:i,className:s,cols:a=2,component:l="ul",rowHeight:c="auto",gap:u=4,style:d,variant:f="standard",...p}=o,h=S.useMemo(()=>({rowHeight:c,gap:u,variant:f}),[c,u,f]),b=f==="masonry"?{columnCount:a,columnGap:u,...d}:{gridTemplateColumns:`repeat(${a}, 1fr)`,gap:u,...d},g={...o,component:l,gap:u,rowHeight:c,variant:f},y=NGe(g);return w.jsx(FGe,{as:l,className:Te(y.root,y[f],s),ref:r,style:b,ownerState:g,...p,children:w.jsx(oA.Provider,{value:h,children:i})})});process.env.NODE_ENV!=="production"&&(aY.propTypes={children:n.node.isRequired,classes:n.object,className:n.string,cols:el,component:n.elementType,gap:n.number,rowHeight:n.oneOfType([n.oneOf(["auto"]),n.number]),style:n.object,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object]),variant:n.oneOfType([n.oneOf(["masonry","quilted","standard","woven"]),n.string])});function LGe(e){return Je("MuiImageListItem",e)}const O1=Ze("MuiImageListItem",["root","img","standard","woven","masonry","quilted"]),$Ge=e=>{const{classes:t,variant:r}=e;return Ie({root:["root",r],img:["img"]},LGe,t)},jGe=ie("li",{name:"MuiImageListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${O1.img}`]:t.img},t.root,t[r.variant]]}})({display:"block",position:"relative",[`& .${O1.img}`]:{objectFit:"cover",width:"100%",height:"100%",display:"block"},variants:[{props:{variant:"standard"},style:{display:"flex",flexDirection:"column"}},{props:{variant:"woven"},style:{height:"100%",alignSelf:"center","&:nth-of-type(even)":{height:"70%"}}},{props:{variant:"standard"},style:{[`& .${O1.img}`]:{height:"auto",flexGrow:1}}}]}),lY=S.forwardRef(function(t,r){const o=Dt({props:t,name:"MuiImageListItem"}),{children:i,className:s,cols:a=1,component:l="li",rows:c=1,style:u,...d}=o,{rowHeight:f="auto",gap:p,variant:h}=S.useContext(oA);let b="auto";h==="woven"?b=void 0:f!=="auto"&&(b=f*c+p*(c-1));const g={...o,cols:a,component:l,gap:p,rowHeight:f,rows:c,variant:h},y=$Ge(g);return w.jsx(jGe,{as:l,className:Te(y.root,y[h],s),ref:r,style:{height:b,gridColumnEnd:h!=="masonry"?`span ${a}`:void 0,gridRowEnd:h!=="masonry"?`span ${c}`:void 0,marginBottom:h==="masonry"?p:void 0,breakInside:h==="masonry"?"avoid":void 0,...u},ownerState:g,...d,children:S.Children.map(i,v=>S.isValidElement(v)?(process.env.NODE_ENV!=="production"&&Tm.isFragment(v)&&console.error(["MUI: The ImageListItem component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
465
465
  `)),v.type==="img"||nf(v,["Image"])?S.cloneElement(v,{className:Te(y.img,v.props.className)}):v):null)})});process.env.NODE_ENV!=="production"&&(lY.propTypes={children:n.node,classes:n.object,className:n.string,cols:el,component:n.elementType,rows:el,style:n.object,sx:n.oneOfType([n.arrayOf(n.oneOfType([n.func,n.object,n.bool])),n.func,n.object])});function BGe({attributes:e={}}){const{MuiAttributes:t={},items:r=[],width:o=500,height:i=450,cols:s=3,rowHeight:a=164}=e;return w.jsx(aY,{sx:{width:o,height:i},cols:s,rowHeight:a,...t,children:r.map(l=>w.jsx(lY,{children:w.jsx("img",{srcSet:`${l.img}?w=${a}&h=${a}&fit=crop&auto=format&dpr=2 2x`,src:`${l.img}?w=${a}&h=${a}&fit=crop&auto=format`,alt:l.title,loading:"lazy"})},l.img))})}function VGe({attributes:e={},rules:t={}}){const{label:r="",value:o="",MuiAttributes:i={},url:s="",target:a="_blank",displayText:l=""}=e,c=t?.validation?.some(f=>f.rule==="mandatory")||!1,u=s||o||"#",d=l||r||u;return w.jsxs(ht.Box,{sx:{width:"100%"},...i.container,children:[r&&l&&w.jsxs(ht.Typography,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},...i.displayText,children:[r,c&&w.jsx(ht.Box,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),w.jsx(ht.Link,{href:u,target:a,rel:a==="_blank"?"noopener noreferrer":void 0,...i.link,children:d})]})}function HGe({attributes:e={},rules:t={},onChange:r}){const{id:o="",MuiAttributes:i={},InputProps:s={},format:a="",buttonText:l="Update Location",buttonIcon:c="location_on",buttonDisplay:u="both",MuiButtonAttributes:d={},disabled:f=!1}=e,[p,h]=Ue.useState({value:e.value!==void 0?e.value:"",helperText:i.helperText||"",error:!1});Ue.useEffect(()=>{e.value!==void 0&&e.value!==p.value&&h(I=>({...I,value:e.value}))},[e.value]);const b=I=>a?yE(I).format(a):I,g=I=>{const{validation:N}=t;if(N)for(let j=0;j<N.length;j+=1){const H=N[j];if(!Uh[H.rule](I,H.value))return{isValid:!1,message:H.message}}return{isValid:!0,message:""}},y=I=>{const{value:N}=I.target,j=g(N);h({value:N,helperText:j.message,error:!j.isValid})},v=I=>{const{value:N}=I.target,j=b(N),H=g(j);h({value:j,helperText:H.message,error:!H.isValid}),typeof r=="function"&&r({id:o,value:j})},C=()=>{r&&r({id:o,value:p.value,option:"location_update_request"})},O=()=>{const I=u,N=w.jsx(ht.Icon,{children:c});switch(I){case"icon":return N;case"text":return w.jsx(w.Fragment,{children:l});default:return w.jsxs(w.Fragment,{children:[N,w.jsx(uf,{component:"span",sx:{ml:.5},children:l})]})}},T=t?.validation?.some(I=>I.rule==="mandatory")||!1,P=!!i?.slotProps,k={...i};let M,_;if(P){const I=i.slotProps&&i.slotProps.input||{};_={...i.slotProps||{},input:{...I}},delete k.slotProps}else M={...i.inputProps||{}},delete k.inputProps;const D=i.variant||"outlined",A=i.size||"medium",F=A==="small"?D==="outlined"?40:48:56;return w.jsxs(uf,{sx:{display:"flex",gap:1,alignItems:"flex-start",width:"100%"},children:[w.jsx(uf,{sx:{flex:1,minWidth:0},children:w.jsx(dl,{fullWidth:!0,...k,required:T,inputProps:P?void 0:M,slotProps:P?_:void 0,InputProps:PI(s),onChange:y,onBlur:v,value:p.value,error:p.error,helperText:p.helperText,disabled:f})}),w.jsx(xs,{variant:"outlined",color:"primary",size:A==="small"?"small":"medium",onClick:C,disabled:f,...d,sx:{whiteSpace:"nowrap",minWidth:"auto",height:F,flexShrink:0,...d?.sx},children:O()})]})}const iA={Typography:Pie,TextField:lye,Table:Qke,DateTime:ORe,DateTimePicker:PRe,TimePicker:ERe,Select:ARe,CheckBox:DRe,Switch:NRe,Radio:tMe,Stepper:iMe,Bar:EBe,Line:lVe,Pie:RVe,MixChart:MVe,Divider:AVe,Chip:DVe,List:_Ve,NumberField:sHe,MultiTextbox:aHe,LineItemList:cHe,FormRepeater:mHe,Signature:IGe,Group:kGe,Accordion:RGe,Tabs:AGe,AutoComplete:DGe,ImgList:BGe,Hyperlink:VGe,LocationField:HGe};function cY(e){const{map:t}=e;if(!t)return w.jsx("div",{});const r=iA[t];return r?w.jsx(r,{...e}):w.jsx("div",{})}const zGe={MUI:{map:uE}},Si={},uY=e=>e?Si[e]:Si,qGe=e=>{const t=Object.keys(Si);e?delete Si[e]:t.forEach(r=>delete Si[r])},UGe=e=>e?.filter(t=>t?.rules?.validation?.some(r=>r.rule==="mandatory")),GGe=(e,t)=>UGe(e)?.reduce((o,i)=>(i?.rules?.validation?.forEach(s=>{const a=i?.id||i?.props?.id;if(!a)return;const l=Si[t]?.[a]?.toString();l&&Uh[s.rule](l,s.value)||o.push({...s,id:i.id})}),o),[]),WGe={};function pp({data:e=[],patch:t=WGe,guid:r,formRef:o,onSubmit:i,onChange:s,onStepChange:a,MuiGridAttributes:l={spacing:2},activeStep:c=0,onFieldClick:u,onFieldDoubleClick:d,onFieldContextMenu:f}){const[p,h]=Ue.useState(t),[b,g]=Ue.useState(0),y=zGe.MUI,v=Ue.useMemo(()=>Ege(P5(e,p,r,Si)),[p,e,r]);Ue.useEffect(()=>{P1(Si[r])&&(Si[r]=t)},[]),oa(()=>{h({...t})},[t]);const C=Ue.useCallback(({id:k,value:M,option:_})=>{Si[r]||(Si[r]={}),Si[r][k]=M,g(D=>D+1),typeof s=="function"&&s({id:k,value:M,option:_})},[r,s]),O=Ue.useCallback((k,M,_)=>{if(typeof k=="function"){const D=GGe(M,_);k(Si,D,M,_)}},[]),T=(k,M,_)=>{typeof a=="function"&&a(k,M,_)},P=(k,M)=>{const{type:_="",style:D={},className:A="",visible:F=!1,rules:I={},subforms:N=[]}=k,j=k.props||{},H=k.layout||{},$=k?.id||j?.id,B=y.map[_]||{},{options:q={}}=B,U=$?Si[r]?.[$]:void 0,V=N.find(L=>Array.isArray(U)?U.includes(L.conditionValue):L.conditionValue===U);return w.jsxs(ht.Grid,{style:{...D,cursor:u?"pointer":"default",position:"relative",transition:"background-color 0.2s, box-shadow 0.2s",borderRadius:4},...H,className:`${A} ${F?"show":"hidden"}`,onClick:L=>{},onDoubleClick:L=>{d&&(L.stopPropagation(),d(k))},onContextMenu:L=>{f&&(L.preventDefault(),L.stopPropagation(),f(L,k))},children:[w.jsx(cY,{map:B.map,option:q.type||"",control:k,attributes:j,rules:I,onChange:C,onStepUpdate:T,currentStep:c,patch:t},`dynamic-comp-${$||M}`),V&&V.data&&w.jsx(ht.Box,{sx:{mt:2,pl:2,borderLeft:"2px solid",borderColor:"divider",width:"100%"},children:w.jsx(pp,{guid:`${r}-subform-${$}`,data:V.data,patch:t,onChange:C,MuiGridAttributes:{spacing:1}})})]},$||`layout-comp-${M}`)};return w.jsxs(w.Fragment,{children:[w.jsx(ht.Grid,{container:!0,...l,children:v.wrows.map((k,M)=>w.jsx(Ue.Fragment,{children:k.map(P)},`row-${M}`))},`layout-grid-${r}`),v.worows.length>0&&w.jsx(ht.Grid,{container:!0,...l,children:v.worows.map((k,M)=>P(k,M))},`layout-grid-worows-${r}`),w.jsx("button",{"aria-label":"button",type:"button",ref:o||null,onClick:()=>O(i,e,r),style:{display:"none"}})]})}exports.AwsSdkSigV4Signer=vM;exports.ClearFormData=qGe;exports.Client=m7;exports.Command=IC;exports.Controls=iA;exports.DEFAULT_MAX_ATTEMPTS=mm;exports.DEFAULT_RETRY_MODE=rK;exports.DEFAULT_USE_DUALSTACK_ENDPOINT=K7;exports.DEFAULT_USE_FIPS_ENDPOINT=Y7;exports.DefaultIdentityProviderConfig=r7;exports.DynamicComponent=cY;exports.EndpointCache=_7;exports.FetchHttpHandler=wC;exports.FormData=uY;exports.FormGenerator=pp;exports.HttpProtocol=t7;exports.HttpRequest=Br;exports.LazyJsonString=Qa;exports.NoOpLogger=kC;exports.NormalizedSchema=or;exports.NumericValue=fg;exports.ProtocolLib=x7;exports.SerdeContextConfig=RC;exports.ServiceException=Qc;exports.Sha256=JK;exports.TypeRegistry=ti;exports.UnionSerde=S7;exports.calculateBodyLength=h7;exports.collectBody=fh;exports.createDefaultUserAgentProvider=eY;exports.customEndpointFunctions=fm;exports.dateToUtcString=i0;exports.deref=Xv;exports.determineTimestampFormat=EC;exports.fromBase64=Tu;exports.fromUtf8=cl;exports.getAwsRegionExtensionConfiguration=oY;exports.getContentLengthPlugin=Q7;exports.getDefaultExtensionConfiguration=b7;exports.getEndpointPlugin=DM;exports.getHostHeaderPlugin=k7;exports.getHttpAuthSchemeEndpointRuleSetPlugin=HW;exports.getHttpHandlerExtensionConfiguration=jW;exports.getHttpSigningPlugin=qW;exports.getLoggerPlugin=R7;exports.getRecursionDetectionPlugin=M7;exports.getRetryPlugin=lK;exports.getSchemaSerdePlugin=ZW;exports.getSmithyContext=gl;exports.getUserAgentPlugin=W7;exports.invalidProvider=nY;exports.isIpAddress=MM;exports.isValidHostLabel=pg;exports.loadConfigsForDefaultMode=g7;exports.mui=uE;exports.normalizeProvider=Rs;exports.parseEpochTimestamp=Mze;exports.parseRfc3339DateTimeWithOffset=Pze;exports.parseRfc7231DateTime=Rze;exports.parseUrl=hm;exports.resolveAwsRegionExtensionConfiguration=iY;exports.resolveAwsSdkSigV4Config=p7;exports.resolveDefaultRuntimeConfig=y7;exports.resolveDefaultsModeConfig=rY;exports.resolveEndpoint=q7;exports.resolveEndpointConfig=nK;exports.resolveHostHeaderConfig=x3e;exports.resolveHttpHandlerRuntimeConfig=BW;exports.resolveRegionConfig=X7;exports.resolveRetryConfig=aK;exports.resolveUserAgentConfig=D7;exports.streamCollector=xM;exports.toBase64=oc;exports.toUtf8=zu;exports.v4=OC;