datocms-plugin-record-bin 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -11
- package/build/assets/index-BnrW9Ts8.js +15 -0
- package/build/assets/index-aWCW2c0n.css +1 -0
- package/build/index.html +13 -1
- package/index.html +12 -0
- package/package.json +24 -18
- package/src/entrypoints/BinOutlet.tsx +262 -37
- package/src/entrypoints/ConfigScreen.tsx +939 -38
- package/src/entrypoints/ErrorModal.tsx +86 -2
- package/src/index.tsx +73 -28
- package/src/react-app-env.d.ts +1 -1
- package/src/types/types.ts +36 -8
- package/src/utils/binCleanup.test.ts +107 -0
- package/src/utils/binCleanup.ts +71 -23
- package/src/utils/debugLogger.ts +27 -0
- package/src/utils/deployProviders.test.ts +33 -0
- package/src/utils/deployProviders.ts +28 -0
- package/src/utils/getDeploymentUrlFromParameters.test.ts +26 -0
- package/src/utils/getDeploymentUrlFromParameters.ts +21 -0
- package/src/utils/getRuntimeMode.test.ts +57 -0
- package/src/utils/getRuntimeMode.ts +23 -0
- package/src/utils/lambdaLessCapture.test.ts +218 -0
- package/src/utils/lambdaLessCapture.ts +160 -0
- package/src/utils/lambdaLessCleanup.test.ts +125 -0
- package/src/utils/lambdaLessCleanup.ts +69 -0
- package/src/utils/lambdaLessRestore.test.ts +248 -0
- package/src/utils/lambdaLessRestore.ts +159 -0
- package/src/utils/recordBinModel.ts +108 -0
- package/src/utils/recordBinPayload.test.ts +103 -0
- package/src/utils/recordBinPayload.ts +136 -0
- package/src/utils/recordBinWebhook.test.ts +253 -0
- package/src/utils/recordBinWebhook.ts +305 -0
- package/src/utils/render.tsx +17 -8
- package/src/utils/restoreError.test.ts +112 -0
- package/src/utils/restoreError.ts +221 -0
- package/src/utils/verifyLambdaHealth.test.ts +248 -0
- package/src/utils/verifyLambdaHealth.ts +422 -0
- package/vite.config.ts +11 -0
- package/build/asset-manifest.json +0 -13
- package/build/static/css/main.10f29737.css +0 -2
- package/build/static/css/main.10f29737.css.map +0 -1
- package/build/static/js/main.53795e3b.js +0 -3
- package/build/static/js/main.53795e3b.js.LICENSE.txt +0 -47
- package/build/static/js/main.53795e3b.js.map +0 -1
- package/src/entrypoints/InstallationModal.tsx +0 -107
- package/src/entrypoints/PreInstallConfig.tsx +0 -28
- package/src/utils/attemptVercelInitialization.ts +0 -16
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))a(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function o(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function a(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();function ms(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var la={exports:{}},wi={},aa={exports:{}},ve={};var xd;function Jm(){if(xd)return ve;xd=1;var i=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function y(b){return b===null||typeof b!="object"?null:(b=v&&b[v]||b["@@iterator"],typeof b=="function"?b:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,I={};function M(b,L,U){this.props=b,this.context=L,this.refs=I,this.updater=U||T}M.prototype.isReactComponent={},M.prototype.setState=function(b,L){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,L,"setState")},M.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function q(){}q.prototype=M.prototype;function te(b,L,U){this.props=b,this.context=L,this.refs=I,this.updater=U||T}var X=te.prototype=new q;X.constructor=te,x(X,M.prototype),X.isPureReactComponent=!0;var V=Array.isArray,fe=Object.prototype.hasOwnProperty,ne={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function ae(b,L,U){var le,de={},me=null,be=null;if(L!=null)for(le in L.ref!==void 0&&(be=L.ref),L.key!==void 0&&(me=""+L.key),L)fe.call(L,le)&&!$.hasOwnProperty(le)&&(de[le]=L[le]);var we=arguments.length-2;if(we===1)de.children=U;else if(1<we){for(var xe=Array(we),Ke=0;Ke<we;Ke++)xe[Ke]=arguments[Ke+2];de.children=xe}if(b&&b.defaultProps)for(le in we=b.defaultProps,we)de[le]===void 0&&(de[le]=we[le]);return{$$typeof:i,type:b,key:me,ref:be,props:de,_owner:ne.current}}function _e(b,L){return{$$typeof:i,type:b.type,key:L,ref:b.ref,props:b.props,_owner:b._owner}}function oe(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function re(b){var L={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(U){return L[U]})}var ye=/\/+/g;function ie(b,L){return typeof b=="object"&&b!==null&&b.key!=null?re(""+b.key):L.toString(36)}function ke(b,L,U,le,de){var me=typeof b;(me==="undefined"||me==="boolean")&&(b=null);var be=!1;if(b===null)be=!0;else switch(me){case"string":case"number":be=!0;break;case"object":switch(b.$$typeof){case i:case n:be=!0}}if(be)return be=b,de=de(be),b=le===""?"."+ie(be,0):le,V(de)?(U="",b!=null&&(U=b.replace(ye,"$&/")+"/"),ke(de,L,U,"",function(Ke){return Ke})):de!=null&&(oe(de)&&(de=_e(de,U+(!de.key||be&&be.key===de.key?"":(""+de.key).replace(ye,"$&/")+"/")+b)),L.push(de)),1;if(be=0,le=le===""?".":le+":",V(b))for(var we=0;we<b.length;we++){me=b[we];var xe=le+ie(me,we);be+=ke(me,L,U,xe,de)}else if(xe=y(b),typeof xe=="function")for(b=xe.call(b),we=0;!(me=b.next()).done;)me=me.value,xe=le+ie(me,we++),be+=ke(me,L,U,xe,de);else if(me==="object")throw L=String(b),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return be}function Fe(b,L,U){if(b==null)return b;var le=[],de=0;return ke(b,le,"","",function(me){return L.call(U,me,de++)}),le}function Pe(b){if(b._status===-1){var L=b._result;L=L(),L.then(function(U){(b._status===0||b._status===-1)&&(b._status=1,b._result=U)},function(U){(b._status===0||b._status===-1)&&(b._status=2,b._result=U)}),b._status===-1&&(b._status=0,b._result=L)}if(b._status===1)return b._result.default;throw b._result}var Se={current:null},j={transition:null},J={ReactCurrentDispatcher:Se,ReactCurrentBatchConfig:j,ReactCurrentOwner:ne};function z(){throw Error("act(...) is not supported in production builds of React.")}return ve.Children={map:Fe,forEach:function(b,L,U){Fe(b,function(){L.apply(this,arguments)},U)},count:function(b){var L=0;return Fe(b,function(){L++}),L},toArray:function(b){return Fe(b,function(L){return L})||[]},only:function(b){if(!oe(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},ve.Component=M,ve.Fragment=o,ve.Profiler=c,ve.PureComponent=te,ve.StrictMode=a,ve.Suspense=_,ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,ve.act=z,ve.cloneElement=function(b,L,U){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var le=x({},b.props),de=b.key,me=b.ref,be=b._owner;if(L!=null){if(L.ref!==void 0&&(me=L.ref,be=ne.current),L.key!==void 0&&(de=""+L.key),b.type&&b.type.defaultProps)var we=b.type.defaultProps;for(xe in L)fe.call(L,xe)&&!$.hasOwnProperty(xe)&&(le[xe]=L[xe]===void 0&&we!==void 0?we[xe]:L[xe])}var xe=arguments.length-2;if(xe===1)le.children=U;else if(1<xe){we=Array(xe);for(var Ke=0;Ke<xe;Ke++)we[Ke]=arguments[Ke+2];le.children=we}return{$$typeof:i,type:b.type,key:de,ref:me,props:le,_owner:be}},ve.createContext=function(b){return b={$$typeof:f,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:d,_context:b},b.Consumer=b},ve.createElement=ae,ve.createFactory=function(b){var L=ae.bind(null,b);return L.type=b,L},ve.createRef=function(){return{current:null}},ve.forwardRef=function(b){return{$$typeof:h,render:b}},ve.isValidElement=oe,ve.lazy=function(b){return{$$typeof:m,_payload:{_status:-1,_result:b},_init:Pe}},ve.memo=function(b,L){return{$$typeof:g,type:b,compare:L===void 0?null:L}},ve.startTransition=function(b){var L=j.transition;j.transition={};try{b()}finally{j.transition=L}},ve.unstable_act=z,ve.useCallback=function(b,L){return Se.current.useCallback(b,L)},ve.useContext=function(b){return Se.current.useContext(b)},ve.useDebugValue=function(){},ve.useDeferredValue=function(b){return Se.current.useDeferredValue(b)},ve.useEffect=function(b,L){return Se.current.useEffect(b,L)},ve.useId=function(){return Se.current.useId()},ve.useImperativeHandle=function(b,L,U){return Se.current.useImperativeHandle(b,L,U)},ve.useInsertionEffect=function(b,L){return Se.current.useInsertionEffect(b,L)},ve.useLayoutEffect=function(b,L){return Se.current.useLayoutEffect(b,L)},ve.useMemo=function(b,L){return Se.current.useMemo(b,L)},ve.useReducer=function(b,L,U){return Se.current.useReducer(b,L,U)},ve.useRef=function(b){return Se.current.useRef(b)},ve.useState=function(b){return Se.current.useState(b)},ve.useSyncExternalStore=function(b,L,U){return Se.current.useSyncExternalStore(b,L,U)},ve.useTransition=function(){return Se.current.useTransition()},ve.version="18.3.1",ve}var Od;function Ua(){return Od||(Od=1,aa.exports=Jm()),aa.exports}var Rd;function Zm(){if(Rd)return wi;Rd=1;var i=Ua(),n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function f(h,_,g){var m,v={},y=null,T=null;g!==void 0&&(y=""+g),_.key!==void 0&&(y=""+_.key),_.ref!==void 0&&(T=_.ref);for(m in _)a.call(_,m)&&!d.hasOwnProperty(m)&&(v[m]=_[m]);if(h&&h.defaultProps)for(m in _=h.defaultProps,_)v[m]===void 0&&(v[m]=_[m]);return{$$typeof:n,type:h,key:y,ref:T,props:v,_owner:c.current}}return wi.Fragment=o,wi.jsx=f,wi.jsxs=f,wi}var Id;function ey(){return Id||(Id=1,la.exports=Zm()),la.exports}var Q=ey(),Bo={exports:{}},Ve={},Ld;function za(){if(Ld)return Ve;Ld=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.DATA_CLONE_ERROR=Ve.MESSAGE=Ve.REJECTED=Ve.FULFILLED=Ve.REPLY=Ve.CALL=Ve.HANDSHAKE_REPLY=Ve.HANDSHAKE=void 0;const i="handshake";Ve.HANDSHAKE=i;const n="handshake-reply";Ve.HANDSHAKE_REPLY=n;const o="call";Ve.CALL=o;const a="reply";Ve.REPLY=a;const c="fulfilled";Ve.FULFILLED=c;const d="rejected";Ve.REJECTED=d;const f="message";Ve.MESSAGE=f;const h="DataCloneError";return Ve.DATA_CLONE_ERROR=h,Ve}var At={},Dd;function Ff(){if(Dd)return At;Dd=1,Object.defineProperty(At,"__esModule",{value:!0}),At.ERR_NO_IFRAME_SRC=At.ERR_NOT_IN_IFRAME=At.ERR_CONNECTION_TIMEOUT=At.ERR_CONNECTION_DESTROYED=void 0;const i="ConnectionDestroyed";At.ERR_CONNECTION_DESTROYED=i;const n="ConnectionTimeout";At.ERR_CONNECTION_TIMEOUT=n;const o="NotInIframe";At.ERR_NOT_IN_IFRAME=o;const a="NoIframeSrc";return At.ERR_NO_IFRAME_SRC=a,At}var Ho={exports:{}},Nd;function ty(){return Nd||(Nd=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=()=>{const a=[];let c=!1;return{destroy(){c=!0,a.forEach(d=>{d()})},onDestroy(d){c?d():a.push(d)}}};n.default=o,i.exports=n.default})(Ho,Ho.exports)),Ho.exports}var Vo={exports:{}},Bn={},Fd;function Af(){if(Fd)return Bn;Fd=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.deserializeError=Bn.serializeError=void 0;const i=o=>{let a=o.name,c=o.message,d=o.stack;return{name:a,message:c,stack:d}};Bn.serializeError=i;const n=o=>{const a=new Error;return Object.keys(o).forEach(c=>a[c]=o[c]),a};return Bn.deserializeError=n,Bn}var Ad;function ny(){return Ad||(Ad=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=za(),a=Af(),c=(d,f,h)=>{const _=d.localName,g=d.local,m=d.remote,v=d.originForSending,y=d.originForReceiving;let T=!1;h(`${_}: Connecting call receiver`);const x=I=>{if(I.source!==m||I.data.penpal!==o.CALL)return;if(I.origin!==y){h(`${_} received message from origin ${I.origin} which did not match expected origin ${y}`);return}const M=I.data,q=M.methodName,te=M.args,X=M.id;h(`${_}: Received ${q}() call`);const V=fe=>ne=>{if(h(`${_}: Sending ${q}() reply`),T){h(`${_}: Unable to send ${q}() reply due to destroyed connection`);return}const $={penpal:o.REPLY,id:X,resolution:fe,returnValue:ne};fe===o.REJECTED&&ne instanceof Error&&($.returnValue=(0,a.serializeError)(ne),$.returnValueIsError=!0);try{m.postMessage($,v)}catch(ae){throw ae.name===o.DATA_CLONE_ERROR&&m.postMessage({penpal:o.REPLY,id:X,resolution:o.REJECTED,returnValue:(0,a.serializeError)(ae),returnValueIsError:!0},v),ae}};new Promise(fe=>fe(f[q].apply(f,te))).then(V(o.FULFILLED),V(o.REJECTED))};return g.addEventListener(o.MESSAGE,x),()=>{T=!0,g.removeEventListener(o.MESSAGE,x)}};n.default=c,i.exports=n.default})(Vo,Vo.exports)),Vo.exports}var Go={exports:{}},Wo={exports:{}},jd;function ry(){return jd||(jd=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;let o=0;var a=()=>++o;n.default=a,i.exports=n.default})(Wo,Wo.exports)),Wo.exports}var Md;function iy(){return Md||(Md=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=za(),a=Ff(),c=f(ry()),d=Af();function f(_){return _&&_.__esModule?_:{default:_}}var h=(_,g,m,v,y)=>{const T=g.localName,x=g.local,I=g.remote,M=g.originForSending,q=g.originForReceiving;let te=!1;y(`${T}: Connecting call sender`);const X=V=>function(){for(var fe=arguments.length,ne=new Array(fe),$=0;$<fe;$++)ne[$]=arguments[$];y(`${T}: Sending ${V}() call`);let ae;try{I.closed&&(ae=!0)}catch{ae=!0}if(ae&&v(),te){const _e=new Error(`Unable to send ${V}() call due to destroyed connection`);throw _e.code=a.ERR_CONNECTION_DESTROYED,_e}return new Promise((_e,oe)=>{const re=(0,c.default)(),ye=ie=>{if(ie.source!==I||ie.data.penpal!==o.REPLY||ie.data.id!==re)return;if(ie.origin!==q){y(`${T} received message from origin ${ie.origin} which did not match expected origin ${q}`);return}y(`${T}: Received ${V}() reply`),x.removeEventListener(o.MESSAGE,ye);let ke=ie.data.returnValue;ie.data.returnValueIsError&&(ke=(0,d.deserializeError)(ke)),(ie.data.resolution===o.FULFILLED?_e:oe)(ke)};x.addEventListener(o.MESSAGE,ye),I.postMessage({penpal:o.CALL,id:re,methodName:V,args:ne},M)})};return m.reduce((V,fe)=>(V[fe]=X(fe),V),_),()=>{te=!0}};n.default=h,i.exports=n.default})(Go,Go.exports)),Go.exports}var Yo={exports:{}},Ud;function oy(){return Ud||(Ud=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a=>function(){if(a){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];console.log("[Penpal]",...d)}};n.default=o,i.exports=n.default})(Yo,Yo.exports)),Yo.exports}var zd;function sy(){return zd||(zd=1,(function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=za(),a=Ff(),c=_(ty()),d=_(ny()),f=_(iy()),h=_(oy());function _(m){return m&&m.__esModule?m:{default:m}}var g=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=v.parentOrigin,T=y===void 0?"*":y,x=v.methods,I=x===void 0?{}:x,M=v.timeout,q=v.debug;const te=(0,h.default)(q);if(window===window.top){const _e=new Error("connectToParent() must be called within an iframe");throw _e.code=a.ERR_NOT_IN_IFRAME,_e}const X=(0,c.default)(),V=X.destroy,fe=X.onDestroy,ne=window,$=ne.parent;return{promise:new Promise((_e,oe)=>{let re;M!==void 0&&(re=setTimeout(()=>{const ie=new Error(`Connection to parent timed out after ${M}ms`);ie.code=a.ERR_CONNECTION_TIMEOUT,oe(ie),V()},M));const ye=ie=>{try{clearTimeout()}catch{return}if(ie.source!==$||ie.data.penpal!==o.HANDSHAKE_REPLY)return;if(T!=="*"&&T!==ie.origin){te(`Child received handshake reply from origin ${ie.origin} which did not match expected origin ${T}`);return}te("Child: Received handshake reply"),ne.removeEventListener(o.MESSAGE,ye);const ke={localName:"Child",local:ne,remote:$,originForSending:ie.origin==="null"?"*":ie.origin,originForReceiving:ie.origin},Fe={},Pe=(0,d.default)(ke,I,te);fe(Pe);const Se=(0,f.default)(Fe,ke,ie.data.methodNames,V,te);fe(Se),clearTimeout(re),_e(Fe)};ne.addEventListener(o.MESSAGE,ye),fe(()=>{ne.removeEventListener(o.MESSAGE,ye);const ie=new Error("Connection destroyed");ie.code=a.ERR_CONNECTION_DESTROYED,oe(ie)}),te("Child: Sending handshake"),$.postMessage({penpal:o.HANDSHAKE,methodNames:Object.keys(I)},T)}),destroy:V}};n.default=g,i.exports=n.default})(Bo,Bo.exports)),Bo.exports}var ly=sy();const ay=ms(ly);var Gt=function(){return Gt=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Gt.apply(this,arguments)};function $d(i,n){for(var o=Gt({},i),a=0,c=n;a<c.length;a++){var d=c[a];delete o[d]}return o}function ua(i){return function(n,o){if(i){for(var a={},c=0,d=n;c<d.length;c++){var f=d[c],h=o.itemTypes[f.relationships.item_type.data.id];a[f.id]=i(f,Gt(Gt({},o),{itemType:h}))}return a}}}function nn(i,n){var o=function(a,c,d){if(d.mode===i){var f=cy(c),h=function(_){n(a,Gt(Gt(Gt({},c),_),f))};return h(d),h}};return o.mode=i,o}function Oi(i,n){var o=function(a,c,d){if(d.mode===i){var f=function(h){n(a,Gt(Gt({},c),h))};return f(d),f}};return o.mode=i,o}function uy(){for(var i=document.querySelectorAll("body *"),n=0,o=0;o<i.length;o++)n=Math.max(i[o].getBoundingClientRect().bottom,n);return n}var cy=function(i){var n=null,o=function(g){var m=g===void 0?Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.getBoundingClientRect().height,uy()):g;m!==n&&(i.setHeight(m),n=m)},a=null,c=null,d=function(){return o()},f=function(){o(),a||(a=new ResizeObserver(d),a.observe(document.documentElement)),c||(c=new MutationObserver(d),c.observe(window.document.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}))},h=function(){a&&(a.disconnect(),a=null),c&&(c.disconnect(),c=null)},_=function(){return!!a};return{updateHeight:o,startAutoResizer:f,stopAutoResizer:h,isAutoResizerActive:_}},dy=nn("renderAssetSource",function(i,n){i.renderAssetSource&&i.renderAssetSource(n.assetSourceId,n)}),fy=nn("renderConfigScreen",function(i,n){i.renderConfigScreen&&i.renderConfigScreen(n)}),py=nn("renderFieldExtension",function(i,n){i.renderFieldExtension&&i.renderFieldExtension(n.fieldExtensionId,n)}),hy=Oi("renderInspector",function(i,n){i.renderInspector&&i.renderInspector(n.inspectorId,n)}),my=Oi("renderInspectorPanel",function(i,n){i.renderInspectorPanel&&i.renderInspectorPanel(n.panelId,n)}),yy=nn("renderItemCollectionOutlet",function(i,n){i.renderItemCollectionOutlet&&i.renderItemCollectionOutlet(n.itemCollectionOutletId,n)}),gy=nn("renderItemFormOutlet",function(i,n){i.renderItemFormOutlet&&i.renderItemFormOutlet(n.itemFormOutletId,n)}),vy=Oi("renderItemFormSidebar",function(i,n){i.renderItemFormSidebar&&i.renderItemFormSidebar(n.sidebarId,n)}),_y=nn("renderItemFormSidebarPanel",function(i,n){i.renderItemFormSidebarPanel&&i.renderItemFormSidebarPanel(n.sidebarPaneId,n)}),wy=nn("renderManualFieldExtensionConfigScreen",function(i,n){i.renderManualFieldExtensionConfigScreen&&i.renderManualFieldExtensionConfigScreen(n.fieldExtensionId,n)}),Ey=nn("renderModal",function(i,n){i.renderModal&&i.renderModal(n.modalId,n)}),Sy=Oi("renderPage",function(i,n){i.renderPage&&i.renderPage(n.pageId,n)}),ky=Oi("renderUploadSidebar",function(i,n){i.renderUploadSidebar&&i.renderUploadSidebar(n.sidebarId,n)}),by=nn("renderUploadSidebarPanel",function(i,n){i.renderUploadSidebarPanel&&i.renderUploadSidebarPanel(n.sidebarPaneId,n)}),Tt=function(){return Tt=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Tt.apply(this,arguments)},Ty=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})},Cy=function(i,n){var o={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,c,d,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=h(0),f.throw=h(1),f.return=h(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(g){return function(m){return _([g,m])}}function _(g){if(a)throw new TypeError("Generator is already executing.");for(;f&&(f=0,g[0]&&(o=0)),o;)try{if(a=1,c&&(d=g[0]&2?c.return:g[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,g[1])).done)return d;switch(c=0,d&&(g=[g[0]&2,d.value]),g[0]){case 0:case 1:d=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,c=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(d=o.trys,!(d=d.length>0&&d[d.length-1])&&(g[0]===6||g[0]===2)){o=0;continue}if(g[0]===3&&(!d||g[1]>d[0]&&g[1]<d[3])){o.label=g[1];break}if(g[0]===6&&o.label<d[1]){o.label=d[1],d=g;break}if(d&&o.label<d[2]){o.label=d[2],o.ops.push(g);break}d[2]&&o.ops.pop(),o.trys.pop();continue}g=n.call(i,o)}catch(m){g=[6,m],c=0}finally{a=d=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},qd=function(i,n,o){if(o||arguments.length===2)for(var a=0,c=n.length,d;a<c;a++)(d||!(a in n))&&(d||(d=Array.prototype.slice.call(n,0,a)),d[a]=n[a]);return i.concat(d||Array.prototype.slice.call(n))};function Py(){return Ty(this,arguments,void 0,function(i){var n,o,a,c,d,f,h,_,g,m,v,y;return i===void 0&&(i={}),Cy(this,function(T){switch(T.label){case 0:return n=null,o=null,a=Tt(Tt({},i),{overrideFieldExtensions:ua(i.overrideFieldExtensions),customMarksForStructuredTextField:ua(i.customMarksForStructuredTextField),customBlockStylesForStructuredTextField:ua(i.customBlockStylesForStructuredTextField)}),c=ay({methods:Tt(Tt({sdkVersion:function(){return"0.3.0"},implementedHooks:function(){return Object.fromEntries(Object.keys(i).map(function(x){return[x,!0]}))}},Object.fromEntries(Object.entries(a).filter(function(x){var I=x[0];return!I.startsWith("render")}))),{onChange:function(x){n&&n(x)},callMethodMergingBootCtx:function(x,I,M,q,te){return o?o(x,I,M,q,te):null}})}),[4,c.promise];case 1:return d=T.sent(),[4,d.getSettings()];case 2:for(f=T.sent(),f.mode==="onBoot"&&(h=f,n=function(x){h=x},o=function(x,I,M,q,te){var X;if(x in a)return(X=a)[x].apply(X,qd(qd([],I,!1),[Tt(Tt(Tt(Tt({},$d(d,["getSettings","setHeight"])),$d(h,["mode","bodyPadding"])),Object.fromEntries(q.map(function(V){return[V,function(){for(var ne=[],$=0;$<arguments.length;$++)ne[$]=arguments[$];return d.callAdditionalCtxMethod(te,V,ne)}]}))),M)],!1))},a.onBoot&&a.onBoot(Tt(Tt({},d),h))),_={renderAssetSource:dy,renderConfigScreen:fy,renderFieldExtension:py,renderItemCollectionOutlet:yy,renderItemFormOutlet:gy,renderItemFormSidebar:vy,renderItemFormSidebarPanel:_y,renderManualFieldExtensionConfigScreen:wy,renderModal:Ey,renderPage:Sy,renderInspector:hy,renderInspectorPanel:my,renderUploadSidebar:ky,renderUploadSidebarPanel:by},g=0,m=Object.values(_);g<m.length;g++)if(v=m[g],y=v(a,d,f),y){n=y;break}return[2]}})})}var Y=Ua();const H=ms(Y);var Ko={},ca={exports:{}},ct={},da={exports:{}},fa={};var Bd;function xy(){return Bd||(Bd=1,(function(i){function n(j,J){var z=j.length;j.push(J);e:for(;0<z;){var b=z-1>>>1,L=j[b];if(0<c(L,J))j[b]=J,j[z]=L,z=b;else break e}}function o(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var J=j[0],z=j.pop();if(z!==J){j[0]=z;e:for(var b=0,L=j.length,U=L>>>1;b<U;){var le=2*(b+1)-1,de=j[le],me=le+1,be=j[me];if(0>c(de,z))me<L&&0>c(be,de)?(j[b]=be,j[me]=z,b=me):(j[b]=de,j[le]=z,b=le);else if(me<L&&0>c(be,z))j[b]=be,j[me]=z,b=me;else break e}}return J}function c(j,J){var z=j.sortIndex-J.sortIndex;return z!==0?z:j.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var f=Date,h=f.now();i.unstable_now=function(){return f.now()-h}}var _=[],g=[],m=1,v=null,y=3,T=!1,x=!1,I=!1,M=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function X(j){for(var J=o(g);J!==null;){if(J.callback===null)a(g);else if(J.startTime<=j)a(g),J.sortIndex=J.expirationTime,n(_,J);else break;J=o(g)}}function V(j){if(I=!1,X(j),!x)if(o(_)!==null)x=!0,Pe(fe);else{var J=o(g);J!==null&&Se(V,J.startTime-j)}}function fe(j,J){x=!1,I&&(I=!1,q(ae),ae=-1),T=!0;var z=y;try{for(X(J),v=o(_);v!==null&&(!(v.expirationTime>J)||j&&!re());){var b=v.callback;if(typeof b=="function"){v.callback=null,y=v.priorityLevel;var L=b(v.expirationTime<=J);J=i.unstable_now(),typeof L=="function"?v.callback=L:v===o(_)&&a(_),X(J)}else a(_);v=o(_)}if(v!==null)var U=!0;else{var le=o(g);le!==null&&Se(V,le.startTime-J),U=!1}return U}finally{v=null,y=z,T=!1}}var ne=!1,$=null,ae=-1,_e=5,oe=-1;function re(){return!(i.unstable_now()-oe<_e)}function ye(){if($!==null){var j=i.unstable_now();oe=j;var J=!0;try{J=$(!0,j)}finally{J?ie():(ne=!1,$=null)}}else ne=!1}var ie;if(typeof te=="function")ie=function(){te(ye)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,Fe=ke.port2;ke.port1.onmessage=ye,ie=function(){Fe.postMessage(null)}}else ie=function(){M(ye,0)};function Pe(j){$=j,ne||(ne=!0,ie())}function Se(j,J){ae=M(function(){j(i.unstable_now())},J)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_continueExecution=function(){x||T||(x=!0,Pe(fe))},i.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_e=0<j?Math.floor(1e3/j):5},i.unstable_getCurrentPriorityLevel=function(){return y},i.unstable_getFirstCallbackNode=function(){return o(_)},i.unstable_next=function(j){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var z=y;y=J;try{return j()}finally{y=z}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(j,J){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var z=y;y=j;try{return J()}finally{y=z}},i.unstable_scheduleCallback=function(j,J,z){var b=i.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?b+z:b):z=b,j){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=z+L,j={id:m++,callback:J,priorityLevel:j,startTime:z,expirationTime:L,sortIndex:-1},z>b?(j.sortIndex=z,n(g,j),o(_)===null&&j===o(g)&&(I?(q(ae),ae=-1):I=!0,Se(V,z-b))):(j.sortIndex=L,n(_,j),x||T||(x=!0,Pe(fe))),j},i.unstable_shouldYield=re,i.unstable_wrapCallback=function(j){var J=y;return function(){var z=y;y=J;try{return j.apply(this,arguments)}finally{y=z}}}})(fa)),fa}var Hd;function Oy(){return Hd||(Hd=1,da.exports=xy()),da.exports}var Vd;function Ry(){if(Vd)return ct;Vd=1;var i=Ua(),n=Oy();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,c={};function d(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(c[e]=t,e=0;e<t.length;e++)a.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},v={};function y(e){return _.call(v,e)?!0:_.call(m,e)?!1:g.test(e)?v[e]=!0:(m[e]=!0,!1)}function T(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x(e,t,r,s){if(t===null||typeof t>"u"||T(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function I(e,t,r,s,l,u,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=p}var M={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){M[e]=new I(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];M[t]=new I(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){M[e]=new I(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){M[e]=new I(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){M[e]=new I(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){M[e]=new I(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){M[e]=new I(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){M[e]=new I(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){M[e]=new I(e,5,!1,e.toLowerCase(),null,!1,!1)});var q=/[\-:]([a-z])/g;function te(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(q,te);M[t]=new I(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(q,te);M[t]=new I(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(q,te);M[t]=new I(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){M[e]=new I(e,1,!1,e.toLowerCase(),null,!1,!1)}),M.xlinkHref=new I("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){M[e]=new I(e,1,!1,e.toLowerCase(),null,!0,!0)});function X(e,t,r,s){var l=M.hasOwnProperty(t)?M[t]:null;(l!==null?l.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(x(t,r,l,s)&&(r=null),s||l===null?y(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):l.mustUseProperty?e[l.propertyName]=r===null?l.type===3?!1:"":r:(t=l.attributeName,s=l.attributeNamespace,r===null?e.removeAttribute(t):(l=l.type,r=l===3||l===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var V=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fe=Symbol.for("react.element"),ne=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),_e=Symbol.for("react.profiler"),oe=Symbol.for("react.provider"),re=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),Fe=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),Se=Symbol.for("react.offscreen"),j=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=j&&e[j]||e["@@iterator"],typeof e=="function"?e:null)}var z=Object.assign,b;function L(e){if(b===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
|
|
2
|
+
`+b+e}var U=!1;function le(e,t){if(!e||U)return"";U=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(O){var s=O}Reflect.construct(e,[],t)}else{try{t.call()}catch(O){s=O}e.call(t.prototype)}else{try{throw Error()}catch(O){s=O}e()}}catch(O){if(O&&s&&typeof O.stack=="string"){for(var l=O.stack.split(`
|
|
3
|
+
`),u=s.stack.split(`
|
|
4
|
+
`),p=l.length-1,w=u.length-1;1<=p&&0<=w&&l[p]!==u[w];)w--;for(;1<=p&&0<=w;p--,w--)if(l[p]!==u[w]){if(p!==1||w!==1)do if(p--,w--,0>w||l[p]!==u[w]){var E=`
|
|
5
|
+
`+l[p].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),E}while(1<=p&&0<=w);break}}}finally{U=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?L(e):""}function de(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function me(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case ne:return"Portal";case _e:return"Profiler";case ae:return"StrictMode";case ie:return"Suspense";case ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case re:return(e.displayName||"Context")+".Consumer";case oe:return(e._context.displayName||"Context")+".Provider";case ye:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fe:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case Pe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}function be(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(t);case 8:return t===ae?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ke(e){var t=xe(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(p){s=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(p){s=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kn(e){e._valueTracker||(e._valueTracker=Ke(e))}function Ri(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=xe(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function yt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qn(e,t){var r=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sn(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=we(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ii(e,t){t=t.checked,t!=null&&X(e,"checked",t,!1)}function Dr(e,t){Ii(e,t);var r=we(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Nr(e,t.type,r):t.hasOwnProperty("defaultValue")&&Nr(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xn(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Nr(e,t,r){(t!=="number"||yt(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var gt=Array.isArray;function ln(e,t,r,s){if(e=e.options,t){t={};for(var l=0;l<r.length;l++)t["$"+r[l]]=!0;for(r=0;r<e.length;r++)l=t.hasOwnProperty("$"+e[r].value),e[r].selected!==l&&(e[r].selected=l),l&&s&&(e[r].defaultSelected=!0)}else{for(r=""+we(r),t=null,l=0;l<e.length;l++){if(e[l].value===r){e[l].selected=!0,s&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Fr(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(o(91));return z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ar(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(o(92));if(gt(r)){if(1<r.length)throw Error(o(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:we(r)}}function Li(e,t){var r=we(t.value),s=we(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function Di(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ni(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jr(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ni(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var an,se=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,l){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,l)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(an=an||document.createElement("div"),an.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=an.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ee(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ge={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ie=["Webkit","ms","Moz","O"];Object.keys(ge).forEach(function(e){Ie.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ge[t]=ge[e]})});function vt(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}function Jn(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,l=vt(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,l):e[r]=l}}var rh=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _s(e,t){if(t){if(rh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function ws(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Es=null;function Ss(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ks=null,Zn=null,er=null;function Va(e){if(e=oi(e)){if(typeof ks!="function")throw Error(o(280));var t=e.stateNode;t&&(t=ro(t),ks(e.stateNode,e.type,t))}}function Ga(e){Zn?er?er.push(e):er=[e]:Zn=e}function Wa(){if(Zn){var e=Zn,t=er;if(er=Zn=null,Va(e),t)for(e=0;e<t.length;e++)Va(t[e])}}function Ya(e,t){return e(t)}function Ka(){}var bs=!1;function Qa(e,t,r){if(bs)return e(t,r);bs=!0;try{return Ya(e,t,r)}finally{bs=!1,(Zn!==null||er!==null)&&(Ka(),Wa())}}function Mr(e,t){var r=e.stateNode;if(r===null)return null;var s=ro(r);if(s===null)return null;r=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Ts=!1;if(h)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){Ts=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Ts=!1}function ih(e,t,r,s,l,u,p,w,E){var O=Array.prototype.slice.call(arguments,3);try{t.apply(r,O)}catch(N){this.onError(N)}}var zr=!1,Fi=null,Ai=!1,Cs=null,oh={onError:function(e){zr=!0,Fi=e}};function sh(e,t,r,s,l,u,p,w,E){zr=!1,Fi=null,ih.apply(oh,arguments)}function lh(e,t,r,s,l,u,p,w,E){if(sh.apply(this,arguments),zr){if(zr){var O=Fi;zr=!1,Fi=null}else throw Error(o(198));Ai||(Ai=!0,Cs=O)}}function Rn(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Xa(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ja(e){if(Rn(e)!==e)throw Error(o(188))}function ah(e){var t=e.alternate;if(!t){if(t=Rn(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,s=t;;){var l=r.return;if(l===null)break;var u=l.alternate;if(u===null){if(s=l.return,s!==null){r=s;continue}break}if(l.child===u.child){for(u=l.child;u;){if(u===r)return Ja(l),e;if(u===s)return Ja(l),t;u=u.sibling}throw Error(o(188))}if(r.return!==s.return)r=l,s=u;else{for(var p=!1,w=l.child;w;){if(w===r){p=!0,r=l,s=u;break}if(w===s){p=!0,s=l,r=u;break}w=w.sibling}if(!p){for(w=u.child;w;){if(w===r){p=!0,r=u,s=l;break}if(w===s){p=!0,s=u,r=l;break}w=w.sibling}if(!p)throw Error(o(189))}}if(r.alternate!==s)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function Za(e){return e=ah(e),e!==null?eu(e):null}function eu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=eu(e);if(t!==null)return t;e=e.sibling}return null}var tu=n.unstable_scheduleCallback,nu=n.unstable_cancelCallback,uh=n.unstable_shouldYield,ch=n.unstable_requestPaint,ze=n.unstable_now,dh=n.unstable_getCurrentPriorityLevel,Ps=n.unstable_ImmediatePriority,ru=n.unstable_UserBlockingPriority,ji=n.unstable_NormalPriority,fh=n.unstable_LowPriority,iu=n.unstable_IdlePriority,Mi=null,$t=null;function ph(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Mi,e,void 0,(e.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:yh,hh=Math.log,mh=Math.LN2;function yh(e){return e>>>=0,e===0?32:31-(hh(e)/mh|0)|0}var Ui=64,zi=4194304;function $r(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $i(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,l=e.suspendedLanes,u=e.pingedLanes,p=r&268435455;if(p!==0){var w=p&~l;w!==0?s=$r(w):(u&=p,u!==0&&(s=$r(u)))}else p=r&~l,p!==0?s=$r(p):u!==0&&(s=$r(u));if(s===0)return 0;if(t!==0&&t!==s&&(t&l)===0&&(l=s&-s,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Ot(t),l=1<<r,s|=e[r],t&=~l;return s}function gh(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vh(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,l=e.expirationTimes,u=e.pendingLanes;0<u;){var p=31-Ot(u),w=1<<p,E=l[p];E===-1?((w&r)===0||(w&s)!==0)&&(l[p]=gh(w,t)):E<=t&&(e.expiredLanes|=w),u&=~w}}function xs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ou(){var e=Ui;return Ui<<=1,(Ui&4194240)===0&&(Ui=64),e}function Os(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function qr(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=r}function _h(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var l=31-Ot(r),u=1<<l;t[l]=0,s[l]=-1,e[l]=-1,r&=~u}}function Rs(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Ot(r),l=1<<s;l&t|e[s]&t&&(e[s]|=t),r&=~l}}var Oe=0;function su(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var lu,Is,au,uu,cu,Ls=!1,qi=[],un=null,cn=null,dn=null,Br=new Map,Hr=new Map,fn=[],wh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function du(e,t){switch(e){case"focusin":case"focusout":un=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":dn=null;break;case"pointerover":case"pointerout":Br.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hr.delete(t.pointerId)}}function Vr(e,t,r,s,l,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:u,targetContainers:[l]},t!==null&&(t=oi(t),t!==null&&Is(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Eh(e,t,r,s,l){switch(t){case"focusin":return un=Vr(un,e,t,r,s,l),!0;case"dragenter":return cn=Vr(cn,e,t,r,s,l),!0;case"mouseover":return dn=Vr(dn,e,t,r,s,l),!0;case"pointerover":var u=l.pointerId;return Br.set(u,Vr(Br.get(u)||null,e,t,r,s,l)),!0;case"gotpointercapture":return u=l.pointerId,Hr.set(u,Vr(Hr.get(u)||null,e,t,r,s,l)),!0}return!1}function fu(e){var t=In(e.target);if(t!==null){var r=Rn(t);if(r!==null){if(t=r.tag,t===13){if(t=Xa(r),t!==null){e.blockedOn=t,cu(e.priority,function(){au(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ns(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Es=s,r.target.dispatchEvent(s),Es=null}else return t=oi(r),t!==null&&Is(t),e.blockedOn=r,!1;t.shift()}return!0}function pu(e,t,r){Bi(e)&&r.delete(t)}function Sh(){Ls=!1,un!==null&&Bi(un)&&(un=null),cn!==null&&Bi(cn)&&(cn=null),dn!==null&&Bi(dn)&&(dn=null),Br.forEach(pu),Hr.forEach(pu)}function Gr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ls||(Ls=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Sh)))}function Wr(e){function t(l){return Gr(l,e)}if(0<qi.length){Gr(qi[0],e);for(var r=1;r<qi.length;r++){var s=qi[r];s.blockedOn===e&&(s.blockedOn=null)}}for(un!==null&&Gr(un,e),cn!==null&&Gr(cn,e),dn!==null&&Gr(dn,e),Br.forEach(t),Hr.forEach(t),r=0;r<fn.length;r++)s=fn[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<fn.length&&(r=fn[0],r.blockedOn===null);)fu(r),r.blockedOn===null&&fn.shift()}var tr=V.ReactCurrentBatchConfig,Hi=!0;function kh(e,t,r,s){var l=Oe,u=tr.transition;tr.transition=null;try{Oe=1,Ds(e,t,r,s)}finally{Oe=l,tr.transition=u}}function bh(e,t,r,s){var l=Oe,u=tr.transition;tr.transition=null;try{Oe=4,Ds(e,t,r,s)}finally{Oe=l,tr.transition=u}}function Ds(e,t,r,s){if(Hi){var l=Ns(e,t,r,s);if(l===null)Xs(e,t,s,Vi,r),du(e,s);else if(Eh(l,e,t,r,s))s.stopPropagation();else if(du(e,s),t&4&&-1<wh.indexOf(e)){for(;l!==null;){var u=oi(l);if(u!==null&&lu(u),u=Ns(e,t,r,s),u===null&&Xs(e,t,s,Vi,r),u===l)break;l=u}l!==null&&s.stopPropagation()}else Xs(e,t,s,null,r)}}var Vi=null;function Ns(e,t,r,s){if(Vi=null,e=Ss(s),e=In(e),e!==null)if(t=Rn(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Xa(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Vi=e,null}function hu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(dh()){case Ps:return 1;case ru:return 4;case ji:case fh:return 16;case iu:return 536870912;default:return 16}default:return 16}}var pn=null,Fs=null,Gi=null;function mu(){if(Gi)return Gi;var e,t=Fs,r=t.length,s,l="value"in pn?pn.value:pn.textContent,u=l.length;for(e=0;e<r&&t[e]===l[e];e++);var p=r-e;for(s=1;s<=p&&t[r-s]===l[u-s];s++);return Gi=l.slice(e,1<s?1-s:void 0)}function Wi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yi(){return!0}function yu(){return!1}function dt(e){function t(r,s,l,u,p){this._reactName=r,this._targetInst=l,this.type=s,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(r=e[w],this[w]=r?r(u):u[w]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Yi:yu,this.isPropagationStopped=yu,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Yi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Yi)},persist:function(){},isPersistent:Yi}),t}var nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},As=dt(nr),Yr=z({},nr,{view:0,detail:0}),Th=dt(Yr),js,Ms,Kr,Ki=z({},Yr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zs,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kr&&(Kr&&e.type==="mousemove"?(js=e.screenX-Kr.screenX,Ms=e.screenY-Kr.screenY):Ms=js=0,Kr=e),js)},movementY:function(e){return"movementY"in e?e.movementY:Ms}}),gu=dt(Ki),Ch=z({},Ki,{dataTransfer:0}),Ph=dt(Ch),xh=z({},Yr,{relatedTarget:0}),Us=dt(xh),Oh=z({},nr,{animationName:0,elapsedTime:0,pseudoElement:0}),Rh=dt(Oh),Ih=z({},nr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lh=dt(Ih),Dh=z({},nr,{data:0}),vu=dt(Dh),Nh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ah={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ah[e])?!!t[e]:!1}function zs(){return jh}var Mh=z({},Yr,{key:function(e){if(e.key){var t=Nh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Fh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zs,charCode:function(e){return e.type==="keypress"?Wi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uh=dt(Mh),zh=z({},Ki,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_u=dt(zh),$h=z({},Yr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zs}),qh=dt($h),Bh=z({},nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hh=dt(Bh),Vh=z({},Ki,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gh=dt(Vh),Wh=[9,13,27,32],$s=h&&"CompositionEvent"in window,Qr=null;h&&"documentMode"in document&&(Qr=document.documentMode);var Yh=h&&"TextEvent"in window&&!Qr,wu=h&&(!$s||Qr&&8<Qr&&11>=Qr),Eu=" ",Su=!1;function ku(e,t){switch(e){case"keyup":return Wh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rr=!1;function Kh(e,t){switch(e){case"compositionend":return bu(t);case"keypress":return t.which!==32?null:(Su=!0,Eu);case"textInput":return e=t.data,e===Eu&&Su?null:e;default:return null}}function Qh(e,t){if(rr)return e==="compositionend"||!$s&&ku(e,t)?(e=mu(),Gi=Fs=pn=null,rr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wu&&t.locale!=="ko"?null:t.data;default:return null}}var Xh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xh[e.type]:t==="textarea"}function Cu(e,t,r,s){Ga(s),t=eo(t,"onChange"),0<t.length&&(r=new As("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Xr=null,Jr=null;function Jh(e){Hu(e,0)}function Qi(e){var t=ar(e);if(Ri(t))return e}function Zh(e,t){if(e==="change")return t}var Pu=!1;if(h){var qs;if(h){var Bs="oninput"in document;if(!Bs){var xu=document.createElement("div");xu.setAttribute("oninput","return;"),Bs=typeof xu.oninput=="function"}qs=Bs}else qs=!1;Pu=qs&&(!document.documentMode||9<document.documentMode)}function Ou(){Xr&&(Xr.detachEvent("onpropertychange",Ru),Jr=Xr=null)}function Ru(e){if(e.propertyName==="value"&&Qi(Jr)){var t=[];Cu(t,Jr,e,Ss(e)),Qa(Jh,t)}}function em(e,t,r){e==="focusin"?(Ou(),Xr=t,Jr=r,Xr.attachEvent("onpropertychange",Ru)):e==="focusout"&&Ou()}function tm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qi(Jr)}function nm(e,t){if(e==="click")return Qi(t)}function rm(e,t){if(e==="input"||e==="change")return Qi(t)}function im(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rt=typeof Object.is=="function"?Object.is:im;function Zr(e,t){if(Rt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var l=r[s];if(!_.call(t,l)||!Rt(e[l],t[l]))return!1}return!0}function Iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lu(e,t){var r=Iu(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Iu(r)}}function Du(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Du(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nu(){for(var e=window,t=yt();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yt(e.document)}return t}function Hs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function om(e){var t=Nu(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Du(r.ownerDocument.documentElement,r)){if(s!==null&&Hs(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,u=Math.min(s.start,l);s=s.end===void 0?u:Math.min(s.end,l),!e.extend&&u>s&&(l=s,s=u,u=l),l=Lu(r,u);var p=Lu(r,s);l&&p&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>s?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sm=h&&"documentMode"in document&&11>=document.documentMode,ir=null,Vs=null,ei=null,Gs=!1;function Fu(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Gs||ir==null||ir!==yt(s)||(s=ir,"selectionStart"in s&&Hs(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ei&&Zr(ei,s)||(ei=s,s=eo(Vs,"onSelect"),0<s.length&&(t=new As("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=ir)))}function Xi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var or={animationend:Xi("Animation","AnimationEnd"),animationiteration:Xi("Animation","AnimationIteration"),animationstart:Xi("Animation","AnimationStart"),transitionend:Xi("Transition","TransitionEnd")},Ws={},Au={};h&&(Au=document.createElement("div").style,"AnimationEvent"in window||(delete or.animationend.animation,delete or.animationiteration.animation,delete or.animationstart.animation),"TransitionEvent"in window||delete or.transitionend.transition);function Ji(e){if(Ws[e])return Ws[e];if(!or[e])return e;var t=or[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Au)return Ws[e]=t[r];return e}var ju=Ji("animationend"),Mu=Ji("animationiteration"),Uu=Ji("animationstart"),zu=Ji("transitionend"),$u=new Map,qu="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function hn(e,t){$u.set(e,t),d(t,[e])}for(var Ys=0;Ys<qu.length;Ys++){var Ks=qu[Ys],lm=Ks.toLowerCase(),am=Ks[0].toUpperCase()+Ks.slice(1);hn(lm,"on"+am)}hn(ju,"onAnimationEnd"),hn(Mu,"onAnimationIteration"),hn(Uu,"onAnimationStart"),hn("dblclick","onDoubleClick"),hn("focusin","onFocus"),hn("focusout","onBlur"),hn(zu,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ti="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),um=new Set("cancel close invalid load scroll toggle".split(" ").concat(ti));function Bu(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,lh(s,t,void 0,e),e.currentTarget=null}function Hu(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],l=s.event;s=s.listeners;e:{var u=void 0;if(t)for(var p=s.length-1;0<=p;p--){var w=s[p],E=w.instance,O=w.currentTarget;if(w=w.listener,E!==u&&l.isPropagationStopped())break e;Bu(l,w,O),u=E}else for(p=0;p<s.length;p++){if(w=s[p],E=w.instance,O=w.currentTarget,w=w.listener,E!==u&&l.isPropagationStopped())break e;Bu(l,w,O),u=E}}}if(Ai)throw e=Cs,Ai=!1,Cs=null,e}function De(e,t){var r=t[rl];r===void 0&&(r=t[rl]=new Set);var s=e+"__bubble";r.has(s)||(Vu(t,e,2,!1),r.add(s))}function Qs(e,t,r){var s=0;t&&(s|=4),Vu(r,e,s,t)}var Zi="_reactListening"+Math.random().toString(36).slice(2);function ni(e){if(!e[Zi]){e[Zi]=!0,a.forEach(function(r){r!=="selectionchange"&&(um.has(r)||Qs(r,!1,e),Qs(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zi]||(t[Zi]=!0,Qs("selectionchange",!1,t))}}function Vu(e,t,r,s){switch(hu(t)){case 1:var l=kh;break;case 4:l=bh;break;default:l=Ds}r=l.bind(null,t,r,e),l=void 0,!Ts||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?e.addEventListener(t,r,{capture:!0,passive:l}):e.addEventListener(t,r,!0):l!==void 0?e.addEventListener(t,r,{passive:l}):e.addEventListener(t,r,!1)}function Xs(e,t,r,s,l){var u=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var p=s.tag;if(p===3||p===4){var w=s.stateNode.containerInfo;if(w===l||w.nodeType===8&&w.parentNode===l)break;if(p===4)for(p=s.return;p!==null;){var E=p.tag;if((E===3||E===4)&&(E=p.stateNode.containerInfo,E===l||E.nodeType===8&&E.parentNode===l))return;p=p.return}for(;w!==null;){if(p=In(w),p===null)return;if(E=p.tag,E===5||E===6){s=u=p;continue e}w=w.parentNode}}s=s.return}Qa(function(){var O=u,N=Ss(r),F=[];e:{var D=$u.get(e);if(D!==void 0){var B=As,K=e;switch(e){case"keypress":if(Wi(r)===0)break e;case"keydown":case"keyup":B=Uh;break;case"focusin":K="focus",B=Us;break;case"focusout":K="blur",B=Us;break;case"beforeblur":case"afterblur":B=Us;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=gu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Ph;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=qh;break;case ju:case Mu:case Uu:B=Rh;break;case zu:B=Hh;break;case"scroll":B=Th;break;case"wheel":B=Gh;break;case"copy":case"cut":case"paste":B=Lh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=_u}var Z=(t&4)!==0,$e=!Z&&e==="scroll",C=Z?D!==null?D+"Capture":null:D;Z=[];for(var S=O,P;S!==null;){P=S;var A=P.stateNode;if(P.tag===5&&A!==null&&(P=A,C!==null&&(A=Mr(S,C),A!=null&&Z.push(ri(S,A,P)))),$e)break;S=S.return}0<Z.length&&(D=new B(D,K,null,r,N),F.push({event:D,listeners:Z}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",D&&r!==Es&&(K=r.relatedTarget||r.fromElement)&&(In(K)||K[Wt]))break e;if((B||D)&&(D=N.window===N?N:(D=N.ownerDocument)?D.defaultView||D.parentWindow:window,B?(K=r.relatedTarget||r.toElement,B=O,K=K?In(K):null,K!==null&&($e=Rn(K),K!==$e||K.tag!==5&&K.tag!==6)&&(K=null)):(B=null,K=O),B!==K)){if(Z=gu,A="onMouseLeave",C="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(Z=_u,A="onPointerLeave",C="onPointerEnter",S="pointer"),$e=B==null?D:ar(B),P=K==null?D:ar(K),D=new Z(A,S+"leave",B,r,N),D.target=$e,D.relatedTarget=P,A=null,In(N)===O&&(Z=new Z(C,S+"enter",K,r,N),Z.target=P,Z.relatedTarget=$e,A=Z),$e=A,B&&K)t:{for(Z=B,C=K,S=0,P=Z;P;P=sr(P))S++;for(P=0,A=C;A;A=sr(A))P++;for(;0<S-P;)Z=sr(Z),S--;for(;0<P-S;)C=sr(C),P--;for(;S--;){if(Z===C||C!==null&&Z===C.alternate)break t;Z=sr(Z),C=sr(C)}Z=null}else Z=null;B!==null&&Gu(F,D,B,Z,!1),K!==null&&$e!==null&&Gu(F,$e,K,Z,!0)}}e:{if(D=O?ar(O):window,B=D.nodeName&&D.nodeName.toLowerCase(),B==="select"||B==="input"&&D.type==="file")var ee=Zh;else if(Tu(D))if(Pu)ee=rm;else{ee=tm;var ue=em}else(B=D.nodeName)&&B.toLowerCase()==="input"&&(D.type==="checkbox"||D.type==="radio")&&(ee=nm);if(ee&&(ee=ee(e,O))){Cu(F,ee,r,N);break e}ue&&ue(e,D,O),e==="focusout"&&(ue=D._wrapperState)&&ue.controlled&&D.type==="number"&&Nr(D,"number",D.value)}switch(ue=O?ar(O):window,e){case"focusin":(Tu(ue)||ue.contentEditable==="true")&&(ir=ue,Vs=O,ei=null);break;case"focusout":ei=Vs=ir=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Fu(F,r,N);break;case"selectionchange":if(sm)break;case"keydown":case"keyup":Fu(F,r,N)}var ce;if($s)e:{switch(e){case"compositionstart":var pe="onCompositionStart";break e;case"compositionend":pe="onCompositionEnd";break e;case"compositionupdate":pe="onCompositionUpdate";break e}pe=void 0}else rr?ku(e,r)&&(pe="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(pe="onCompositionStart");pe&&(wu&&r.locale!=="ko"&&(rr||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&rr&&(ce=mu()):(pn=N,Fs="value"in pn?pn.value:pn.textContent,rr=!0)),ue=eo(O,pe),0<ue.length&&(pe=new vu(pe,e,null,r,N),F.push({event:pe,listeners:ue}),ce?pe.data=ce:(ce=bu(r),ce!==null&&(pe.data=ce)))),(ce=Yh?Kh(e,r):Qh(e,r))&&(O=eo(O,"onBeforeInput"),0<O.length&&(N=new vu("onBeforeInput","beforeinput",null,r,N),F.push({event:N,listeners:O}),N.data=ce))}Hu(F,t)})}function ri(e,t,r){return{instance:e,listener:t,currentTarget:r}}function eo(e,t){for(var r=t+"Capture",s=[];e!==null;){var l=e,u=l.stateNode;l.tag===5&&u!==null&&(l=u,u=Mr(e,r),u!=null&&s.unshift(ri(e,u,l)),u=Mr(e,t),u!=null&&s.push(ri(e,u,l))),e=e.return}return s}function sr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gu(e,t,r,s,l){for(var u=t._reactName,p=[];r!==null&&r!==s;){var w=r,E=w.alternate,O=w.stateNode;if(E!==null&&E===s)break;w.tag===5&&O!==null&&(w=O,l?(E=Mr(r,u),E!=null&&p.unshift(ri(r,E,w))):l||(E=Mr(r,u),E!=null&&p.push(ri(r,E,w)))),r=r.return}p.length!==0&&e.push({event:t,listeners:p})}var cm=/\r\n?/g,dm=/\u0000|\uFFFD/g;function Wu(e){return(typeof e=="string"?e:""+e).replace(cm,`
|
|
6
|
+
`).replace(dm,"")}function to(e,t,r){if(t=Wu(t),Wu(e)!==t&&r)throw Error(o(425))}function no(){}var Js=null,Zs=null;function el(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tl=typeof setTimeout=="function"?setTimeout:void 0,fm=typeof clearTimeout=="function"?clearTimeout:void 0,Yu=typeof Promise=="function"?Promise:void 0,pm=typeof queueMicrotask=="function"?queueMicrotask:typeof Yu<"u"?function(e){return Yu.resolve(null).then(e).catch(hm)}:tl;function hm(e){setTimeout(function(){throw e})}function nl(e,t){var r=t,s=0;do{var l=r.nextSibling;if(e.removeChild(r),l&&l.nodeType===8)if(r=l.data,r==="/$"){if(s===0){e.removeChild(l),Wr(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=l}while(r);Wr(t)}function mn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ku(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var lr=Math.random().toString(36).slice(2),qt="__reactFiber$"+lr,ii="__reactProps$"+lr,Wt="__reactContainer$"+lr,rl="__reactEvents$"+lr,mm="__reactListeners$"+lr,ym="__reactHandles$"+lr;function In(e){var t=e[qt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Wt]||r[qt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ku(e);e!==null;){if(r=e[qt])return r;e=Ku(e)}return t}e=r,r=e.parentNode}return null}function oi(e){return e=e[qt]||e[Wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ar(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function ro(e){return e[ii]||null}var il=[],ur=-1;function yn(e){return{current:e}}function Ne(e){0>ur||(e.current=il[ur],il[ur]=null,ur--)}function Le(e,t){ur++,il[ur]=e.current,e.current=t}var gn={},Je=yn(gn),ot=yn(!1),Ln=gn;function cr(e,t){var r=e.type.contextTypes;if(!r)return gn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in r)l[u]=t[u];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function st(e){return e=e.childContextTypes,e!=null}function io(){Ne(ot),Ne(Je)}function Qu(e,t,r){if(Je.current!==gn)throw Error(o(168));Le(Je,t),Le(ot,r)}function Xu(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var l in s)if(!(l in t))throw Error(o(108,be(e)||"Unknown",l));return z({},r,s)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gn,Ln=Je.current,Le(Je,e),Le(ot,ot.current),!0}function Ju(e,t,r){var s=e.stateNode;if(!s)throw Error(o(169));r?(e=Xu(e,t,Ln),s.__reactInternalMemoizedMergedChildContext=e,Ne(ot),Ne(Je),Le(Je,e)):Ne(ot),Le(ot,r)}var Yt=null,so=!1,ol=!1;function Zu(e){Yt===null?Yt=[e]:Yt.push(e)}function gm(e){so=!0,Zu(e)}function vn(){if(!ol&&Yt!==null){ol=!0;var e=0,t=Oe;try{var r=Yt;for(Oe=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Yt=null,so=!1}catch(l){throw Yt!==null&&(Yt=Yt.slice(e+1)),tu(Ps,vn),l}finally{Oe=t,ol=!1}}return null}var dr=[],fr=0,lo=null,ao=0,_t=[],wt=0,Dn=null,Kt=1,Qt="";function Nn(e,t){dr[fr++]=ao,dr[fr++]=lo,lo=e,ao=t}function ec(e,t,r){_t[wt++]=Kt,_t[wt++]=Qt,_t[wt++]=Dn,Dn=e;var s=Kt;e=Qt;var l=32-Ot(s)-1;s&=~(1<<l),r+=1;var u=32-Ot(t)+l;if(30<u){var p=l-l%5;u=(s&(1<<p)-1).toString(32),s>>=p,l-=p,Kt=1<<32-Ot(t)+l|r<<l|s,Qt=u+e}else Kt=1<<u|r<<l|s,Qt=e}function sl(e){e.return!==null&&(Nn(e,1),ec(e,1,0))}function ll(e){for(;e===lo;)lo=dr[--fr],dr[fr]=null,ao=dr[--fr],dr[fr]=null;for(;e===Dn;)Dn=_t[--wt],_t[wt]=null,Qt=_t[--wt],_t[wt]=null,Kt=_t[--wt],_t[wt]=null}var ft=null,pt=null,Ae=!1,It=null;function tc(e,t){var r=bt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function nc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ft=e,pt=mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ft=e,pt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Dn!==null?{id:Kt,overflow:Qt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=bt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ft=e,pt=null,!0):!1;default:return!1}}function al(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ul(e){if(Ae){var t=pt;if(t){var r=t;if(!nc(e,t)){if(al(e))throw Error(o(418));t=mn(r.nextSibling);var s=ft;t&&nc(e,t)?tc(s,r):(e.flags=e.flags&-4097|2,Ae=!1,ft=e)}}else{if(al(e))throw Error(o(418));e.flags=e.flags&-4097|2,Ae=!1,ft=e}}}function rc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ft=e}function uo(e){if(e!==ft)return!1;if(!Ae)return rc(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!el(e.type,e.memoizedProps)),t&&(t=pt)){if(al(e))throw ic(),Error(o(418));for(;t;)tc(e,t),t=mn(t.nextSibling)}if(rc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){pt=mn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}pt=null}}else pt=ft?mn(e.stateNode.nextSibling):null;return!0}function ic(){for(var e=pt;e;)e=mn(e.nextSibling)}function pr(){pt=ft=null,Ae=!1}function cl(e){It===null?It=[e]:It.push(e)}var vm=V.ReactCurrentBatchConfig;function si(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(o(309));var s=r.stateNode}if(!s)throw Error(o(147,e));var l=s,u=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===u?t.ref:(t=function(p){var w=l.refs;p===null?delete w[u]:w[u]=p},t._stringRef=u,t)}if(typeof e!="string")throw Error(o(284));if(!r._owner)throw Error(o(290,e))}return e}function co(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function oc(e){var t=e._init;return t(e._payload)}function sc(e){function t(C,S){if(e){var P=C.deletions;P===null?(C.deletions=[S],C.flags|=16):P.push(S)}}function r(C,S){if(!e)return null;for(;S!==null;)t(C,S),S=S.sibling;return null}function s(C,S){for(C=new Map;S!==null;)S.key!==null?C.set(S.key,S):C.set(S.index,S),S=S.sibling;return C}function l(C,S){return C=Cn(C,S),C.index=0,C.sibling=null,C}function u(C,S,P){return C.index=P,e?(P=C.alternate,P!==null?(P=P.index,P<S?(C.flags|=2,S):P):(C.flags|=2,S)):(C.flags|=1048576,S)}function p(C){return e&&C.alternate===null&&(C.flags|=2),C}function w(C,S,P,A){return S===null||S.tag!==6?(S=ta(P,C.mode,A),S.return=C,S):(S=l(S,P),S.return=C,S)}function E(C,S,P,A){var ee=P.type;return ee===$?N(C,S,P.props.children,A,P.key):S!==null&&(S.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===Pe&&oc(ee)===S.type)?(A=l(S,P.props),A.ref=si(C,S,P),A.return=C,A):(A=Fo(P.type,P.key,P.props,null,C.mode,A),A.ref=si(C,S,P),A.return=C,A)}function O(C,S,P,A){return S===null||S.tag!==4||S.stateNode.containerInfo!==P.containerInfo||S.stateNode.implementation!==P.implementation?(S=na(P,C.mode,A),S.return=C,S):(S=l(S,P.children||[]),S.return=C,S)}function N(C,S,P,A,ee){return S===null||S.tag!==7?(S=qn(P,C.mode,A,ee),S.return=C,S):(S=l(S,P),S.return=C,S)}function F(C,S,P){if(typeof S=="string"&&S!==""||typeof S=="number")return S=ta(""+S,C.mode,P),S.return=C,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case fe:return P=Fo(S.type,S.key,S.props,null,C.mode,P),P.ref=si(C,null,S),P.return=C,P;case ne:return S=na(S,C.mode,P),S.return=C,S;case Pe:var A=S._init;return F(C,A(S._payload),P)}if(gt(S)||J(S))return S=qn(S,C.mode,P,null),S.return=C,S;co(C,S)}return null}function D(C,S,P,A){var ee=S!==null?S.key:null;if(typeof P=="string"&&P!==""||typeof P=="number")return ee!==null?null:w(C,S,""+P,A);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case fe:return P.key===ee?E(C,S,P,A):null;case ne:return P.key===ee?O(C,S,P,A):null;case Pe:return ee=P._init,D(C,S,ee(P._payload),A)}if(gt(P)||J(P))return ee!==null?null:N(C,S,P,A,null);co(C,P)}return null}function B(C,S,P,A,ee){if(typeof A=="string"&&A!==""||typeof A=="number")return C=C.get(P)||null,w(S,C,""+A,ee);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case fe:return C=C.get(A.key===null?P:A.key)||null,E(S,C,A,ee);case ne:return C=C.get(A.key===null?P:A.key)||null,O(S,C,A,ee);case Pe:var ue=A._init;return B(C,S,P,ue(A._payload),ee)}if(gt(A)||J(A))return C=C.get(P)||null,N(S,C,A,ee,null);co(S,A)}return null}function K(C,S,P,A){for(var ee=null,ue=null,ce=S,pe=S=0,Ye=null;ce!==null&&pe<P.length;pe++){ce.index>pe?(Ye=ce,ce=null):Ye=ce.sibling;var Ce=D(C,ce,P[pe],A);if(Ce===null){ce===null&&(ce=Ye);break}e&&ce&&Ce.alternate===null&&t(C,ce),S=u(Ce,S,pe),ue===null?ee=Ce:ue.sibling=Ce,ue=Ce,ce=Ye}if(pe===P.length)return r(C,ce),Ae&&Nn(C,pe),ee;if(ce===null){for(;pe<P.length;pe++)ce=F(C,P[pe],A),ce!==null&&(S=u(ce,S,pe),ue===null?ee=ce:ue.sibling=ce,ue=ce);return Ae&&Nn(C,pe),ee}for(ce=s(C,ce);pe<P.length;pe++)Ye=B(ce,C,pe,P[pe],A),Ye!==null&&(e&&Ye.alternate!==null&&ce.delete(Ye.key===null?pe:Ye.key),S=u(Ye,S,pe),ue===null?ee=Ye:ue.sibling=Ye,ue=Ye);return e&&ce.forEach(function(Pn){return t(C,Pn)}),Ae&&Nn(C,pe),ee}function Z(C,S,P,A){var ee=J(P);if(typeof ee!="function")throw Error(o(150));if(P=ee.call(P),P==null)throw Error(o(151));for(var ue=ee=null,ce=S,pe=S=0,Ye=null,Ce=P.next();ce!==null&&!Ce.done;pe++,Ce=P.next()){ce.index>pe?(Ye=ce,ce=null):Ye=ce.sibling;var Pn=D(C,ce,Ce.value,A);if(Pn===null){ce===null&&(ce=Ye);break}e&&ce&&Pn.alternate===null&&t(C,ce),S=u(Pn,S,pe),ue===null?ee=Pn:ue.sibling=Pn,ue=Pn,ce=Ye}if(Ce.done)return r(C,ce),Ae&&Nn(C,pe),ee;if(ce===null){for(;!Ce.done;pe++,Ce=P.next())Ce=F(C,Ce.value,A),Ce!==null&&(S=u(Ce,S,pe),ue===null?ee=Ce:ue.sibling=Ce,ue=Ce);return Ae&&Nn(C,pe),ee}for(ce=s(C,ce);!Ce.done;pe++,Ce=P.next())Ce=B(ce,C,pe,Ce.value,A),Ce!==null&&(e&&Ce.alternate!==null&&ce.delete(Ce.key===null?pe:Ce.key),S=u(Ce,S,pe),ue===null?ee=Ce:ue.sibling=Ce,ue=Ce);return e&&ce.forEach(function(Xm){return t(C,Xm)}),Ae&&Nn(C,pe),ee}function $e(C,S,P,A){if(typeof P=="object"&&P!==null&&P.type===$&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case fe:e:{for(var ee=P.key,ue=S;ue!==null;){if(ue.key===ee){if(ee=P.type,ee===$){if(ue.tag===7){r(C,ue.sibling),S=l(ue,P.props.children),S.return=C,C=S;break e}}else if(ue.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===Pe&&oc(ee)===ue.type){r(C,ue.sibling),S=l(ue,P.props),S.ref=si(C,ue,P),S.return=C,C=S;break e}r(C,ue);break}else t(C,ue);ue=ue.sibling}P.type===$?(S=qn(P.props.children,C.mode,A,P.key),S.return=C,C=S):(A=Fo(P.type,P.key,P.props,null,C.mode,A),A.ref=si(C,S,P),A.return=C,C=A)}return p(C);case ne:e:{for(ue=P.key;S!==null;){if(S.key===ue)if(S.tag===4&&S.stateNode.containerInfo===P.containerInfo&&S.stateNode.implementation===P.implementation){r(C,S.sibling),S=l(S,P.children||[]),S.return=C,C=S;break e}else{r(C,S);break}else t(C,S);S=S.sibling}S=na(P,C.mode,A),S.return=C,C=S}return p(C);case Pe:return ue=P._init,$e(C,S,ue(P._payload),A)}if(gt(P))return K(C,S,P,A);if(J(P))return Z(C,S,P,A);co(C,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,S!==null&&S.tag===6?(r(C,S.sibling),S=l(S,P),S.return=C,C=S):(r(C,S),S=ta(P,C.mode,A),S.return=C,C=S),p(C)):r(C,S)}return $e}var hr=sc(!0),lc=sc(!1),fo=yn(null),po=null,mr=null,dl=null;function fl(){dl=mr=po=null}function pl(e){var t=fo.current;Ne(fo),e._currentValue=t}function hl(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function yr(e,t){po=e,dl=mr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(lt=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},mr===null){if(po===null)throw Error(o(308));mr=e,po.dependencies={lanes:0,firstContext:e}}else mr=mr.next=e;return t}var Fn=null;function ml(e){Fn===null?Fn=[e]:Fn.push(e)}function ac(e,t,r,s){var l=t.interleaved;return l===null?(r.next=r,ml(t)):(r.next=l.next,l.next=r),t.interleaved=r,Xt(e,s)}function Xt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var _n=!1;function yl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wn(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Te&2)!==0){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,Xt(e,r)}return l=s.interleaved,l===null?(t.next=t,ml(s)):(t.next=l.next,l.next=t),s.interleaved=t,Xt(e,r)}function ho(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Rs(e,r)}}function cc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var l=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var p={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};u===null?l=u=p:u=u.next=p,r=r.next}while(r!==null);u===null?l=u=t:u=u.next=t}else l=u=t;r={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function mo(e,t,r,s){var l=e.updateQueue;_n=!1;var u=l.firstBaseUpdate,p=l.lastBaseUpdate,w=l.shared.pending;if(w!==null){l.shared.pending=null;var E=w,O=E.next;E.next=null,p===null?u=O:p.next=O,p=E;var N=e.alternate;N!==null&&(N=N.updateQueue,w=N.lastBaseUpdate,w!==p&&(w===null?N.firstBaseUpdate=O:w.next=O,N.lastBaseUpdate=E))}if(u!==null){var F=l.baseState;p=0,N=O=E=null,w=u;do{var D=w.lane,B=w.eventTime;if((s&D)===D){N!==null&&(N=N.next={eventTime:B,lane:0,tag:w.tag,payload:w.payload,callback:w.callback,next:null});e:{var K=e,Z=w;switch(D=t,B=r,Z.tag){case 1:if(K=Z.payload,typeof K=="function"){F=K.call(B,F,D);break e}F=K;break e;case 3:K.flags=K.flags&-65537|128;case 0:if(K=Z.payload,D=typeof K=="function"?K.call(B,F,D):K,D==null)break e;F=z({},F,D);break e;case 2:_n=!0}}w.callback!==null&&w.lane!==0&&(e.flags|=64,D=l.effects,D===null?l.effects=[w]:D.push(w))}else B={eventTime:B,lane:D,tag:w.tag,payload:w.payload,callback:w.callback,next:null},N===null?(O=N=B,E=F):N=N.next=B,p|=D;if(w=w.next,w===null){if(w=l.shared.pending,w===null)break;D=w,w=D.next,D.next=null,l.lastBaseUpdate=D,l.shared.pending=null}}while(!0);if(N===null&&(E=F),l.baseState=E,l.firstBaseUpdate=O,l.lastBaseUpdate=N,t=l.shared.interleaved,t!==null){l=t;do p|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);Mn|=p,e.lanes=p,e.memoizedState=F}}function dc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],l=s.callback;if(l!==null){if(s.callback=null,s=r,typeof l!="function")throw Error(o(191,l));l.call(s)}}}var li={},Bt=yn(li),ai=yn(li),ui=yn(li);function An(e){if(e===li)throw Error(o(174));return e}function gl(e,t){switch(Le(ui,t),Le(ai,e),Le(Bt,li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jr(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jr(t,e)}Ne(Bt),Le(Bt,t)}function gr(){Ne(Bt),Ne(ai),Ne(ui)}function fc(e){An(ui.current);var t=An(Bt.current),r=jr(t,e.type);t!==r&&(Le(ai,e),Le(Bt,r))}function vl(e){ai.current===e&&(Ne(Bt),Ne(ai))}var je=yn(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _l=[];function wl(){for(var e=0;e<_l.length;e++)_l[e]._workInProgressVersionPrimary=null;_l.length=0}var go=V.ReactCurrentDispatcher,El=V.ReactCurrentBatchConfig,jn=0,Me=null,Be=null,Ge=null,vo=!1,ci=!1,di=0,_m=0;function Ze(){throw Error(o(321))}function Sl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Rt(e[r],t[r]))return!1;return!0}function kl(e,t,r,s,l,u){if(jn=u,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,go.current=e===null||e.memoizedState===null?km:bm,e=r(s,l),ci){u=0;do{if(ci=!1,di=0,25<=u)throw Error(o(301));u+=1,Ge=Be=null,t.updateQueue=null,go.current=Tm,e=r(s,l)}while(ci)}if(go.current=Eo,t=Be!==null&&Be.next!==null,jn=0,Ge=Be=Me=null,vo=!1,t)throw Error(o(300));return e}function bl(){var e=di!==0;return di=0,e}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?Me.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function St(){if(Be===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=Ge===null?Me.memoizedState:Ge.next;if(t!==null)Ge=t,Be=e;else{if(e===null)throw Error(o(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},Ge===null?Me.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function fi(e,t){return typeof t=="function"?t(e):t}function Tl(e){var t=St(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var s=Be,l=s.baseQueue,u=r.pending;if(u!==null){if(l!==null){var p=l.next;l.next=u.next,u.next=p}s.baseQueue=l=u,r.pending=null}if(l!==null){u=l.next,s=s.baseState;var w=p=null,E=null,O=u;do{var N=O.lane;if((jn&N)===N)E!==null&&(E=E.next={lane:0,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),s=O.hasEagerState?O.eagerState:e(s,O.action);else{var F={lane:N,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null};E===null?(w=E=F,p=s):E=E.next=F,Me.lanes|=N,Mn|=N}O=O.next}while(O!==null&&O!==u);E===null?p=s:E.next=w,Rt(s,t.memoizedState)||(lt=!0),t.memoizedState=s,t.baseState=p,t.baseQueue=E,r.lastRenderedState=s}if(e=r.interleaved,e!==null){l=e;do u=l.lane,Me.lanes|=u,Mn|=u,l=l.next;while(l!==e)}else l===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Cl(e){var t=St(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var s=r.dispatch,l=r.pending,u=t.memoizedState;if(l!==null){r.pending=null;var p=l=l.next;do u=e(u,p.action),p=p.next;while(p!==l);Rt(u,t.memoizedState)||(lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),r.lastRenderedState=u}return[u,s]}function pc(){}function hc(e,t){var r=Me,s=St(),l=t(),u=!Rt(s.memoizedState,l);if(u&&(s.memoizedState=l,lt=!0),s=s.queue,Pl(gc.bind(null,r,s,e),[e]),s.getSnapshot!==t||u||Ge!==null&&Ge.memoizedState.tag&1){if(r.flags|=2048,pi(9,yc.bind(null,r,s,l,t),void 0,null),We===null)throw Error(o(349));(jn&30)!==0||mc(r,t,l)}return l}function mc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function yc(e,t,r,s){t.value=r,t.getSnapshot=s,vc(t)&&_c(e)}function gc(e,t,r){return r(function(){vc(t)&&_c(e)})}function vc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Rt(e,r)}catch{return!0}}function _c(e){var t=Xt(e,1);t!==null&&Ft(t,e,1,-1)}function wc(e){var t=Ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:e},t.queue=e,e=e.dispatch=Sm.bind(null,Me,e),[t.memoizedState,e]}function pi(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Ec(){return St().memoizedState}function _o(e,t,r,s){var l=Ht();Me.flags|=e,l.memoizedState=pi(1|t,r,void 0,s===void 0?null:s)}function wo(e,t,r,s){var l=St();s=s===void 0?null:s;var u=void 0;if(Be!==null){var p=Be.memoizedState;if(u=p.destroy,s!==null&&Sl(s,p.deps)){l.memoizedState=pi(t,r,u,s);return}}Me.flags|=e,l.memoizedState=pi(1|t,r,u,s)}function Sc(e,t){return _o(8390656,8,e,t)}function Pl(e,t){return wo(2048,8,e,t)}function kc(e,t){return wo(4,2,e,t)}function bc(e,t){return wo(4,4,e,t)}function Tc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cc(e,t,r){return r=r!=null?r.concat([e]):null,wo(4,4,Tc.bind(null,t,e),r)}function xl(){}function Pc(e,t){var r=St();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Sl(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function xc(e,t){var r=St();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Sl(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Oc(e,t,r){return(jn&21)===0?(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=r):(Rt(r,t)||(r=ou(),Me.lanes|=r,Mn|=r,e.baseState=!0),t)}function wm(e,t){var r=Oe;Oe=r!==0&&4>r?r:4,e(!0);var s=El.transition;El.transition={};try{e(!1),t()}finally{Oe=r,El.transition=s}}function Rc(){return St().memoizedState}function Em(e,t,r){var s=bn(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Ic(e))Lc(t,r);else if(r=ac(e,t,r,s),r!==null){var l=it();Ft(r,e,s,l),Dc(r,t,s)}}function Sm(e,t,r){var s=bn(e),l={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ic(e))Lc(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,w=u(p,r);if(l.hasEagerState=!0,l.eagerState=w,Rt(w,p)){var E=t.interleaved;E===null?(l.next=l,ml(t)):(l.next=E.next,E.next=l),t.interleaved=l;return}}catch{}r=ac(e,t,l,s),r!==null&&(l=it(),Ft(r,e,s,l),Dc(r,t,s))}}function Ic(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function Lc(e,t){ci=vo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Dc(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Rs(e,r)}}var Eo={readContext:Et,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},km={readContext:Et,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Sc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,_o(4194308,4,Tc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return _o(4194308,4,e,t)},useInsertionEffect:function(e,t){return _o(4,2,e,t)},useMemo:function(e,t){var r=Ht();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=Ht();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Em.bind(null,Me,e),[s.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:wc,useDebugValue:xl,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=wc(!1),t=e[0];return e=wm.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=Me,l=Ht();if(Ae){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),We===null)throw Error(o(349));(jn&30)!==0||mc(s,t,r)}l.memoizedState=r;var u={value:r,getSnapshot:t};return l.queue=u,Sc(gc.bind(null,s,u,e),[e]),s.flags|=2048,pi(9,yc.bind(null,s,u,r,t),void 0,null),r},useId:function(){var e=Ht(),t=We.identifierPrefix;if(Ae){var r=Qt,s=Kt;r=(s&~(1<<32-Ot(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=di++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_m++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bm={readContext:Et,useCallback:Pc,useContext:Et,useEffect:Pl,useImperativeHandle:Cc,useInsertionEffect:kc,useLayoutEffect:bc,useMemo:xc,useReducer:Tl,useRef:Ec,useState:function(){return Tl(fi)},useDebugValue:xl,useDeferredValue:function(e){var t=St();return Oc(t,Be.memoizedState,e)},useTransition:function(){var e=Tl(fi)[0],t=St().memoizedState;return[e,t]},useMutableSource:pc,useSyncExternalStore:hc,useId:Rc,unstable_isNewReconciler:!1},Tm={readContext:Et,useCallback:Pc,useContext:Et,useEffect:Pl,useImperativeHandle:Cc,useInsertionEffect:kc,useLayoutEffect:bc,useMemo:xc,useReducer:Cl,useRef:Ec,useState:function(){return Cl(fi)},useDebugValue:xl,useDeferredValue:function(e){var t=St();return Be===null?t.memoizedState=e:Oc(t,Be.memoizedState,e)},useTransition:function(){var e=Cl(fi)[0],t=St().memoizedState;return[e,t]},useMutableSource:pc,useSyncExternalStore:hc,useId:Rc,unstable_isNewReconciler:!1};function Lt(e,t){if(e&&e.defaultProps){t=z({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ol(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:z({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var So={isMounted:function(e){return(e=e._reactInternals)?Rn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=it(),l=bn(e),u=Jt(s,l);u.payload=t,r!=null&&(u.callback=r),t=wn(e,u,l),t!==null&&(Ft(t,e,l,s),ho(t,e,l))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=it(),l=bn(e),u=Jt(s,l);u.tag=1,u.payload=t,r!=null&&(u.callback=r),t=wn(e,u,l),t!==null&&(Ft(t,e,l,s),ho(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=it(),s=bn(e),l=Jt(r,s);l.tag=2,t!=null&&(l.callback=t),t=wn(e,l,s),t!==null&&(Ft(t,e,s,r),ho(t,e,s))}};function Nc(e,t,r,s,l,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,p):t.prototype&&t.prototype.isPureReactComponent?!Zr(r,s)||!Zr(l,u):!0}function Fc(e,t,r){var s=!1,l=gn,u=t.contextType;return typeof u=="object"&&u!==null?u=Et(u):(l=st(t)?Ln:Je.current,s=t.contextTypes,u=(s=s!=null)?cr(e,l):gn),t=new t(r,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=So,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=u),t}function Ac(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&So.enqueueReplaceState(t,t.state,null)}function Rl(e,t,r,s){var l=e.stateNode;l.props=r,l.state=e.memoizedState,l.refs={},yl(e);var u=t.contextType;typeof u=="object"&&u!==null?l.context=Et(u):(u=st(t)?Ln:Je.current,l.context=cr(e,u)),l.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(Ol(e,t,u,r),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&So.enqueueReplaceState(l,l.state,null),mo(e,r,l,s),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var r="",s=t;do r+=de(s),s=s.return;while(s);var l=r}catch(u){l=`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}return{value:e,source:t,stack:l,digest:null}}function Il(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ll(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Cm=typeof WeakMap=="function"?WeakMap:Map;function jc(e,t,r){r=Jt(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){Oo||(Oo=!0,Wl=s),Ll(e,t)},r}function Mc(e,t,r){r=Jt(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var l=t.value;r.payload=function(){return s(l)},r.callback=function(){Ll(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(r.callback=function(){Ll(e,t),typeof s!="function"&&(Sn===null?Sn=new Set([this]):Sn.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),r}function Uc(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Cm;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(r)||(l.add(r),e=zm.bind(null,e,t,r),t.then(e,e))}function zc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $c(e,t,r,s,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Jt(-1,1),t.tag=2,wn(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Pm=V.ReactCurrentOwner,lt=!1;function rt(e,t,r,s){t.child=e===null?lc(t,null,r,s):hr(t,e.child,r,s)}function qc(e,t,r,s,l){r=r.render;var u=t.ref;return yr(t,l),s=kl(e,t,r,s,u,l),r=bl(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zt(e,t,l)):(Ae&&r&&sl(t),t.flags|=1,rt(e,t,s,l),t.child)}function Bc(e,t,r,s,l){if(e===null){var u=r.type;return typeof u=="function"&&!ea(u)&&u.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=u,Hc(e,t,u,s,l)):(e=Fo(r.type,null,s,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&l)===0){var p=u.memoizedProps;if(r=r.compare,r=r!==null?r:Zr,r(p,s)&&e.ref===t.ref)return Zt(e,t,l)}return t.flags|=1,e=Cn(u,s),e.ref=t.ref,e.return=t,t.child=e}function Hc(e,t,r,s,l){if(e!==null){var u=e.memoizedProps;if(Zr(u,s)&&e.ref===t.ref)if(lt=!1,t.pendingProps=s=u,(e.lanes&l)!==0)(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Zt(e,t,l)}return Dl(e,t,r,s,l)}function Vc(e,t,r){var s=t.pendingProps,l=s.children,u=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(wr,ht),ht|=r;else{if((r&1073741824)===0)return e=u!==null?u.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(wr,ht),ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=u!==null?u.baseLanes:r,Le(wr,ht),ht|=s}else u!==null?(s=u.baseLanes|r,t.memoizedState=null):s=r,Le(wr,ht),ht|=s;return rt(e,t,l,r),t.child}function Gc(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Dl(e,t,r,s,l){var u=st(r)?Ln:Je.current;return u=cr(t,u),yr(t,l),r=kl(e,t,r,s,u,l),s=bl(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zt(e,t,l)):(Ae&&s&&sl(t),t.flags|=1,rt(e,t,r,l),t.child)}function Wc(e,t,r,s,l){if(st(r)){var u=!0;oo(t)}else u=!1;if(yr(t,l),t.stateNode===null)bo(e,t),Fc(t,r,s),Rl(t,r,s,l),s=!0;else if(e===null){var p=t.stateNode,w=t.memoizedProps;p.props=w;var E=p.context,O=r.contextType;typeof O=="object"&&O!==null?O=Et(O):(O=st(r)?Ln:Je.current,O=cr(t,O));var N=r.getDerivedStateFromProps,F=typeof N=="function"||typeof p.getSnapshotBeforeUpdate=="function";F||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==s||E!==O)&&Ac(t,p,s,O),_n=!1;var D=t.memoizedState;p.state=D,mo(t,s,p,l),E=t.memoizedState,w!==s||D!==E||ot.current||_n?(typeof N=="function"&&(Ol(t,r,N,s),E=t.memoizedState),(w=_n||Nc(t,r,w,s,D,E,O))?(F||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=E),p.props=s,p.state=E,p.context=O,s=w):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{p=t.stateNode,uc(e,t),w=t.memoizedProps,O=t.type===t.elementType?w:Lt(t.type,w),p.props=O,F=t.pendingProps,D=p.context,E=r.contextType,typeof E=="object"&&E!==null?E=Et(E):(E=st(r)?Ln:Je.current,E=cr(t,E));var B=r.getDerivedStateFromProps;(N=typeof B=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==F||D!==E)&&Ac(t,p,s,E),_n=!1,D=t.memoizedState,p.state=D,mo(t,s,p,l);var K=t.memoizedState;w!==F||D!==K||ot.current||_n?(typeof B=="function"&&(Ol(t,r,B,s),K=t.memoizedState),(O=_n||Nc(t,r,O,s,D,K,E)||!1)?(N||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,K,E),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,K,E)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=K),p.props=s,p.state=K,p.context=E,s=O):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),s=!1)}return Nl(e,t,r,s,u,l)}function Nl(e,t,r,s,l,u){Gc(e,t);var p=(t.flags&128)!==0;if(!s&&!p)return l&&Ju(t,r,!1),Zt(e,t,u);s=t.stateNode,Pm.current=t;var w=p&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&p?(t.child=hr(t,e.child,null,u),t.child=hr(t,null,w,u)):rt(e,t,w,u),t.memoizedState=s.state,l&&Ju(t,r,!0),t.child}function Yc(e){var t=e.stateNode;t.pendingContext?Qu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Qu(e,t.context,!1),gl(e,t.containerInfo)}function Kc(e,t,r,s,l){return pr(),cl(l),t.flags|=256,rt(e,t,r,s),t.child}var Fl={dehydrated:null,treeContext:null,retryLane:0};function Al(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qc(e,t,r){var s=t.pendingProps,l=je.current,u=!1,p=(t.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(l&2)!==0),w?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Le(je,l&1),e===null)return ul(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=s.children,e=s.fallback,u?(s=t.mode,u=t.child,p={mode:"hidden",children:p},(s&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=p):u=Ao(p,s,0,null),e=qn(e,s,r,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=Al(r),t.memoizedState=Fl,e):jl(t,p));if(l=e.memoizedState,l!==null&&(w=l.dehydrated,w!==null))return xm(e,t,p,s,w,l,r);if(u){u=s.fallback,p=t.mode,l=e.child,w=l.sibling;var E={mode:"hidden",children:s.children};return(p&1)===0&&t.child!==l?(s=t.child,s.childLanes=0,s.pendingProps=E,t.deletions=null):(s=Cn(l,E),s.subtreeFlags=l.subtreeFlags&14680064),w!==null?u=Cn(w,u):(u=qn(u,p,r,null),u.flags|=2),u.return=t,s.return=t,s.sibling=u,t.child=s,s=u,u=t.child,p=e.child.memoizedState,p=p===null?Al(r):{baseLanes:p.baseLanes|r,cachePool:null,transitions:p.transitions},u.memoizedState=p,u.childLanes=e.childLanes&~r,t.memoizedState=Fl,s}return u=e.child,e=u.sibling,s=Cn(u,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function jl(e,t){return t=Ao({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ko(e,t,r,s){return s!==null&&cl(s),hr(t,e.child,null,r),e=jl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xm(e,t,r,s,l,u,p){if(r)return t.flags&256?(t.flags&=-257,s=Il(Error(o(422))),ko(e,t,p,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=s.fallback,l=t.mode,s=Ao({mode:"visible",children:s.children},l,0,null),u=qn(u,l,p,null),u.flags|=2,s.return=t,u.return=t,s.sibling=u,t.child=s,(t.mode&1)!==0&&hr(t,e.child,null,p),t.child.memoizedState=Al(p),t.memoizedState=Fl,u);if((t.mode&1)===0)return ko(e,t,p,null);if(l.data==="$!"){if(s=l.nextSibling&&l.nextSibling.dataset,s)var w=s.dgst;return s=w,u=Error(o(419)),s=Il(u,s,void 0),ko(e,t,p,s)}if(w=(p&e.childLanes)!==0,lt||w){if(s=We,s!==null){switch(p&-p){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(s.suspendedLanes|p))!==0?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,Xt(e,l),Ft(s,e,l,-1))}return Zl(),s=Il(Error(o(421))),ko(e,t,p,s)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=$m.bind(null,e),l._reactRetry=t,null):(e=u.treeContext,pt=mn(l.nextSibling),ft=t,Ae=!0,It=null,e!==null&&(_t[wt++]=Kt,_t[wt++]=Qt,_t[wt++]=Dn,Kt=e.id,Qt=e.overflow,Dn=t),t=jl(t,s.children),t.flags|=4096,t)}function Xc(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),hl(e.return,t,r)}function Ml(e,t,r,s,l){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:l}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=s,u.tail=r,u.tailMode=l)}function Jc(e,t,r){var s=t.pendingProps,l=s.revealOrder,u=s.tail;if(rt(e,t,s.children,r),s=je.current,(s&2)!==0)s=s&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,r,t);else if(e.tag===19)Xc(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Le(je,s),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(r=t.child,l=null;r!==null;)e=r.alternate,e!==null&&yo(e)===null&&(l=r),r=r.sibling;r=l,r===null?(l=t.child,t.child=null):(l=r.sibling,r.sibling=null),Ml(t,!1,l,r,u);break;case"backwards":for(r=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&yo(e)===null){t.child=l;break}e=l.sibling,l.sibling=r,r=l,l=e}Ml(t,!0,r,null,u);break;case"together":Ml(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Mn|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Cn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Cn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Om(e,t,r){switch(t.tag){case 3:Yc(t),pr();break;case 5:fc(t);break;case 1:st(t.type)&&oo(t);break;case 4:gl(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,l=t.memoizedProps.value;Le(fo,s._currentValue),s._currentValue=l;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Le(je,je.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Qc(e,t,r):(Le(je,je.current&1),e=Zt(e,t,r),e!==null?e.sibling:null);Le(je,je.current&1);break;case 19:if(s=(r&t.childLanes)!==0,(e.flags&128)!==0){if(s)return Jc(e,t,r);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Le(je,je.current),s)break;return null;case 22:case 23:return t.lanes=0,Vc(e,t,r)}return Zt(e,t,r)}var Zc,Ul,ed,td;Zc=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Ul=function(){},ed=function(e,t,r,s){var l=e.memoizedProps;if(l!==s){e=t.stateNode,An(Bt.current);var u=null;switch(r){case"input":l=Qn(e,l),s=Qn(e,s),u=[];break;case"select":l=z({},l,{value:void 0}),s=z({},s,{value:void 0}),u=[];break;case"textarea":l=Fr(e,l),s=Fr(e,s),u=[];break;default:typeof l.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=no)}_s(r,s);var p;r=null;for(O in l)if(!s.hasOwnProperty(O)&&l.hasOwnProperty(O)&&l[O]!=null)if(O==="style"){var w=l[O];for(p in w)w.hasOwnProperty(p)&&(r||(r={}),r[p]="")}else O!=="dangerouslySetInnerHTML"&&O!=="children"&&O!=="suppressContentEditableWarning"&&O!=="suppressHydrationWarning"&&O!=="autoFocus"&&(c.hasOwnProperty(O)?u||(u=[]):(u=u||[]).push(O,null));for(O in s){var E=s[O];if(w=l?.[O],s.hasOwnProperty(O)&&E!==w&&(E!=null||w!=null))if(O==="style")if(w){for(p in w)!w.hasOwnProperty(p)||E&&E.hasOwnProperty(p)||(r||(r={}),r[p]="");for(p in E)E.hasOwnProperty(p)&&w[p]!==E[p]&&(r||(r={}),r[p]=E[p])}else r||(u||(u=[]),u.push(O,r)),r=E;else O==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,w=w?w.__html:void 0,E!=null&&w!==E&&(u=u||[]).push(O,E)):O==="children"?typeof E!="string"&&typeof E!="number"||(u=u||[]).push(O,""+E):O!=="suppressContentEditableWarning"&&O!=="suppressHydrationWarning"&&(c.hasOwnProperty(O)?(E!=null&&O==="onScroll"&&De("scroll",e),u||w===E||(u=[])):(u=u||[]).push(O,E))}r&&(u=u||[]).push("style",r);var O=u;(t.updateQueue=O)&&(t.flags|=4)}},td=function(e,t,r,s){r!==s&&(t.flags|=4)};function hi(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var l=e.child;l!==null;)r|=l.lanes|l.childLanes,s|=l.subtreeFlags&14680064,s|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)r|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function Rm(e,t,r){var s=t.pendingProps;switch(ll(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return st(t.type)&&io(),et(t),null;case 3:return s=t.stateNode,gr(),Ne(ot),Ne(Je),wl(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(uo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,It!==null&&(Ql(It),It=null))),Ul(e,t),et(t),null;case 5:vl(t);var l=An(ui.current);if(r=t.type,e!==null&&t.stateNode!=null)ed(e,t,r,s,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(o(166));return et(t),null}if(e=An(Bt.current),uo(t)){s=t.stateNode,r=t.type;var u=t.memoizedProps;switch(s[qt]=t,s[ii]=u,e=(t.mode&1)!==0,r){case"dialog":De("cancel",s),De("close",s);break;case"iframe":case"object":case"embed":De("load",s);break;case"video":case"audio":for(l=0;l<ti.length;l++)De(ti[l],s);break;case"source":De("error",s);break;case"img":case"image":case"link":De("error",s),De("load",s);break;case"details":De("toggle",s);break;case"input":sn(s,u),De("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!u.multiple},De("invalid",s);break;case"textarea":Ar(s,u),De("invalid",s)}_s(r,u),l=null;for(var p in u)if(u.hasOwnProperty(p)){var w=u[p];p==="children"?typeof w=="string"?s.textContent!==w&&(u.suppressHydrationWarning!==!0&&to(s.textContent,w,e),l=["children",w]):typeof w=="number"&&s.textContent!==""+w&&(u.suppressHydrationWarning!==!0&&to(s.textContent,w,e),l=["children",""+w]):c.hasOwnProperty(p)&&w!=null&&p==="onScroll"&&De("scroll",s)}switch(r){case"input":Kn(s),Xn(s,u,!0);break;case"textarea":Kn(s),Di(s);break;case"select":case"option":break;default:typeof u.onClick=="function"&&(s.onclick=no)}s=l,t.updateQueue=s,s!==null&&(t.flags|=4)}else{p=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ni(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=p.createElement(r,{is:s.is}):(e=p.createElement(r),r==="select"&&(p=e,s.multiple?p.multiple=!0:s.size&&(p.size=s.size))):e=p.createElementNS(e,r),e[qt]=t,e[ii]=s,Zc(e,t,!1,!1),t.stateNode=e;e:{switch(p=ws(r,s),r){case"dialog":De("cancel",e),De("close",e),l=s;break;case"iframe":case"object":case"embed":De("load",e),l=s;break;case"video":case"audio":for(l=0;l<ti.length;l++)De(ti[l],e);l=s;break;case"source":De("error",e),l=s;break;case"img":case"image":case"link":De("error",e),De("load",e),l=s;break;case"details":De("toggle",e),l=s;break;case"input":sn(e,s),l=Qn(e,s),De("invalid",e);break;case"option":l=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},l=z({},s,{value:void 0}),De("invalid",e);break;case"textarea":Ar(e,s),l=Fr(e,s),De("invalid",e);break;default:l=s}_s(r,l),w=l;for(u in w)if(w.hasOwnProperty(u)){var E=w[u];u==="style"?Jn(e,E):u==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,E!=null&&se(e,E)):u==="children"?typeof E=="string"?(r!=="textarea"||E!=="")&&Ee(e,E):typeof E=="number"&&Ee(e,""+E):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(c.hasOwnProperty(u)?E!=null&&u==="onScroll"&&De("scroll",e):E!=null&&X(e,u,E,p))}switch(r){case"input":Kn(e),Xn(e,s,!1);break;case"textarea":Kn(e),Di(e);break;case"option":s.value!=null&&e.setAttribute("value",""+we(s.value));break;case"select":e.multiple=!!s.multiple,u=s.value,u!=null?ln(e,!!s.multiple,u,!1):s.defaultValue!=null&&ln(e,!!s.multiple,s.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=no)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return et(t),null;case 6:if(e&&t.stateNode!=null)td(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(r=An(ui.current),An(Bt.current),uo(t)){if(s=t.stateNode,r=t.memoizedProps,s[qt]=t,(u=s.nodeValue!==r)&&(e=ft,e!==null))switch(e.tag){case 3:to(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&to(s.nodeValue,r,(e.mode&1)!==0)}u&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[qt]=t,t.stateNode=s}return et(t),null;case 13:if(Ne(je),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&pt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)ic(),pr(),t.flags|=98560,u=!1;else if(u=uo(t),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[qt]=t}else pr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),u=!1}else It!==null&&(Ql(It),It=null),u=!0;if(!u)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(je.current&1)!==0?He===0&&(He=3):Zl())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return gr(),Ul(e,t),e===null&&ni(t.stateNode.containerInfo),et(t),null;case 10:return pl(t.type._context),et(t),null;case 17:return st(t.type)&&io(),et(t),null;case 19:if(Ne(je),u=t.memoizedState,u===null)return et(t),null;if(s=(t.flags&128)!==0,p=u.rendering,p===null)if(s)hi(u,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=yo(e),p!==null){for(t.flags|=128,hi(u,!1),s=p.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)u=r,e=s,u.flags&=14680066,p=u.alternate,p===null?(u.childLanes=0,u.lanes=e,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=p.childLanes,u.lanes=p.lanes,u.child=p.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=p.memoizedProps,u.memoizedState=p.memoizedState,u.updateQueue=p.updateQueue,u.type=p.type,e=p.dependencies,u.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Le(je,je.current&1|2),t.child}e=e.sibling}u.tail!==null&&ze()>Er&&(t.flags|=128,s=!0,hi(u,!1),t.lanes=4194304)}else{if(!s)if(e=yo(p),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hi(u,!0),u.tail===null&&u.tailMode==="hidden"&&!p.alternate&&!Ae)return et(t),null}else 2*ze()-u.renderingStartTime>Er&&r!==1073741824&&(t.flags|=128,s=!0,hi(u,!1),t.lanes=4194304);u.isBackwards?(p.sibling=t.child,t.child=p):(r=u.last,r!==null?r.sibling=p:t.child=p,u.last=p)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ze(),t.sibling=null,r=je.current,Le(je,s?r&1|2:r&1),t):(et(t),null);case 22:case 23:return Jl(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(ht&1073741824)!==0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function Im(e,t){switch(ll(t),t.tag){case 1:return st(t.type)&&io(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gr(),Ne(ot),Ne(Je),wl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return vl(t),null;case 13:if(Ne(je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));pr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(je),null;case 4:return gr(),null;case 10:return pl(t.type._context),null;case 22:case 23:return Jl(),null;case 24:return null;default:return null}}var To=!1,tt=!1,Lm=typeof WeakSet=="function"?WeakSet:Set,W=null;function _r(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Ue(e,t,s)}else r.current=null}function zl(e,t,r){try{r()}catch(s){Ue(e,t,s)}}var nd=!1;function Dm(e,t){if(Js=Hi,e=Nu(),Hs(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var l=s.anchorOffset,u=s.focusNode;s=s.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var p=0,w=-1,E=-1,O=0,N=0,F=e,D=null;t:for(;;){for(var B;F!==r||l!==0&&F.nodeType!==3||(w=p+l),F!==u||s!==0&&F.nodeType!==3||(E=p+s),F.nodeType===3&&(p+=F.nodeValue.length),(B=F.firstChild)!==null;)D=F,F=B;for(;;){if(F===e)break t;if(D===r&&++O===l&&(w=p),D===u&&++N===s&&(E=p),(B=F.nextSibling)!==null)break;F=D,D=F.parentNode}F=B}r=w===-1||E===-1?null:{start:w,end:E}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zs={focusedElem:e,selectionRange:r},Hi=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var K=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(K!==null){var Z=K.memoizedProps,$e=K.memoizedState,C=t.stateNode,S=C.getSnapshotBeforeUpdate(t.elementType===t.type?Z:Lt(t.type,Z),$e);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(A){Ue(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return K=nd,nd=!1,K}function mi(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&zl(t,r,u)}l=l.next}while(l!==s)}}function Co(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function $l(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function rd(e){var t=e.alternate;t!==null&&(e.alternate=null,rd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[ii],delete t[rl],delete t[mm],delete t[ym])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function id(e){return e.tag===5||e.tag===3||e.tag===4}function od(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||id(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ql(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=no));else if(s!==4&&(e=e.child,e!==null))for(ql(e,t,r),e=e.sibling;e!==null;)ql(e,t,r),e=e.sibling}function Bl(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Bl(e,t,r),e=e.sibling;e!==null;)Bl(e,t,r),e=e.sibling}var Qe=null,Dt=!1;function En(e,t,r){for(r=r.child;r!==null;)sd(e,t,r),r=r.sibling}function sd(e,t,r){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Mi,r)}catch{}switch(r.tag){case 5:tt||_r(r,t);case 6:var s=Qe,l=Dt;Qe=null,En(e,t,r),Qe=s,Dt=l,Qe!==null&&(Dt?(e=Qe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Qe.removeChild(r.stateNode));break;case 18:Qe!==null&&(Dt?(e=Qe,r=r.stateNode,e.nodeType===8?nl(e.parentNode,r):e.nodeType===1&&nl(e,r),Wr(e)):nl(Qe,r.stateNode));break;case 4:s=Qe,l=Dt,Qe=r.stateNode.containerInfo,Dt=!0,En(e,t,r),Qe=s,Dt=l;break;case 0:case 11:case 14:case 15:if(!tt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){l=s=s.next;do{var u=l,p=u.destroy;u=u.tag,p!==void 0&&((u&2)!==0||(u&4)!==0)&&zl(r,t,p),l=l.next}while(l!==s)}En(e,t,r);break;case 1:if(!tt&&(_r(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(w){Ue(r,t,w)}En(e,t,r);break;case 21:En(e,t,r);break;case 22:r.mode&1?(tt=(s=tt)||r.memoizedState!==null,En(e,t,r),tt=s):En(e,t,r);break;default:En(e,t,r)}}function ld(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Lm),t.forEach(function(s){var l=qm.bind(null,e,s);r.has(s)||(r.add(s),s.then(l,l))})}}function Nt(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var l=r[s];try{var u=e,p=t,w=p;e:for(;w!==null;){switch(w.tag){case 5:Qe=w.stateNode,Dt=!1;break e;case 3:Qe=w.stateNode.containerInfo,Dt=!0;break e;case 4:Qe=w.stateNode.containerInfo,Dt=!0;break e}w=w.return}if(Qe===null)throw Error(o(160));sd(u,p,l),Qe=null,Dt=!1;var E=l.alternate;E!==null&&(E.return=null),l.return=null}catch(O){Ue(l,t,O)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ad(t,e),t=t.sibling}function ad(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nt(t,e),Vt(e),s&4){try{mi(3,e,e.return),Co(3,e)}catch(Z){Ue(e,e.return,Z)}try{mi(5,e,e.return)}catch(Z){Ue(e,e.return,Z)}}break;case 1:Nt(t,e),Vt(e),s&512&&r!==null&&_r(r,r.return);break;case 5:if(Nt(t,e),Vt(e),s&512&&r!==null&&_r(r,r.return),e.flags&32){var l=e.stateNode;try{Ee(l,"")}catch(Z){Ue(e,e.return,Z)}}if(s&4&&(l=e.stateNode,l!=null)){var u=e.memoizedProps,p=r!==null?r.memoizedProps:u,w=e.type,E=e.updateQueue;if(e.updateQueue=null,E!==null)try{w==="input"&&u.type==="radio"&&u.name!=null&&Ii(l,u),ws(w,p);var O=ws(w,u);for(p=0;p<E.length;p+=2){var N=E[p],F=E[p+1];N==="style"?Jn(l,F):N==="dangerouslySetInnerHTML"?se(l,F):N==="children"?Ee(l,F):X(l,N,F,O)}switch(w){case"input":Dr(l,u);break;case"textarea":Li(l,u);break;case"select":var D=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!u.multiple;var B=u.value;B!=null?ln(l,!!u.multiple,B,!1):D!==!!u.multiple&&(u.defaultValue!=null?ln(l,!!u.multiple,u.defaultValue,!0):ln(l,!!u.multiple,u.multiple?[]:"",!1))}l[ii]=u}catch(Z){Ue(e,e.return,Z)}}break;case 6:if(Nt(t,e),Vt(e),s&4){if(e.stateNode===null)throw Error(o(162));l=e.stateNode,u=e.memoizedProps;try{l.nodeValue=u}catch(Z){Ue(e,e.return,Z)}}break;case 3:if(Nt(t,e),Vt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Wr(t.containerInfo)}catch(Z){Ue(e,e.return,Z)}break;case 4:Nt(t,e),Vt(e);break;case 13:Nt(t,e),Vt(e),l=e.child,l.flags&8192&&(u=l.memoizedState!==null,l.stateNode.isHidden=u,!u||l.alternate!==null&&l.alternate.memoizedState!==null||(Gl=ze())),s&4&&ld(e);break;case 22:if(N=r!==null&&r.memoizedState!==null,e.mode&1?(tt=(O=tt)||N,Nt(t,e),tt=O):Nt(t,e),Vt(e),s&8192){if(O=e.memoizedState!==null,(e.stateNode.isHidden=O)&&!N&&(e.mode&1)!==0)for(W=e,N=e.child;N!==null;){for(F=W=N;W!==null;){switch(D=W,B=D.child,D.tag){case 0:case 11:case 14:case 15:mi(4,D,D.return);break;case 1:_r(D,D.return);var K=D.stateNode;if(typeof K.componentWillUnmount=="function"){s=D,r=D.return;try{t=s,K.props=t.memoizedProps,K.state=t.memoizedState,K.componentWillUnmount()}catch(Z){Ue(s,r,Z)}}break;case 5:_r(D,D.return);break;case 22:if(D.memoizedState!==null){dd(F);continue}}B!==null?(B.return=D,W=B):dd(F)}N=N.sibling}e:for(N=null,F=e;;){if(F.tag===5){if(N===null){N=F;try{l=F.stateNode,O?(u=l.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"):(w=F.stateNode,E=F.memoizedProps.style,p=E!=null&&E.hasOwnProperty("display")?E.display:null,w.style.display=vt("display",p))}catch(Z){Ue(e,e.return,Z)}}}else if(F.tag===6){if(N===null)try{F.stateNode.nodeValue=O?"":F.memoizedProps}catch(Z){Ue(e,e.return,Z)}}else if((F.tag!==22&&F.tag!==23||F.memoizedState===null||F===e)&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===e)break e;for(;F.sibling===null;){if(F.return===null||F.return===e)break e;N===F&&(N=null),F=F.return}N===F&&(N=null),F.sibling.return=F.return,F=F.sibling}}break;case 19:Nt(t,e),Vt(e),s&4&&ld(e);break;case 21:break;default:Nt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(id(r)){var s=r;break e}r=r.return}throw Error(o(160))}switch(s.tag){case 5:var l=s.stateNode;s.flags&32&&(Ee(l,""),s.flags&=-33);var u=od(e);Bl(e,u,l);break;case 3:case 4:var p=s.stateNode.containerInfo,w=od(e);ql(e,w,p);break;default:throw Error(o(161))}}catch(E){Ue(e,e.return,E)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nm(e,t,r){W=e,ud(e)}function ud(e,t,r){for(var s=(e.mode&1)!==0;W!==null;){var l=W,u=l.child;if(l.tag===22&&s){var p=l.memoizedState!==null||To;if(!p){var w=l.alternate,E=w!==null&&w.memoizedState!==null||tt;w=To;var O=tt;if(To=p,(tt=E)&&!O)for(W=l;W!==null;)p=W,E=p.child,p.tag===22&&p.memoizedState!==null?fd(l):E!==null?(E.return=p,W=E):fd(l);for(;u!==null;)W=u,ud(u),u=u.sibling;W=l,To=w,tt=O}cd(e)}else(l.subtreeFlags&8772)!==0&&u!==null?(u.return=l,W=u):cd(e)}}function cd(e){for(;W!==null;){var t=W;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:tt||Co(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!tt)if(r===null)s.componentDidMount();else{var l=t.elementType===t.type?r.memoizedProps:Lt(t.type,r.memoizedProps);s.componentDidUpdate(l,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&dc(t,u,s);break;case 3:var p=t.updateQueue;if(p!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}dc(t,p,r)}break;case 5:var w=t.stateNode;if(r===null&&t.flags&4){r=w;var E=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":E.autoFocus&&r.focus();break;case"img":E.src&&(r.src=E.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var O=t.alternate;if(O!==null){var N=O.memoizedState;if(N!==null){var F=N.dehydrated;F!==null&&Wr(F)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}tt||t.flags&512&&$l(t)}catch(D){Ue(t,t.return,D)}}if(t===e){W=null;break}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}}function dd(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var r=t.sibling;if(r!==null){r.return=t.return,W=r;break}W=t.return}}function fd(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Co(4,t)}catch(E){Ue(t,r,E)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var l=t.return;try{s.componentDidMount()}catch(E){Ue(t,l,E)}}var u=t.return;try{$l(t)}catch(E){Ue(t,u,E)}break;case 5:var p=t.return;try{$l(t)}catch(E){Ue(t,p,E)}}}catch(E){Ue(t,t.return,E)}if(t===e){W=null;break}var w=t.sibling;if(w!==null){w.return=t.return,W=w;break}W=t.return}}var Fm=Math.ceil,Po=V.ReactCurrentDispatcher,Hl=V.ReactCurrentOwner,kt=V.ReactCurrentBatchConfig,Te=0,We=null,qe=null,Xe=0,ht=0,wr=yn(0),He=0,yi=null,Mn=0,xo=0,Vl=0,gi=null,at=null,Gl=0,Er=1/0,en=null,Oo=!1,Wl=null,Sn=null,Ro=!1,kn=null,Io=0,vi=0,Yl=null,Lo=-1,Do=0;function it(){return(Te&6)!==0?ze():Lo!==-1?Lo:Lo=ze()}function bn(e){return(e.mode&1)===0?1:(Te&2)!==0&&Xe!==0?Xe&-Xe:vm.transition!==null?(Do===0&&(Do=ou()),Do):(e=Oe,e!==0||(e=window.event,e=e===void 0?16:hu(e.type)),e)}function Ft(e,t,r,s){if(50<vi)throw vi=0,Yl=null,Error(o(185));qr(e,r,s),((Te&2)===0||e!==We)&&(e===We&&((Te&2)===0&&(xo|=r),He===4&&Tn(e,Xe)),ut(e,s),r===1&&Te===0&&(t.mode&1)===0&&(Er=ze()+500,so&&vn()))}function ut(e,t){var r=e.callbackNode;vh(e,t);var s=$i(e,e===We?Xe:0);if(s===0)r!==null&&nu(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&nu(r),t===1)e.tag===0?gm(hd.bind(null,e)):Zu(hd.bind(null,e)),pm(function(){(Te&6)===0&&vn()}),r=null;else{switch(su(s)){case 1:r=Ps;break;case 4:r=ru;break;case 16:r=ji;break;case 536870912:r=iu;break;default:r=ji}r=Sd(r,pd.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function pd(e,t){if(Lo=-1,Do=0,(Te&6)!==0)throw Error(o(327));var r=e.callbackNode;if(Sr()&&e.callbackNode!==r)return null;var s=$i(e,e===We?Xe:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=No(e,s);else{t=s;var l=Te;Te|=2;var u=yd();(We!==e||Xe!==t)&&(en=null,Er=ze()+500,zn(e,t));do try{Mm();break}catch(w){md(e,w)}while(!0);fl(),Po.current=u,Te=l,qe!==null?t=0:(We=null,Xe=0,t=He)}if(t!==0){if(t===2&&(l=xs(e),l!==0&&(s=l,t=Kl(e,l))),t===1)throw r=yi,zn(e,0),Tn(e,s),ut(e,ze()),r;if(t===6)Tn(e,s);else{if(l=e.current.alternate,(s&30)===0&&!Am(l)&&(t=No(e,s),t===2&&(u=xs(e),u!==0&&(s=u,t=Kl(e,u))),t===1))throw r=yi,zn(e,0),Tn(e,s),ut(e,ze()),r;switch(e.finishedWork=l,e.finishedLanes=s,t){case 0:case 1:throw Error(o(345));case 2:$n(e,at,en);break;case 3:if(Tn(e,s),(s&130023424)===s&&(t=Gl+500-ze(),10<t)){if($i(e,0)!==0)break;if(l=e.suspendedLanes,(l&s)!==s){it(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=tl($n.bind(null,e,at,en),t);break}$n(e,at,en);break;case 4:if(Tn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,l=-1;0<s;){var p=31-Ot(s);u=1<<p,p=t[p],p>l&&(l=p),s&=~u}if(s=l,s=ze()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Fm(s/1960))-s,10<s){e.timeoutHandle=tl($n.bind(null,e,at,en),s);break}$n(e,at,en);break;case 5:$n(e,at,en);break;default:throw Error(o(329))}}}return ut(e,ze()),e.callbackNode===r?pd.bind(null,e):null}function Kl(e,t){var r=gi;return e.current.memoizedState.isDehydrated&&(zn(e,t).flags|=256),e=No(e,t),e!==2&&(t=at,at=r,t!==null&&Ql(t)),e}function Ql(e){at===null?at=e:at.push.apply(at,e)}function Am(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var l=r[s],u=l.getSnapshot;l=l.value;try{if(!Rt(u(),l))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tn(e,t){for(t&=~Vl,t&=~xo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ot(t),s=1<<r;e[r]=-1,t&=~s}}function hd(e){if((Te&6)!==0)throw Error(o(327));Sr();var t=$i(e,0);if((t&1)===0)return ut(e,ze()),null;var r=No(e,t);if(e.tag!==0&&r===2){var s=xs(e);s!==0&&(t=s,r=Kl(e,s))}if(r===1)throw r=yi,zn(e,0),Tn(e,t),ut(e,ze()),r;if(r===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$n(e,at,en),ut(e,ze()),null}function Xl(e,t){var r=Te;Te|=1;try{return e(t)}finally{Te=r,Te===0&&(Er=ze()+500,so&&vn())}}function Un(e){kn!==null&&kn.tag===0&&(Te&6)===0&&Sr();var t=Te;Te|=1;var r=kt.transition,s=Oe;try{if(kt.transition=null,Oe=1,e)return e()}finally{Oe=s,kt.transition=r,Te=t,(Te&6)===0&&vn()}}function Jl(){ht=wr.current,Ne(wr)}function zn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,fm(r)),qe!==null)for(r=qe.return;r!==null;){var s=r;switch(ll(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&io();break;case 3:gr(),Ne(ot),Ne(Je),wl();break;case 5:vl(s);break;case 4:gr();break;case 13:Ne(je);break;case 19:Ne(je);break;case 10:pl(s.type._context);break;case 22:case 23:Jl()}r=r.return}if(We=e,qe=e=Cn(e.current,null),Xe=ht=t,He=0,yi=null,Vl=xo=Mn=0,at=gi=null,Fn!==null){for(t=0;t<Fn.length;t++)if(r=Fn[t],s=r.interleaved,s!==null){r.interleaved=null;var l=s.next,u=r.pending;if(u!==null){var p=u.next;u.next=l,s.next=p}r.pending=s}Fn=null}return e}function md(e,t){do{var r=qe;try{if(fl(),go.current=Eo,vo){for(var s=Me.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}vo=!1}if(jn=0,Ge=Be=Me=null,ci=!1,di=0,Hl.current=null,r===null||r.return===null){He=1,yi=t,qe=null;break}e:{var u=e,p=r.return,w=r,E=t;if(t=Xe,w.flags|=32768,E!==null&&typeof E=="object"&&typeof E.then=="function"){var O=E,N=w,F=N.tag;if((N.mode&1)===0&&(F===0||F===11||F===15)){var D=N.alternate;D?(N.updateQueue=D.updateQueue,N.memoizedState=D.memoizedState,N.lanes=D.lanes):(N.updateQueue=null,N.memoizedState=null)}var B=zc(p);if(B!==null){B.flags&=-257,$c(B,p,w,u,t),B.mode&1&&Uc(u,O,t),t=B,E=O;var K=t.updateQueue;if(K===null){var Z=new Set;Z.add(E),t.updateQueue=Z}else K.add(E);break e}else{if((t&1)===0){Uc(u,O,t),Zl();break e}E=Error(o(426))}}else if(Ae&&w.mode&1){var $e=zc(p);if($e!==null){($e.flags&65536)===0&&($e.flags|=256),$c($e,p,w,u,t),cl(vr(E,w));break e}}u=E=vr(E,w),He!==4&&(He=2),gi===null?gi=[u]:gi.push(u),u=p;do{switch(u.tag){case 3:u.flags|=65536,t&=-t,u.lanes|=t;var C=jc(u,E,t);cc(u,C);break e;case 1:w=E;var S=u.type,P=u.stateNode;if((u.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||P!==null&&typeof P.componentDidCatch=="function"&&(Sn===null||!Sn.has(P)))){u.flags|=65536,t&=-t,u.lanes|=t;var A=Mc(u,w,t);cc(u,A);break e}}u=u.return}while(u!==null)}vd(r)}catch(ee){t=ee,qe===r&&r!==null&&(qe=r=r.return);continue}break}while(!0)}function yd(){var e=Po.current;return Po.current=Eo,e===null?Eo:e}function Zl(){(He===0||He===3||He===2)&&(He=4),We===null||(Mn&268435455)===0&&(xo&268435455)===0||Tn(We,Xe)}function No(e,t){var r=Te;Te|=2;var s=yd();(We!==e||Xe!==t)&&(en=null,zn(e,t));do try{jm();break}catch(l){md(e,l)}while(!0);if(fl(),Te=r,Po.current=s,qe!==null)throw Error(o(261));return We=null,Xe=0,He}function jm(){for(;qe!==null;)gd(qe)}function Mm(){for(;qe!==null&&!uh();)gd(qe)}function gd(e){var t=Ed(e.alternate,e,ht);e.memoizedProps=e.pendingProps,t===null?vd(e):qe=t,Hl.current=null}function vd(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Rm(r,t,ht),r!==null){qe=r;return}}else{if(r=Im(r,t),r!==null){r.flags&=32767,qe=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,qe=null;return}}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);He===0&&(He=5)}function $n(e,t,r){var s=Oe,l=kt.transition;try{kt.transition=null,Oe=1,Um(e,t,r,s)}finally{kt.transition=l,Oe=s}return null}function Um(e,t,r,s){do Sr();while(kn!==null);if((Te&6)!==0)throw Error(o(327));r=e.finishedWork;var l=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var u=r.lanes|r.childLanes;if(_h(e,u),e===We&&(qe=We=null,Xe=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Ro||(Ro=!0,Sd(ji,function(){return Sr(),null})),u=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||u){u=kt.transition,kt.transition=null;var p=Oe;Oe=1;var w=Te;Te|=4,Hl.current=null,Dm(e,r),ad(r,e),om(Zs),Hi=!!Js,Zs=Js=null,e.current=r,Nm(r),ch(),Te=w,Oe=p,kt.transition=u}else e.current=r;if(Ro&&(Ro=!1,kn=e,Io=l),u=e.pendingLanes,u===0&&(Sn=null),ph(r.stateNode),ut(e,ze()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)l=t[r],s(l.value,{componentStack:l.stack,digest:l.digest});if(Oo)throw Oo=!1,e=Wl,Wl=null,e;return(Io&1)!==0&&e.tag!==0&&Sr(),u=e.pendingLanes,(u&1)!==0?e===Yl?vi++:(vi=0,Yl=e):vi=0,vn(),null}function Sr(){if(kn!==null){var e=su(Io),t=kt.transition,r=Oe;try{if(kt.transition=null,Oe=16>e?16:e,kn===null)var s=!1;else{if(e=kn,kn=null,Io=0,(Te&6)!==0)throw Error(o(331));var l=Te;for(Te|=4,W=e.current;W!==null;){var u=W,p=u.child;if((W.flags&16)!==0){var w=u.deletions;if(w!==null){for(var E=0;E<w.length;E++){var O=w[E];for(W=O;W!==null;){var N=W;switch(N.tag){case 0:case 11:case 15:mi(8,N,u)}var F=N.child;if(F!==null)F.return=N,W=F;else for(;W!==null;){N=W;var D=N.sibling,B=N.return;if(rd(N),N===O){W=null;break}if(D!==null){D.return=B,W=D;break}W=B}}}var K=u.alternate;if(K!==null){var Z=K.child;if(Z!==null){K.child=null;do{var $e=Z.sibling;Z.sibling=null,Z=$e}while(Z!==null)}}W=u}}if((u.subtreeFlags&2064)!==0&&p!==null)p.return=u,W=p;else e:for(;W!==null;){if(u=W,(u.flags&2048)!==0)switch(u.tag){case 0:case 11:case 15:mi(9,u,u.return)}var C=u.sibling;if(C!==null){C.return=u.return,W=C;break e}W=u.return}}var S=e.current;for(W=S;W!==null;){p=W;var P=p.child;if((p.subtreeFlags&2064)!==0&&P!==null)P.return=p,W=P;else e:for(p=S;W!==null;){if(w=W,(w.flags&2048)!==0)try{switch(w.tag){case 0:case 11:case 15:Co(9,w)}}catch(ee){Ue(w,w.return,ee)}if(w===p){W=null;break e}var A=w.sibling;if(A!==null){A.return=w.return,W=A;break e}W=w.return}}if(Te=l,vn(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Mi,e)}catch{}s=!0}return s}finally{Oe=r,kt.transition=t}}return!1}function _d(e,t,r){t=vr(r,t),t=jc(e,t,1),e=wn(e,t,1),t=it(),e!==null&&(qr(e,1,t),ut(e,t))}function Ue(e,t,r){if(e.tag===3)_d(e,e,r);else for(;t!==null;){if(t.tag===3){_d(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Sn===null||!Sn.has(s))){e=vr(r,e),e=Mc(t,e,1),t=wn(t,e,1),e=it(),t!==null&&(qr(t,1,e),ut(t,e));break}}t=t.return}}function zm(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=it(),e.pingedLanes|=e.suspendedLanes&r,We===e&&(Xe&r)===r&&(He===4||He===3&&(Xe&130023424)===Xe&&500>ze()-Gl?zn(e,0):Vl|=r),ut(e,t)}function wd(e,t){t===0&&((e.mode&1)===0?t=1:(t=zi,zi<<=1,(zi&130023424)===0&&(zi=4194304)));var r=it();e=Xt(e,t),e!==null&&(qr(e,t,r),ut(e,r))}function $m(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wd(e,r)}function qm(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(o(314))}s!==null&&s.delete(t),wd(e,r)}var Ed;Ed=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)lt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return lt=!1,Om(e,t,r);lt=(e.flags&131072)!==0}else lt=!1,Ae&&(t.flags&1048576)!==0&&ec(t,ao,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;bo(e,t),e=t.pendingProps;var l=cr(t,Je.current);yr(t,r),l=kl(null,t,s,e,l,r);var u=bl();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(s)?(u=!0,oo(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,yl(t),l.updater=So,t.stateNode=l,l._reactInternals=t,Rl(t,s,e,r),t=Nl(null,t,s,!0,u,r)):(t.tag=0,Ae&&u&&sl(t),rt(null,t,l,r),t=t.child),t;case 16:s=t.elementType;e:{switch(bo(e,t),e=t.pendingProps,l=s._init,s=l(s._payload),t.type=s,l=t.tag=Hm(s),e=Lt(s,e),l){case 0:t=Dl(null,t,s,e,r);break e;case 1:t=Wc(null,t,s,e,r);break e;case 11:t=qc(null,t,s,e,r);break e;case 14:t=Bc(null,t,s,Lt(s.type,e),r);break e}throw Error(o(306,s,""))}return t;case 0:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Lt(s,l),Dl(e,t,s,l,r);case 1:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Lt(s,l),Wc(e,t,s,l,r);case 3:e:{if(Yc(t),e===null)throw Error(o(387));s=t.pendingProps,u=t.memoizedState,l=u.element,uc(e,t),mo(t,s,null,r);var p=t.memoizedState;if(s=p.element,u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=vr(Error(o(423)),t),t=Kc(e,t,s,r,l);break e}else if(s!==l){l=vr(Error(o(424)),t),t=Kc(e,t,s,r,l);break e}else for(pt=mn(t.stateNode.containerInfo.firstChild),ft=t,Ae=!0,It=null,r=lc(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(pr(),s===l){t=Zt(e,t,r);break e}rt(e,t,s,r)}t=t.child}return t;case 5:return fc(t),e===null&&ul(t),s=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,p=l.children,el(s,l)?p=null:u!==null&&el(s,u)&&(t.flags|=32),Gc(e,t),rt(e,t,p,r),t.child;case 6:return e===null&&ul(t),null;case 13:return Qc(e,t,r);case 4:return gl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=hr(t,null,s,r):rt(e,t,s,r),t.child;case 11:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Lt(s,l),qc(e,t,s,l,r);case 7:return rt(e,t,t.pendingProps,r),t.child;case 8:return rt(e,t,t.pendingProps.children,r),t.child;case 12:return rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,l=t.pendingProps,u=t.memoizedProps,p=l.value,Le(fo,s._currentValue),s._currentValue=p,u!==null)if(Rt(u.value,p)){if(u.children===l.children&&!ot.current){t=Zt(e,t,r);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var w=u.dependencies;if(w!==null){p=u.child;for(var E=w.firstContext;E!==null;){if(E.context===s){if(u.tag===1){E=Jt(-1,r&-r),E.tag=2;var O=u.updateQueue;if(O!==null){O=O.shared;var N=O.pending;N===null?E.next=E:(E.next=N.next,N.next=E),O.pending=E}}u.lanes|=r,E=u.alternate,E!==null&&(E.lanes|=r),hl(u.return,r,t),w.lanes|=r;break}E=E.next}}else if(u.tag===10)p=u.type===t.type?null:u.child;else if(u.tag===18){if(p=u.return,p===null)throw Error(o(341));p.lanes|=r,w=p.alternate,w!==null&&(w.lanes|=r),hl(p,r,t),p=u.sibling}else p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===t){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}rt(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,s=t.pendingProps.children,yr(t,r),l=Et(l),s=s(l),t.flags|=1,rt(e,t,s,r),t.child;case 14:return s=t.type,l=Lt(s,t.pendingProps),l=Lt(s.type,l),Bc(e,t,s,l,r);case 15:return Hc(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Lt(s,l),bo(e,t),t.tag=1,st(s)?(e=!0,oo(t)):e=!1,yr(t,r),Fc(t,s,l),Rl(t,s,l,r),Nl(null,t,s,!0,e,r);case 19:return Jc(e,t,r);case 22:return Vc(e,t,r)}throw Error(o(156,t.tag))};function Sd(e,t){return tu(e,t)}function Bm(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,r,s){return new Bm(e,t,r,s)}function ea(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hm(e){if(typeof e=="function")return ea(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ye)return 11;if(e===Fe)return 14}return 2}function Cn(e,t){var r=e.alternate;return r===null?(r=bt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fo(e,t,r,s,l,u){var p=2;if(s=e,typeof e=="function")ea(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case $:return qn(r.children,l,u,t);case ae:p=8,l|=8;break;case _e:return e=bt(12,r,t,l|2),e.elementType=_e,e.lanes=u,e;case ie:return e=bt(13,r,t,l),e.elementType=ie,e.lanes=u,e;case ke:return e=bt(19,r,t,l),e.elementType=ke,e.lanes=u,e;case Se:return Ao(r,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oe:p=10;break e;case re:p=9;break e;case ye:p=11;break e;case Fe:p=14;break e;case Pe:p=16,s=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=bt(p,r,t,l),t.elementType=e,t.type=s,t.lanes=u,t}function qn(e,t,r,s){return e=bt(7,e,s,t),e.lanes=r,e}function Ao(e,t,r,s){return e=bt(22,e,s,t),e.elementType=Se,e.lanes=r,e.stateNode={isHidden:!1},e}function ta(e,t,r){return e=bt(6,e,null,t),e.lanes=r,e}function na(e,t,r){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vm(e,t,r,s,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Os(0),this.expirationTimes=Os(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Os(0),this.identifierPrefix=s,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ra(e,t,r,s,l,u,p,w,E){return e=new Vm(e,t,r,w,E),t===1?(t=1,u===!0&&(t|=8)):t=0,u=bt(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yl(u),e}function Gm(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ne,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function kd(e){if(!e)return gn;e=e._reactInternals;e:{if(Rn(e)!==e||e.tag!==1)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(st(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(o(171))}if(e.tag===1){var r=e.type;if(st(r))return Xu(e,r,t)}return t}function bd(e,t,r,s,l,u,p,w,E){return e=ra(r,s,!0,e,l,u,p,w,E),e.context=kd(null),r=e.current,s=it(),l=bn(r),u=Jt(s,l),u.callback=t??null,wn(r,u,l),e.current.lanes=l,qr(e,l,s),ut(e,s),e}function jo(e,t,r,s){var l=t.current,u=it(),p=bn(l);return r=kd(r),t.context===null?t.context=r:t.pendingContext=r,t=Jt(u,p),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=wn(l,t,p),e!==null&&(Ft(e,l,p,u),ho(e,l,p)),p}function Mo(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Td(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ia(e,t){Td(e,t),(e=e.alternate)&&Td(e,t)}function Wm(){return null}var Cd=typeof reportError=="function"?reportError:function(e){console.error(e)};function oa(e){this._internalRoot=e}Uo.prototype.render=oa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));jo(e,t,null,null)},Uo.prototype.unmount=oa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Un(function(){jo(null,e,null,null)}),t[Wt]=null}};function Uo(e){this._internalRoot=e}Uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=uu();e={blockedOn:null,target:e,priority:t};for(var r=0;r<fn.length&&t!==0&&t<fn[r].priority;r++);fn.splice(r,0,e),r===0&&fu(e)}};function sa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pd(){}function Ym(e,t,r,s,l){if(l){if(typeof s=="function"){var u=s;s=function(){var O=Mo(p);u.call(O)}}var p=bd(t,s,e,0,null,!1,!1,"",Pd);return e._reactRootContainer=p,e[Wt]=p.current,ni(e.nodeType===8?e.parentNode:e),Un(),p}for(;l=e.lastChild;)e.removeChild(l);if(typeof s=="function"){var w=s;s=function(){var O=Mo(E);w.call(O)}}var E=ra(e,0,!1,null,null,!1,!1,"",Pd);return e._reactRootContainer=E,e[Wt]=E.current,ni(e.nodeType===8?e.parentNode:e),Un(function(){jo(t,E,r,s)}),E}function $o(e,t,r,s,l){var u=r._reactRootContainer;if(u){var p=u;if(typeof l=="function"){var w=l;l=function(){var E=Mo(p);w.call(E)}}jo(t,p,e,l)}else p=Ym(r,t,e,l,s);return Mo(p)}lu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=$r(t.pendingLanes);r!==0&&(Rs(t,r|1),ut(t,ze()),(Te&6)===0&&(Er=ze()+500,vn()))}break;case 13:Un(function(){var s=Xt(e,1);if(s!==null){var l=it();Ft(s,e,1,l)}}),ia(e,1)}},Is=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var r=it();Ft(t,e,134217728,r)}ia(e,134217728)}},au=function(e){if(e.tag===13){var t=bn(e),r=Xt(e,t);if(r!==null){var s=it();Ft(r,e,t,s)}ia(e,t)}},uu=function(){return Oe},cu=function(e,t){var r=Oe;try{return Oe=e,t()}finally{Oe=r}},ks=function(e,t,r){switch(t){case"input":if(Dr(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var l=ro(s);if(!l)throw Error(o(90));Ri(s),Dr(s,l)}}}break;case"textarea":Li(e,r);break;case"select":t=r.value,t!=null&&ln(e,!!r.multiple,t,!1)}},Ya=Xl,Ka=Un;var Km={usingClientEntryPoint:!1,Events:[oi,ar,ro,Ga,Wa,Xl]},_i={findFiberByHostInstance:In,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qm={bundleType:_i.bundleType,version:_i.version,rendererPackageName:_i.rendererPackageName,rendererConfig:_i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:V.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Za(e),e===null?null:e.stateNode},findFiberByHostInstance:_i.findFiberByHostInstance||Wm,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qo.isDisabled&&qo.supportsFiber)try{Mi=qo.inject(Qm),$t=qo}catch{}}return ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Km,ct.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sa(t))throw Error(o(200));return Gm(e,t,null,r)},ct.createRoot=function(e,t){if(!sa(e))throw Error(o(299));var r=!1,s="",l=Cd;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=ra(e,1,!1,null,null,r,!1,s,l),e[Wt]=t.current,ni(e.nodeType===8?e.parentNode:e),new oa(t)},ct.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Za(t),e=e===null?null:e.stateNode,e},ct.flushSync=function(e){return Un(e)},ct.hydrate=function(e,t,r){if(!zo(t))throw Error(o(200));return $o(null,e,t,!0,r)},ct.hydrateRoot=function(e,t,r){if(!sa(e))throw Error(o(405));var s=r!=null&&r.hydratedSources||null,l=!1,u="",p=Cd;if(r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(p=r.onRecoverableError)),t=bd(t,null,e,1,r??null,l,!1,u,p),e[Wt]=t.current,ni(e),s)for(e=0;e<s.length;e++)r=s[e],l=r._getVersion,l=l(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,l]:t.mutableSourceEagerHydrationData.push(r,l);return new Uo(t)},ct.render=function(e,t,r){if(!zo(t))throw Error(o(200));return $o(null,e,t,!1,r)},ct.unmountComponentAtNode=function(e){if(!zo(e))throw Error(o(40));return e._reactRootContainer?(Un(function(){$o(null,null,e,!1,function(){e._reactRootContainer=null,e[Wt]=null})}),!0):!1},ct.unstable_batchedUpdates=Xl,ct.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!zo(r))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return $o(e,t,r,!1,s)},ct.version="18.3.1-next-f1338f8080-20240426",ct}var Gd;function jf(){if(Gd)return ca.exports;Gd=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),ca.exports=Ry(),ca.exports}var Wd;function Iy(){if(Wd)return Ko;Wd=1;var i=jf();return Ko.createRoot=i.createRoot,Ko.hydrateRoot=i.hydrateRoot,Ko}var Ly=Iy();let pa=null;function ha(i){const n=document.getElementById("root");if(!n)throw new Error("Missing #root container");pa||(pa=Ly.createRoot(n)),pa.render(Q.jsx(Y.StrictMode,{children:i}))}var ma={exports:{}};var Yd;function Dy(){return Yd||(Yd=1,(function(i){(function(){var n={}.hasOwnProperty;function o(){for(var a=[],c=0;c<arguments.length;c++){var d=arguments[c];if(d){var f=typeof d;if(f==="string"||f==="number")a.push(d);else if(Array.isArray(d)){if(d.length){var h=o.apply(null,d);h&&a.push(h)}}else if(f==="object")if(d.toString===Object.prototype.toString)for(var _ in d)n.call(d,_)&&d[_]&&a.push(_);else a.push(d.toString())}}return a.join(" ")}i.exports?(o.default=o,i.exports=o):window.classNames=o})()})(ma)),ma.exports}var Ny=Dy();const nt=ms(Ny),Fy="_button_474wk_1",Ay="_disabled_474wk_30",jy="_fullWidth_474wk_118",My="_button__leftIcon_474wk_124",Uy="_button__rightIcon_474wk_125",Hn={button:Fy,disabled:Ay,"buttonType-muted":"_buttonType-muted_474wk_34","buttonType-primary":"_buttonType-primary_474wk_50","buttonType-negative":"_buttonType-negative_474wk_71","buttonSize-xxs":"_buttonSize-xxs_474wk_88","buttonSize-xs":"_buttonSize-xs_474wk_93","buttonSize-s":"_buttonSize-s_474wk_98","buttonSize-m":"_buttonSize-m_474wk_103","buttonSize-l":"_buttonSize-l_474wk_108","buttonSize-xl":"_buttonSize-xl_474wk_113",fullWidth:jy,button__leftIcon:My,button__rightIcon:Uy};function tn(i){var n,o=i.children,a=i.className,c=i.disabled,d=i.buttonType,f=d===void 0?"muted":d,h=i.buttonSize,_=h===void 0?"m":h,g=i.fullWidth,m=i.onClick,v=i.style,y=i.leftIcon,T=i.rightIcon,x=i.type,I=x===void 0?"button":x;return H.createElement("button",{type:I,className:nt(Hn.button,Hn["buttonType-".concat(f)],Hn["buttonSize-".concat(_)],(n={},n[Hn.disabled]=c,n[Hn.fullWidth]=g,n),a),disabled:c,onClick:m,style:v},y&&H.createElement("span",{className:Hn.button__leftIcon},y),o&&H.createElement("span",null,o),T&&H.createElement("span",{className:Hn.button__rightIcon},T))}var Ea=function(){return Ea=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Ea.apply(this,arguments)};function Kd(i){return i===i.toLowerCase()?i:i.replace(/[A-Z]/g,function(n){return"-".concat(n.toLowerCase())})}function Mf(i,n){return n===void 0&&(n=!1),Ea({padding:n?void 0:i.bodyPadding.map(function(o){return"".concat(o,"px")}).join(" ")},Object.fromEntries(Object.entries(i.theme).flatMap(function(o){var a,c=o[0],d=o[1];return[["--".concat(Kd(c)),d],["--".concat(Kd("".concat(c,"RgbComponents"))),((a=d.match(/rgb\((\d+, \d+, \d+)\)/))===null||a===void 0?void 0:a[1])||void 0]]})))}const zy="_themeVariables_2dr1w_1",$y="_canvas_2dr1w_70",ds={themeVariables:zy,canvas:$y};var Uf=Y.createContext(null);function $a(){var i=Y.useContext(Uf);if(!i)throw new Error("useCtx requires <Canvas />!");return i}function qa(i){var n=i.ctx,o=i.children,a=i.noAutoResizer,c=n.mode;return Y.useEffect(function(){if(!a&&"startAutoResizer"in n){var d=n;return d.startAutoResizer(),function(){d.stopAutoResizer()}}},[c,a]),H.createElement(Uf.Provider,{value:n},H.createElement("div",{className:nt(ds.themeVariables,ds.canvas),style:Mf(n)},o))}function qy(i){var n=Y.useRef(null),o=Y.useCallback(function(a){a.target,!(!n.current||n.current.contains(a.target))&&i(a)},[i]);return Y.useEffect(function(){return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),function(){document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[o]),n}var ys=Y.createContext({closeMenu:function(){}});const By="_Dropdown_nie0g_1",Hy="_Dropdown__spacer_nie0g_5",Vy="_Dropdown__menu__search_nie0g_11",Gy="_Dropdown__menu__search__input_nie0g_16",Wy="_Dropdown__menu_nie0g_11",Yy="_Dropdown__menu__inner_nie0g_61",Ky="_Dropdown__menu__group__title_nie0g_65",Qy="_Dropdown__menu__group__content_nie0g_73",Xy="_Dropdown__menu__option_nie0g_86",Jy="_Dropdown__menu__option__content_nie0g_115",Zy="_Dropdown__menu__option__icons_nie0g_194",eg="_Dropdown__menu__option__icon_nie0g_194",Re={Dropdown:By,Dropdown__spacer:Hy,Dropdown__menu__search:Vy,Dropdown__menu__search__input:Gy,"Dropdown__menu-container":"_Dropdown__menu-container_nie0g_45",Dropdown__menu:Wy,Dropdown__menu__inner:Yy,Dropdown__menu__group__title:Ky,Dropdown__menu__group__content:Qy,Dropdown__menu__option:Xy,"Dropdown__menu__option--is-selected":"_Dropdown__menu__option--is-selected_nie0g_108","Dropdown__menu__option--is-disabled":"_Dropdown__menu__option--is-disabled_nie0g_112",Dropdown__menu__option__content:Jy,"Dropdown__menu__option--is-dangerous":"_Dropdown__menu__option--is-dangerous_nie0g_120","Dropdown__menu__option--is-active":"_Dropdown__menu__option--is-active_nie0g_138","Dropdown__menu__option--is-valid":"_Dropdown__menu__option--is-valid_nie0g_147","Dropdown__menu__option--is-invalid":"_Dropdown__menu__option--is-invalid_nie0g_151",Dropdown__menu__option__icons:Zy,Dropdown__menu__option__icon:eg,"Dropdown__menu__option__icon--delete":"_Dropdown__menu__option__icon--delete_nie0g_241"};function tg(i){var n=i.renderTrigger,o=i.children,a=Y.useState(!1),c=a[0],d=a[1],f=Y.useCallback(function(m){!m.target.closest(".".concat(Re.Dropdown__menu))&&c&&d(!1)},[d,c]),h=qy(f),_=Y.useCallback(function(){d(!1)},[d]),g=Y.useCallback(function(){d(function(m){return!m})},[d]);return H.createElement(ys.Provider,{value:{closeMenu:_}},H.createElement("div",{className:Re.Dropdown,ref:h},n({open:c,onClick:g}),c&&o))}var ng=function(i){var n=i.children,o=i.name;return H.createElement("div",null,H.createElement("div",{className:Re.Dropdown__menu__group__title},o),H.createElement("div",{className:Re.Dropdown__menu__group__content},n))},Sa=new Map,Qo=new WeakMap,Qd=0,rg=void 0;function ig(i){return i?(Qo.has(i)||(Qd+=1,Qo.set(i,Qd.toString())),Qo.get(i)):"0"}function og(i){return Object.keys(i).sort().filter(function(n){return i[n]!==void 0}).map(function(n){return n+"_"+(n==="root"?ig(i.root):i[n])}).toString()}function sg(i){var n=og(i),o=Sa.get(n);if(!o){var a=new Map,c,d=new IntersectionObserver(function(f){f.forEach(function(h){var _,g=h.isIntersecting&&c.some(function(m){return h.intersectionRatio>=m});i.trackVisibility&&typeof h.isVisible>"u"&&(h.isVisible=g),(_=a.get(h.target))==null||_.forEach(function(m){m(g,h)})})},i);c=d.thresholds||(Array.isArray(i.threshold)?i.threshold:[i.threshold||0]),o={id:n,observer:d,elements:a},Sa.set(n,o)}return o}function lg(i,n,o,a){if(o===void 0&&(o={}),a===void 0&&(a=rg),typeof window.IntersectionObserver>"u"&&a!==void 0){var c=i.getBoundingClientRect();return n(a,{isIntersecting:a,target:i,intersectionRatio:typeof o.threshold=="number"?o.threshold:0,time:0,boundingClientRect:c,intersectionRect:c,rootBounds:c}),function(){}}var d=sg(o),f=d.id,h=d.observer,_=d.elements,g=_.get(i)||[];return _.has(i)||_.set(i,g),g.push(n),h.observe(i),function(){g.splice(g.indexOf(n),1),g.length===0&&(_.delete(i),h.unobserve(i)),_.size===0&&(h.disconnect(),Sa.delete(f))}}function ag(i){var n=i===void 0?{}:i,o=n.threshold,a=n.delay,c=n.trackVisibility,d=n.rootMargin,f=n.root,h=n.triggerOnce,_=n.skip,g=n.initialInView,m=n.fallbackInView,v=Y.useRef(),y=Y.useState({inView:!!g}),T=y[0],x=y[1],I=Y.useCallback(function(q){v.current!==void 0&&(v.current(),v.current=void 0),!_&&q&&(v.current=lg(q,function(te,X){x({inView:te,entry:X}),X.isIntersecting&&h&&v.current&&(v.current(),v.current=void 0)},{root:f,rootMargin:d,threshold:o,trackVisibility:c,delay:a},m))},[Array.isArray(o)?o.toString():o,f,d,h,_,c,m,a]);Y.useEffect(function(){!v.current&&T.entry&&!h&&!_&&x({inView:!!g})});var M=[I,T.inView,T.entry];return M.ref=M[0],M.inView=M[1],M.entry=M[2],M}function Xd(i){return typeof i=="object"&&i!=null&&i.nodeType===1}function Jd(i,n){return(!n||i!=="hidden")&&i!=="visible"&&i!=="clip"}function ya(i,n){if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){var o=getComputedStyle(i,null);return Jd(o.overflowY,n)||Jd(o.overflowX,n)||(function(a){var c=(function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!c&&(c.clientHeight<a.scrollHeight||c.clientWidth<a.scrollWidth)})(i)}return!1}function Xo(i,n,o,a,c,d,f,h){return d<i&&f>n||d>i&&f<n?0:d<=i&&h<=o||f>=n&&h>=o?d-i-a:f>n&&h<o||d<i&&h>o?f-n+c:0}function Zd(i,n){var o=window,a=n.scrollMode,c=n.block,d=n.inline,f=n.boundary,h=n.skipOverflowHiddenElements,_=typeof f=="function"?f:function(Ke){return Ke!==f};if(!Xd(i))throw new TypeError("Invalid target");for(var g=document.scrollingElement||document.documentElement,m=[],v=i;Xd(v)&&_(v);){if((v=v.parentElement)===g){m.push(v);break}v!=null&&v===document.body&&ya(v)&&!ya(document.documentElement)||v!=null&&ya(v,h)&&m.push(v)}for(var y=o.visualViewport?o.visualViewport.width:innerWidth,T=o.visualViewport?o.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,I=window.scrollY||pageYOffset,M=i.getBoundingClientRect(),q=M.height,te=M.width,X=M.top,V=M.right,fe=M.bottom,ne=M.left,$=c==="start"||c==="nearest"?X:c==="end"?fe:X+q/2,ae=d==="center"?ne+te/2:d==="end"?V:ne,_e=[],oe=0;oe<m.length;oe++){var re=m[oe],ye=re.getBoundingClientRect(),ie=ye.height,ke=ye.width,Fe=ye.top,Pe=ye.right,Se=ye.bottom,j=ye.left;if(a==="if-needed"&&X>=0&&ne>=0&&fe<=T&&V<=y&&X>=Fe&&fe<=Se&&ne>=j&&V<=Pe)return _e;var J=getComputedStyle(re),z=parseInt(J.borderLeftWidth,10),b=parseInt(J.borderTopWidth,10),L=parseInt(J.borderRightWidth,10),U=parseInt(J.borderBottomWidth,10),le=0,de=0,me="offsetWidth"in re?re.offsetWidth-re.clientWidth-z-L:0,be="offsetHeight"in re?re.offsetHeight-re.clientHeight-b-U:0;if(g===re)le=c==="start"?$:c==="end"?$-T:c==="nearest"?Xo(I,I+T,T,b,U,I+$,I+$+q,q):$-T/2,de=d==="start"?ae:d==="center"?ae-y/2:d==="end"?ae-y:Xo(x,x+y,y,z,L,x+ae,x+ae+te,te),le=Math.max(0,le+I),de=Math.max(0,de+x);else{le=c==="start"?$-Fe-b:c==="end"?$-Se+U+be:c==="nearest"?Xo(Fe,Se,ie,b,U+be,$,$+q,q):$-(Fe+ie/2)+be/2,de=d==="start"?ae-j-z:d==="center"?ae-(j+ke/2)+me/2:d==="end"?ae-Pe+L+me:Xo(j,Pe,ke,z,L+me,ae,ae+te,te);var we=re.scrollLeft,xe=re.scrollTop;$+=xe-(le=Math.max(0,Math.min(xe+le,re.scrollHeight-ie+be))),ae+=we-(de=Math.max(0,Math.min(we+de,re.scrollWidth-ke+me)))}_e.push({el:re,top:le,left:de})}return _e}function zf(i){return i===Object(i)&&Object.keys(i).length!==0}function ug(i,n){n===void 0&&(n="auto");var o="scrollBehavior"in document.body.style;i.forEach(function(a){var c=a.el,d=a.top,f=a.left;c.scroll&&o?c.scroll({top:d,left:f,behavior:n}):(c.scrollTop=d,c.scrollLeft=f)})}function cg(i){return i===!1?{block:"end",inline:"nearest"}:zf(i)?i:{block:"start",inline:"nearest"}}function dg(i,n){var o=i.isConnected||i.ownerDocument.documentElement.contains(i);if(zf(n)&&typeof n.behavior=="function")return n.behavior(o?Zd(i,n):[]);if(o){var a=cg(n);return ug(Zd(i,a),a.behavior)}}var fg=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return function(o){for(var a=0,c=i;a<c.length;a++){var d=c[a];typeof d=="function"?d(o):d&&typeof d=="object"&&(d.current=o)}}},$f=Y.createContext({searchTerm:"",addOption:function(){},setClickHandlerForOption:function(){}}),pg=jf();const hg=ms(pg);function mg(i){var n=i.children,o=$a(),a=Y.useRef(typeof document>"u"?null:document.createElement("div"));return Y.useEffect(function(){if(!(!a.current||!document.body))return document.body.appendChild(a.current),function(){a.current&&document.body.removeChild(a.current)}},[]),a.current?hg.createPortal(H.createElement("div",{className:nt(ds.themeVariables,ds.canvas),style:Mf(o,!0)},n),a.current):null}var fs=function(){return fs=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},fs.apply(this,arguments)},ef=function(i,n,o){if(o||arguments.length===2)for(var a=0,c=n.length,d;a<c;a++)(d||!(a in n))&&(d||(d=Array.prototype.slice.call(n,0,a)),d[a]=n[a]);return i.concat(d||Array.prototype.slice.call(n))};function yg(i){return"isAutoResizerActive"in i}var gg=H.forwardRef(function(i,n){var o=i.children;return H.createElement(mg,null,H.createElement("div",{className:Re["Dropdown__menu-container"],style:{zIndex:1e3},ref:n},o))});function vg(i){var n=window.getComputedStyle(i),o=Number.parseFloat(n.marginTop)+Number.parseFloat(n.marginBottom);return Math.ceil(i.offsetHeight+o)}function tf(i){var n=window.getComputedStyle(i),o=Number.parseFloat(n.marginLeft)+Number.parseFloat(n.marginRight);return Math.ceil(i.offsetWidth+o)}function _g(i,n,o,a){var c=n.getBoundingClientRect(),d=vg(i),f=tf(n),h=tf(i);o==="left"?i.style.left="".concat(c.left+window.pageXOffset,"px"):i.style.left="".concat(c.left+window.pageXOffset+f-h,"px");var _=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),g=i.querySelector(".".concat(Re.Dropdown__menu));if(g){var m=window.getComputedStyle(g),v=Number.parseFloat(m.marginTop),y=c.bottom+d<=_,T=c.top-d>0;if(!y&&T)i.style.top="".concat(c.bottom-d,"px");else if(y)i.style.top="".concat(c.bottom,"px");else{var x=c.top,I=_-c.bottom;I>x?(i.style.top="".concat(c.bottom,"px"),a||(g.style.maxHeight="".concat(_-c.bottom-v-10,"px"))):(i.style.top="0px",a||(g.style.maxHeight="".concat(c.top-v,"px")))}i.style.visibility="visible"}}var wg=function(i){var n=i.children,o=i.alignment,a=o===void 0?"left":o,c=$a(),d=Y.useContext(ys).closeMenu,f=H.Children.toArray(n),h=Y.useState(""),_=h[0],g=h[1],m=Y.useState([]),v=m[0],y=m[1],T=Y.useCallback(function(oe){g(oe.target.value)},[g]),x=f.some(function(oe){return typeof oe=="object"&&"type"in oe&&oe.type===ng}),I=Y.useCallback(function(oe){return y(function(re){return ef(ef([],re,!0),[{id:oe}],!1)}),function(){y(function(re){return re.filter(function(ye){return ye.id!==oe})})}},[y]),M=Y.useCallback(function(oe,re){y(function(ye){return ye.map(function(ie){return ie.id!==oe?ie:fs(fs({},ie),{handler:re})})})},[y]),q=Y.useRef(null),te=Y.useCallback(function(oe){if(oe.key==="Escape"&&(oe.preventDefault(),oe.stopPropagation(),d()),["ArrowDown","ArrowUp"].includes(oe.key)){if(oe.preventDefault(),oe.stopPropagation(),!q.current)return;var re=oe.key==="ArrowUp"?-1:1,ye=q.current.querySelector(".".concat(Re["Dropdown__menu__option--is-selected"])),ie=void 0;if(!ye)ie=q.current.querySelector(".".concat(Re.Dropdown__menu__option));else{var ke=Array.from(q.current.querySelectorAll(".".concat(Re.Dropdown__menu__option))),Fe=ke.findIndex(function(z){return z===ye}),Pe=Fe+re<0?ke.length-1:(Fe+re)%ke.length;ie=ke[Pe],ye.classList.remove(Re["Dropdown__menu__option--is-selected"])}ie&&(ie.classList.add(Re["Dropdown__menu__option--is-selected"]),dg(ie,{scrollMode:"if-needed",behavior:"auto"}))}if(oe.key==="Enter"){if(oe.preventDefault(),oe.stopPropagation(),!q.current)return;var Se=q.current.querySelector(".".concat(Re["Dropdown__menu__option--is-selected"]));if(Se){var j=Se.dataset.optionId,J=v.find(function(z){return z.id===j});J?.handler&&J.handler(oe)}}},[v]),X=ag({threshold:0,rootMargin:"0px 0px 0px 0px",triggerOnce:!1}),V=X[0],fe=X[1],ne=X[2],$=Y.createRef(),ae=Y.createRef(),_e=Y.useCallback(function(){if(ae.current&&$.current){var oe=yg(c)&&c.isAutoResizerActive();_g(ae.current,$.current,a,oe)}},[ae,$,a]);return Y.useEffect(function(){_e()},[fe,ne?.intersectionRatio]),Y.useEffect(function(){if(ae.current&&$.current){var oe=new ResizeObserver(_e);return oe.observe(ae.current),oe.observe($.current),function(){oe.disconnect()}}},[ae,_e]),Y.useEffect(function(){return window.addEventListener("resize",_e),function(){return window.removeEventListener("resize",_e)}},[_e]),H.createElement(H.Fragment,null,H.createElement("div",{ref:fg(V,$),className:Re.Dropdown__spacer}),H.createElement(gg,{ref:ae},H.createElement("div",{className:Re.Dropdown__menu},v.length>5&&H.createElement("div",{className:Re.Dropdown__menu__search},H.createElement("input",{type:"text",value:_||"",onChange:T,onKeyDown:te,placeholder:"Search...",className:Re.Dropdown__menu__search__input})),H.createElement($f.Provider,{value:{searchTerm:_,addOption:I,setClickHandlerForOption:M}},H.createElement("div",{className:Re.Dropdown__menu__inner,ref:q},x?n:H.createElement("div",{className:Re.Dropdown__menu__group__content},n))))))},ka=function(i){var n=i.icon,o=i.red,a=i.onClick,c=i.closeMenuOnClick;return H.createElement(ys.Consumer,null,function(d){var f;return H.createElement("button",{type:"button",className:nt(Re.Dropdown__menu__option__icon,(f={},f[Re["Dropdown__menu__option__icon--delete"]]=o,f)),onClick:function(h){h.preventDefault(),h.stopPropagation(),(c??!0)&&d.closeMenu(),a(h)}},n)})};ka.displayName="DropdownOptionAction";var Eg=function(i){var n,o=i.onClick,a=i.to,c=i.active,d=i.red,f=i.valid,h=i.invalid,_=i.children,g=i.disabled,m=i.closeMenuOnClick,v=$a(),y=Y.useMemo(function(){return new Date().getTime().toString(36)},[]),T=Y.useContext($f),x=T.searchTerm,I=T.addOption,M=T.setClickHandlerForOption,q=H.Children.toArray(_),te=q.filter(function(re){return typeof re=="object"&&"type"in re&&re.type===ka}),X=q.filter(function(re){return typeof re!="object"||!("type"in re)||re.type!==ka}),V=Y.useRef(null),fe=Y.useState(""),ne=fe[0],$=fe[1];Y.useEffect(function(){V.current&&$(V.current.innerText)});var ae=Y.useContext(ys).closeMenu,_e=Y.useCallback(function(re){!o&&!a||(re.preventDefault(),re.stopPropagation(),!g&&((m??!0)&&ae(),a&&v?.navigateTo(a),o&&o(re)))},[m,ae,o,a]);if(Y.useEffect(function(){return I(y)},[y]),Y.useEffect(function(){return M(y,_e)},[y,_e,M]),ne&&x&&!ne.toLowerCase().includes(x.toLowerCase()))return null;var oe=H.createElement(H.Fragment,null,H.createElement("button",{type:"button",className:Re.Dropdown__menu__option__content,ref:V,onClick:_e},X),te.length>0&&H.createElement("div",{className:Re.Dropdown__menu__option__icons},te));return H.createElement("div",{className:nt(Re.Dropdown__menu__option,(n={},n[Re["Dropdown__menu__option--is-active"]]=c,n[Re["Dropdown__menu__option--is-disabled"]]=g,n[Re["Dropdown__menu__option--is-valid"]]=f,n[Re["Dropdown__menu__option--is-invalid"]]=h,n[Re["Dropdown__menu__option--is-dangerous"]]=d,n)),"data-option-id":y},oe)};const Sg="_fieldError_qi0xk_1",kg={fieldError:Sg};function qf(i){var n=i.children;return H.createElement("div",{className:kg.fieldError},n)}const bg="_FieldGroup_uz9ju_1",Tg="_FieldGroup__item_uz9ju_5",nf={FieldGroup:bg,FieldGroup__item:Tg};var ba=function(){return ba=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},ba.apply(this,arguments)},Cg=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o};function rf(i){var n=i.children,o=i.className,a=Cg(i,["children","className"]),c=nt(nf.FieldGroup,o);return H.createElement("div",ba({},a,{className:c}),H.Children.map(n,function(d){return d&&H.createElement("div",{className:nf.FieldGroup__item},d)}))}const Pg="_fieldHint_1avon_1",xg={fieldHint:Pg};function Bf(i){var n=i.children;return H.createElement("div",{className:xg.fieldHint},n)}var Ta=function(){return Ta=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Ta.apply(this,arguments)};function Og(i){var n=i.id,o=i.label,a=i.hint,c=i.error,d=i.required,f=i.formLabelProps,h=i.children;return H.createElement(H.Fragment,null,H.createElement(Vf,Ta({},f,{htmlFor:n,required:d,error:!!c}),o),h,c&&H.createElement(qf,null,c),a&&H.createElement(Bf,null,a))}const Rg="_Form_5qspp_1",Ig="_Form__item_5qspp_5",ga={Form:Rg,Form__item:Ig,"Form__item--default":"_Form__item--default_5qspp_13","Form__item--condensed":"_Form__item--condensed_5qspp_17"};var Ca=function(){return Ca=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Ca.apply(this,arguments)},Lg=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o},Hf=function(i){var n=i.children,o=i.className,a=i.onSubmit,c=i.spacing,d=c===void 0?"default":c,f=Lg(i,["children","className","onSubmit","spacing"]),h=nt(ga.Form,o),_=nt(ga.Form__item,ga["Form__item--".concat(d)]),g=Y.useCallback(function(m){m.preventDefault(),a&&a(m)},[a]);return H.createElement("form",Ca({className:h,onSubmit:g},f),Y.Children.map(n,function(m){return m?H.createElement("div",{className:_},m):null}))};const Dg="_formLabel_tcjrv_1",Ng="_formLabel__code_tcjrv_8",Fg="_formLabel__label_tcjrv_18",Ag="_formLabel__required_tcjrv_30",Ei={formLabel:Dg,formLabel__code:Ng,"formLabel--error":"_formLabel--error_tcjrv_14",formLabel__label:Fg,formLabel__required:Ag};var Pa=function(){return Pa=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Pa.apply(this,arguments)},jg=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o},Vf=function(i){var n,o=i.children,a=i.className,c=i.htmlFor,d=i.code,f=i.required,h=f===void 0?!1:f,_=i.error,g=_===void 0?!1:_,m=jg(i,["children","className","htmlFor","code","required","error"]),v=nt(Ei.formLabel,a,(n={},n[Ei["formLabel--error"]]=g,n));return H.createElement("label",Pa({className:v,htmlFor:c},m),H.createElement("span",{className:Ei.formLabel__label},o,h&&H.createElement("span",{className:Ei.formLabel__required},"*")),d&&H.createElement("span",{className:Ei.formLabel__code},d))};const Mg="_Section_zh95u_1",Ug="_Section__header_zh95u_19",zg="_Section__title_zh95u_38",$g="_Section__title__content_zh95u_52",qg="_Section__arrow_zh95u_55",Vn={Section:Mg,"Section--highlighted":"_Section--highlighted_zh95u_5",Section__header:Ug,Section__title:zg,Section__title__content:$g,Section__arrow:qg,"Section__arrow--is-open":"_Section__arrow--is-open_zh95u_82"};function Bg(i){var n,o,a=i.title,c=i.children,d=i.highlighted,f=i.collapsible,h=i.headerClassName,_=i.titleClassName,g=i.headerStyle,m=i.titleStyle;return H.createElement("div",{className:nt(Vn.Section,(n={},n[Vn["Section--highlighted"]]=d,n))},H.createElement("div",{className:nt(Vn.Section__header,h),style:g},H.createElement("div",{className:nt(Vn.Section__title,_),style:m},f&&H.createElement("button",{type:"button",className:nt(Vn.Section__arrow,(o={},o[Vn["Section__arrow--is-open"]]=f.isOpen,o)),onClick:f.onToggle}),H.createElement("div",{className:Vn.Section__title__content},a))),(!f||f.isOpen)&&c)}const Hg="_switchField__flex_16z4j_1",Vg="_switchField__switchInput_16z4j_6",Gg="_switchField__label_16z4j_10",Wg="_switchField__below_16z4j_22",Jo={switchField__flex:Hg,switchField__switchInput:Vg,switchField__label:Gg,switchField__below:Wg};var ps=function(){return ps=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},ps.apply(this,arguments)};function of(i){var n=i.id,o=i.name,a=i.label,c=i.hint,d=i.error,f=i.required,h=i.formLabelProps,_=i.value,g=i.onChange,m=i.switchInputProps;return H.createElement(H.Fragment,null,H.createElement("div",{className:Jo.switchField__flex},H.createElement("div",{className:Jo.switchField__switchInput},H.createElement(Zg,ps({},m,{name:o,value:_,onChange:g}))),H.createElement(Vf,ps({},h,{htmlFor:n,required:f,className:nt(Jo.switchField__label,h?.className),error:!!d}),a)),(c||d)&&H.createElement("div",{className:Jo.switchField__below},d&&H.createElement(qf,null,d),c&&H.createElement(Bf,null,c)))}const Yg="_switchInput__inner_1knbg_1",Kg="_switchInput_1knbg_1",Qg="_switchInput__checked_1knbg_47",Xg="_switchInput__disabled_1knbg_60",Zo={switchInput__inner:Yg,switchInput:Kg,switchInput__checked:Qg,switchInput__disabled:Xg};var xa=function(){return xa=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},xa.apply(this,arguments)},Jg=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o};function Zg(i){var n,o=i.className,a=i.value,c=i.disabled,d=i.onClick,f=i.onChange,h=i.onKeyDown,_=Jg(i,["className","value","disabled","onClick","onChange","onKeyDown"]);function g(T,x){!c&&f&&f(T,x)}function m(T){T.key==="ArrowLeft"?g(!1,T):T.key==="ArrowRight"&&g(!0,T),h?.(T)}function v(T){g(!a,T),d?.(T)}var y=nt(Zo.switchInput,o,(n={},n[Zo.switchInput__checked]=a,n[Zo.switchInput__disabled]=c,n));return H.createElement("button",xa({},_,{type:"button",role:"switch","aria-checked":a,disabled:c,className:y,onKeyDown:m,onClick:v}),H.createElement("span",{className:Zo.switchInput__inner}))}var Oa=function(){return Oa=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Oa.apply(this,arguments)};function sf(i){var n=i.id,o=i.name,a=i.label,c=i.hint,d=i.error,f=i.required,h=i.placeholder,_=i.formLabelProps,g=i.value,m=i.onChange,v=i.textInputProps;return H.createElement(Og,{formLabelProps:_,id:n,required:f,error:d,hint:c,label:a},H.createElement(nv,Oa({},v,{id:n,name:o,value:g,placeholder:h,onChange:m,error:!!d})))}const ev="_TextInput_x2oj2_1",es={TextInput:ev,"TextInput--monospaced":"_TextInput--monospaced_x2oj2_30","TextInput--disabled":"_TextInput--disabled_x2oj2_35","TextInput--error":"_TextInput--error_x2oj2_41"};var Ra=function(){return Ra=Object.assign||function(i){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c])}return i},Ra.apply(this,arguments)},tv=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o},nv=function(i){var n,o=i.className,a=i.disabled,c=a===void 0?!1:a,d=i.error,f=i.id,h=i.inputRef,_=i.maxLength,g=i.name,m=i.labelText,v=i.onBlur,y=i.onChange,T=i.placeholder,x=i.required,I=x===void 0?!1:x,M=i.type,q=i.value,te=i.monospaced,X=tv(i,["className","disabled","error","id","inputRef","maxLength","name","labelText","onBlur","onChange","placeholder","required","type","value","monospaced"]),V=Y.useCallback(function(ne){y&&y(ne.target.value,ne)},[y]),fe=nt(es.TextInput,o,(n={},n[es["TextInput--disabled"]]=c,n[es["TextInput--error"]]=d,n[es["TextInput--monospaced"]]=te,n));return H.createElement("input",Ra({className:fe,"aria-label":m,id:f,name:g,required:I,placeholder:T,maxLength:_,disabled:c,onBlur:v,onChange:V,value:q,type:M,ref:h},X))};const lf=[{provider:"vercel",label:"Vercel",url:"https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmarcelofinamorvieira%2Frecord-bin-lambda-function&env=DATOCMS_FULLACCESS_API_TOKEN&project-name=datocms-record-bin-lambda-function&repo-name=datocms-record-bin-lambda-function"},{provider:"netlify",label:"Netlify",url:"https://app.netlify.com/start/deploy?repository=https://github.com/marcelofinamorvieira/record-bin-lambda-function"},{provider:"cloudflare",label:"Cloudflare",url:"https://github.com/marcelofinamorvieira/record-bin-lambda-function#deploying-on-cloudflare-workers"}],rv="https://github.com/datocms/plugins/tree/master/record-bin#readme",iv="[record-bin]",jt=i=>i?.debug===!0,xt=(i,n)=>{const o=`${iv}[${n}]`,a=(c,...d)=>{i&&console[c](o,...d)};return{enabled:i,log:(...c)=>a("log",...c),warn:(...c)=>a("warn",...c),error:(...c)=>a("error",...c)}},af=i=>typeof i=="string",Ci=i=>i?af(i.deploymentURL)&&i.deploymentURL.trim()?i.deploymentURL:af(i.vercelURL)?i.vercelURL:"":"",ov=i=>i==="lambda"||i==="lambdaless",gs=i=>{const n=i?.runtimeMode;return ov(n)?n:typeof i?.lambdaFullMode=="boolean"?i.lambdaFullMode?"lambda":"lambdaless":Ci(i).trim()?"lambda":"lambdaless"};function Gf(i){return typeof i=="object"&&!!i&&"data"in i}function sv(i){return typeof i=="object"&&!!i&&"included"in i}function zt({__itemTypeId:i,id:n,type:o,attributes:a,relationships:c,meta:d}){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i?{__itemTypeId:i}:{}),n?{id:n}:{}),o?{type:o}:{}),a||{}),c?Object.fromEntries(Object.entries(c).map(([f,h])=>[f,h?.data])):{}),d?{meta:d}:{})}function k(i){if(!Gf(i))throw new Error("Invalid body!");return Array.isArray(i.data)?i.data.map(zt):zt(i.data)}function Wf(i){return!!(i&&typeof i=="object"&&"type"in i&&i.type==="item")}function Ia(i){if(Array.isArray(i))return i.map(Ia);if(i&&typeof i=="object"){if(Wf(i))return ki(i);const n={};for(const[o,a]of Object.entries(i))n[o]=Ia(a);return n}return i}function ki(i){if(!Wf(i))return i;const n=i.attributes?Ia(i.attributes):i.attributes;return Object.assign(Object.assign({},i),{attributes:n,__itemTypeId:i.relationships.item_type.data.id})}function Pt(i){if(!Gf(i))throw new Error("Invalid body!");let n;Array.isArray(i.data)?n=i.data.map(ki):n=ki(i.data);let o;return sv(i)&&(o=i.included.map(ki)),Object.assign(Object.assign(Object.assign({},i),{data:n}),o?{included:o}:{})}function lv(i){if(typeof i!="object"||i===null||!("data"in i))return!1;const n=i;if(!Array.isArray(n.data))return!1;const o=n;if(o.data.length===0)return!1;const a=o.data[0];return!(typeof a!="object"||a===null||!("id"in a)||!("type"in a)||!("attributes"in a)||a.type!=="api_error")}class av extends Error{constructor(n){super("API Error!"),Object.setPrototypeOf(this,new.target.prototype),"captureStackTrace"in Error?Error.captureStackTrace(this,Yn):this.stack=new Error().stack,this.request=n.request,this.preCallStack=n.preCallStack,this.message=`${n.request.method} ${n.request.url}: Timeout error`,this.preCallStack&&(this.stack+=`
|
|
9
|
+
Caused By:
|
|
10
|
+
${this.preCallStack}`)}}class Yn extends Error{constructor(n){super("API Error!"),Object.setPrototypeOf(this,new.target.prototype),"captureStackTrace"in Error?Error.captureStackTrace(this,Yn):this.stack=new Error().stack,this.request=n.request,this.response=n.response,this.preCallStack=n.preCallStack;let o=`${n.request.method} ${n.request.url}: ${this.response.status} ${this.response.statusText}`;this.errors.length>0&&(o+=`
|
|
11
|
+
|
|
12
|
+
${JSON.stringify(this.errors,null,2)}`),this.message=o,this.preCallStack&&(this.stack+=`
|
|
13
|
+
Caused By:
|
|
14
|
+
${this.preCallStack}`)}get errors(){return lv(this.response.body)?this.response.body.data:[]}findError(n,o){const a=Array.isArray(n)?n:[n];return this.errors.find(c=>a.includes(c.attributes.code)&&(!o||(typeof o=="function"?o(c.attributes.details):Object.entries(o).every(([d,f])=>c.attributes.details[d]===f))))}}class Pi extends Error{constructor(){super("Promise canceled!"),Object.setPrototypeOf(this,new.target.prototype)}}function xi(i,n){let o=null;const a=new Promise((c,d)=>{o=()=>{try{n&&n(),d(new Pi)}catch(h){d(h)}},(typeof i=="function"?i():i).then(c,d)});return o&&(a.cancel=o),a}function os(i){return new Promise(n=>{setTimeout(n,i)})}var uv=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})};function cv(i){return uv(this,void 0,void 0,function*(){let n,o=0;do try{o+=1,yield os(o*1e3),n=yield i()}catch(a){if(!(a instanceof Yn)||a.response.status!==404)throw a}while(!n);return n})}var Si={},xn={},va={},uf;function Yf(){return uf||(uf=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.TaskCollisionStrategy=void 0,(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.KEEP_THIS=1]="KEEP_THIS",n[n.KEEP_OTHER=2]="KEEP_OTHER",n[n.KEEP_BOTH=3]="KEEP_BOTH",n[n.RESOLVE_THIS=4]="RESOLVE_THIS",n[n.RESOLVE_OTHER=5]="RESOLVE_OTHER"})(i.TaskCollisionStrategy||(i.TaskCollisionStrategy={}))})(va)),va}var ts={},cf;function Kf(){if(cf)return ts;cf=1,Object.defineProperty(ts,"__esModule",{value:!0});let i=class{constructor(o,a){this._code=o,this._message=a}get code(){return this._code}get message(){return this._message}};return ts.default=i,ts}var Gn={},df;function Qf(){if(df)return Gn;df=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.mutexEquality=Gn.mutexBitwiseAnd=void 0;function i(o,a){return(o&a)!==0}Gn.mutexBitwiseAnd=i;function n(o,a){return o===a}return Gn.mutexEquality=n,Gn}var ns={},ff;function dv(){if(ff)return ns;ff=1,Object.defineProperty(ns,"__esModule",{value:!0});let i=class{constructor(o,a){this._meta=void 0,this._task=o,this._scheduler=a}withDescriptor(o){return this._descriptor=o,this}withMutex(o){return this._mutex=o,this}withMeta(o){return this._meta=o,this}runBeforeExecuting(o){return this._onPreExecute=o,this}handleCollisions(o){return this._onTaskCollision=o,this}execute(o){return this._scheduler.enqueue({priority:o,mutex:this._mutex,descriptor:this._descriptor,meta:this._meta,execute:this._task,onPreExecute:this._onPreExecute,onTaskCollision:this._onTaskCollision})}};return ns.default=i,ns}var pf;function fv(){if(pf)return xn;pf=1;var i=xn&&xn.__awaiter||function(g,m,v,y){function T(x){return x instanceof v?x:new v(function(I){I(x)})}return new(v||(v=Promise))(function(x,I){function M(X){try{te(y.next(X))}catch(V){I(V)}}function q(X){try{te(y.throw(X))}catch(V){I(V)}}function te(X){X.done?x(X.value):T(X.value).then(M,q)}te((y=y.apply(g,m||[])).next())})},n=xn&&xn.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(xn,"__esModule",{value:!0});const o=Yf(),a=n(Kf()),c=Qf(),d=n(dv());var f;(function(g){g[g.PENDING=0]="PENDING",g[g.EXECUTING=1]="EXECUTING",g[g.TERMINATED=2]="TERMINATED"})(f||(f={}));function h(g,m){for(let v of g.listeners)v.reject(m)}let _=class{constructor(m,v={}){this._queue=[],this._isExecuting=!1,this._idleListeners=[],this._maxConcurrentTasks=m,this._samePriorityMutex=!!v.samePriorityMutex,this._mutexStrategy=v.mutexStrategy||c.mutexEquality,v.disableLogging?this._errorLog=()=>{}:this._errorLog=console.error}enqueue(m){return new Promise((v,y)=>{typeof m=="function"&&(m={priority:0,execute:m});const T=this._checkMutexes(m,v,y);T.task?this._addTask(T.task):T.canceled&&y(this.createCanceledError())})}prepare(m){return new d.default(m,this)}_addTask(m){this._queue.push(m),this._applyPriorities(),this._isExecuting||(this._isExecuting=!0,setTimeout(this._executeNextTasks.bind(this)))}get executingTasks(){return this._queue.reduce((m,v)=>v.state===f.EXECUTING?m+1:m,0)}createCanceledError(){return new a.default(50,"Task has been canceled in favor of another task")}_findFirstPendingTask(){return this._queue.find(m=>m.state===f.PENDING)}_isIdle(){return this._queue.length===0||!this._queue.find(m=>m.state!==f.TERMINATED)}_removeTaskAt(m){this._queue.splice(m,1)}_executeTask(m){return i(this,void 0,void 0,function*(){try{return m.task.onPreExecute&&m.task.onPreExecute(),yield m.task.execute()}catch(v){throw v}finally{m.state=f.TERMINATED;let v=this._queue.indexOf(m);this._removeTaskAt(v),this._executeNextTasks()}})}_executeNextTasks(){let m=this.executingTasks;if(m>=this._maxConcurrentTasks)return;let v=this._maxConcurrentTasks-m;for(let y=0;y<v;y++){const T=this._findFirstPendingTask();if(!T){this._isIdle()&&this._switchToIdle();return}T.state=f.EXECUTING,this._executeTask(T).then(x=>{for(const{resolve:I}of T.listeners)try{I(x)}catch(M){this._errorLog("An error occurred while resolving listener",M)}}).catch(x=>{for(const{reject:I}of T.listeners)try{I(x)}catch(M){this._errorLog("An error occurred while rejecting listener",M)}})}}_switchToIdle(){this._isExecuting=!1;const m=this._idleListeners;this._idleListeners=[];for(const{resolve:v}of m)try{v()}catch{}}waitForIdle(){return this._isExecuting?new Promise((m,v)=>{this._idleListeners.push({resolve:m,reject:v})}):Promise.resolve()}_applyPriorities(){this._queue.sort((m,v)=>v.task.priority-m.task.priority)}_checkMutexes(m,v,y){for(let T=0;T<this._queue.length;T++){let x=this._queue[T];if(x.state===f.TERMINATED||this._samePriorityMutex&&x.task.priority!=m.priority||!x.task.mutex||!m.mutex||!this._mutexStrategy(x.task.mutex,m.mutex))continue;let I,M;if(x.task.onTaskCollision)if(I=x.task.onTaskCollision(m),I===o.TaskCollisionStrategy.KEEP_OTHER&&x.state!==f.EXECUTING){this._removeTaskAt(T--),h(x,this.createCanceledError());continue}else{if(I===o.TaskCollisionStrategy.KEEP_THIS)return{canceled:!0};if(I===o.TaskCollisionStrategy.RESOLVE_OTHER)return this._removeTaskAt(T--),{canceled:!1,task:{task:m,state:f.PENDING,listeners:[{resolve:v,reject:y},...x.listeners]}};if(I===o.TaskCollisionStrategy.RESOLVE_THIS)return x.listeners=[...x.listeners,{resolve:v,reject:y}],{canceled:!1}}if(m.onTaskCollision){if(M=m.onTaskCollision(x.task),M===o.TaskCollisionStrategy.KEEP_OTHER)return{canceled:!0};if(M===o.TaskCollisionStrategy.KEEP_THIS){this._removeTaskAt(T--),h(x,this.createCanceledError());continue}else{if(M===o.TaskCollisionStrategy.RESOLVE_OTHER)return x.listeners=[...x.listeners,{resolve:v,reject:y}],{canceled:!1};if(M===o.TaskCollisionStrategy.RESOLVE_THIS)return this._removeTaskAt(T--),{canceled:!1,task:{task:m,state:f.PENDING,listeners:[{resolve:v,reject:y},...x.listeners]}}}}if(!(I===o.TaskCollisionStrategy.KEEP_BOTH&&M===o.TaskCollisionStrategy.KEEP_BOTH))return{canceled:!0}}return{canceled:!1,task:{task:m,state:f.PENDING,listeners:[{resolve:v,reject:y}]}}}};return xn.default=_,xn}var hf;function pv(){return hf||(hf=1,(function(i){var n=Si&&Si.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(i,"__esModule",{value:!0}),i.mutexEquality=i.mutexBitwiseAnd=i.SchedulerError=i.TaskCollisionStrategy=i.Scheduler=void 0;const o=n(fv());i.Scheduler=o.default;const a=Yf();Object.defineProperty(i,"TaskCollisionStrategy",{enumerable:!0,get:function(){return a.TaskCollisionStrategy}});const c=n(Kf());i.SchedulerError=c.default;const d=Qf();Object.defineProperty(i,"mutexBitwiseAnd",{enumerable:!0,get:function(){return d.mutexBitwiseAnd}}),Object.defineProperty(i,"mutexEquality",{enumerable:!0,get:function(){return d.mutexEquality}})})(Si)),Si}var hv=pv(),Wn=function(i){return this instanceof Wn?(this.v=i,this):new Wn(i)},mv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Wn?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};function rn(i,n,o,a){return mv(this,arguments,function*(){const d=o?.perPage||i.defaultLimit;if(d>i.maxLimit)throw new Error(`perPage option cannot exceed maximum value of ${i.maxLimit}`);const f=o?.concurrency||1;if(f>10)throw new Error("concurrency option cannot exceed maximum value of 10");const h=yield Wn(n({limit:d,offset:0}));for(const v of h.data)yield yield Wn(v);const _=h.meta.total_count,g=new hv.Scheduler(f),m=[];for(let v=d;v<_;v+=d)m.push(g.enqueue(()=>n({limit:d,offset:v})));for(;m.length>0;){const v=yield Wn(m.shift());for(const y of v.data)yield yield Wn(a?ki(y):y)}})}function on(i){i&&"page"in i&&console.warn("Passing a `page` query param on paged iterators has no effect: use the `perPage` option instead.")}const Xf="__ARRAY_INDEX__";function yv(i){return i.reduce((n,o,a)=>a===0?o:o===Xf?`${n}[]`:`${n}[${o}]`,"")}function gv(i){if(typeof i=="number"||typeof i=="string")return i.toString();if(i===!0)return"true";if(i===!1)return"false";throw`Don't know how to serialize param value ${JSON.stringify(i)}`}function La(i,n=[]){const o=[];if(typeof i=="number"||typeof i=="string"||typeof i=="boolean")o.push([yv(n),gv(i)]);else if(typeof i=="object"){if(Array.isArray(i))for(const a of i)for(const c of La(a,[...n,Xf]))o.push(c);else if(i)for(const[a,c]of Object.entries(i))for(const d of La(c,[...n,a]))o.push(d)}return o}var vv=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})};const _v=typeof window<"u"&&typeof window.document<"u",wv=5;var Ct;(function(i){i[i.NONE=0]="NONE",i[i.BASIC=1]="BASIC",i[i.BODY=2]="BODY",i[i.BODY_AND_HEADERS=3]="BODY_AND_HEADERS"})(Ct||(Ct={}));function Ev(i){const n={};return i.forEach((o,a)=>{n[a]=o}),n}function mf(i,n,o,a,c,d,f){return{request:{url:n,method:i,headers:o,body:a},response:{status:c.status,statusText:c.statusText,headers:Ev(c.headers),body:d},preCallStack:f}}function Sv(i,n,o,a,c){return{request:{url:n,method:i,headers:o,body:a},preCallStack:c}}function kv(i,n,o,a,c,d,f){return{request:{url:n,method:i,headers:o,body:a},response:{status:c,statusText:"N/A",headers:{},body:d},preCallStack:f}}function bv(i){return typeof i=="object"&&!!i&&"code"in i}function Tv(i){return Object.fromEntries(Object.entries(i).map(([n,o])=>[n.toLowerCase(),o]))}let yf=1;function Cv(i){const n=i||(typeof fetch>"u"?void 0:fetch)||(typeof globalThis>"u"?void 0:globalThis.fetch);if(typeof n>"u")throw new Error("fetch() is not available: either polyfill it globally, or provide it as fetchFn option.");return n}function ss(i){var n;return vv(this,void 0,void 0,function*(){const o=yf;yf+=1;const a=Cv(i.fetchFn),c=i.preCallStack,d=i.userAgent||"@datocms/rest-client-utils",f=i.retryCount||1,h=i.logLevel||Ct.NONE,_="autoRetry"in i?i.autoRetry:!0,g=i.logFn||(()=>!0),m=Object.assign({"content-type":"application/json",accept:"application/json",authorization:`Bearer ${i.apiToken}`,"user-agent":d},i.extraHeaders?Tv(i.extraHeaders):{});_v&&delete m["user-agent"];const v=i.baseUrl.replace(/\/$/,""),y=i.body?JSON.stringify(i.body,null,2):void 0,T=i.queryParams&&Object.keys(i.queryParams).length>0?`?${new URLSearchParams(La(i.queryParams)).toString()}`:"",x=`${v}${i.url}${T}`;if(h>=Ct.BASIC){if(g(`[${o}] ${i.method} ${x}`),h>=Ct.BODY_AND_HEADERS)for(const[I,M]of Object.entries(m||{}))g(`[${o}] ${I}: ${M}`);h>=Ct.BODY&&y&&g(`[${o}] ${y}`)}try{const I=xi(a(x,{method:i.method,headers:m,body:y})),M=setTimeout(()=>{I.cancel()},i.requestTimeout||3e4),q=yield I;clearTimeout(M);const te=q.headers.get("Content-Type"),X=te&&!te.includes("application/json");if(q.status===429||X){if(!_||X&&i.method!=="GET")throw new Yn(mf(i.method,x,m,i.body,q,void 0,c));const $=q.headers.has("X-RateLimit-Reset")?Number.parseInt(q.headers.get("X-RateLimit-Reset"),10):f;return h>=Ct.BASIC&&(q.status===429?g(`[${o}] Rate limit exceeded, wait ${$} seconds then retry...`):g(`[${o}] Invalid response content type "${te}" (status ${q.status}). Wait ${$} seconds then retry...`)),yield os($*1e3),ss(Object.assign(Object.assign({},i),{retryCount:f+1}))}if(h>=Ct.BASIC&&(g(`[${o}] Status: ${q.status} (${q.statusText})`),h>=Ct.BODY_AND_HEADERS))for(const $ of["x-api-version","x-environment","x-queue-time","x-ratelimit-remaining","x-request-id","cf-ray"]){const ae=q.headers.get($);ae&&g(`[${o}] ${$}: ${ae}`)}let V=q.status===204?void 0:yield q.json();if(h>=Ct.BODY&&V&&g(`[${o}] ${JSON.stringify(V,null,2)}`),q.status===202){const $=yield i.fetchJobResult(V.data.id);if($.status<200||$.status>=300)throw new Yn(kv(i.method,x,m,i.body,$.status,$.payload,c));V=$.payload}if(q.status>=200&&q.status<300)return V;const fe=new Yn(mf(i.method,x,m,i.body,q,V,c)),ne=(n=fe.errors.find($=>$.attributes.transient))===null||n===void 0?void 0:n.attributes.code;if(_&&ne)return h>=Ct.BASIC&&g(`[${o}] ${ne}, wait ${f} seconds then retry...`),yield os(f*1e3),ss(Object.assign(Object.assign({},i),{retryCount:f+1}));throw fe}catch(I){if(I instanceof Pi||bv(I)&&I.code.includes("ETIMEDOUT")){if(_&&f<wv)return h>=Ct.BASIC&&g(`[${o}] Timeout error, wait ${f} seconds then retry...`),yield os(f*1e3),ss(Object.assign(Object.assign({},i),{retryCount:f+1}));throw new av(Sv(i.method,x,m,i.body,c))}throw I}})}var Jf=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o};function ls(i){return typeof i=="object"&&!!i&&"id"in i&&"type"in i}function _a(i){return Array.isArray(i)&&i.every(ls)}function G(i,n){if(typeof i!="object"||!i)throw new Error("Invalid body!");if(Array.isArray(i))return{data:i.map(g=>{var m;return(m=G(g,n))===null||m===void 0?void 0:m.data})};const o=i,{id:a,type:c,meta:d}=o,f=Jf(o,["id","type","meta"]),h={},_={};if(n.attributes==="*")for(const[g,m]of Object.entries(f))if(n.relationships.includes(g))if(ls(m)){const{id:v,type:y}=m;_[g]={data:{id:v,type:y}}}else _a(m)?_[g]={data:m.map(({id:v,type:y})=>({id:v,type:y}))}:_[g]={data:null};else h[g]=m;else if(n.relationships==="*")for(const[g,m]of Object.entries(f))if(n.attributes.includes(g))h[g]=m;else if(ls(m)){const{id:v,type:y}=m;_[g]={data:{id:v,type:y}}}else _a(m)?_[g]={data:m.map(({id:v,type:y})=>({id:v,type:y}))}:_[g]={data:null};else{for(const[g,m]of Object.entries(f))if(n.attributes.includes(g))h[g]=m;else if(n.relationships.includes(g))if(ls(m)){const{id:v,type:y}=m;_[g]={data:{id:v,type:y}}}else _a(m)?_[g]={data:m.map(({id:v,type:y})=>({id:v,type:y}))}:_[g]={data:null};n.attributes.includes("type")&&(h.type=c)}return{data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a||n.id?{id:a||n.id}:{}),{type:n.type}),Object.keys(h).length>0?{attributes:h}:{}),Object.keys(_).length>0?{relationships:_}:{}),d?{meta:d}:{})}}function Da(i){if(Array.isArray(i))return i.map(Da);if(i&&typeof i=="object"){const n={};for(const[o,a]of Object.entries(i))o!=="__itemTypeId"&&(n[o]=Da(a));return n}return i}function gf(i){if(!i||typeof i!="object")return i;const{__itemTypeId:n}=i,o=Jf(i,["__itemTypeId"]),a={};for(const[c,d]of Object.entries(o))a[c]=Da(d);return a}function rs(i){return!i||!("data"in i)?i:Array.isArray(i.data)?Object.assign(Object.assign({},i),{data:i.data.map(gf)}):Object.assign(Object.assign({},i),{data:gf(i.data)})}function R(i){return typeof i=="string"?i:i.id}class he{constructor(n){this.client=n}}class Zf extends he{create(n){return this.rawCreate(G(n,{type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/roles",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/roles/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/roles"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/roles/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/roles/${n}`})}duplicate(n){return this.rawDuplicate(R(n)).then(o=>k(o))}rawDuplicate(n){return this.client.request({method:"POST",url:`/roles/${n}/duplicate`})}}Zf.TYPE="role";var Pv=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})};function vf(i,n){return i==null&&n==null?!0:i===n}function xv(i,n){for(const o in i)if(!vf(i[o],n[o]))return!1;for(const o in n)if(!vf(i[o],n[o]))return!1;return!0}function is(i,n,o,a){if(!n)return i;const{add:c,remove:d}=n;return[...d?d.reduce((f,h)=>{const _=Object.assign(Object.assign({},h),{environment:o}),g=f.find(m=>xv(m,_));if(!g)throw new Error(`Cannot find rule ${JSON.stringify(_)} to remove in ${a}!`);return f.filter(m=>m!==g)},i):i,...c?c.map(f=>Object.assign({environment:o},f)):[]]}class Ov extends Zf{updateCurrentEnvironmentPermissions(n,o){return Pv(this,void 0,void 0,function*(){const a=this.client.config.environment||(yield this.client.environments.list()).find(_=>_.meta.primary).id,c=yield this.find(n),d=!!(o.positive_item_type_permissions||o.negative_item_type_permissions),f=!!(o.positive_upload_permissions||o.negative_upload_permissions),h=Object.assign(Object.assign({},d?{positive_item_type_permissions:is(c.positive_item_type_permissions,o.positive_item_type_permissions,a,"positive_item_type_permissions"),negative_item_type_permissions:is(c.negative_item_type_permissions,o.negative_item_type_permissions,a,"negative_item_type_permissions")}:{}),f?{positive_upload_permissions:is(c.positive_upload_permissions,o.positive_upload_permissions,a,"positive_upload_permissions"),negative_upload_permissions:is(c.negative_upload_permissions,o.negative_upload_permissions,a,"negative_upload_permissions")}:{});return this.update(n,h)})}}class ep extends he{update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"user",attributes:["is_active"],relationships:["role"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/users/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/users"})}find(n,o){return this.rawFind(R(n),o).then(a=>k(a))}rawFind(n,o){return this.client.request({method:"GET",url:`/users/${n}`,queryParams:o})}findMe(n){return this.rawFindMe(n).then(o=>k(o))}rawFindMe(n){return this.client.request({method:"GET",url:"/users/me",queryParams:n})}destroy(n,o){return this.rawDestroy(R(n),o).then(a=>k(a))}rawDestroy(n,o){return this.client.request({method:"DELETE",url:`/users/${n}`,queryParams:o})}}ep.TYPE="user";class tp extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/sso-users"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/sso-users/${n}`})}copyUsers(){return this.rawCopyUsers().then(n=>k(n))}rawCopyUsers(){return this.client.request({method:"POST",url:"/sso-users/copy-users"})}destroy(n,o){return this.rawDestroy(R(n),o).then(a=>k(a))}rawDestroy(n,o){return this.client.request({method:"DELETE",url:`/sso-users/${n}`,queryParams:o})}}tp.TYPE="sso_user";class np extends he{query(n){return this.rawQuery(G(n,{type:"audit_log_query",attributes:["filter","next_token","detailed_log"],relationships:[]})).then(o=>k(o))}rawQuery(n){return this.client.request({method:"POST",url:"/audit-log-events/query",body:n})}}np.TYPE="audit_log_event";class rp extends he{create(n){return this.rawCreate(G(n,{type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/menu-items",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/menu-items/${n}`,body:o})}list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/menu-items",queryParams:n})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/menu-items/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/menu-items/${n}`})}reorder(n){return this.rawReorder(G(n,{type:"menu_item",attributes:["position"],relationships:["parent"]})).then(o=>k(o))}rawReorder(n){return this.client.request({method:"POST",url:"/menu-items/reorder",body:n})}}rp.TYPE="menu_item";class ip extends he{create(n){return this.rawCreate(G(n,{type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/schema-menu-items",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent","children"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/schema-menu-items/${n}`,body:o})}list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/schema-menu-items",queryParams:n})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/schema-menu-items/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/schema-menu-items/${n}`})}reorder(n){return this.rawReorder(G(n,{type:"schema_menu_item",attributes:["position"],relationships:["parent"]})).then(o=>k(o))}rawReorder(n){return this.client.request({method:"POST",url:"/schema-menu-items/reorder",body:n})}}ip.TYPE="schema_menu_item";class op extends he{create(n){return this.rawCreate(G(n,{type:"upload_collection",attributes:["label","position"],relationships:["parent"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/upload-collections",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"upload_collection",attributes:["label","position"],relationships:["parent","children"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/upload-collections/${n}`,body:o})}list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/upload-collections",queryParams:n})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/upload-collections/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/upload-collections/${n}`})}reorder(n){return this.rawReorder(G(n,{type:"upload_collection",attributes:["position"],relationships:["parent"]})).then(o=>k(o))}rawReorder(n){return this.client.request({method:"POST",url:"/upload-collections/reorder",body:n})}}op.TYPE="upload_collection";class sp extends he{create(n,o){return this.rawCreate(G(n,{type:"item_type",attributes:["name","api_key","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","collection_appeareance","collection_appearance","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]}),o).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:"/item-types",body:n,queryParams:o})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"item_type",attributes:["name","api_key","collection_appeareance","collection_appearance","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","has_singleton_item","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/item-types/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/item-types"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/item-types/${n}`})}duplicate(n){return this.rawDuplicate(R(n)).then(o=>k(o))}rawDuplicate(n){return this.client.request({method:"POST",url:`/item-types/${n}/duplicate`})}destroy(n,o){return this.rawDestroy(R(n),o).then(a=>k(a))}rawDestroy(n,o){return this.client.request({method:"DELETE",url:`/item-types/${n}`,queryParams:o})}referencing(n){return this.rawReferencing(R(n)).then(o=>k(o))}rawReferencing(n){return this.client.request({method:"GET",url:`/item-types/${n}/referencing`})}rawReorderFieldsAndFieldsets(n,o){return this.client.request({method:"POST",url:`/item-types/${n}/reorder-fields-and-fieldsets`,body:o})}}sp.TYPE="item_type";class lp extends he{create(n,o){return this.rawCreate(R(n),G(o,{type:"field",attributes:["label","field_type","api_key","localized","validators","appeareance","appearance","position","hint","default_value","deep_filtering_enabled"],relationships:["fieldset"]})).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:`/item-types/${n}/fields`,body:o})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"field",attributes:["default_value","label","api_key","localized","validators","appeareance","appearance","position","field_type","hint","deep_filtering_enabled"],relationships:["fieldset"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/fields/${n}`,body:o})}list(n){return this.rawList(R(n)).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:`/item-types/${n}/fields`})}referencing(n){return this.rawReferencing(R(n)).then(o=>k(o))}rawReferencing(n){return this.client.request({method:"GET",url:`/item-types/${n}/fields/referencing`})}related(n){return this.rawRelated(R(n)).then(o=>k(o))}rawRelated(n){return this.client.request({method:"GET",url:`/item-types/${n}/fields/related`})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/fields/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/fields/${n}`})}duplicate(n){return this.rawDuplicate(R(n)).then(o=>k(o))}rawDuplicate(n){return this.client.request({method:"POST",url:`/fields/${n}/duplicate`})}}lp.TYPE="field";class ap extends he{create(n,o){return this.rawCreate(R(n),G(o,{type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:`/item-types/${n}/fieldsets`,body:o})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/fieldsets/${n}`,body:o})}list(n){return this.rawList(R(n)).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:`/item-types/${n}/fieldsets`})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/fieldsets/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/fieldsets/${n}`})}}ap.TYPE="fieldset";class up extends he{create(n){return this.rawCreate(G(n,{type:"email_credentials",attributes:["email","password","otp_code"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/sessions",body:n})}}up.TYPE="session";class cp extends he{create(n){return this.rawCreate(G(n,{type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/access_tokens",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/access_tokens/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/access_tokens"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/access_tokens/${n}`})}regenerateToken(n){return this.rawRegenerateToken(R(n)).then(o=>k(o))}rawRegenerateToken(n){return this.client.request({method:"POST",url:`/access_tokens/${n}/regenerate_token`})}destroy(n,o){return this.rawDestroy(R(n),o).then(a=>k(a))}rawDestroy(n,o){return this.client.request({method:"DELETE",url:`/access_tokens/${n}`,queryParams:o})}}cp.TYPE="access_token";class dp extends he{create(n){return this.rawCreate(G(n,{type:"plugin",attributes:["package_name","name","description","url","permissions","plugin_type","field_types","parameter_definitions","package_version"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/plugins",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"plugin",attributes:["name","description","url","parameters","package_version","permissions"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/plugins/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/plugins"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/plugins/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/plugins/${n}`})}fields(n){return this.rawFields(R(n)).then(o=>k(o))}rawFields(n){return this.client.request({method:"GET",url:`/plugins/${n}/fields`})}}dp.TYPE="plugin";class fp extends he{find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/job-results/${n}`})}}fp.TYPE="job_result";class pp extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/subscription-limits"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/subscription-limits/${n}`})}}pp.TYPE="subscription_limit";class hp extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/subscription-features"})}}hp.TYPE="subscription_feature";var Rv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},br=function(i){return this instanceof br?(this.v=i,this):new br(i)},Iv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof br?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class mp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/build-events",queryParams:n})}listPagedIterator(n,o){return Iv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Rv(this.rawListPagedIterator(n,o)),m;m=yield br(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield br(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield br(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:30,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/build-events/${n}`})}}mp.TYPE="build_event";var Lv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Tr=function(i){return this instanceof Tr?(this.v=i,this):new Tr(i)},Dv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Tr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class yp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/search-index-events",queryParams:n})}listPagedIterator(n,o){return Dv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Lv(this.rawListPagedIterator(n,o)),m;m=yield Tr(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Tr(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Tr(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:30,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/search-index-events/${n}`})}}yp.TYPE="search_index_event";var Nv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Cr=function(i){return this instanceof Cr?(this.v=i,this):new Cr(i)},Fv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Cr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class gp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/items",queryParams:n}).then(Pt)}listPagedIterator(n,o){return Fv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Nv(this.rawListPagedIterator(n,o)),m;m=yield Cr(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Cr(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Cr(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:30,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o,!0)}validateExisting(n,o){return this.rawValidateExisting(R(n),G(o,{id:R(n),type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateExisting(n,o){return this.client.request({method:"POST",url:`/items/${n}/validate`,body:rs(o)})}validateNew(n){return this.rawValidateNew(G(n,{type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateNew(n){return this.client.request({method:"POST",url:"/items/validate",body:rs(n)})}create(n){return this.rawCreate(G(n,{type:"item",attributes:"*",relationships:["item_type","creator"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/items",body:rs(n)}).then(Pt)}duplicate(n){return this.rawDuplicate(R(n)).then(o=>k(o))}rawDuplicate(n){return this.client.request({method:"POST",url:`/items/${n}/duplicate`}).then(Pt)}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"item",attributes:"*",relationships:["item_type","creator"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/items/${n}`,body:rs(o)}).then(Pt)}references(n,o){return this.rawReferences(R(n),o).then(a=>k(a))}rawReferences(n,o){return this.client.request({method:"GET",url:`/items/${n}/references`,queryParams:o}).then(Pt)}find(n,o){return this.rawFind(R(n),o).then(a=>k(a))}rawFind(n,o){return this.client.request({method:"GET",url:`/items/${n}`,queryParams:o}).then(Pt)}currentVsPublishedState(n){return this.rawCurrentVsPublishedState(R(n)).then(o=>k(o))}rawCurrentVsPublishedState(n){return this.client.request({method:"GET",url:`/items/${n}/current-vs-published-state`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/items/${n}`}).then(Pt)}publish(n,o,a){return this.rawPublish(R(n),o?G(o,{type:"selective_publish_operation",attributes:["content_in_locales","non_localized_content"],relationships:[]}):null,a).then(c=>k(c))}rawPublish(n,o,a){return this.client.request({method:"PUT",url:`/items/${n}/publish`,body:o,queryParams:a}).then(Pt)}unpublish(n,o,a){return this.rawUnpublish(R(n),o?G(o,{type:"selective_unpublish_operation",attributes:["content_in_locales"],relationships:[]}):null,a).then(c=>k(c))}rawUnpublish(n,o,a){return this.client.request({method:"PUT",url:`/items/${n}/unpublish`,body:o,queryParams:a}).then(Pt)}bulkPublish(n){return this.rawBulkPublish(G(n,{type:"item_bulk_publish_operation",attributes:[],relationships:["items"]})).then(o=>k(o))}rawBulkPublish(n){return this.client.request({method:"POST",url:"/items/bulk/publish",body:n})}bulkUnpublish(n){return this.rawBulkUnpublish(G(n,{type:"item_bulk_unpublish_operation",attributes:[],relationships:["items"]})).then(o=>k(o))}rawBulkUnpublish(n){return this.client.request({method:"POST",url:"/items/bulk/unpublish",body:n})}bulkDestroy(n){return this.rawBulkDestroy(G(n,{type:"item_bulk_destroy_operation",attributes:[],relationships:["items"]})).then(o=>k(o))}rawBulkDestroy(n){return this.client.request({method:"POST",url:"/items/bulk/destroy",body:n})}bulkMoveToStage(n){return this.rawBulkMoveToStage(G(n,{type:"item_bulk_move_to_stage_operation",attributes:["stage"],relationships:["items"]})).then(o=>k(o))}rawBulkMoveToStage(n){return this.client.request({method:"POST",url:"/items/bulk/move-to-stage",body:n})}}gp.TYPE="item";var Av=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Pr=function(i){return this instanceof Pr?(this.v=i,this):new Pr(i)},jv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Pr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class vp extends he{restore(n){return this.rawRestore(R(n)).then(o=>k(o))}rawRestore(n){return this.client.request({method:"POST",url:`/versions/${n}/restore`})}list(n,o){return this.rawList(R(n),o).then(a=>k(a))}rawList(n,o){return this.client.request({method:"GET",url:`/items/${n}/versions`,queryParams:o})}listPagedIterator(n,o,a){return jv(this,arguments,function*(){var d,f,h,_;try{for(var g=!0,m=Av(this.rawListPagedIterator(R(n),o,a)),v;v=yield Pr(m.next()),d=v.done,!d;){_=v.value,g=!1;try{yield yield Pr(zt(_))}finally{g=!0}}}catch(y){f={error:y}}finally{try{!g&&!d&&(h=m.return)&&(yield Pr(h.call(m)))}finally{if(f)throw f.error}}})}rawListPagedIterator(n,o,a){return on(o),rn({defaultLimit:15,maxLimit:50},c=>this.rawList(n,Object.assign(Object.assign({},o),{page:c})),a)}find(n,o){return this.rawFind(R(n),o).then(a=>k(a))}rawFind(n,o){return this.client.request({method:"GET",url:`/versions/${n}`,queryParams:o})}}vp.TYPE="item_version";var Mv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},xr=function(i){return this instanceof xr?(this.v=i,this):new xr(i)},Uv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof xr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};let Ba=class extends he{create(n){return this.rawCreate(G(n,{type:"upload",attributes:["path","copyright","author","notes","default_field_metadata","tags"],relationships:["upload_collection"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/uploads",body:n})}list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/uploads",queryParams:n})}listPagedIterator(n,o){return Uv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Mv(this.rawListPagedIterator(n,o)),m;m=yield xr(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield xr(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield xr(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:30,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/uploads/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/uploads/${n}`})}update(n,o,a){return this.rawUpdate(R(n),G(o,{id:R(n),type:"upload",attributes:["path","basename","copyright","author","notes","tags","default_field_metadata"],relationships:["creator","upload_collection"]}),a).then(c=>k(c))}rawUpdate(n,o,a){return this.client.request({method:"PUT",url:`/uploads/${n}`,body:o,queryParams:a})}references(n,o){return this.rawReferences(R(n),o).then(a=>k(a))}rawReferences(n,o){return this.client.request({method:"GET",url:`/uploads/${n}/references`,queryParams:o}).then(Pt)}bulkTag(n){return this.rawBulkTag(G(n,{type:"upload_bulk_tag_operation",attributes:["tags"],relationships:["uploads"]})).then(o=>k(o))}rawBulkTag(n){return this.client.request({method:"POST",url:"/uploads/bulk/tag",body:n})}bulkSetUploadCollection(n){return this.rawBulkSetUploadCollection(G(n,{type:"upload_bulk_set_upload_collection_operation",attributes:[],relationships:["upload_collection","uploads"]})).then(o=>k(o))}rawBulkSetUploadCollection(n){return this.client.request({method:"POST",url:"/uploads/bulk/set-upload-collection",body:n})}bulkDestroy(n){return this.rawBulkDestroy(G(n,{type:"upload_bulk_destroy_operation",attributes:[],relationships:["uploads"]})).then(o=>k(o))}rawBulkDestroy(n){return this.client.request({method:"POST",url:"/uploads/bulk/destroy",body:n})}};Ba.TYPE="upload";class _p extends he{create(n){return this.rawCreate(G(n,{type:"upload_request",attributes:["filename"],relationships:["upload_collection"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/upload-requests",body:n})}}_p.TYPE="upload_request";class wp extends he{create(n,o){return this.rawCreate(R(n),G(o,{type:"upload_track",attributes:["url_or_upload_request_id","type","name","language_code","closed_captions"],relationships:[]})).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:`/uploads/${n}/tracks`,body:o})}list(n){return this.rawList(R(n)).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:`/uploads/${n}/tracks`})}destroy(n,o){return this.rawDestroy(R(n),R(o)).then(a=>k(a))}rawDestroy(n,o){return this.client.request({method:"DELETE",url:`/uploads/${n}/tracks/${o}`})}generateSubtitles(n,o){return this.rawGenerateSubtitles(R(n),G(o,{type:"upload_track",attributes:["name","language_code"],relationships:[]})).then(a=>k(a))}rawGenerateSubtitles(n,o){return this.client.request({method:"POST",url:`/uploads/${n}/tracks/generate-subtitles`,body:o})}}wp.TYPE="upload_track";class Ep extends he{create(n,o){return this.rawCreate(R(n),G(o,{type:"scheduled_publication",attributes:["publication_scheduled_at","selective_publication"],relationships:[]})).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:`/items/${n}/scheduled-publication`,body:o})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/items/${n}/scheduled-publication`}).then(Pt)}}Ep.TYPE="scheduled_publication";class Sp extends he{create(n,o){return this.rawCreate(R(n),G(o,{type:"scheduled_unpublishing",attributes:["unpublishing_scheduled_at","content_in_locales"],relationships:[]})).then(a=>k(a))}rawCreate(n,o){return this.client.request({method:"POST",url:`/items/${n}/scheduled-unpublishing`,body:o})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/items/${n}/scheduled-unpublishing`}).then(Pt)}}Sp.TYPE="scheduled_unpublishing";var zv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Or=function(i){return this instanceof Or?(this.v=i,this):new Or(i)},$v=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Or?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class kp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/search-results",queryParams:n})}listPagedIterator(n,o){return $v(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=zv(this.rawListPagedIterator(n,o)),m;m=yield Or(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Or(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Or(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:20,maxLimit:100},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}}kp.TYPE="search_result";class bp extends he{fork(n,o,a){return this.rawFork(R(n),G(o,{id:R(n),type:"environment",attributes:[],relationships:[]}),a).then(c=>k(c))}rawFork(n,o,a){return this.client.request({method:"POST",url:`/environments/${n}/fork`,body:o,queryParams:a})}promote(n){return this.rawPromote(R(n)).then(o=>k(o))}rawPromote(n){return this.client.request({method:"PUT",url:`/environments/${n}/promote`})}rename(n,o){return this.rawRename(R(n),G(o,{id:R(n),type:"environment",attributes:[],relationships:[]})).then(a=>k(a))}rawRename(n,o){return this.client.request({method:"PUT",url:`/environments/${n}/rename`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/environments"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/environments/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/environments/${n}`})}}bp.TYPE="environment";class Tp extends he{find(){return this.rawFind().then(n=>k(n))}rawFind(){return this.client.request({method:"GET",url:"/maintenance-mode"})}activate(n){return this.rawActivate(n).then(o=>k(o))}rawActivate(n){return this.client.request({method:"PUT",url:"/maintenance-mode/activate",queryParams:n})}deactivate(){return this.rawDeactivate().then(n=>k(n))}rawDeactivate(){return this.client.request({method:"PUT",url:"/maintenance-mode/deactivate"})}}Tp.TYPE="maintenance_mode";class Cp extends he{create(n){return this.rawCreate(G(n,{type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/webhooks",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/webhooks/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/webhooks"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/webhooks/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/webhooks/${n}`})}}Cp.TYPE="webhook";var qv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Rr=function(i){return this instanceof Rr?(this.v=i,this):new Rr(i)},Bv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Rr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class Pp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/webhook_calls",queryParams:n})}listPagedIterator(n,o){return Bv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=qv(this.rawListPagedIterator(n,o)),m;m=yield Rr(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Rr(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Rr(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:30,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/webhook_calls/${n}`})}resendWebhook(n){return this.rawResendWebhook(R(n))}rawResendWebhook(n){return this.client.request({method:"POST",url:`/webhook_calls/${n}/resend_webhook`})}}Pp.TYPE="webhook_call";class xp extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/build-triggers"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/build-triggers/${n}`})}create(n){return this.rawCreate(G(n,{type:"build_trigger",attributes:["name","webhook_token","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/build-triggers",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"build_trigger",attributes:["name","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/build-triggers/${n}`,body:o})}trigger(n){return this.rawTrigger(R(n))}rawTrigger(n){return this.client.request({method:"POST",url:`/build-triggers/${n}/trigger`})}abort(n){return this.rawAbort(R(n))}rawAbort(n){return this.client.request({method:"DELETE",url:`/build-triggers/${n}/abort`})}abortIndexing(n){return this.rawAbortIndexing(R(n))}rawAbortIndexing(n){return this.client.request({method:"DELETE",url:`/build-triggers/${n}/abort_indexing`})}reindex(n){return this.rawReindex(R(n))}rawReindex(n){return this.client.request({method:"PUT",url:`/build-triggers/${n}/reindex`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/build-triggers/${n}`})}}xp.TYPE="build_trigger";class Op extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/search-indexes"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/search-indexes/${n}`})}create(n){return this.rawCreate(G(n,{type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/search-indexes",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/search-indexes/${n}`,body:o})}trigger(n){return this.rawTrigger(R(n))}rawTrigger(n){return this.client.request({method:"POST",url:`/search-indexes/${n}/trigger`})}abort(n){return this.rawAbort(R(n))}rawAbort(n){return this.client.request({method:"DELETE",url:`/search-indexes/${n}/abort`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/search-indexes/${n}`})}}Op.TYPE="search_index";class Rp extends he{create(n){return this.rawCreate(G(n,{type:"item_type_filter",attributes:["name","filter","columns","order_by","shared"],relationships:["item_type"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/item-type-filters",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"item_type_filter",attributes:["name","columns","order_by","shared","filter"],relationships:["item_type"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/item-type-filters/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/item-type-filters"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/item-type-filters/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/item-type-filters/${n}`})}}Rp.TYPE="item_type_filter";class Ip extends he{create(n){return this.rawCreate(G(n,{type:"upload_filter",attributes:["name","filter","shared"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/upload-filters",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"upload_filter",attributes:["name","shared","filter"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/upload-filters/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/upload-filters"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/upload-filters/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/upload-filters/${n}`})}}Ip.TYPE="upload_filter";class Lp extends he{create(n){return this.rawCreate(G(n,{type:"site_invitation",attributes:["email"],relationships:["role"]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/site-invitations",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"site_invitation",attributes:[],relationships:["role"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/site-invitations/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/site-invitations"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/site-invitations/${n}`})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/site-invitations/${n}`})}resend(n){return this.rawResend(R(n)).then(o=>k(o))}rawResend(n){return this.client.request({method:"POST",url:`/site-invitations/${n}/resend`})}}Lp.TYPE="site_invitation";class Dp extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/editing-sessions"})}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/editing-sessions/${n}`,body:o})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/editing-sessions/${n}`})}}Dp.TYPE="editing_session";class Np extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/sso-groups"})}copyRoles(n){return this.rawCopyRoles(R(n)).then(o=>k(o))}rawCopyRoles(n){return this.client.request({method:"POST",url:`/sso-groups/${n}/copy-roles`})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"sso_group",attributes:["priority"],relationships:["role"]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/sso-groups/${n}`,body:o})}destroy(n){return this.rawDestroy(R(n)).then(o=>k(o))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/sso-groups/${n}`})}}Np.TYPE="sso_group";class Fp extends he{find(){return this.rawFind().then(n=>k(n))}rawFind(){return this.client.request({method:"GET",url:"/sso-settings"})}generateToken(){return this.rawGenerateToken().then(n=>k(n))}rawGenerateToken(){return this.client.request({method:"PUT",url:"/sso-settings/generate-token"})}update(n){return this.rawUpdate(G(n,{type:"sso_settings",attributes:["idp_saml_metadata_url","idp_saml_metadata_xml"],relationships:["default_role"]})).then(o=>k(o))}rawUpdate(n){return this.client.request({method:"PUT",url:"/sso-settings",body:n})}}Fp.TYPE="sso_settings";class Ap extends he{find(n){return this.rawFind(n).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:"/emoji-suggestions",queryParams:n})}}Ap.TYPE="emoji_suggestions";class jp extends he{find(){return this.rawFind().then(n=>k(n))}rawFind(){return this.client.request({method:"GET",url:"/white-label-settings"})}update(n){return this.rawUpdate(G(n,{type:"white_label_settings",attributes:["custom_i18n_messages_template_url"],relationships:[]})).then(o=>k(o))}rawUpdate(n){return this.client.request({method:"PUT",url:"/white-label-settings",body:n})}}jp.TYPE="white_label_settings";class Mp extends he{find(){return this.rawFind().then(n=>k(n))}rawFind(){return this.client.request({method:"GET",url:"/public-info"})}}Mp.TYPE="public_info";class Up extends he{list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/daily-site-usages"})}}Up.TYPE="daily_usage";class zp extends he{find(n,o){return this.rawFind(R(n),o).then(a=>k(a))}rawFind(n,o){return this.client.request({method:"GET",url:`/usage-log-counters/${n}`,queryParams:o})}}zp.TYPE="usage_counter";var Hv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Ir=function(i){return this instanceof Ir?(this.v=i,this):new Ir(i)},Vv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Ir?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class $p extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/upload-tags",queryParams:n})}listPagedIterator(n,o){return Vv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Hv(this.rawListPagedIterator(n,o)),m;m=yield Ir(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Ir(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Ir(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:50,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}create(n){return this.rawCreate(G(n,{type:"upload_tag",attributes:["name"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/upload-tags",body:n})}}$p.TYPE="upload_tag";var Gv=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i[Symbol.asyncIterator],o;return n?n.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(d){o[d]=i[d]&&function(f){return new Promise(function(h,_){f=i[d](f),c(h,_,f.done,f.value)})}}function c(d,f,h,_){Promise.resolve(_).then(function(g){d({value:g,done:h})},f)}},Lr=function(i){return this instanceof Lr?(this.v=i,this):new Lr(i)},Wv=function(i,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,n||[]),c,d=[];return c={},f("next"),f("throw"),f("return"),c[Symbol.asyncIterator]=function(){return this},c;function f(y){a[y]&&(c[y]=function(T){return new Promise(function(x,I){d.push([y,T,x,I])>1||h(y,T)})})}function h(y,T){try{_(a[y](T))}catch(x){v(d[0][3],x)}}function _(y){y.value instanceof Lr?Promise.resolve(y.value.v).then(g,m):v(d[0][2],y)}function g(y){h("next",y)}function m(y){h("throw",y)}function v(y,T){y(T),d.shift(),d.length&&h(d[0][0],d[0][1])}};class qp extends he{list(n){return this.rawList(n).then(o=>k(o))}rawList(n){return this.client.request({method:"GET",url:"/upload-smart-tags",queryParams:n})}listPagedIterator(n,o){return Wv(this,arguments,function*(){var c,d,f,h;try{for(var _=!0,g=Gv(this.rawListPagedIterator(n,o)),m;m=yield Lr(g.next()),c=m.done,!c;){h=m.value,_=!1;try{yield yield Lr(zt(h))}finally{_=!0}}}catch(v){d={error:v}}finally{try{!_&&!c&&(f=g.return)&&(yield Lr(f.call(g)))}finally{if(d)throw d.error}}})}rawListPagedIterator(n,o){return on(n),rn({defaultLimit:50,maxLimit:500},a=>this.rawList(Object.assign(Object.assign({},n),{page:a})),o)}}qp.TYPE="upload_smart_tag";class Bp extends he{find(n){return this.rawFind(n).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:"/site",queryParams:n})}update(n){return this.rawUpdate(G(n,{type:"site",attributes:["no_index","favicon","global_seo","name","theme","locales","timezone","require_2fa","ip_tracking_enabled","force_use_of_sandbox_environments"],relationships:["sso_default_role"]})).then(o=>k(o))}rawUpdate(n){return this.client.request({method:"PUT",url:"/site",body:n})}activateImprovedTimezoneManagement(){return this.rawActivateImprovedTimezoneManagement().then(n=>k(n))}rawActivateImprovedTimezoneManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-timezone-management"})}activateImprovedHexManagement(){return this.rawActivateImprovedHexManagement().then(n=>k(n))}rawActivateImprovedHexManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-hex-management"})}activateImprovedGqlMultilocaleFields(){return this.rawActivateImprovedGqlMultilocaleFields().then(n=>k(n))}rawActivateImprovedGqlMultilocaleFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-multilocale-fields"})}activateImprovedGqlVisibilityControl(){return this.rawActivateImprovedGqlVisibilityControl().then(n=>k(n))}rawActivateImprovedGqlVisibilityControl(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-visibility-control"})}activateImprovedBooleanFields(){return this.rawActivateImprovedBooleanFields().then(n=>k(n))}rawActivateImprovedBooleanFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-boolean-fields"})}activateDraftModeAsDefault(){return this.rawActivateDraftModeAsDefault().then(n=>k(n))}rawActivateDraftModeAsDefault(){return this.client.request({method:"PUT",url:"/site/activate-draft-mode-as-default"})}activateImprovedValidationAtPublishing(){return this.rawActivateImprovedValidationAtPublishing().then(n=>k(n))}rawActivateImprovedValidationAtPublishing(){return this.client.request({method:"PUT",url:"/site/activate-improved-validation-at-publishing"})}activateImprovedExposureOfInlineBlocksInCda(){return this.rawActivateImprovedExposureOfInlineBlocksInCda().then(n=>k(n))}rawActivateImprovedExposureOfInlineBlocksInCda(){return this.client.request({method:"PUT",url:"/site/activate-improved-exposure-of-inline-blocks-in-cda"})}activateImprovedItemsListing(){return this.rawActivateImprovedItemsListing().then(n=>k(n))}rawActivateImprovedItemsListing(){return this.client.request({method:"PUT",url:"/site/activate-improved-items-listing"})}activateMillisecondsInDatetime(){return this.rawActivateMillisecondsInDatetime().then(n=>k(n))}rawActivateMillisecondsInDatetime(){return this.client.request({method:"PUT",url:"/site/activate-milliseconds-in-datetime"})}updateAssetsCdnDefaultSettings(n){return this.rawUpdateAssetsCdnDefaultSettings(G(n,{type:"assets-cdn-default-settings",attributes:["assets_cdn_default_settings"],relationships:[]})).then(o=>k(o))}rawUpdateAssetsCdnDefaultSettings(n){return this.client.request({method:"PUT",url:"/site/assets-cdn-default-settings",body:n})}}Bp.TYPE="site";class Hp extends he{create(n){return this.rawCreate(G(n,{type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(o=>k(o))}rawCreate(n){return this.client.request({method:"POST",url:"/workflows",body:n})}update(n,o){return this.rawUpdate(R(n),G(o,{id:R(n),type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(a=>k(a))}rawUpdate(n,o){return this.client.request({method:"PUT",url:`/workflows/${n}`,body:o})}list(){return this.rawList().then(n=>k(n))}rawList(){return this.client.request({method:"GET",url:"/workflows"})}find(n){return this.rawFind(R(n)).then(o=>k(o))}rawFind(n){return this.client.request({method:"GET",url:`/workflows/${n}`})}destroy(n){return this.rawDestroy(R(n))}rawDestroy(n){return this.client.request({method:"DELETE",url:`/workflows/${n}`})}}Hp.TYPE="workflow";var Yv=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})};let Vp=class Gp{constructor(n){this.config=n,this.roles=new Ov(this),this.users=new ep(this),this.ssoUsers=new tp(this),this.auditLogEvents=new np(this),this.menuItems=new rp(this),this.schemaMenuItems=new ip(this),this.uploadCollections=new op(this),this.itemTypes=new sp(this),this.fields=new lp(this),this.fieldsets=new ap(this),this.session=new up(this),this.accessTokens=new cp(this),this.plugins=new dp(this),this.jobResults=new fp(this),this.subscriptionLimits=new pp(this),this.subscriptionFeatures=new hp(this),this.buildEvents=new mp(this),this.searchIndexEvents=new yp(this),this.items=new gp(this),this.itemVersions=new vp(this),this.uploads=new Ba(this),this.uploadRequest=new _p(this),this.uploadTracks=new wp(this),this.scheduledPublication=new Ep(this),this.scheduledUnpublishing=new Sp(this),this.searchResults=new kp(this),this.environments=new bp(this),this.maintenanceMode=new Tp(this),this.webhooks=new Cp(this),this.webhookCalls=new Pp(this),this.buildTriggers=new xp(this),this.searchIndexes=new Op(this),this.itemTypeFilters=new Rp(this),this.uploadFilters=new Ip(this),this.siteInvitations=new Lp(this),this.editingSessions=new Dp(this),this.ssoGroups=new Np(this),this.ssoSettings=new Fp(this),this.emojiSuggestions=new Ap(this),this.whiteLabelSettings=new jp(this),this.publicInfo=new Mp(this),this.dailyUsages=new Up(this),this.usageCounters=new zp(this),this.uploadTags=new $p(this),this.uploadSmartTags=new qp(this),this.site=new Bp(this),this.workflows=new Hp(this)}get baseUrl(){return this.config.baseUrl||Gp.defaultBaseUrl}request(n){return ss(Object.assign(Object.assign(Object.assign({},this.config),n),{logFn:this.config.logFn||console.log,userAgent:"@datocms/cma-client v5.3.0",baseUrl:this.baseUrl,preCallStack:new Error().stack,extraHeaders:Object.assign(Object.assign(Object.assign({},this.config.extraHeaders||{}),this.config.environment?{"X-Environment":this.config.environment}:{}),{"X-API-Version":"3"}),fetchJobResult:o=>this.jobResultsFetcher?this.jobResultsFetcher(o):cv(()=>this.jobResults.find(o))}))}eventsChannelName(){return Yv(this,void 0,void 0,function*(){if(this.cachedEventsChannelName)return this.cachedEventsChannelName;const{data:n}=yield this.site.rawFind();return this.cachedEventsChannelName=this.config.environment?`private-site-${n.id}-environment-${this.config.environment}`:`private-site-${n.id}`,this.cachedEventsChannelName})}};Vp.defaultBaseUrl="https://site-api.datocms.com";function Kv(i,n,{onProgress:o,additionalHeaders:a}={}){const c=new XMLHttpRequest;return xi(new Promise((d,f)=>{if(o&&c.upload&&(c.upload.onprogress=h=>{h.lengthComputable&&o({type:"UPLOADING_FILE",payload:{progress:Math.round(h.loaded/h.total*100)}})}),c.onreadystatechange=()=>{c.readyState===4&&(c.status===200?d():f(new Error(`Status ${c.status}`)))},c.addEventListener("error",f,!1),c.open("PUT",n,!0),a)for(const[h,_]of Object.entries(a))c.setRequestHeader(h,_);c.send(i)}),()=>{c.onreadystatechange=null,c.abort()})}var Qv=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})};function _f(i,n,o={}){const a=o.filename||("name"in n?n.name:void 0);if(!a)throw new Error("Missing filename, please provide it as an option!");let c=!1,d;return xi(()=>Qv(this,void 0,void 0,function*(){o.onProgress&&o?.onProgress({type:"REQUESTING_UPLOAD_URL",payload:{filename:a}});const{id:f,url:h,request_headers:_}=yield i.uploadRequest.create({filename:a});if(c)throw new Pi;return o.onProgress&&o.onProgress({type:"UPLOADING_FILE",payload:{progress:0}}),d=Kv(n,h,Object.assign(Object.assign({},o),{additionalHeaders:_})),yield d,f}),()=>{d?d.cancel():c=!0})}var wf=function(i,n,o,a){function c(d){return d instanceof o?d:new o(function(f){f(d)})}return new(o||(o=Promise))(function(d,f){function h(m){try{g(a.next(m))}catch(v){f(v)}}function _(m){try{g(a.throw(m))}catch(v){f(v)}}function g(m){m.done?d(m.value):c(m.value).then(h,_)}g((a=a.apply(i,n||[])).next())})},Ef=function(i,n){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(i);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(i,a[c])&&(o[a[c]]=i[a[c]]);return o};class Xv extends Ba{createFromFileOrBlob(n){let o=!1,a;return xi(()=>wf(this,void 0,void 0,function*(){if(o)throw new Pi;const{fileOrBlob:c,filename:d,onProgress:f}=n,h=Ef(n,["fileOrBlob","filename","onProgress"]);a=_f(this.client,c,{filename:d,onProgress:f});const _=yield a;return f&&f({type:"CREATING_UPLOAD_OBJECT"}),this.create(Object.assign(Object.assign({},h),{path:_}))}),()=>{a?a.cancel():o=!0})}updateFromFileOrBlob(n,o){let a=!1,c;return xi(()=>wf(this,void 0,void 0,function*(){if(a)throw new Pi;const{fileOrBlob:d,filename:f,onProgress:h}=o,_=Ef(o,["fileOrBlob","filename","onProgress"]);c=_f(this.client,d,{filename:f,onProgress:h});const g=yield c;return h&&h({type:"CREATING_UPLOAD_OBJECT"}),this.update(n,Object.assign(Object.assign({},_),{path:g}))}),()=>{c?c.cancel():a=!0})}}class Jv extends Vp{constructor(n){super(n),this.uploads=new Xv(this)}}function vs(i){return new Jv(i)}const Wp="🗑️ Record Bin",Zv="🗑 Record Bin",e_=[Wp,Zv],t_=[{entity_type:"item",event_types:["delete"]}];class On extends Error{constructor({code:n,message:o,details:a}){super(o),this.name="RecordBinWebhookSyncError",this.code=n,this.details=a}}const Sf=i=>i instanceof On,hs=i=>i instanceof Error&&i.message?i.message:"Unknown error",Yp=({currentUserAccessToken:i,canManageWebhooks:n,environment:o})=>{if(!i)throw new On({code:"MISSING_ACCESS_TOKEN",message:"Missing access token. Grant the plugin permission currentUserAccessToken."});if(!n)throw new On({code:"INSUFFICIENT_PERMISSIONS",message:"Current user does not have permission to manage webhooks in this project."});return vs({apiToken:i,environment:o})},n_=i=>typeof i=="string"&&e_.includes(i),r_=i=>{if(!i||typeof i!="object")return!1;const n=i;return typeof n.id=="string"&&n_(n.name)},Kp=async i=>{let n;try{n=await i.webhooks.list()}catch(o){throw new On({code:"WEBHOOK_LIST_FAILED",message:`Could not list existing webhooks. ${hs(o)}`})}return Array.isArray(n)?n.filter(r_):[]},Qp=i=>{if(!(i.length<=1))throw new On({code:"AMBIGUOUS_RECORD_BIN_WEBHOOK",message:"Found multiple managed Record Bin webhooks. Resolve duplicates before continuing.",details:{webhookIds:i.map(n=>n.id),webhookNames:i.map(n=>n.name)}})},kf=i=>({name:Wp,url:i,custom_payload:null,headers:{},events:t_,http_basic_user:null,http_basic_password:null,enabled:!0,payload_api_version:"3",nested_items_in_payload:!0}),bf=async({lambdaBaseUrl:i,...n})=>{const o=Yp(n),a=await Kp(o);if(Qp(a),a.length===0)try{const d=await o.webhooks.create(kf(i));return{action:"created",webhookId:d&&typeof d.id=="string"?d.id:void 0}}catch(d){throw new On({code:"WEBHOOK_CREATE_FAILED",message:`Could not create the Record Bin webhook. ${hs(d)}`})}const c=a[0];try{return await o.webhooks.update(c.id,kf(i)),{action:"updated",webhookId:c.id}}catch(d){throw new On({code:"WEBHOOK_UPDATE_FAILED",message:`Could not update the Record Bin webhook. ${hs(d)}`,details:{webhookId:c.id}})}},Tf=async i=>{const n=Yp(i),o=await Kp(n);if(Qp(o),o.length===0)return{action:"none"};const a=o[0];try{return await n.webhooks.destroy(a.id),{action:"deleted",webhookId:a.id}}catch(c){throw new On({code:"WEBHOOK_DELETE_FAILED",message:`Could not delete the Record Bin webhook. ${hs(c)}`,details:{webhookId:a.id}})}},i_=i=>i?Object.entries(i).map(([n,o])=>Array.isArray(o)?`${n}: ${o.join(", ")}`:o==null?`${n}: ${String(o)}`:typeof o=="object"?`${n}: ${JSON.stringify(o)}`:`${n}: ${String(o)}`):[],o_=(i,n)=>[n==="connect"?"Could not synchronize the Record Bin webhook while connecting the lambda.":"Could not delete the Record Bin webhook while disconnecting the lambda.",`Failure code: ${i.code}.`,`Failure details: ${i.message}`,...i_(i.details),"Ensure the plugin has currentUserAccessToken permission and that your role can manage webhooks."],wa=8e3,Na="/api/datocms/plugin-health",s_="datocms-plugin-record-bin",l_="DATOCMS_RECORD_BIN_PLUGIN_PING",Ha="2026-02-25",Xp="DATOCMS_RECORD_BIN_LAMBDA_PONG",Jp="record-bin-lambda-function",Zp="ready",Cf=280,a_=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//;class Mt extends Error{constructor({code:n,message:o,phase:a,endpoint:c,httpStatus:d,responseSnippet:f}){super(o),this.name="LambdaHealthCheckError",this.code=n,this.phase=a,this.endpoint=c,this.httpStatus=d,this.responseSnippet=f}}const as=i=>{const n=eh(i);try{const o=new URL(n);return new URL(Na,`${o.origin}/`).toString()}catch{return`${n||"(empty url)"}${Na}`}},eh=i=>{const n=i.trim();return n?a_.test(n)?n:`https://${n}`:""},u_=(i,n)=>{const o=eh(i);if(!o)throw new Mt({code:"INVALID_URL",message:"No URL was provided for the lambda deployment.",phase:n,endpoint:"(missing endpoint)"});let a;try{a=new URL(o)}catch{throw new Mt({code:"INVALID_URL",message:"The deployed URL is not valid. Use a full URL like https://record-bin.example.com, or paste only the hostname and https will be added automatically.",phase:n,endpoint:as(o)})}if(a.protocol!=="https:"&&a.protocol!=="http:")throw new Mt({code:"INVALID_URL",message:"The deployed URL must use http or https. Example: https://record-bin.example.com",phase:n,endpoint:as(o)});const c=a.hostname.toLowerCase(),d=c==="localhost",f=c.includes(".");if(!d&&!f)throw new Mt({code:"INVALID_URL",message:"The deployed URL hostname looks incomplete. Use a full domain like https://record-bin.example.com, or localhost for local testing.",phase:n,endpoint:as(o)});return a.origin},us=i=>{if(!i)return"";const n=i.replace(/\s+/g," ").trim();return n.length<=Cf?n:`${n.slice(0,Cf)}...`},th=i=>{if(!i.trim())throw new Error("empty");return JSON.parse(i)},c_=(i,n)=>{try{const o=th(i),a=o.error?.code,c=o.error?.message||o.message||"";if(a&&c)return`HTTP ${n}: ${a} - ${c}`;if(c)return`HTTP ${n}: ${c}`}catch{}return`HTTP ${n}: lambda health endpoint returned an error status.`},d_=i=>typeof i=="object"&&i!==null&&"name"in i&&i.name==="AbortError",f_=i=>i.ok===!0&&i.mpi?.message===Xp&&i.mpi?.version===Ha&&i.service===Jp&&i.status===Zp,p_=(i,n,o,a)=>{if(!f_(i))throw new Mt({code:"UNEXPECTED_RESPONSE",message:"Health endpoint response did not match the expected MPI PONG contract.",phase:o,endpoint:n,responseSnippet:us(a)})},h_=()=>`Expected HTTP 200 JSON with ok=true, mpi.message=${Xp}, mpi.version=${Ha}, service=${Jp}, status=${Zp}.`,Pf=async({baseUrl:i,environment:n,phase:o,debug:a=!1})=>{const c=xt(a,"verifyLambdaHealth");c.log("Starting health check",{baseUrl:i,environment:n,phase:o});const d=u_(i,o);c.log("Normalized base URL",{normalizedBaseUrl:d});const f=new URL(Na,`${d}/`).toString(),h=new Date().toISOString(),_=JSON.stringify({event_type:"plugin_health_ping",mpi:{message:l_,version:Ha,phase:o},plugin:{name:s_,environment:n}});c.log("Prepared health check request",{endpoint:f,requestBody:JSON.parse(_),checkedAt:h});const g=new AbortController,m=setTimeout(()=>g.abort(),wa);let v;try{v=await fetch(f,{method:"POST",body:_,headers:{Accept:"*/*","Content-Type":"application/json"},signal:g.signal}),c.log("Health check response received",{status:v.status,ok:v.ok})}catch(I){throw d_(I)?(c.warn("Health check request timed out",{timeoutMs:wa}),new Mt({code:"TIMEOUT",message:`Health check timed out after ${wa}ms.`,phase:o,endpoint:f})):(c.error("Health check request failed due to network error",I),new Mt({code:"NETWORK",message:"Could not reach the lambda health endpoint.",phase:o,endpoint:f}))}finally{clearTimeout(m)}const y=await v.text();if(c.log("Health check raw payload",{payload:us(y)}),!v.ok)throw c.warn("Health check returned non-200 status",{status:v.status}),new Mt({code:"HTTP",message:c_(y,v.status),phase:o,endpoint:f,httpStatus:v.status,responseSnippet:us(y)});let T;try{T=th(y),c.log("Health check payload parsed as JSON",T)}catch{throw c.warn("Health check payload is not valid JSON"),new Mt({code:"INVALID_JSON",message:"Health endpoint returned HTTP 200 with an invalid JSON payload.",phase:o,endpoint:f,responseSnippet:us(y)})}p_(T,f,o,y),c.log("Health check response matched expected contract");const x={endpoint:f,checkedAt:h,normalizedBaseUrl:d};return c.log("Health check completed successfully",x),x},xf=(i,n,o)=>{const a=as(n),c=new Date().toISOString();return i instanceof Mt?{status:"disconnected",endpoint:i.endpoint||a,lastCheckedAt:c,lastCheckPhase:o,errorCode:i.code,errorMessage:i.message,httpStatus:i.httpStatus,responseSnippet:i.responseSnippet}:{status:"disconnected",endpoint:a,lastCheckedAt:c,lastCheckPhase:o,errorCode:"NETWORK",errorMessage:"Unexpected error while checking lambda health."}},Of=(i,n,o)=>({status:"connected",endpoint:i,lastCheckedAt:n,lastCheckPhase:o}),Rf=i=>["Could not validate the Record Bin lambda deployment.",`Health check phase: ${i.lastCheckPhase}.`,`Endpoint called: ${i.endpoint}.`,i.errorCode?`Failure code: ${i.errorCode}.`:"",i.errorMessage?`Failure details: ${i.errorMessage}`:"",i.httpStatus?`HTTP status: ${i.httpStatus}.`:"",i.responseSnippet?`Response snippet: ${i.responseSnippet}`:"",h_(),"If this worked before, the deployment may have been deleted or is no longer healthy on your chosen platform.","Confirm /api/datocms/plugin-health exists and returns the expected MPI PONG payload."].filter(Boolean),m_="Could not validate the Record Bin lambda deployment.",If=i=>!i||i.status!=="disconnected"?"":i.errorMessage||m_;function y_({ctx:i}){const n=i.plugin.attributes.parameters.lambdaConnection??void 0,o=gs(i.plugin.attributes.parameters),a=Ci(i.plugin.attributes.parameters),c=jt(i.plugin.attributes.parameters),d=String(i.plugin.attributes.parameters?.automaticBinCleanup?.numberOfDays??"30"),f=a.trim().length>0&&n?.status==="disconnected"&&!!(n.errorCode||n.errorMessage||n.httpStatus||n.responseSnippet),[h,_]=Y.useState(d),[g,m]=Y.useState(c),[v,y]=Y.useState(o),[T,x]=Y.useState({numberOfDays:d,debugEnabled:c,runtimeMode:o}),[I,M]=Y.useState(!1),[q,te]=Y.useState(!1),[X,V]=Y.useState(!1),[fe,ne]=Y.useState(""),[$,ae]=Y.useState(!1),[_e,oe]=Y.useState(a),[re,ye]=Y.useState(a),[ie,ke]=Y.useState(n),[Fe,Pe]=Y.useState(f?If(n):""),[Se,j]=Y.useState(f?Rf(n):[]),[J,z]=Y.useState(!1),[b,L]=Y.useState(!1),U=xt(g,"ConfigScreen"),le=async se=>{await i.updatePluginParameters({...i.plugin.attributes.parameters,...se})},de=()=>{Pe(""),j([]),z(!1)},me=se=>{ke(se),Pe(If(se)),j(Rf(se)),z(!1)},be=(se,Ee)=>{Pe(se.message),j(o_(se,Ee)),z(!1)},we=i.currentRole?.meta?.final_permissions?.can_manage_webhooks===!0;Y.useEffect(()=>{let se=!1;return U.log("Config screen mounted",{initialDebugEnabled:c,hasInitialConnectionState:!!n}),(async()=>{if(ae(!0),o!=="lambda"){U.log("Skipping lambda health check because Lambda-full mode is not selected"),se||ae(!1);return}const ge=Ci(i.plugin.attributes.parameters);if(se||(oe(ge),ye(ge)),U.log("Running lambda health check",{phase:"config_mount",deploymentUrl:ge}),!ge.trim()){U.log("Skipping lambda health check because no deployment URL is configured"),se||(ke(void 0),de(),ae(!1));try{await le({lambdaConnection:null,runtimeMode:v,lambdaFullMode:v==="lambda"}),U.log("Cleared lambda connection state without URL")}catch(Ie){U.warn("Failed to clear lambda connection state without URL",Ie)}return}try{const Ie=await Pf({baseUrl:ge,environment:i.environment,phase:"config_mount",debug:g});U.log("Lambda health check succeeded",Ie);const vt=Of(Ie.endpoint,Ie.checkedAt,"config_mount");se||(ke(vt),de(),oe(Ie.normalizedBaseUrl),ye(Ie.normalizedBaseUrl));try{await le({deploymentURL:Ie.normalizedBaseUrl,vercelURL:Ie.normalizedBaseUrl,lambdaConnection:vt,runtimeMode:v,lambdaFullMode:v==="lambda"}),U.log("Persisted connected lambda state on mount")}catch(Jn){U.warn("Failed to persist connected lambda state on mount",Jn)}}catch(Ie){U.warn("Lambda health check failed on mount",Ie);const vt=xf(Ie,ge,"config_mount");se||me(vt);try{await le({lambdaConnection:vt,runtimeMode:v,lambdaFullMode:v==="lambda"}),U.log("Persisted disconnected lambda state on mount")}catch(Jn){U.warn("Failed to persist disconnected lambda state on mount",Jn)}}finally{se||ae(!1),U.log("Lambda health check on mount finished")}})(),()=>{se=!0,U.log("Config screen unmounted")}},[]);const xe=async()=>{if(v!=="lambda"){await i.alert("Enable 'Also save records deleted from the API' before connecting a lambda deployment.");return}const se=_e.trim();if(!se){Pe("Enter your lambda deployment URL."),j([]),z(!1);return}U.log("Connecting lambda function from config",{candidateUrl:se}),V(!0),de();try{const Ee=await Pf({baseUrl:se,environment:i.environment,phase:"config_connect",debug:g});U.log("Lambda connect health check succeeded",Ee);const ge=await bf({currentUserAccessToken:i.currentUserAccessToken,canManageWebhooks:we,environment:i.environment,lambdaBaseUrl:Ee.normalizedBaseUrl});U.log("Record Bin webhook synchronized on connect",{action:ge.action,webhookId:ge.webhookId});const Ie=Of(Ee.endpoint,Ee.checkedAt,"config_connect");ke(Ie),oe(Ee.normalizedBaseUrl),ye(Ee.normalizedBaseUrl),de(),await le({deploymentURL:Ee.normalizedBaseUrl,vercelURL:Ee.normalizedBaseUrl,lambdaConnection:Ie,runtimeMode:v,lambdaFullMode:v==="lambda"}),U.log("Persisted connected lambda state from config connect"),i.notice("Lambda function connected successfully.")}catch(Ee){if(Ee instanceof Mt){U.warn("Lambda connect health check failed",Ee);const ge=xf(Ee,se,"config_connect");me(ge);try{await le({lambdaConnection:ge,runtimeMode:v,lambdaFullMode:v==="lambda"}),U.log("Persisted disconnected lambda state from connect")}catch(Ie){U.warn("Failed to persist disconnected lambda state from connect",Ie)}}else Sf(Ee)?(U.warn("Record Bin webhook synchronization failed",Ee),be(Ee,"connect")):(U.error("Unexpected error while connecting lambda function",Ee),Pe("Unexpected error while connecting lambda."),j(["Unexpected error while connecting lambda.",`Failure details: ${Ee instanceof Error?Ee.message:"Unknown error"}`]),z(!1))}finally{V(!1)}},Ke=async()=>{const se=re;U.log("Disconnecting current lambda function",{activeDeploymentUrl:re}),te(!0),de();let Ee=!1;try{const ge=await Tf({currentUserAccessToken:i.currentUserAccessToken,canManageWebhooks:we,environment:i.environment});Ee=ge.action==="deleted",U.log("Record Bin webhook synchronized on disconnect",{action:ge.action,webhookId:ge.webhookId}),await le({deploymentURL:"",vercelURL:"",lambdaConnection:null,runtimeMode:v,lambdaFullMode:v==="lambda"}),oe(""),ye(""),ke(void 0),de(),U.log("Current lambda function disconnected"),i.notice("Current lambda function has been disconnected.")}catch(ge){if(Ee&&se.trim())try{const Ie=await bf({currentUserAccessToken:i.currentUserAccessToken,canManageWebhooks:we,environment:i.environment,lambdaBaseUrl:se});U.warn("Restored Record Bin webhook after disconnect failure",Ie)}catch(Ie){U.error("Failed to restore Record Bin webhook after disconnect failure",Ie)}Sf(ge)?(U.warn("Failed to synchronize Record Bin webhook on disconnect",ge),be(ge,"disconnect")):(U.warn("Failed to disconnect current lambda function",ge),Pe("Could not disconnect the current lambda."),j(["Could not disconnect the current lambda function.",`Failure details: ${ge instanceof Error?ge.message:"Unknown error"}`]),z(!1)),await i.alert("Could not disconnect the current lambda function.")}finally{te(!1)}},Kn=se=>{const Ee=lf.find(ge=>ge.provider===se);Ee&&(U.log("Opening deploy helper from config",{provider:se}),window.open(Ee.url,"_blank","noreferrer"))},Ri=async()=>{const se=parseInt(h,10);if(U.log("Saving plugin settings",{numberOfDays:h,parsedNumberOfDays:se,debugEnabled:g,runtimeModeSelection:v}),isNaN(se)){ne("Days must be an integer number"),U.warn("Cannot save settings: numberOfDays is not a number");return}if(!(v!=="lambda"||re.trim().length>0&&ie?.status==="connected"&&!$&&!X)){await i.alert("Cannot save while 'Also save records deleted from the API' is enabled unless the Lambda URL is connected and ping status is Connected.");return}M(!0);try{let ge=re.trim(),Ie=ie??null;if(v==="lambdaless"&&ge){U.log("Switching to Lambda-less mode: attempting to remove managed webhook and clear lambda URL");try{const vt=await Tf({currentUserAccessToken:i.currentUserAccessToken,canManageWebhooks:we,environment:i.environment});U.log("Managed Record Bin webhook synchronized while switching to Lambda-less mode",vt)}catch(vt){U.warn("Could not remove managed webhook while switching to Lambda-less mode",vt),await i.notice("Runtime was switched to Lambda-less, but the managed webhook could not be removed automatically. If you see duplicate captures, remove the webhook manually.")}ge="",Ie=null,oe(""),ye(""),ke(void 0),de()}await le({debug:g,automaticBinCleanup:{numberOfDays:se,timeStamp:""},runtimeMode:v,lambdaFullMode:v==="lambda",deploymentURL:ge,vercelURL:ge,lambdaConnection:Ie}),U.log("Plugin settings saved",{numberOfDays:se,runtimeModeSelection:v}),i.notice(`Settings saved. Runtime mode: ${v==="lambda"?"Lambda-full":"Lambda-less"}. All records older than ${h} days in the bin will be daily deleted. Debug logging is ${g?"enabled":"disabled"}.`),x({numberOfDays:String(se),debugEnabled:g,runtimeMode:v})}catch(ge){U.warn("Failed to save plugin settings",ge),await i.alert("Could not save plugin settings.")}finally{M(!1)}},yt=v==="lambda",Qn=$||X?{label:"Checking ping...",color:"var(--warning-color)"}:ie?.status==="connected"?{label:"Connected (ping successful)",color:"var(--notice-color)"}:ie?.status==="disconnected"?{label:"Disconnected (ping failed)",color:"var(--alert-color)"}:re?{label:"Connection pending",color:"var(--light-body-color)"}:{label:"Disconnected (no lambda URL configured)",color:"var(--light-body-color)"},sn=re.trim().length>0,Ii=X?sn?"Changing Lambda URL...":"Connecting...":sn?"Change Lambda URL":"Connect",Dr=q?"Disconnecting...":"Disconnect",Xn={width:"100%",height:"40px",fontSize:"var(--font-size-m)",fontWeight:500,lineHeight:"1",padding:"0 var(--spacing-m)",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",flex:"1 1 0",whiteSpace:"nowrap"},Nr={border:"1px solid var(--border-color)",borderRadius:"6px",background:"#fff",padding:"var(--spacing-l)",marginBottom:"var(--spacing-l)",textAlign:"left"},gt={margin:0,color:"var(--light-body-color)",fontSize:"var(--font-size-xs)"},ln={marginTop:0,marginBottom:"var(--spacing-s)",color:"var(--base-body-color)",fontSize:"var(--font-size-s)"},Fr={display:"flex",flexDirection:"column",gap:"var(--spacing-m)"},Ar={"--spacing-s":"0"},Li={...Ar,marginBottom:"0.25rem"},Di=X||q||$||I,Ni=h!==T.numberOfDays||g!==T.debugEnabled||v!==T.runtimeMode,jr=!yt||sn&&ie?.status==="connected"&&!$&&!X,an=yt?sn?$||X?"Wait for the Lambda ping check to finish.":ie?.status!=="connected"?"To save with API capture enabled, Lambda status must be Connected.":"":"To save with API capture enabled, connect a Lambda URL first.":"";return Q.jsx(qa,{ctx:i,children:Q.jsxs("div",{style:{maxWidth:"760px",margin:"0 auto"},children:[yt&&Q.jsxs("div",{style:Nr,children:[Q.jsx("h2",{style:{marginTop:0,marginBottom:"var(--spacing-s)",fontSize:"var(--font-size-l)"},children:"Lambda setup"}),Q.jsxs("p",{style:ln,children:[Q.jsx("strong",{children:"Current URL:"})," ",Q.jsx("span",{style:{wordBreak:"break-all"},children:re||"No lambda function connected."})]}),Q.jsxs("p",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"var(--spacing-s)",marginTop:0,marginBottom:"var(--spacing-s)",fontSize:"var(--font-size-s)",color:"var(--light-body-color)"},children:[Q.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"999px",background:Qn.color}}),Q.jsx("span",{children:Qn.label})]}),Q.jsx("p",{style:{...gt,marginBottom:"var(--spacing-l)"},children:"Status is based on the `/api/datocms/plugin-health` ping."}),Q.jsx(sf,{name:"deploymentURL",id:"deploymentURL",label:"Lambda URL",value:_e,placeholder:"https://record-bin.example.com/",onChange:se=>{oe(se),de()}}),Q.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"nowrap",width:"100%",gap:"var(--spacing-s)",marginTop:"var(--spacing-l)"},children:[Q.jsx(tg,{style:{flex:"1 1 0"},renderTrigger:({onClick:se})=>Q.jsx(tn,{buttonType:"muted",onClick:se,disabled:X||$||q,style:Xn,children:"Deploy lambda"}),children:Q.jsx(wg,{alignment:"left",children:lf.map(se=>Q.jsx(Eg,{onClick:()=>Kn(se.provider),children:se.label},se.provider))})}),Q.jsx(tn,{onClick:Ke,buttonType:"negative",disabled:q||$||!re.trim(),style:Xn,children:Dr}),Q.jsx(tn,{buttonType:"primary",onClick:xe,disabled:X||$||q,style:Xn,children:Ii})]})]}),yt&&Fe&&Q.jsxs("div",{style:{border:"1px solid rgba(var(--alert-color-rgb-components), 0.5)",borderRadius:"6px",background:"rgba(var(--alert-color-rgb-components), 0.08)",padding:"var(--spacing-m)",marginBottom:"var(--spacing-m)"},children:[Q.jsx("p",{style:{marginTop:0,marginBottom:"var(--spacing-s)"},children:Fe}),Se.length>0&&Q.jsx(tn,{buttonType:"muted",buttonSize:"s",onClick:()=>z(se=>!se),children:J?"Hide details":"Show details"})]}),yt&&J&&Se.length>0&&Q.jsx("div",{style:{border:"1px solid rgba(var(--alert-color-rgb-components), 0.5)",borderRadius:"6px",background:"#fff",padding:"var(--spacing-m)",marginBottom:"var(--spacing-l)",textAlign:"left"},children:Se.map((se,Ee)=>Q.jsx("p",{children:se},`config-health-error-${Ee}`))}),Q.jsx("h2",{style:{marginTop:0,marginBottom:"var(--spacing-s)",fontSize:"var(--font-size-l)"},children:"Bin cleanup settings"}),Q.jsxs(Hf,{children:[Q.jsx(sf,{error:fe,required:!0,name:"numberOfDays",id:"numberOfDays",label:"Delete trashed records older than (days)",value:h,onChange:se=>{_(se),ne("")}}),Q.jsx(Bg,{title:"Advanced settings",collapsible:{isOpen:b,onToggle:()=>L(se=>!se)},children:Q.jsxs("div",{style:Fr,children:[Q.jsx("div",{style:Li,children:Q.jsx(of,{name:"debug",id:"debug",label:"Enable debug logs",hint:"When enabled, plugin events and requests are logged to the browser console.",value:g,onChange:se=>m(se)})}),Q.jsx("div",{style:Ar,children:Q.jsx(of,{name:"lambdaMode",id:"lambdaMode",label:"Also save records deleted from the API",hint:"If you do not know what Serverless Functions are, keep this disabled",value:yt,switchInputProps:{disabled:Di},onChange:se=>{y(se?"lambda":"lambdaless"),de()}})}),Q.jsx("p",{style:gt,children:Q.jsx("a",{href:`${rv}#runtime-modes`,target:"_blank",rel:"noreferrer",children:"Runtime mode guide and differences"})}),yt&&Q.jsx("p",{style:gt,children:"To capture API deletions, connect a Lambda function above."}),v==="lambdaless"&&sn&&Q.jsx("p",{style:gt,children:"Lambda is currently connected. Click Save to complete the switch to Lambda-less and remove the managed webhook."}),an&&Q.jsx("p",{style:{...gt,color:"var(--alert-color)"},children:an})]})}),!b&&an&&Q.jsx("p",{style:{...gt,marginTop:"var(--spacing-s)",color:"var(--alert-color)"},children:"Open Advanced settings to configure API capture before saving."}),Q.jsx(tn,{onClick:Ri,fullWidth:!0,buttonType:I?"muted":"primary",disabled:I||q||X||!jr||!Ni,children:"Save"})]})]})})}const g_="2026-02-25",bi=i=>!!i&&typeof i=="object"&&!Array.isArray(i),v_=i=>typeof i!="string"?i:JSON.parse(i),__=i=>bi(i)&&typeof i.type=="string"&&bi(i.relationships)&&bi(i.attributes),Ti=(i,n)=>{const o=i[n];return bi(o)?o:void 0},w_=({environment:i,entity:n,capturedAt:o=new Date().toISOString()})=>({event_type:"to_be_restored",entity_type:"item",environment:i,entity:n,event_triggered_at:o,related_entities:[],__record_bin:{source:"onBeforeItemsDestroy",version:g_}}),E_=(i,n)=>{const o=v_(i);if(!bi(o))throw new Error("Record body is not a JSON object.");if(__(o))return{environment:n,entity:o};const a=Ti(o,"entity");if(!a)throw new Error("Record body does not include an entity payload.");const c=typeof o.environment=="string"&&o.environment.trim().length>0?o.environment:n,d=typeof o.event_type=="string"?o.event_type:void 0;return{environment:c,entity:a,eventType:d}},S_=i=>{const n=Ti(i,"relationships");if(!n)return;const o=Ti(n,"item_type");if(!o)return;const a=Ti(o,"data");if(a)return typeof a.id=="string"?a.id:void 0},k_=i=>Ti(i,"attributes")??{},kr="UNKNOWN",b_="Could not parse restoration error payload.",Ut=i=>!!i&&typeof i=="object"&&!Array.isArray(i),mt=i=>typeof i=="string"&&i.trim().length>0,T_=i=>{if(i instanceof Error)return JSON.stringify(i,Object.getOwnPropertyNames(i),2);try{return JSON.stringify(i,null,2)}catch{return String(i)}},Fa=i=>!Ut(i)||typeof i.fullErrorPayload!="string"||!Ut(i.simplifiedError)?!1:Ut(i.simplifiedError.details),C_=(i,n)=>{const o=mt(i)?i:i instanceof Error&&mt(i.message)?i.message:n;return{code:kr,details:{code:kr,message:o}}},Lf=(i,n)=>{const o=Ut(i.details)?{...i.details}:{};if(!(mt(i.code)||Object.keys(o).length>0))return mt(i.message)?{code:kr,details:{code:kr,message:i.message}}:void 0;const c=mt(i.code)?i.code:kr,d={...o};return mt(d.code)||(d.code=c),!mt(d.message)&&mt(i.message)&&(d.message=i.message),Object.keys(d).length===1&&d.code===kr&&!mt(d.message)&&(d.message=n),{...i,code:c,details:d}},P_=i=>{let n=i;for(;Ut(n)&&"error"in n;){const o=n.error;if(o===void 0||o===n)break;n=o}return n},x_=(i,n)=>{if(Fa(i))return i.simplifiedError;const o=P_(i);if(Fa(o))return o.simplifiedError;if(Ut(o)&&Array.isArray(o.errors)){const a=o.errors[0];if(Ut(a)&&Ut(a.attributes)){const c=Lf(a.attributes,n);if(c)return c}}if(Ut(o)){const a=Lf(o,n);if(a)return a}return C_(o,n)},O_=i=>{if(mt(i))try{return JSON.parse(i)}catch{return}},Aa=(i,n={})=>{const{fullErrorPayload:o,fallbackMessage:a=b_}=n;return Fa(i)&&!mt(o)?i:{simplifiedError:x_(i,a),fullErrorPayload:o??T_(i)}},R_=i=>!Ut(i)||!Ut(i.restoredRecord)?!1:mt(i.restoredRecord.id)&&mt(i.restoredRecord.modelID),cs=i=>!!i&&typeof i=="object"&&!Array.isArray(i),ja=(i,n)=>{if(Array.isArray(i)){for(const o of i)ja(o,n);return}if(cs(i)){Object.prototype.hasOwnProperty.call(i,"id")&&n!=="data"&&delete i.id;for(const o of Object.keys(i)){const a=i[o];typeof a=="object"&&a!==null&&ja(a,o)}}},I_=i=>JSON.parse(JSON.stringify(i)),L_=i=>{const n=I_(i);delete n.id;const o=cs(n.attributes)?n.attributes:{};delete o.created_at,delete o.updated_at,n.attributes=o;const a=cs(n.relationships)?n.relationships:{};delete a.creator,n.relationships=a;const c=cs(n.meta)?n.meta:{};return n.meta={created_at:c.created_at,first_published_at:c.first_published_at},ja(n,""),n};class nh extends Error{constructor(n,o){super(n),this.name="LambdaLessRestoreError",this.restorationError=o}}const D_=i=>i instanceof nh,N_=async({currentUserAccessToken:i,fallbackEnvironment:n,recordBody:o,trashRecordID:a})=>{if(!i)throw new Error("Missing currentUserAccessToken for Lambda-less restore.");const c=E_(o,n),d=L_(c.entity),f=vs({apiToken:i,environment:c.environment});let h;try{h=await f.items.rawCreate({data:d})}catch(m){throw new nh("The record could not be restored!",Aa(m))}await f.items.destroy(a);const _=h.data.id,g=h.data.relationships.item_type.data.id;return{restoredRecord:{id:_,modelID:g}}},F_=i=>{const n=i.simplifiedError.details,o=typeof n.field=="string"&&n.field||(Array.isArray(n.extraneous_attributes)&&n.extraneous_attributes.length>0?n.extraneous_attributes.join(", "):void 0)||typeof n.message=="string"&&n.message||"No details available";return`${i.simplifiedError.code||"UNKNOWN"}: ${o}`},A_=i=>{const n=i.simplifiedError.details;if(typeof n.code=="string"&&n.code.trim().length>0)return`Details code: ${n.code}`;if(typeof n.field_id=="string"&&n.field_id.trim().length>0)return`Field ID: ${n.field_id}`;if(typeof n.field_label=="string"&&n.field_label.trim().length>0)return`Field label: ${n.field_label}`},j_=({ctx:i})=>{const n=xt(jt(i.plugin.attributes.parameters),"BinOutlet"),[o,a]=Y.useState(!1),[c,d]=Y.useState(),f=async()=>{n.log("Starting record restoration",{itemId:i.item?.id,itemTypeId:i.itemType.id}),d(void 0),a(!0);const v=gs(i.plugin.attributes.parameters),y=i.formValues.record_body;let T;try{T=typeof y=="string"?JSON.parse(y):y}catch(x){n.warn("Could not parse record_body JSON before restore",x),await i.alert("The record body is not valid JSON.");return}try{if(v==="lambda"){const I=Ci(i.plugin.attributes.parameters);if(!I){n.warn("Missing deployment URL while restoring record"),await i.alert("The plugin deployment URL is missing.");return}if(!T||typeof T!="object"||Array.isArray(T)){n.warn("record_body must be a JSON object for lambda restore"),await i.alert("The record body is not a valid restore payload.");return}if(!i.item?.id){n.warn("Missing trash record id in lambda restore"),await i.alert("Could not determine the trash record to remove.");return}const M={...T,trashRecordID:i.item.id},q=JSON.stringify(M);n.log("Sending restoration request to lambda",{deploymentURL:I,requestBodyLength:q.length});let te;try{te=await fetch(I,{method:"POST",body:q,headers:{Accept:"*/*","Content-Type":"application/json"}})}catch(fe){const ne=Aa(fe);d(ne),n.warn("Restoration request failed before receiving response",ne),await i.alert("The record could not be restored!");return}n.log("Received restoration response",{status:te.status});const X=await te.text(),V=O_(X);if(!te.ok||!R_(V)){const fe=te.ok?"The restore API returned an invalid success payload.":`The restore API request failed with status ${te.status}.`,ne=X.trim(),$=Aa(V??X,{fullErrorPayload:ne.length>0?ne:void 0,fallbackMessage:fe});d($),n.warn("Restoration request failed",{status:te.status,restorationError:$}),await i.alert("The record could not be restored!");return}n.log("Restoration succeeded",{restoredRecordId:V.restoredRecord.id,restoredModelId:V.restoredRecord.modelID}),i.notice("The record has been successfully restored!"),i.navigateTo("/editor/item_types/"+V.restoredRecord.modelID+"/items/"+V.restoredRecord.id);return}if(!i.item?.id){n.warn("Missing trash record id in lambda-less restore"),await i.alert("Could not determine the trash record to remove.");return}n.log("Sending restoration request through Lambda-less runtime");let x;try{x=await N_({currentUserAccessToken:i.currentUserAccessToken,fallbackEnvironment:i.environment,recordBody:T,trashRecordID:i.item.id})}catch(I){if(D_(I)){d(I.restorationError),n.warn("Lambda-less restoration request failed",I.restorationError),await i.alert("The record could not be restored!");return}throw I}if(!x)return;n.log("Lambda-less restoration succeeded",{restoredRecordId:x.restoredRecord.id,restoredModelId:x.restoredRecord.modelID}),i.notice("The record has been successfully restored!"),i.navigateTo("/editor/item_types/"+x.restoredRecord.modelID+"/items/"+x.restoredRecord.id)}catch(x){n.error("Restoration flow failed",x),await i.alert("The record could not be restored!")}finally{a(!1)}},h=async()=>{c&&(n.log("Opening restoration error modal"),await i.openModal({id:"errorModal",title:"Restoration error",width:"l",parameters:{errorPayload:c.fullErrorPayload}}))},_=c?F_(c):void 0,g=c?A_(c):void 0,m={border:"1px solid rgba(var(--alert-color-rgb-components), 0.5)",borderRadius:"6px",background:"rgba(var(--alert-color-rgb-components), 0.08)",padding:"var(--spacing-m)",marginBottom:"var(--spacing-m)"};return Q.jsx(qa,{ctx:i,children:Q.jsxs(Hf,{children:[Q.jsx(rf,{children:Q.jsx(tn,{buttonType:o?"muted":"primary",disabled:o,fullWidth:!0,onClick:f,children:"Restore record ♻️"})}),Q.jsx(rf,{children:c&&Q.jsxs("div",{style:m,children:[Q.jsx("h3",{style:{marginTop:0,marginBottom:"var(--spacing-s)",fontSize:"var(--font-size-m)"},children:"Restoration error"}),Q.jsx("p",{style:{marginTop:0,marginBottom:"var(--spacing-s)"},children:"Restoring a record is an optimistic operation. If this record references linked records that no longer exist, restoration can fail."}),Q.jsxs("p",{style:{marginTop:0,marginBottom:"var(--spacing-s)"},children:["In case of API errors, inspect the details below and update the"," ",Q.jsx("code",{children:"record_body"})," JSON if needed before trying again."]}),Q.jsx("p",{style:{marginTop:0,marginBottom:"var(--spacing-s)"},children:_}),g&&Q.jsx("p",{style:{marginTop:0,marginBottom:"var(--spacing-s)"},children:g}),Q.jsx(tn,{onClick:h,children:"See full restoration error report"}),Q.jsx("p",{style:{marginTop:"var(--spacing-s)",marginBottom:0},children:"You can manually correct the JSON payload, save the record, and re-attempt restoration."})]})})]})})},M_=({ctx:i})=>{const n=xt(jt(i.plugin.attributes.parameters),"ErrorModal"),o=async f=>{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"){await navigator.clipboard.writeText(f);return}if(typeof document>"u")throw new Error("Clipboard API is unavailable in this environment.");const h=document.createElement("textarea");h.value=f,h.setAttribute("readonly",""),h.style.position="fixed",h.style.left="-9999px",document.body.appendChild(h),h.select();const _=document.execCommand("copy");if(document.body.removeChild(h),!_)throw new Error("execCommand copy failed.")},a=()=>{n.log("Closing restoration error modal"),i.resolve("done")},c=i.parameters.errorPayload.replaceAll("\\n",`
|
|
15
|
+
`).replaceAll("\\",""),d=async()=>{try{await o(c),n.log("Copied restoration error payload to clipboard",{payloadLength:c.length}),await i.notice("Restoration error copied to clipboard.")}catch(f){n.warn("Failed to copy restoration error payload",f),await i.alert("Could not copy restoration error to clipboard.")}};return n.log("Rendering error payload in modal",{payloadLength:c.length}),Q.jsxs(qa,{ctx:i,children:[Q.jsx(tn,{onClick:d,fullWidth:!0,buttonType:"muted",children:"Copy error to clipboard"}),Q.jsx("div",{style:{marginTop:"var(--spacing-s)",marginBottom:"var(--spacing-s)",border:"1px solid var(--border-color)",borderRadius:"6px",background:"#f8f9fb"},children:Q.jsx("pre",{style:{margin:0,padding:"var(--spacing-m)",maxHeight:"320px",overflowY:"auto",overflowX:"auto",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word",fontSize:"12px",lineHeight:"1.5",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:Q.jsx("code",{children:c})})}),Q.jsx(tn,{onClick:a,fullWidth:!0,buttonType:"primary",children:"Done"})]})},U_=async({currentUserAccessToken:i,environment:n,numberOfDays:o})=>{if(!i)throw new Error("Missing currentUserAccessToken for Lambda-less cleanup.");const a=vs({apiToken:i,environment:n});try{await a.itemTypes.find("record_bin")}catch{return{deletedCount:0,skipped:!0}}const c=new Date;c.setDate(new Date().getDate()-o);const d=await a.items.list({filter:{fields:{dateOfDeletion:{lte:c.toISOString()}},type:"record_bin"}});return d.length===0?{deletedCount:0,skipped:!1}:(await a.items.bulkDestroy({items:d.map(f=>({type:"item",id:f.id}))}),{deletedCount:d.length,skipped:!1})},z_=async i=>{const n=xt(jt(i.plugin.attributes.parameters),"binCleanup");if(n.log("Evaluating daily bin cleanup execution"),i.plugin.attributes.parameters.automaticBinCleanup){const o=new Date().toISOString().split("T")[0],a=i.plugin.attributes.parameters.automaticBinCleanup;if(a.timeStamp===o){n.log("Skipping cleanup because it already ran today",{currentTimeStamp:o});return}if(gs(i.plugin.attributes.parameters)==="lambda"){const f=Ci(i.plugin.attributes.parameters);if(!f){n.warn("Skipping cleanup because deployment URL is missing");return}const h={event_type:"cleanup",numberOfDays:a.numberOfDays,environment:i.environment},_=JSON.stringify(h);n.log("Sending lambda cleanup request",{deploymentURL:f,requestBody:h});try{const g=await fetch(f,{method:"POST",body:_,headers:{Accept:"*/*","Content-Type":"application/json"}});n.log("Lambda cleanup request finished",{status:g.status})}catch(g){n.error("Lambda cleanup request failed",g)}}else{n.log("Running cleanup in Lambda-less mode");try{const f=await U_({currentUserAccessToken:i.currentUserAccessToken,environment:i.environment,numberOfDays:a.numberOfDays});n.log("Lambda-less cleanup finished",f)}catch(f){n.error("Lambda-less cleanup failed",f)}}const d={...i.plugin.attributes.parameters};d.automaticBinCleanup.timeStamp=o,await i.updatePluginParameters(d),n.log("Cleanup timestamp persisted",{currentTimeStamp:o});return}n.log("Skipping cleanup because automatic cleanup is disabled")},Ma=i=>{if(!i||typeof i!="object")return;const n=i;return typeof n.id=="string"?n.id:void 0},Df=async i=>{try{const n=await i.itemTypes.find("record_bin"),o=Ma(n);return o?{id:o}:void 0}catch{return}},$_=async i=>{const n=await Df(i);if(n)return n;let o;try{const d=await i.itemTypes.create({name:"🗑 Record Bin",api_key:"record_bin",collection_appearance:"table"});o=Ma(d)}catch(d){const f=await Df(i);if(f)return f;throw d}if(!o)throw new Error("Record Bin model creation returned an invalid model id.");const a=await i.fields.create(o,{label:"Label",field_type:"string",api_key:"label",position:1});await i.fields.create(o,{label:"Model",field_type:"string",api_key:"model",position:2}),await i.fields.create(o,{label:"Date of deletion",field_type:"date_time",api_key:"date_of_deletion",position:3}),await i.fields.create(o,{label:"Record body",field_type:"json",api_key:"record_body",position:4});const c=Ma(a);if(!c)throw new Error("Record Bin label field creation returned an invalid field id.");return await i.itemTypes.update(o,{title_field:{type:"field",id:c},collection_appearance:"table"}),{id:o}},q_=(i,n)=>{let o="No title record";for(const a of Object.keys(i)){const c=i[a];if(typeof c=="string"&&Number.isNaN(Number(c))){o=c;break}}return`${o} | Model: ${n} | ${new Date().toDateString()}`},Nf=i=>{const n=i.relationships?.item_type?.data?.id;return typeof n=="string"?n:void 0},B_=async(i,n)=>{const o=xt(jt(n.plugin.attributes.parameters),"lambdaLessCapture"),a={capturedCount:0,failedItemIds:[],skippedRecordBinItems:0};if(!n.currentUserAccessToken)return o.warn("Skipping Lambda-less capture because currentUserAccessToken is missing"),await n.notice("Record Bin could not archive deleted records because currentUserAccessToken is missing."),{...a,failedItemIds:i.map(f=>f.id).filter(f=>!!f)};const c=vs({apiToken:n.currentUserAccessToken,environment:n.environment});let d="";try{d=(await $_(c)).id}catch(f){return o.error("Could not ensure record_bin model before delete capture",f),await n.notice("Record Bin could not archive deleted records because the record_bin model is unavailable."),{...a,failedItemIds:i.map(h=>h.id).filter(h=>!!h)}}for(const f of i){const h=f.id;if(h){if(Nf(f)===d){a.skippedRecordBinItems+=1;continue}try{const g=(await c.items.rawFind(h,{nested:!0})).data,m=S_(g)??Nf(f);if(!m)throw new Error("Deleted record model id could not be determined.");if(m===d){a.skippedRecordBinItems+=1;continue}const v=q_(k_(g),m),y=w_({environment:n.environment,entity:g});await c.items.create({item_type:{type:"item_type",id:d},label:v,model:m,record_body:JSON.stringify(y),date_of_deletion:new Date().toISOString()}),a.capturedCount+=1}catch(_){a.failedItemIds.push(h),o.warn("Could not archive deleted record",{itemId:h,error:_})}}}return a.failedItemIds.length>0&&await n.notice(`Record Bin could not archive ${a.failedItemIds.length} deleted record(s). Deletion still completed.`),o.log("Lambda-less delete capture finished",a),a};Py({async onBoot(i){const n=i.plugin.attributes.parameters,o=xt(jt(n),"index.onBoot");o.log("Plugin boot started"),o.log("Running daily cleanup check"),await z_(i),o.log("Plugin boot completed")},async onBeforeItemsDestroy(i,n){const o=xt(jt(n.plugin.attributes.parameters),"index.onBeforeItemsDestroy");if(gs(n.plugin.attributes.parameters)==="lambda")return o.log("Skipping Lambda-less delete capture because lambda mode is active"),!0;try{const c=await B_(i,n);o.log("Lambda-less delete capture completed",c)}catch(c){o.error("Unexpected error in Lambda-less delete capture. Proceeding with deletion (fail-open).",c)}return!0},renderConfigScreen(i){return xt(jt(i.plugin.attributes.parameters),"index.renderConfigScreen").log("Rendering config screen"),ha(Q.jsx(y_,{ctx:i}))},itemFormOutlets(i,n){const o=xt(jt(n.plugin.attributes.parameters),"index.itemFormOutlets");return i.attributes.api_key==="record_bin"?(o.log("Registering item form outlet for record_bin model"),[{id:"recordBin",initialHeight:0}]):(o.log("Skipping item form outlet for model",{modelApiKey:i.attributes.api_key}),[])},renderItemFormOutlet(i,n){const o=xt(jt(n.plugin.attributes.parameters),"index.renderItemFormOutlet");if(i==="recordBin"){o.log("Rendering record bin outlet"),ha(Q.jsx(j_,{ctx:n}));return}o.log("Skipping outlet rendering",{outletId:i})},renderModal(i,n){const o=xt(jt(n.plugin.attributes.parameters),"index.renderModal");if(o.log("Rendering modal",{modalId:i}),i==="errorModal")return ha(Q.jsx(M_,{ctx:n}));o.warn("Received unknown modal id",{modalId:i})}});
|