slicer-studio 0.6.0 → 0.7.0

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.
@@ -5,15 +5,15 @@ import{r as e,t}from"./chunks/rolldown-runtime-XKyaHtl9.js";import{a as n,i as r
5
5
  `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
6
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
- `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function _t(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[yt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=/* @__PURE__ */ new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[: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]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var Ut=!1;function Wt(){var e=Ut;return Ut=!1,e}function Gt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Xt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zt(e){if(!e._valueTracker){var t=Yt(e)?`checked`:`value`;e._valueTracker=Xt(e,t,``+e[t])}}function Qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var $t=/[\n"\\]/g;function en(e){return e.replace($t,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function tn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):rn(e,Jt(n)):o===`number`&&e.value==t?rn(e,Jt(e.value)):rn(e,Jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Jt(s):e.removeAttribute(`name`)}function nn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Zt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Zt(e)}function rn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function an(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function on(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(pe(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Zt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function un(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Ut=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(un(e,i,r),Ut=!0)}else for(var a in t)t.hasOwnProperty(a)&&un(e,a,t[a])}function fn(e){if(e.indexOf(`-`)===-1)return!1;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 pn=/* @__PURE__ */ new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),mn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hn(e){return mn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var _n=null;function vn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(tn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+en(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[bt]||null;if(!i)throw Error(o(90));tn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Qt(r)}break a;case`textarea`:on(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&an(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Ld(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,n=t.length,r,i=`value`in On?On.value:On.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return An=i.slice(e,1<r?1-r:void 0)}function Mn(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 Nn(){return!0}function Pn(){return!1}function Fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Nn:Pn,this.isPropagationStopped=Pn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=D({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=D({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:er,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!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(D({},Un,{dataTransfer:0})),Kn=Fn(D({},Rn,{relatedTarget:0})),qn=Fn(D({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=Fn(D({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=Fn(D({},In,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={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`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function $n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function er(){return $n}var tr=Fn(D({},Rn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:er,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),nr=Fn(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),rr=Fn(D({},In,{submitter:0})),ir=Fn(D({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:er})),ar=Fn(D({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),or=Fn(D({},Un,{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})),sr=Fn(D({},In,{newState:0,oldState:0,source:0})),cr=[9,13,27,32],lr=Tn&&`CompositionEvent`in window,ur=null;Tn&&`documentMode`in document&&(ur=document.documentMode);var dr=Tn&&`TextEvent`in window&&!ur,fr=Tn&&(!lr||ur&&8<ur&&11>=ur),pr=` `,mr=!1;function hr(e,t){switch(e){case`keyup`:return cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function gr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var _r=!1;function vr(e,t){switch(e){case`compositionend`:return gr(t);case`keypress`:return t.which===32?(mr=!0,pr):null;case`textInput`:return e=t.data,e===pr&&mr?null:e;default:return null}}function yr(e,t){if(_r)return e===`compositionend`||!lr&&hr(e,t)?(e=jn(),An=kn=On=null,_r=!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 fr&&t.locale!==`ko`?null:t.data;default:return null}}var br={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 xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!br[e.type]:t===`textarea`}function Sr(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=qf(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Cr=null,wr=null;function Tr(e){Bf(e,0)}function Er(e){if(Qt(jt(e)))return e}function Dr(e,t){if(e===`change`)return t}var Or=!1;if(Tn){var kr;if(Tn){var Ar=`oninput`in document;if(!Ar){var jr=document.createElement(`div`);jr.setAttribute(`oninput`,`return;`),Ar=typeof jr.oninput==`function`}kr=Ar}else kr=!1;Or=kr&&(!document.documentMode||9<document.documentMode)}function Mr(){Cr&&(Cr.detachEvent(`onpropertychange`,Nr),wr=Cr=null)}function Nr(e){if(e.propertyName===`value`&&Er(wr)){var t=[];Sr(t,wr,e,vn(e)),Cn(Tr,t)}}function Pr(e,t,n){e===`focusin`?(Mr(),Cr=t,wr=n,Cr.attachEvent(`onpropertychange`,Nr)):e===`focusout`&&Mr()}function Fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Er(wr)}function Ir(e,t){if(e===`click`)return Er(t)}function Lr(e,t){if(e===`input`||e===`change`)return Er(t)}function Rr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var zr=typeof Object.is==`function`?Object.is:Rr;function Br(e,t){if(zr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!zr(e[i],t[i]))return!1}return!0}function Vr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=Hr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Hr(n)}}function Wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vr(e.document)}return t}function Kr(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`)}var qr=Tn&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Vr(r)||(r=Jr,`selectionStart`in r&&Kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xr&&Br(Xr,r)||(Xr=r,r=qf(Yr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};Tn&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),di=/* @__PURE__ */ new Map,fi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);fi.push(`scrollEnd`);function pi(e,t){di.set(e,t),Lt(t,[e])}var mi=0;function hi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=mi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function gi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function _i(e,t){return e=gi(e),t=gi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var vi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},yi=[],bi=0,xi=0;function Si(){for(var e=bi,t=xi=bi=0;t<e;){var n=yi[t];yi[t++]=null;var r=yi[t];yi[t++]=null;var i=yi[t];yi[t++]=null;var a=yi[t];if(yi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ei(n,i,a)}}function Ci(e,t,n,r){yi[bi++]=e,yi[bi++]=t,yi[bi++]=n,yi[bi++]=r,xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function wi(e,t,n,r){return Ci(e,t,n,r),Di(e)}function Ti(e,t){return Ci(e,null,null,t),Di(e)}function Ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Di(e){if(50<Dd)throw Dd=0,Od=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function ki(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(e,t,n,r){return new ki(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,t){var n=e.alternate;return n===null?(n=Ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ni(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pi(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)ji(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Ai(31,n,t,i),e.elementType=ie,e.lanes=a,e;case j:return Fi(n.children,i,a,t);case M:s=8,i|=24;break;case N:return e=Ai(12,n,t,i|2),e.elementType=N,e.lanes=a,e;case ee:return e=Ai(13,n,t,i),e.elementType=ee,e.lanes=a,e;case te:return e=Ai(19,n,t,i),e.elementType=te,e.lanes=a,e;case ae:case se:return e=i|32,e=Ai(30,n,t,e),e.elementType=se,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=Ai(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Fi(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function Ii(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Li(e){var t=Ai(18,null,null,0);return t.stateNode=e,t}function Ri(e,t,n){return t=Ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zi=/* @__PURE__ */ new WeakMap;function Bi(e,t){if(typeof e==`object`&&e){var n=zi.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},zi.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Vi=[],Hi=0,Ui=null,Wi=0,Gi=[],Ki=0,qi=null,H=1,Ji=``;function Yi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Ui,Ui=e,Wi=t}function Xi(e,t,n){Gi[Ki++]=H,Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e;var r=H;e=Ji;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,H=1<<32-Ye(t)+i|n<<i|r,Ji=a+e}else H=1<<a|n<<i|r,Ji=e}function Zi(e){e.return!==null&&(Yi(e,1),Xi(e,1,0))}function Qi(e){for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null;for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null,H=Gi[--Ki],Gi[Ki]=null}function $i(e,t){Gi[Ki++]=H,Gi[Ki++]=Ji,Gi[Ki++]=qi,H=t.id,Ji=t.overflow,qi=e}var ea=null,ta=null,U=!1,na=null,ra=!1,ia=Error(o(519));function aa(e){throw da(Bi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),nn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),sn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for(ea=e.return;ea;)switch(ea.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:ea=ea.return}}function ca(e){if(e!==ea)return!1;if(!U)return sa(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ta&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ta=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ta=dm(e)}else t===27?(t=ta,Sp(e.type)?(e=um,um=null,ta=e):ta=t):ta=ea?lm(e.stateNode.nextSibling):null;return!0}function la(){ta=ea=null,U=!1}function ua(){var e=na;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=_e(null),pa=null,ma=null;function ha(e,t,n){z(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,ve(fa)}function _a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function va(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),_a(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),_a(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),_a(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ya(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;zr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Se.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!zr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(o(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:/* @__PURE__ */ new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Nf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=L.S;L.S=function(e,t){if(pd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=yf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=_e(null);function Ua(){var e=Ha.current;return e===null?Zu.pooledCache:e}function Wa(e,t){t===null?z(Ha,Ha.current):z(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(o(460)),qa=Error(o(474)),Ja=Error(o(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(o(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(o(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===O?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=/* @__PURE__ */ new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Mi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ii(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===re&&Qa(a)===t.type)?(t=i(t,n.props),ao(t,n),t.return=e,t):(t=Pi(n.type,n.key,n.props,null,e.mode,r),ao(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ri(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Fi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Pi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case A:return t=Ri(t,e.mode,n),t.return=e,t;case re:return t=Qa(t),f(e,t,n)}if(pe(t)||ue(t))return t=Fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===F)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case re:return n=Qa(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===F)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Qa(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===F)return m(e,t,n,Ca(t,r),i);oo(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&Yi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return U&&Yi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&Yi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),U&&Yi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&Yi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),U&&Yi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),ao(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Qa(l)===r.type){n(e,r.sibling),c=i(r,a.props),ao(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Fi(a.props.children,e.mode,c,a.key),ao(c,a),c.return=e,e=c):(c=Pi(a.type,a.key,a.props,null,e.mode,c),ao(c,a),c.return=e,e=c)}return s(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ri(a,e.mode,c),c.return=e,e=c}return s(e);case re:return a=Qa(a),_(e,r,a,c)}if(pe(a))return h(e,r,a,c);if(ue(a)){if(l=ue(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,io(a),c);if(a.$$typeof===F)return _(e,r,Ca(e,a),c);oo(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Ii(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Di(e),Ei(e,null,n),t}return Ci(e,r,t,n),Di(e)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:uo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=_e(null),wo=_e(0);function To(e,t){e=nd,z(wo,e),z(Co,t),nd=e|t.baseLanes}function Eo(){z(wo,nd),z(Co,Co.current)}function Do(){nd=wo.current,ve(Co),ve(wo)}var Oo=_e(null),ko=null;function Ao(e){var t=e.alternate;z(Po,Po.current&1),z(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){z(Po,Po.current),z(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(z(Po,Po.current),z(Oo,e),ko===null&&(ko=e)):No()}function No(){z(Po,Po.current),z(Oo,Oo.current)}function W(e){ve(Oo),ko===e&&(ko=null),ve(Po)}var Po=_e(0);function Fo(e,t){z(Oo,Oo.current),z(Po,t)}function Io(e){ve(Po),ve(Oo),ko===e&&(ko=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)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 Ro=0,G=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(o(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Ro=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?fc:pc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){L.H=dc;var t=zo!==null&&zo.next!==null;if(Ro=0,Bo=zo=G=null,Vo=!1,Go=0,Ko=null,t)throw Error(o(300));e===null||Ac||(e=e.dependencies,e!==null&&ba(e)&&(Ac=!0))}function Qo(e,t,n,r){G=e;var i=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=i)throw Error(o(301));if(i+=1,Bo=zo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}L.H=mc,a=t(n,r)}while(Ho);return a}function $o(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(G.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Ro=0,Bo=zo=G=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?G.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw G.alternate===null?Error(o(467)):Error(o(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Za(Ko,e,t),t=G,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?fc:pc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===ce)return;if(e.$$typeof===F)return Sa(e)}throw Error(o(438,String(e)))}function cs(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=oe;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ia&&(d=!0);else if((Ro&p)===p){u=u.next,p===Ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,G.lanes|=p,id|=p;f=u.action,Uo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,G.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!zr(a,e.memoizedState)&&(Ac=!0,d&&(n=La,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);zr(a,t.memoizedState)||(Ac=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ps(e,t,n){var r=G,i=is(),a=U;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!zr((zo||i).memoizedState,n);if(s&&(i.memoizedState=n,Ac=!0),i=i.queue,Ls(gs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(o(349));a||Ro&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=as(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zr(e,n)}catch{return!0}}function vs(e){var t=Ti(e,2);t!==null&&Md(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,i){if(cc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};L.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ss(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(U){var n=Zu.formState;if(n!==null){a:{var r=G;if(U){if(ta){b:{for(var i=ta,a=ra;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ta=lm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=ac.bind(null,G,r),r.dispatch=n,r=ys(!1),a=sc.bind(null,G,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=as(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();G.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(G.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function K(e,t){Fs(8390656,8,e,t)}function Ls(e,t){Is(2048,8,e,t)}function Rs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=as(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=is().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(Xu&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Is(4,2,e,t)}function Vs(e,t){return Is(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Ro&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),G.lanes|=e,id|=e,n)}function Js(e,t,n,r){return zr(n,t)?n:Co.current===null?!(Ro&106)||Ro&1073741824&&!(Z&261930)?(Ac=!0,e.memoizedState=n):(e=Ad(),G.lanes|=e,id|=e,t):(e=qs(e,n,r),zr(e,t)||(Ac=!0),e)}function Ys(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,sc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,Ba(c,r),kd(e)):oc(e,t,r,kd(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Qs(e).queue;Ys(e,i,t,me,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},kd())}function ec(){return Sa(sh)}function tc(){return is().memoizedState}function nc(){return is().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=mo(n);var r=ho(t,e,n);r!==null&&(Md(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=wi(e,t,n,r),n!==null&&(Md(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,kd())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,zr(s,o))return Ci(e,t,i,0),Zu===null&&Si(),!1}catch{}if(n=wi(e,t,i,r),n!==null)return Md(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(o(479))}else t=wi(e,n,r,2),t!==null&&Md(t,e,2)}function cc(e){var t=e.alternate;return e===G||t!==null&&t===G}function lc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var dc={readContext:Sa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},fc={readContext:Sa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:K,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ic.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=ac.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Ys.bind(null,G,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,i=rs();if(U){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Zu===null)throw Error(o(349));Z&127||ms(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,K(gs.bind(null,r,a,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,a,n,t),null),n},useId:function(){var e=rs(),t=Zu.identifierPrefix;if(U){var n=Ji,r=H;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=rc.bind(null,G)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(Xu&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},pc={readContext:Sa,use:ss,useCallback:Gs,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:tc,useHostTransitionStatus:ec,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:nc,useEffectEvent:zs},mc={readContext:Sa,use:ss,useCallback:Gs,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=is();return zo===null?qs(n,e,t):Js(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:tc,useHostTransitionStatus:ec,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:nc,useEffectEvent:zs};function hc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Md(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Md(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Md(t,e,n),go(t,e,n))}};function _c(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Br(n,r)||!Br(i,a):!0}function vc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gc.enqueueReplaceState(t,t.state,null)}function yc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function bc(e){vi(e)}function xc(e){console.error(e)}function Sc(e){vi(e)}function Cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){Cc(e,t)},n}function Ec(e){return e=mo(e),e.tag=3,e}function Dc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(gd===null?gd=/* @__PURE__ */ new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,i,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),pf(e,r,i)),!1}throw Error(o(435,n.tag))}return pf(e,r,i),Wd(),!1}if(U)return t=Oo.current,t===null?(r!==ia&&(t=Error(o(423),{cause:r}),da(Bi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Bi(r,n),i=Tc(e.stateNode,r,i),_o(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ia&&(e=Error(o(422),{cause:r}),da(Bi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Bi(a,n),ld===null?ld=[a]:ld.push(a),rd!==4&&(rd=2),t===null)return!0;r=Bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Tc(n.stateNode,r,e),_o(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(gd===null||!gd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ec(i),Dc(i,e,n,r),_o(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(o(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Mc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return xa(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!Ac?(ts(e,t,i),ol(e,t,i)):(U&&s&&Zi(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ji(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=Pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Br:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=Mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Br(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return co(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,W(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(jo(t),(e=ta)?(e=am(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:H,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Rc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(jo(t),i){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(Ac||ya(e,t,n,!1),i=(n&e.childLanes)!==0,Ac||i){if(Co.current===null){if(r=Zu,r!==null&&(s=pt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Ti(e,s),Md(r,e,s),kc;Wd()}t=zc(e,t,n)}else e=a.treeContext,ta=lm(s.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=Mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Hc(e,t,n,r,i){return xa(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!Ac?(ts(e,t,i),ol(e,t,i)):(U&&r&&Zi(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!Ac?(ts(e,t,a),ol(e,t,a)):(U&&r&&Zi(t),t.flags|=1,jc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Oi,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=gc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(hc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&gc.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=yc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Oi,typeof u==`object`&&u&&(o=Sa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&vc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(hc(t,n,d,r),l=t.memoizedState),(c=uo||_c(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,po(e,t),o=t.memoizedProps,u=yc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Oi,typeof l==`object`&&l&&(c=Sa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&vc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(hc(t,n,s,r),p=t.memoizedState),(u=uo||_c(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=co(t,e.child,null,i),t.child=co(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return la(),t.flags|=256,jc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ga()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(U){if(i?Ao(t):No(),(e=ta)?(e=am(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:H,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Fi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Ao(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Mi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Fi(i,a,n,null),i.flags|=2):i=Mi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Ai(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return co(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(No(),a=i.fallback,s=t.mode,i=Zc({mode:`visible`,children:i.children},s),a=Fi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,co(t,e.child,null,c),i=t.child,i.memoizedState=qc(c),i.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,i)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,da({value:i,source:null,stack:null})),Qc(e,t,c)}if(Ac||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(Co.current!==null)return Qc(e,t,c);if(r=Zu,r!==null&&(i=pt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Ti(e,i),Md(r,e,i),kc;return om(a)||Wd(),Qc(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ta=lm(a.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=Xc(t,i.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function nl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(rl(e),jc(e,t,r,n),rl(e)):jc(e,t,r,n),r=U?Wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),jc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function cl(e,t,n){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Ce(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Ao(t),e=ol(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!sl(e,n)&&!(t.flags&128))return Ac=!1,cl(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,U&&t.flags&1048576&&Xi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ji(e)?(r=yc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===I){t.tag=11,t=Mc(null,t,e,r,n);break a}if(i===ne){t.tag=14,t=Nc(null,t,e,r,n);break a}if(i===F){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=fe(e)||e,Error(o(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=yc(r,t.pendingProps),Wc(e,t,r,i,n);case 3:a:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0),yo(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==i){i=Bi(Error(o(424)),t),da(i),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ta=lm(e.firstChild),ea=t,U=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===i){t=ol(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(t.stateNode=fp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&U&&(r=t.stateNode=hm(t.type,t.pendingProps,xe.current),ea=t,ra=!0,i=ta,Sp(t.type)?(um=i,ta=lm(r.firstChild)):ta=i),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((i=r=ta)&&(r=rm(r,t.type,t.pendingProps,ra),r===null?i=!1:(t.stateNode=r,ea=t,ta=lm(r.firstChild),ra=!1,i=!0)),i||aa(t)),Ce(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Xo(e,t,$o,null,null,n),sh._currentValue=i),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=ta)&&(n=im(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,ea=t,ta=null,e=!0)),e||aa(t)),null;case 13:return Yc(e,t,n);case 4:return B(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,xa(t),i=Sa(i),r=r(i),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(i=Ua(),i===null&&(i=Zu,a=ka(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},fo(t),ha(t,Oa,i)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ha(t,Oa,r),r!==i.cache&&va(t,[Oa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ha(t,Oa,r))),jc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:U&&Zi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw $a=Ya,qa}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,cd|=t)}function ml(e,t){if(!U)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var r=t.pendingProps;switch(Qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),V(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),hl(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(ul(t),a===null?(hl(t),dl(t,i,null,r,n)):(hl(t),fl(t,a))):a?a===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,a)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,i,e,r,n)),null;case 27:if(we(t),n=xe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return hl(t),t.subtreeFlags&=-33554433,null}e=ye.current,ca(t)?oa(t,e):(e=hm(i,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return hl(t),t.subtreeFlags&=-33554433,null}if(a=ye.current,ca(t))oa(t,a);else{var s=lp(xe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[yt]=t,a[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=xe.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ea,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||aa(t,!0)}else e=lp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[yt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(W(t),t):(W(t),null);if(t.flags&128)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[yt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(W(t),t):(W(t),null)}return W(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),hl(t),null);case 4:return V(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ga(t.type),hl(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return hl(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)ml(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Lo(e),a!==null){for(t.flags|=128,ml(r,!1),e=a.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ni(n,e),n=n.sibling;return Fo(t,Po.current&1|2),U&&Yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>md&&(t.flags|=128,i=!0,ml(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Lo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!U)return hl(t),null}else 2*Le()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,ml(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,a=Po.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||U?Fo(t,a):(n=a,z(Oo,t),z(Po,n),ko===null&&(ko=t)),U&&Yi(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return W(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ve(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(o(156,t.tag))}function _l(e,t){switch(Qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),V(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(W(t),t.alternate===null)throw Error(o(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(W(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return V(),null;case 10:return ga(t.type),null;case 22:case 23:return W(t),Do(),e!==null&&ve(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function vl(e,t){switch(Qi(t),t.tag){case 3:ga(Oa),V();break;case 26:case 27:case 5:we(t);break;case 4:V();break;case 31:t.memoizedState!==null&&W(t);break;case 13:W(t);break;case 19:Io(t);break;case 10:ga(t.type);break;case 22:case 23:W(t),Do(),e!==null&&ve(Ha);break;case 24:ga(Oa)}}function yl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function bl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){ff(e,e.return,t)}}}function Sl(e,t,n){n.props=yc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=hi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&em(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&tm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[bt]=t}catch(t){ff(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),Tl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[yt]=e,t[bt]=n}catch(t){ff(e,e.return,t)}}var Ll=!1,q=null;function Rl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var zl=null;function Bl(){var e=zl;return zl=null,e}var Vl=0;function Hl(e,t,n,r,i){return Vl=0,Ul(e.child,t,n,r,i)}function Ul(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Ll=!0,Tp(o,Vl===0?t:t+`_`+Vl,n),Vl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Ul(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Wl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Wl(e.child,t),e=e.sibling}function Gl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Gl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=_i(t.default,t.share),t!==`none`&&(Hl(e,n,t,null,!1)||Wl(e.child,!1))}e=e.sibling}}function Kl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=hi(r,n),a=_i(r.default,n.paired?r.share:r.enter);a===`none`?Gl(e):Hl(e,i,a,null,!1)?(Gl(e),n.paired||t||jd(e,r.onEnter)):Wl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e,t),e=e.sibling;else Gl(e)}function ql(e){if(q!==null&&q.size!==0){var t=q;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=_i(n.default,n.share);if(a!==`none`&&(Hl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Wl(e.child,!1)),t.delete(r),t.size===0)break}}}ql(e)}e=e.sibling}}}function Jl(e){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode),r=q===null?void 0:q.get(n),i=_i(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Hl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,q.delete(n),jd(e,t.onShare)):Wl(e.child,!1)),q!==null&&ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else q!==null&&ql(e)}function Yl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode);t=_i(t.default,t.update),e.flags&=-5,t!==`none`&&Hl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Yl(e);e=e.sibling}}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Wl(e.child,!1))}Xl(e)}e=e.sibling}}function Zl(e){if(e.tag===30)e.stateNode.paired=null,Wl(e.child,!1),Xl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Xl(e)}function Ql(e){for(e=e.child;e!==null;)e.tag===30?Wl(e.child,!1):e.subtreeFlags&33554432&&Ql(e),e=e.sibling}function $l(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Vl<a.length){var l=a[Vl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Vl===0?n:n+`_`+Vl,i),s&&e.flags&4||(zl===null&&(zl=[]),zl.push(c,Vl===0?r:r+`_`+Vl,t.memoizedProps)),Vl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:$l(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function eu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=hi(n,r),a=_i(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Vl=0,i=$l(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&eu(e,t);e=e.sibling}}var tu=!1,J=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,Y=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Gr(e),Kr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Jl(r[a]);if(e.alternate===null&&e.flags&2)n&&Rl(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Jl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Rl(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Yl(e),uu(n))}}q=null}function uu(e){for(;au!==null;){var t=au,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=yc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=hi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=_i(i.default,i.update),i!==`none`&&Hl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&yl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=yc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{So(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:ju(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||tu,!r){var a=t!==null&&t.memoizedState!==null||J;t=tu,i=J,tu=r,(J=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),tu=t,J=i}break;case 30:ju(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ut=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:J||wl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!J&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:J||wl(n,t),Dl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:J||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),Ut=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),Ut=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),J||bl(4,n,t),vu(e,t,n);break;case 1:J||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:J=(r=J)||n.memoizedState!==null,vu(e,t,n),J=r;break;case 30:wl(n,t),vu(e,t,n);break;case 7:J||wl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(o(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(o(160));yu(s,c,a),gu=null,_u=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),i&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(J||r===null||wl(r,r.return)),i&64&&tu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Tu,wu(t,e,n),Du(e),i&512&&(J||r===null||wl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(tu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else tu||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||J||t.parentNode.removeChild(t)):i.count--,n===null?tu||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(J||r===null||wl(r,r.return)),r!==null&&i&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=nu,nu=!1,wu(t,e,n),nu=a,Du(e),i&512&&(J||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),Ut=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),i&1024&&(ru=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ut=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(Ut=!1,Wm=null,a=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}ru&&(ru=!1,Ou(e)),Ut=!1;break;case 4:i=nu,nu=tu,r=Wt(),a=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,Ut&&Y&&(su=!0),Ut=r,nu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Le()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=tu,l=J,u=nu;tu=c||a,nu=u||a,J=l||s,wu(t,e,n),J=l,nu=u,tu=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||tu||J||(t=s||J,n=tu,r=J,tu=a||tu,J=t,Mu(e,2),tu=n,J=r),!a&&nu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(J||r===null||wl(r,r.return)),i=Wt(),a=Y,s=(n&335544064)===n,c=e.memoizedProps,Y=s&&_i(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&Ut&&(e.flags|=4),Y=a,Ut=i;break;case 21:break;case 7:i&512&&(J||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(kl(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Ol(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(o(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else eu(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Kl(e,!1);else switch(e.tag){case 3:if(cu=ou=!1,Bl(),ku(t,e),!ou&&!su){if(e=zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}zl=null;break;case 5:ku(t,e);break;case 4:r=ou,ou=!1,ku(t,e),ou&&(su=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Kl(e,!1));break;case 30:r=ou,i=Bl(),ou=!1,ku(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=hi(a,o),o=hi(n.memoizedProps,o);var s=_i(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Vl=0,t=$l(e,n,t,o,s,a,!0),Vl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),zl=i):i!==null&&(i.push.apply(i,zl),zl=i),ou=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Mu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Mu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||J||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:wl(n,n.return),Mu(n,r);break;case 7:wl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),yl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)xo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Nu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||tu||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),Cl(a,a.return);break;case 30:Nu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Ql(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Zl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&yl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Zl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Zl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Wl(a.child,!0),Wl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,q===null&&(q=/* @__PURE__ */ new Map),q.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:bl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(hu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Ju={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,Xu=0,Zu=null,X=null,Z=0,Qu=0,Q=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Xu&2&&Z!==0?Z&-Z:L.T===null?gt():Nf()}function Ad(){if(sd===0){if(!(Z&536870912)||U){var e=et;et<<=1,!(et&3932160)&&(et=262144),sd=e}else sd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(hi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Zu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Z,sd,!1)),lt(e,n),Xu&2&&e===Zu||(e===Zu&&(!(Xu&2)&&(ad|=n),rd===4&&Id(e,Z,sd,!1)),Tf(e))}function Nd(e,t,n){if(Xu&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),i=r?qd(e,t):Gd(e,t,!0),a=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,a&&!Fd(n))i=Gd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=a,ad|=a,i=4;break a}a=ud,ud=i,a!==null&&(ud===null?ud=a:ud.push.apply(ud,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){zd(e,0),Id(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=fd+300-Le(),10<i)){if(Id(r,t,sd,!$u),rt(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,a,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,a,null,-0,0)}break}}while(1);Tf(e)}function Pd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},q=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Le():(a&4194048)===a?pd-Le():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!zr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Id(e,t,n,r){t=at(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ld(){return Xu&6?!0:(Ef(0,!1),!1)}function Rd(){if(X!==null){if(Qu===0)var e=X.return;else e=X,ma=pa=null,ns(e),no=null,ro=0,e=X;for(;e!==null;)vl(e.alternate,e),e=e.return;X=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Zu=e,X=n=Mi(e.current,null),Z=t,Qu=0,Q=null,$u=!1,ed=it(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=at(e,t),Si(),n}function Bd(e,t){G=null,L.H=dc,t===Ka||t===Ja?(t=eo(),Qu=3):t===qa?(t=eo(),Qu=4):Qu=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Q=t,X===null&&(rd=1,Cc(e,Bi(t,e.current)))}function Vd(){var e=Oo.current;return e===null?!0:(Z&4194048)===Z?ko===null:(Z&62914560)===Z||Z&536870912?e===ko:!1}function Hd(){var e=L.H;return L.H=dc,e===null?dc:e}function Ud(){var e=L.A;return L.A=Ju,e}function Wd(){rd=4,$u||(Z&4194048)!==Z&&Oo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Zu===null||Id(Zu,Z,sd,!1)}function Gd(e,t,n){var r=Xu;Xu|=2;var i=Hd(),a=Ud();(Zu!==e||Z!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Qu!==0&&X!==null){var s=X,c=Q;switch(Qu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=Qu;if(Qu=0,Q=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Qu,Qu=0,Q=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,Xu=r,L.H=i,L.A=a,X===null&&(Zu=null,Z=0,Si()),o}function Kd(){for(;X!==null;)Yd(X)}function qd(e,t){var n=Xu;Xu|=2;var r=Hd(),i=Ud();Zu!==e||Z!==t?(hd=null,md=Le()+500,zd(e,t)):ed=it(e,t);a:do try{if(Qu!==0&&X!==null){t=X;var a=Q;b:switch(Qu){case 1:Qu=0,Q=null,Zd(e,t,a,1);break;case 2:case 9:if(Xa(a)){Qu=0,Q=null,Xd(t);break}t=function(){Qu!==2&&Qu!==9||Zu!==e||(Qu=7),Tf(e)},a.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Xa(a)?(Qu=0,Q=null,Xd(t)):(Qu=0,Q=null,Zd(e,t,a,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Ym(s):c.stateNode.complete){Qu=0,Q=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Qd(u))}break b}}Qu=0,Q=null,Zd(e,t,a,5);break;case 6:Qu=0,Q=null,Zd(e,t,a,6);break;case 8:Rd(),rd=6;break a;default:throw Error(o(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return ma=pa=null,L.H=r,L.A=i,Xu=n,X===null?(Zu=null,Z=0,Si(),rd):0}function Jd(){for(;X!==null&&!Fe();)Yd(X)}function Yd(e){var t=ll(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:ns(t);var r=t;r===ea&&(U?(sa(r),r.tag===5&&r.stateNode!=null&&(ta=r.stateNode)):(sa(r),U=!0));default:vl(n,t),t=X=Ni(t,nd),t=ll(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Zd(e,t,n,r){ma=pa=null,ns(t),no=null,ro=0;var i=t.return;try{if(Oc(e,i,t,n,Z)){rd=1,Cc(e,Bi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;rd=1,Cc(e,Bi(n,e.current)),X=null;return}t.flags&32768?(U||r===1?e=!0:ed||Z&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=gl(t.alternate,t,nd);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);rd=6,X=null}function ef(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(Xu&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Zu&&(X=Zu=null,Z=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=xi,ut(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Na(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ve,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Xu,Xu|=4;try{lu(e,t,n)}finally{Xu=a,R.p=i,L.T=r}}_d=1,Ll?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Xu;Xu|=4;try{Y=su=!1,Eu(t,e,n),n=cp;var o=Gr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Wr(s.ownerDocument.documentElement,s)){if(c!==null&&Kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ur(s,h),v=Ur(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Xu=a,R.p=i,L.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Xu;Xu|=4;try{du(e,t.alternate,t)}finally{Xu=i,R.p=r,L.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ie();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=ht(bd),r=L.T,i=R.p;try{R.p=32>n?32:n,L.T=null,n=Sd,Sd=null;var a=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Xu&6)throw Error(o(331));var c=Xu;if(Xu|=4,Gu(a.current),Lu(a,a.current,s,n),Xu=c,Ef(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,a)}catch{}return!0}finally{R.p=i,L.T=r,cf(e,t)}}function df(e,t,n){t=Bi(n,t),t=Tc(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(lt(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Bi(n,e),n=Ec(2),r=ho(t,n,2),r!==null&&(Dc(n,r,t,e),lt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&(Z&n)===n&&(rd===4||rd===3&&(Z&62914560)===Z&&300>Le()-fd?Xu&2?od|=n:zd(e,0):od|=n,cd===Z&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=st()),e=Ti(e,t),e!==null&&(lt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Ne(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Z,a=rt(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Le(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=Z,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Af.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Z;return r=rt(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){Xu&6?Ne(ze,Df):Of()})}function Nf(){if(wf===0){var e=Ia;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:hn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<fi.length;If++){var Lf=fi[If];pi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}pi(ii,`onAnimationEnd`),pi(ai,`onAnimationIteration`),pi(oi,`onAnimationStart`),pi(`dblclick`,`onDoubleClick`),pi(`focusin`,`onFocus`),pi(`focusout`,`onBlur`),pi(si,`onTransitionRun`),pi(ci,`onTransitionStart`),pi(li,`onTransitionCancel`),pi(ui,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[St];n===void 0&&(n=t[St]=/* @__PURE__ */ new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!En||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=kt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Cn(function(){var r=a,i=vn(n),o=[];a:{var s=di.get(e);if(s!==void 0){var c=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:c=tr;break;case`focusin`:u=`focus`,c=Kn;break;case`focusout`:u=`blur`,c=Kn;break;case`beforeblur`:case`afterblur`:c=Kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=ir;break;case ii:case ai:case oi:c=qn;break;case ui:c=ar;break;case`scroll`:case`scrollend`:c=zn;break;case`wheel`:c=or;break;case`copy`:case`cut`:case`paste`:c=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=nr;break;case`submit`:c=rr;break;case`toggle`:case`beforetoggle`:c=sr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=wn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==_n&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?kt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=nr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:jt(s),h=c==null?u:jt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,Jf):null,s!==null&&Yf(o,u,s,d,!1),c!==null&&f!==null&&Yf(o,f,c,d,!0)))}a:{if(s=r?jt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Dr;else if(xr(s)){if(Or)_=Lr;else{_=Fr;var v=Pr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&fn(r.elementType)&&(_=Dr):_=Ir;if(_&&=_(e,r)){Sr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?jt(r):window,e){case`focusin`:(xr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(o,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(o,n,i)}var y;if(lr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else _r?hr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(fr&&n.locale!==`ko`&&(_r||b!==`onCompositionStart`?b===`onCompositionEnd`&&_r&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,_r=!0)),v=qf(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=gr(n),y!==null&&(b.data=y)))),(y=dr?vr(e,n):yr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=wn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=wn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=wn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=wn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
- `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:dn(e,r,a);return;case`data`:if(t!==`object`){Kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=hn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=pn.get(n)||n,Gt(e,n,r);else return}Ut=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:dn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}Ut=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}Ut=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,a,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:ep(e,t,r,d,n,null)}}nn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&an(e,!!r,n,!0):an(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:ep(e,t,s,c,n,null)}sn(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ut=!0),a=m;break;case`name`:m!==f&&(Ut=!0),i=m;break;case`checked`:m!==f&&(Ut=!0),u=m;break;case`defaultChecked`:m!==f&&(Ut=!0),d=m;break;case`value`:m!==f&&(Ut=!0),s=m;break;case`defaultValue`:m!==f&&(Ut=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}tn(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ep(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(Ut=!0),p=a;break;case`defaultValue`:a!==l&&(Ut=!0),c=a;break;case`multiple`:a!==l&&(Ut=!0),s=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?an(e,!!n,n?[]:``,!1):an(e,!!n,t,!0)):an(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(Ut=!0),p=i;break;case`defaultValue`:i!==a&&(Ut=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&ep(e,t,s,i,r,a)}on(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ut=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[yt]=r,n[bt]=t,np(n,e,t),Nt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=/* @__PURE__ */ new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=/* @__PURE__ */ new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),Ot(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var vm=/* @__PURE__ */ new Map,ym=/* @__PURE__ */ new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=R.d;R.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=en(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+en(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+en(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+en(n.imageSizes)+`"]`)):i+=`[href="`+en(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+en(r)+`"][href="`+en(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Mt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Nt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=xe.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Mt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Mt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Mt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+en(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),np(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+en(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+en(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Nt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Nt(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Nt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=/* @__PURE__ */ new Map,i=Wm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=/* @__PURE__ */ new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=/* @__PURE__ */ new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=/* @__PURE__ */ new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */ new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=/* @__PURE__ */ new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function uh(e){return e?(e=Oi,e):Oi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Md(n,e,t),go(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=mt(t);var n=Ti(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Xu&6)&&(md=Le()+500,Ef(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=vn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=kt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=/* @__PURE__ */ new Map,kh=/* @__PURE__ */ new Map,Ah=[],jh=`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`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=kt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_n=r,n.target.dispatchEvent(r),_n=null}else return t=At(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[xt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=i.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));R.findDOMNode=function(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=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ke=Jh.inject(qh),qe=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=bc,a=xc,s=Sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,s,Uh),e[xt]=t.current,Uf(e),new Wh(t)}})),Se=/* @__PURE__ */ t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xe()})),B=/* @__PURE__ */ e(n(),1),V=a(),Ce=B.createContext(void 0),we=e=>{let t=B.useContext(Ce);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Te=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */ (0,V.jsx)(Ce.Provider,{value:e,children:t})),Ee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},De=new class{#e=Ee;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Oe(e){setTimeout(e,0)}var ke=typeof window>`u`||`Deno`in globalThis;function Ae(){}function je(e,t){return typeof e==`function`?e(t):e}function Me(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ne(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pe(e,t){return typeof e==`function`?e(t):e}function Fe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Le(o,t.options))return!1}else if(!ze(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ie(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Re(t.options.mutationKey)!==Re(a))return!1}else if(!ze(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Le(e,t){return(t?.queryKeyHashFn||Re)(e)}function Re(e){return JSON.stringify(e,(e,t)=>We(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ze(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ze(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ze(e[r],t[r]))return!1;return!0}return!1}var Be=Object.prototype.hasOwnProperty;function Ve(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ue(e)&&Ue(t);if(!r&&!(We(e)&&We(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Be.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ve(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function He(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function We(e){if(!Ge(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Ge(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Ge(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ke(e){return new Promise(t=>{De.setTimeout(t,e)})}function qe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ve(e,t)}function Je(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ye(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xe=Symbol();function Ze(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xe?()=>Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qe(e,t){return typeof e==`function`?e(...t):!!e}function $e(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var et=()=>ke,tt=()=>et(),nt=class{constructor(){this.listeners=/* @__PURE__ */ new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rt=new class extends nt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},it=Oe;function at(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=it,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ot=at(),st=new class extends nt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ct(e){return Math.min(1e3*2**e,3e4)}function lt(e){return(e??`online`)!==`online`||st.isOnline()}var ut=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function dt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Ae);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ut(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>rt.isFocused()&&(e.networkMode===`always`||st.isOnline())&&e.canRun(),p=()=>lt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(tt()?0:3),a=e.retryDelay??ct,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Ke(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var ft=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Me(this.gcTime)&&(this.#e=De.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tt()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(De.clearTimeout(this.#e),this.#e=void 0)}};function pt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{$e(e,()=>t.signal,()=>n=!0)},u=Ze(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ye:Je;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ht:mt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:mt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function mt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ht(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var gt=class extends ft{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=yt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=yt(this.options);e.data!==void 0&&(this.setState(vt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=qe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Pe(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ne(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ze(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?pt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=dt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ut&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ut){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,..._t(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...vt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ot.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function _t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function vt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function yt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var bt=class extends nt{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=/* @__PURE__ */ new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),St(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ct(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ct(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Pe(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!He(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&wt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||Pe(this.options.staleTime,this.#t)!==Pe(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ae)),t}#h(e){return!tt()&&Pe(this.options.enabled,this.#t)!==!1&&Me(e)}#g(){this.#b();let e=Pe(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ne(this.#r.dataUpdatedAt,e)+1;this.#u=De.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Pe(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=De.setInterval(()=>{(this.options.refetchIntervalInBackground||rt.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(De.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(De.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&St(e,t),o=i&&wt(e,n,t,r);(a||o)&&(l={...l,..._t(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=qe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=qe(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Tt(e,t),refetch:this.refetch,isEnabled:Pe(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),He(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ot.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function xt(e,t){return Pe(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Pe(t.retryOnMount,e)!==!1)}function St(e,t){return xt(e,t)||e.state.data!==void 0&&Ct(e,t,t.refetchOnMount)}function Ct(e,t,n){if(Pe(t.enabled,e)!==!1&&Pe(t.staleTime,e)!==`static`){let r=Pe(n,e);return r===`always`||r!==!1&&Tt(e,t)}return!1}function wt(e,t,n,r){return(e!==t||Pe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Tt(e,n)}function Tt(e,t){return Pe(t.enabled,e)!==!1&&e.isStaleByTime(Pe(t.staleTime,e))}var Et=class extends ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Dt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=dt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(/* @__PURE__ */ Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ot.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Dt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ot=class extends nt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Set,this.#t=/* @__PURE__ */ new Map,this.#n=0}build(e,t,n){let r=new Et({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ot.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ie(t,e))}findAll(e={}){return this.getAll().filter(t=>Ie(e,t))}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ot.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ae))))}};function kt(e){return e.options.scope?.id}var At=class extends nt{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),He(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Re(t.mutationKey)!==Re(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Dt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ot.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function jt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Mt=class extends nt{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ot.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!He(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(jt(e,n).forEach(e=>{e.destroy()}),jt(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=/* @__PURE__ */ new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ve(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=/* @__PURE__ */ new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new bt(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ot.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Nt=class extends nt{#e;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Le(r,t),a=this.get(i);return a||(a=new gt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ot.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Fe(e,t)):t}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Nt,this.#t=e.mutationCache||new Ot,this.#n=e.defaultOptions||{},this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=rt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=st.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Pe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=je(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ot.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ot.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ot.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return ot.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ae)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ae)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Pe(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Pe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return st.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Re(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ze(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Re(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ze(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Le(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Xe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ft=B.createContext(!1),It=()=>B.useContext(Ft);Ft.Provider;function Lt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rt=B.createContext(Lt()),zt=()=>B.useContext(Rt),Bt=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Qe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Vt=e=>{B.useEffect(()=>{e.clearReset()},[e])},Ht=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Qe(n,[e.error,r])),Ut=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Wt=(e,t)=>e?.suspense&&t.isPending,Gt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Kt({queries:e,...t},n){let r=we(n),i=It(),a=zt(),o=t.subscribed!==!1,s=B.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Ut(e);let t=r.getQueryCache().get(e.queryHash);Bt(e,a,t)}),Vt(a);let[c]=B.useState(()=>new Mt(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;B.useSyncExternalStore(B.useCallback(e=>f?c.subscribe(ot.batchCalls(e)):Ae,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),B.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Wt(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Wt(n,e)?Gt(n,new bt(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Ht({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function qt(e,t,n){let r=It(),i=zt(),a=we(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ut(o),Bt(o,i,s),Vt(i);let[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(ot.batchCalls(e)):Ae;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),Wt(o,u))throw Gt(o,l,i);if(Ht({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Jt(e,t){return qt(e,bt,t)}function Yt(e,t){let n=we(t),[r]=B.useState(()=>new At(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe(ot.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ae)},[r]);if(i.error&&Qe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Xt=Object.defineProperty,Zt=(e,t)=>Xt(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
10
- function Qt(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),o=/* @__PURE__ */ Zt(e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ (0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=C(t,i.collectionRef);return/* @__PURE__ */ (0,V.jsx)(u,{ref:o,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=l(f),h=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=C(t,o),c=a(f,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),/* @__PURE__ */ (0,V.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Zt(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},g,r]}Zt(Qt,`createCollection`);var $t=/* @__PURE__ */ new WeakMap,en=class e extends Map{static{Zt(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],$t.set(this,!0)}set(e,t){return $t.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=rn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=tn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=tn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return tn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function tn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=nn(e,t);return n===-1?void 0:e[n]}Zt(tn,`at`);function nn(e,t){let n=e.length,r=rn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Zt(nn,`toSafeIndex`);function rn(e){return e!==e||e===0?0:Math.trunc(e)}Zt(rn,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
11
- function an(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ Zt(({state:e,...t})=>e?/* @__PURE__ */ (0,V.jsx)(p,{...t,state:e}):/* @__PURE__ */ (0,V.jsx)(d,{...t}),`CollectionProvider`);u.displayName=t;let d=/* @__PURE__ */ Zt(e=>{let t=b();return/* @__PURE__ */ (0,V.jsx)(p,{...e,state:t})},`CollectionInit`);d.displayName=e+`CollectionInit`;let p=/* @__PURE__ */ Zt(e=>{let{scope:t,children:n,state:r}=e,a=B.useRef(null),[s,c]=B.useState(null),l=C(a,c),[u,d]=r,f=B.useRef(new en),p=B.useCallback(()=>{let e=f.current;return cn(e)||e.sort(ln),e},[]);return B.useEffect(()=>{if(!s)return;let e=un(()=>{d(e=>{let t=e.toSorted(ln);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),/* @__PURE__ */ (0,V.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:/* @__PURE__ */ (0,V.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);p.displayName=e+`CollectionProviderImpl`;let m=e+`CollectionSlot`,h=l(m),g=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(m,n),o=C(t,i.collectionElementRef);return/* @__PURE__ */ (0,V.jsx)(h,{ref:o,children:r})});g.displayName=m;let _=e+`CollectionItemSlot`,v=l(_),y=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),{setCollection:s,registryRef:c}=a(_,n),l=B.useRef(i);on(l.current,i)||(l.current=i);let u=l.current,d=B.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),p=C(t,d,o);f(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let m=B.useRef(null);return B.useEffect(()=>{let e=o.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(m.current=e?{element:e,itemData:u}:null,s(n=>{let r=new en(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(ln)}))}),B.useEffect(()=>()=>{let e=m.current;m.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new en(t);return n.delete(e.element),n})},[s]),/* @__PURE__ */ (0,V.jsx)(v,{"data-radix-collection-item":``,ref:p,children:r})});y.displayName=_;function b(){return B.useState(new en)}Zt(b,`useInitCollection`);function x(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Zt(x,`useCollection`);function S(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Zt(S,`useGetCollection`),[{Provider:u,Slot:g,ItemSlot:y},{createCollectionScope:r,useCollection:x,useGetCollection:S,useInitCollection:b}]}Zt(an,`createCollection`);function on(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Zt(on,`shallowEqual`);function sn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Zt(sn,`isElementPreceding`);function cn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Zt(cn,`isInDocumentOrder`);function ln(e,t){return!e[1].element||!t[1].element?0:sn(e[1].element,t[1].element)?-1:1}Zt(ln,`sortByDocumentPosition`);function un(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Zt(un,`getChildListObserver`);var dn=Object.defineProperty,fn=(e,t)=>dn(e,`name`,{value:t,configurable:!0}),pn={LTR:`ltr`,RTL:`rtl`},mn=B.createContext(void 0);function hn(e){let t=B.useContext(mn);return e||t||pn.LTR}fn(hn,`useDirection`);var gn=/* @__PURE__ */ e(s(),1),_n=/* @__PURE__ */ e(Se(),1),vn=Object.defineProperty,yn=(e,t)=>vn(e,`name`,{value:t,configurable:!0}),bn=0,xn=null;function Sn(e){return Cn(),e.children}yn(Sn,`FocusGuards`);function Cn(){B.useEffect(()=>{xn||={start:wn(),end:wn()};let{start:e,end:t}=xn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),bn++,()=>{bn===1&&(xn?.start.remove(),xn?.end.remove(),xn=null),bn=Math.max(0,bn-1)}},[])}yn(Cn,`useFocusGuards`);function wn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}yn(wn,`createFocusGuard`);var Tn=function(){return Tn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tn.apply(this,arguments)};function En(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Dn(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var On=`right-scroll-bar-position`,kn=`width-before-scroll-bar`,An=`with-scroll-bars-hidden`,jn=`--removed-body-scroll-bar-size`;function Mn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Nn(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Pn=typeof window<`u`?B.useLayoutEffect:B.useEffect,Fn=/* @__PURE__ */ new WeakMap;function In(e,t){var n=Nn(t||null,function(t){return e.forEach(function(e){return Mn(e,t)})});return Pn(function(){var t=Fn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Mn(e,null)}),i.forEach(function(e){r.has(e)||Mn(e,a)})}Fn.set(n,e)},[e]),n}function Ln(e){return e}function Rn(e,t){t===void 0&&(t=Ln);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function zn(e){e===void 0&&(e={});var t=Rn(null);return t.options=Tn({async:!0,ssr:!1},e),t}var Bn=function(e){var t=e.sideCar,n=En(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,Tn({},n))};Bn.isSideCarExport=!0;function Vn(e,t){return e.useMedium(t),Bn}var Hn=zn(),Un=function(){},Wn=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:Un,onWheelCapture:Un,onTouchMoveCapture:Un}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=En(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=In([n,t]),C=Tn(Tn({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:Hn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),Tn(Tn({},C),{ref:S})):B.createElement(v,Tn({},C,{className:c,ref:S}),s))});Wn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wn.classNames={fullWidth:kn,zeroRight:On};var Gn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Kn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Gn();return t&&e.setAttribute(`nonce`,t),e}function qn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Yn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Kn())&&(qn(t,n),Jn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xn=function(){var e=Yn();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zn=function(){var e=Xn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qn={left:0,top:0,right:0,gap:0},$n=function(e){return parseInt(e||``,10)||0},er=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[$n(n),$n(r),$n(i)]},tr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qn;var t=er(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nr=Zn(),rr=`data-scroll-locked`,ir=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
- .${An} {
8
+ `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function _t(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[yt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=/* @__PURE__ */ new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[: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]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var H=!1;function Ut(){var e=H;return H=!1,e}function Wt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(pe(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,H=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(ln(e,i,r),H=!0)}else for(var a in t)t.hasOwnProperty(a)&&ln(e,a,t[a])}function dn(e){if(e.indexOf(`-`)===-1)return!1;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 fn=/* @__PURE__ */ new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),pn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[bt]||null;if(!i)throw Error(o(90));en(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Ld(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(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 Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,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!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(D({},Hn,{dataTransfer:0})),Gn=Pn(D({},Ln,{relatedTarget:0})),Kn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(D({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={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`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(D({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(D({},Fn,{submitter:0})),rr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(D({},Hn,{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})),or=Pn(D({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!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 dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={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 br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Bf(e,0)}function Tr(e){if(Zt(jt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Br(e.document)}return t}function Gr(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`)}var Kr=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yr&&zr(Yr,r)||(Yr=r,r=qf(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=/* @__PURE__ */ new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),Lt(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Dd)throw Dd=0,Od=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Mi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ni(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=ki(31,n,t,i),e.elementType=ie,e.lanes=a,e;case j:return Pi(n.children,i,a,t);case M:s=8,i|=24;break;case N:return e=ki(12,n,t,i|2),e.elementType=N,e.lanes=a,e;case ee:return e=ki(13,n,t,i),e.elementType=ee,e.lanes=a,e;case te:return e=ki(19,n,t,i),e.elementType=te,e.lanes=a,e;case ae:case se:return e=i|32,e=ki(30,n,t,e),e.elementType=se,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=/* @__PURE__ */ new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,U=1,qi=``;function Ji(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Yi(e,t,n){Wi[Gi++]=U,Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e;var r=U;e=qi;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,U=1<<32-Ye(t)+i|n<<i|r,qi=a+e}else U=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null,U=Wi[--Gi],Wi[Gi]=null}function Qi(e,t){Wi[Gi++]=U,Wi[Gi++]=qi,Wi[Gi++]=Ki,U=t.id,qi=t.overflow,Ki=e}var $i=null,ea=null,W=!1,ta=null,na=!1,ra=Error(o(519));function ia(e){throw ua(zi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:$i=$i.return}}function sa(e){if(e!==$i)return!1;if(!W)return oa(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ea&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ea=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ea=dm(e)}else t===27?(t=ea,Sp(e.type)?(e=um,um=null,ea=e):ea=t):ea=$i?lm(e.stateNode.nextSibling):null;return!0}function ca(){ea=$i=null,W=!1}function la(){var e=ta;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=_e(null),fa=null,pa=null;function ma(e,t,n){z(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ve(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ga(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ga(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ga(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function va(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Rr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Se.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(o(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:/* @__PURE__ */ new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Nf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=L.S;L.S=function(e,t){if(pd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=yf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=_e(null);function Ha(){var e=Va.current;return e===null?Zu.pooledCache:e}function Ua(e,t){t===null?z(Va,Va.current):z(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(o(460)),Ka=Error(o(474)),qa=Error(o(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(o(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(o(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=/* @__PURE__ */ new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ji(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Fi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===re&&Za(a)===t.type)?(t=i(t,n.props),io(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Li(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Pi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ni(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Li(t,e.mode,n),t.return=e,t;case re:return t=Za(t),f(e,t,n)}if(pe(t)||ue(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case re:return n=Za(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Za(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return W&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ji(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),W&&Ji(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Ji(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),W&&Ji(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),io(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Za(l)===r.type){n(e,r.sibling),c=i(r,a.props),io(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Pi(a.props.children,e.mode,c,a.key),io(c,a),c.return=e,e=c):(c=Ni(a.type,a.key,a.props,null,e.mode,c),io(c,a),c.return=e,e=c)}return s(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Li(a,e.mode,c),c.return=e,e=c}return s(e);case re:return a=Za(a),_(e,r,a,c)}if(pe(a))return h(e,r,a,c);if(ue(a)){if(l=ue(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,ro(a),c);if(a.$$typeof===F)return _(e,r,Sa(e,a),c);ao(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Fi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=_e(null),Co=_e(0);function wo(e,t){e=nd,z(Co,e),z(So,t),nd=e|t.baseLanes}function To(){z(Co,nd),z(So,So.current)}function Eo(){nd=Co.current,ve(So),ve(Co)}var Do=_e(null),Oo=null;function ko(e){var t=e.alternate;z(No,No.current&1),z(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){z(No,No.current),z(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(z(No,No.current),z(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){z(No,No.current),z(Do,Do.current)}function G(e){ve(Do),Oo===e&&(Oo=null),ve(No)}var No=_e(0);function Po(e,t){z(Do,Do.current),z(No,t)}function Fo(e){ve(No),ve(Do),Oo===e&&(Oo=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)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 Lo=0,K=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(o(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?dc:fc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){L.H=uc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=K=null,Bo=!1,Wo=0,Go=null,t)throw Error(o(300));e===null||kc||(e=e.dependencies,e!==null&&ya(e)&&(kc=!0))}function Zo(e,t,n,r){K=e;var i=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=i)throw Error(o(301));if(i+=1,zo=Ro=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}L.H=pc,a=t(n,r)}while(Vo);return a}function Qo(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(K.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=K=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?K.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?K.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw K.alternate===null?Error(o(467)):Error(o(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?K.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Xa(Go,e,t),t=K,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?dc:fc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===ce)return;if(e.$$typeof===F)return xa(e)}throw Error(o(438,String(e)))}function ss(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=is(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=oe;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,K.lanes|=p,id|=p;f=u.action,Ho&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,K.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Rr(a,e.memoizedState)&&(kc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ds(e){var t=rs(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Rr(a,t.memoizedState)||(kc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fs(e,t,n){var r=K,i=rs(),a=W;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Rr((Ro||i).memoizedState,n);if(s&&(i.memoizedState=n,kc=!0),i=i.queue,Is(hs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(o(349));a||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=is(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function _s(e){var t=wi(e,2);t!==null&&Md(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,i){if(sc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};L.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,xs(t,a)):(a.next=n.next,t.pending=n.next=a)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(W){var n=Zu.formState;if(n!==null){a:{var r=K;if(W){if(ea){b:{for(var i=ea,a=na;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=lm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ic.bind(null,K,r),r.dispatch=n,r=vs(!1),a=oc.bind(null,K,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Ga?qa:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=is(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();K.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(K.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function q(e,t){Ps(8390656,8,e,t)}function Is(e,t){Fs(2048,8,e,t)}function Ls(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=is(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=rs().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Xu&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Fs(4,2,e,t)}function Bs(e,t){return Fs(4,4,e,t)}function Vs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hs(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Lo&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),K.lanes|=e,id|=e,n)}function qs(e,t,n,r){return Rr(n,t)?n:So.current===null?!(Lo&106)||Lo&1073741824&&!(Z&261930)?(kc=!0,e.memoizedState=n):(e=Ad(),K.lanes|=e,id|=e,t):(e=Ks(e,n,r),Rr(e,t)||(kc=!0),e)}function Js(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,oc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,za(c,r),kd(e)):ac(e,t,r,kd(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Zs(e).queue;Js(e,i,t,me,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},kd())}function $s(){return xa(sh)}function ec(){return rs().memoizedState}function tc(){return rs().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=po(n);var r=mo(t,e,n);r!==null&&(Md(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=Ci(e,t,n,r),n!==null&&(Md(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,kd())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Rr(s,o))return Si(e,t,i,0),Zu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Md(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(o(479))}else t=Ci(e,n,r,2),t!==null&&Md(t,e,2)}function sc(e){var t=e.alternate;return e===K||t!==null&&t===K}function cc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var uc={readContext:xa,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},dc={readContext:xa,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:q,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=rc.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ic.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Js.bind(null,K,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,i=ns();if(W){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Zu===null)throw Error(o(349));Z&127||ps(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,q(hs.bind(null,r,a,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,a,n,t),null),n},useId:function(){var e=ns(),t=Zu.identifierPrefix;if(W){var n=qi,r=U;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=nc.bind(null,K)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(Xu&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:xa,use:os,useCallback:Ws,useContext:xa,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:xa,use:os,useCallback:Ws,useContext:xa,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Us,useDeferredValue:function(e,t){var n=rs();return Ro===null?Ks(n,e,t):qs(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:ec,useHostTransitionStatus:$s,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Md(t,e,n),ho(t,e,n))}};function gc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!zr(n,r)||!zr(i,a):!0}function _c(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hc.enqueueReplaceState(t,t.state,null)}function vc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){_i(e)}function bc(e){console.error(e)}function xc(e){_i(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=po(e),e.tag=3,e}function Ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(gd===null?gd=/* @__PURE__ */ new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,i,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),pf(e,r,i)),!1}throw Error(o(435,n.tag))}return pf(e,r,i),Wd(),!1}if(W)return t=Do.current,t===null?(r!==ra&&(t=Error(o(423),{cause:r}),ua(zi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=zi(r,n),i=wc(e.stateNode,r,i),go(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ra&&(e=Error(o(422),{cause:r}),ua(zi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=zi(a,n),ld===null?ld=[a]:ld.push(a),rd!==4&&(rd=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=wc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(gd===null||!gd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Tc(i),Ec(i,e,n,r),go(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(o(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function jc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!kc?(es(e,t,i),al(e,t,i)):(W&&s&&Xi(t),t.flags|=1,Ac(e,t,r,i),t.child)}function Mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Nc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ol(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return al(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,ol(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,al(e,t,i)}}return Vc(e,t,n,r,i)}function Pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ic(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Lc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rc(e,t,n){return so(t,e.child,null,n),e=Lc(t,t.pendingProps),e.flags|=2,G(t),t.memoizedState=null,e}function zc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=Lc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fc(null,e);if(Ao(t),(e=ea)?(e=am(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:U,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Lc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Ao(t),i){if(t.flags&256)t.flags&=-257,t=Rc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(kc||va(e,t,n,!1),i=(n&e.childLanes)!==0,kc||i){if(So.current===null){if(r=Zu,r!==null&&(s=pt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,wi(e,s),Md(r,e,s),Oc;Wd()}t=Rc(e,t,n)}else e=a.treeContext,ea=lm(s.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Lc(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vc(e,t,n,r,i){return ba(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!kc?(es(e,t,i),al(e,t,i)):(W&&r&&Xi(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Hc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!kc?(es(e,t,a),al(e,t,a)):(W&&r&&Xi(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Uc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&hc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&_c(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=lo||gc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&_c(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=lo||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Bc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=al(e,t,i),e}function Wc(e,t,n,r){return ca(),t.flags|=256,Ac(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wa()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(W){if(i?ko(t):Mo(),(e=ea)?(e=am(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:U,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(null,r)):(ko(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Qc(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Fc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ji(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function Zc(e,t,n){return so(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qc(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,Zc(e,t,c)):t.memoizedState===null?(Mo(),a=i.fallback,s=t.mode,i=Xc({mode:`visible`,children:i.children},s),a=Pi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,so(t,e.child,null,c),i=t.child,i.memoizedState=Kc(c),i.childLanes=qc(e,r,c),t.memoizedState=Gc,Fc(null,i)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,ua({value:i,source:null,stack:null})),Zc(e,t,c)}if(kc||va(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(So.current!==null)return Zc(e,t,c);if(r=Zu,r!==null&&(i=pt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,wi(e,i),Md(r,e,i),Oc;return om(a)||Wd(),Zc(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=lm(a.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Yc(t,i.children),t.flags|=134221824,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function el(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function tl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function nl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function rl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(nl(e),Ac(e,t,r,n),nl(e)):Ac(e,t,r,n),r=W?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$c(e,n,t);else if(e.tag===19)$c(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,nl(t)),tl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tl(t,!0,n,null,a,r);break;case`together`:tl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tl(t,!1,i,n,a,r)}return t.child}function il(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function al(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ol(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function sl(e,t,n){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ce(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(ko(t),e=al(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return rl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return rl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Pc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return al(e,t,n)}function cl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!ol(e,n)&&!(t.flags&128))return kc=!1,sl(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,W&&t.flags&1048576&&Yi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=vc(e,r),t.tag=1,t=Uc(null,t,e,r,n)):(t.tag=0,t=Vc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===I){t.tag=11,t=jc(null,t,e,r,n);break a}if(i===ne){t.tag=14,t=Mc(null,t,e,r,n);break a}if(i===F){t.tag=10,t.type=e,t=il(null,t,n);break a}}throw t=fe(e)||e,Error(o(306,t,``))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=vc(r,t.pendingProps),Uc(e,t,r,i,n);case 3:a:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0),vo(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Wc(e,t,r,n);break a}if(r!==i){i=zi(Error(o(424)),t),ua(i),t=Wc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=lm(e.firstChild),$i=t,W=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===i){t=al(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return Bc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(t.stateNode=fp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&W&&(r=t.stateNode=hm(t.type,t.pendingProps,xe.current),$i=t,na=!0,i=ea,Sp(t.type)?(um=i,ea=lm(r.firstChild)):ea=i),Ac(e,t,t.pendingProps.children,n),Bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((i=r=ea)&&(r=rm(r,t.type,t.pendingProps,na),r===null?i=!1:(t.stateNode=r,$i=t,ea=lm(r.firstChild),na=!1,i=!0)),i||ia(t)),Ce(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Yo(e,t,Qo,null,null,n),sh._currentValue=i),Bc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ea)&&(n=im(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||ia(t)),null;case 13:return Jc(e,t,n);case 4:return B(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Bc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return il(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ba(t),i=xa(i),r=r(i),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return Mc(e,t,t.type,t.pendingProps,n);case 15:return Nc(e,t,t.type,t.pendingProps,n);case 19:return rl(e,t,n);case 31:return zc(e,t,n);case 22:return Pc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(i=Ha(),i===null&&(i=Zu,a=Oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},uo(t),ma(t,Da,i)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ma(t,Da,r),r!==i.cache&&_a(t,[Da],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ma(t,Da,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:W&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Bc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ll(e){e.flags|=4}function ul(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,cd|=t)}function pl(e,t){if(!W)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ml(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),V(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),ml(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(ll(t),a===null?(ml(t),ul(t,i,null,r,n)):(ml(t),dl(t,a))):a?a===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,a)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,i,e,r,n)),null;case 27:if(we(t),n=xe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}e=ye.current,sa(t)?aa(t,e):(e=hm(i,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}if(a=ye.current,sa(t))aa(t,a);else{var s=lp(xe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[yt]=t,a[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=xe.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=$i,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ia(t,!0)}else e=lp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(G(t),t):(G(t),null);if(t.flags&128)throw Error(o(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),i=!1}else i=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(G(t),t):(G(t),null)}return G(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fl(t,t.updateQueue),ml(t),null);case 4:return V(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return ha(t.type),ml(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return ml(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)pl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Io(e),a!==null){for(t.flags|=128,pl(r,!1),e=a.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Po(t,No.current&1|2),W&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>md&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Io(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!W)return ml(t),null}else 2*Le()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,a=No.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||W?Po(t,a):(n=a,z(Do,t),z(No,n),Oo===null&&(Oo=t)),W&&Ji(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return G(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ve(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(o(156,t.tag))}function gl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),V(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(G(t),t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(G(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return V(),null;case 10:return ha(t.type),null;case 22:case 23:return G(t),Eo(),e!==null&&ve(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function _l(e,t){switch(Zi(t),t.tag){case 3:ha(Da),V();break;case 26:case 27:case 5:we(t);break;case 4:V();break;case 31:t.memoizedState!==null&&G(t);break;case 13:G(t);break;case 19:Fo(t);break;case 10:ha(t.type);break;case 22:case 23:G(t),Eo(),e!==null&&ve(Va);break;case 24:ha(Da)}}function vl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function yl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function bl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){ff(e,e.return,t)}}}function xl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function Sl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function wl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&em(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&tm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[bt]=t}catch(t){ff(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(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.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),wl(e,r),H=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),H=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[yt]=e,t[bt]=n}catch(t){ff(e,e.return,t)}}var Il=!1,J=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Il=!0,Tp(o,Bl===0?t:t+`_`+Bl,n),Bl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ul(e.child,t),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||jd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(J!==null&&J.size!==0){var t=J;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=J===null?void 0:J.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,J.delete(n),jd(e,t.onShare)):Ul(e.child,!1)),J!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else J!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,Y=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Wr(e),Gr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),uu(n))}}J=null}function uu(e){for(;au!==null;){var t=au,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=vc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=gi(i.default,i.update),i!==`none`&&Vl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&vl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&bl(n),r&512&&Sl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:ju(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),eu=t,tu=i}break;case 30:ju(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,H=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:tu||Cl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Cl(n,t),El(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:tu||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),H=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),H=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),tu||yl(4,n,t),vu(e,t,n);break;case 1:tu||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&xl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,vu(e,t,n),tu=r;break;case 30:Cl(n,t),vu(e,t,n);break;case 7:tu||Cl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(o(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(o(160));yu(s,c,a),gu=null,_u=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),i&4&&(yl(3,e,e.return),vl(3,e),yl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),i&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Tu,wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else eu||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):i.count--,n===null?eu||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(tu||r===null||Cl(r,r.return)),r!==null&&i&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=nu,nu=!1,wu(t,e,n),nu=a,Du(e),i&512&&(tu||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),H=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),i&1024&&(ru=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,H=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(H=!1,Wm=null,a=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}ru&&(ru=!1,Ou(e)),H=!1;break;case 4:i=nu,nu=eu,r=Ut(),a=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,H&&Y&&(su=!0),H=r,nu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Le()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||a,nu=u||a,tu=l||s,wu(t,e,n),tu=l,nu=u,eu=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=a||eu,tu=t,Mu(e,2),eu=n,tu=r),!a&&nu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(tu||r===null||Cl(r,r.return)),i=Ut(),a=Y,s=(n&335544064)===n,c=e.memoizedProps,Y=s&&gi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&H&&(e.flags|=4),Y=a,H=i;break;case 21:break;case 7:i&512&&(tu||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ol(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Dl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(o(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else $l(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(cu=ou=!1,zl(),ku(t,e),!ou&&!su){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}Rl=null;break;case 5:ku(t,e);break;case 4:r=ou,ou=!1,ku(t,e),ou&&(su=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,ku(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:yl(4,n,n.return),Mu(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&xl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),Mu(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:Cl(n,n.return),Mu(n,r);break;case 7:Cl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),vl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&bl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),Sl(a,a.return);break;case 30:Nu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&vl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,J===null&&(J=/* @__PURE__ */ new Map),J.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&yl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:yl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(hu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Ju={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,Xu=0,Zu=null,X=null,Z=0,Qu=0,Q=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Xu&2&&Z!==0?Z&-Z:L.T===null?gt():Nf()}function Ad(){if(sd===0){if(!(Z&536870912)||W){var e=et;et<<=1,!(et&3932160)&&(et=262144),sd=e}else sd=536870912}return e=Do.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(mi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Zu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Z,sd,!1)),lt(e,n),Xu&2&&e===Zu||(e===Zu&&(!(Xu&2)&&(ad|=n),rd===4&&Id(e,Z,sd,!1)),Tf(e))}function Nd(e,t,n){if(Xu&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),i=r?qd(e,t):Gd(e,t,!0),a=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,a&&!Fd(n))i=Gd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=a,ad|=a,i=4;break a}a=ud,ud=i,a!==null&&(ud===null?ud=a:ud.push.apply(ud,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){zd(e,0),Id(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=fd+300-Le(),10<i)){if(Id(r,t,sd,!$u),rt(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,a,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,a,null,-0,0)}break}}while(1);Tf(e)}function Pd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},J=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Le():(a&4194048)===a?pd-Le():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Rr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Id(e,t,n,r){t=at(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ld(){return Xu&6?!0:(Ef(0,!1),!1)}function Rd(){if(X!==null){if(Qu===0)var e=X.return;else e=X,pa=fa=null,ts(e),to=null,no=0,e=X;for(;e!==null;)_l(e.alternate,e),e=e.return;X=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Zu=e,X=n=ji(e.current,null),Z=t,Qu=0,Q=null,$u=!1,ed=it(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=at(e,t),xi(),n}function Bd(e,t){K=null,L.H=uc,t===Ga||t===qa?(t=$a(),Qu=3):t===Ka?(t=$a(),Qu=4):Qu=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Q=t,X===null&&(rd=1,Sc(e,zi(t,e.current)))}function Vd(){var e=Do.current;return e===null?!0:(Z&4194048)===Z?Oo===null:(Z&62914560)===Z||Z&536870912?e===Oo:!1}function Hd(){var e=L.H;return L.H=uc,e===null?uc:e}function Ud(){var e=L.A;return L.A=Ju,e}function Wd(){rd=4,$u||(Z&4194048)!==Z&&Do.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Zu===null||Id(Zu,Z,sd,!1)}function Gd(e,t,n){var r=Xu;Xu|=2;var i=Hd(),a=Ud();(Zu!==e||Z!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Qu!==0&&X!==null){var s=X,c=Q;switch(Qu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=Qu;if(Qu=0,Q=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Qu,Qu=0,Q=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Xu=r,L.H=i,L.A=a,X===null&&(Zu=null,Z=0,xi()),o}function Kd(){for(;X!==null;)Yd(X)}function qd(e,t){var n=Xu;Xu|=2;var r=Hd(),i=Ud();Zu!==e||Z!==t?(hd=null,md=Le()+500,zd(e,t)):ed=it(e,t);a:do try{if(Qu!==0&&X!==null){t=X;var a=Q;b:switch(Qu){case 1:Qu=0,Q=null,Zd(e,t,a,1);break;case 2:case 9:if(Ya(a)){Qu=0,Q=null,Xd(t);break}t=function(){Qu!==2&&Qu!==9||Zu!==e||(Qu=7),Tf(e)},a.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Ya(a)?(Qu=0,Q=null,Xd(t)):(Qu=0,Q=null,Zd(e,t,a,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Ym(s):c.stateNode.complete){Qu=0,Q=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Qd(u))}break b}}Qu=0,Q=null,Zd(e,t,a,5);break;case 6:Qu=0,Q=null,Zd(e,t,a,6);break;case 8:Rd(),rd=6;break a;default:throw Error(o(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return pa=fa=null,L.H=r,L.A=i,Xu=n,X===null?(Zu=null,Z=0,xi(),rd):0}function Jd(){for(;X!==null&&!Fe();)Yd(X)}function Yd(e){var t=cl(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=Hc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:ts(t);var r=t;r===$i&&(W?(oa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(oa(r),W=!0));default:_l(n,t),t=X=Mi(t,nd),t=cl(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):X=t}function Zd(e,t,n,r){pa=fa=null,ts(t),to=null,no=0;var i=t.return;try{if(Dc(e,i,t,n,Z)){rd=1,Sc(e,zi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;rd=1,Sc(e,zi(n,e.current)),X=null;return}t.flags&32768?(W||r===1?e=!0:ed||Z&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=hl(t.alternate,t,nd);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);rd=6,X=null}function ef(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(Xu&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Zu&&(X=Zu=null,Z=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=bi,ut(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Ma(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ve,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Xu,Xu|=4;try{lu(e,t,n)}finally{Xu=a,R.p=i,L.T=r}}_d=1,Il?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Xu;Xu|=4;try{Y=su=!1,Eu(t,e,n),n=cp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Hr(s,h),v=Hr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Xu=a,R.p=i,L.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Xu;Xu|=4;try{du(e,t.alternate,t)}finally{Xu=i,R.p=r,L.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ie();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=ht(bd),r=L.T,i=R.p;try{R.p=32>n?32:n,L.T=null,n=Sd,Sd=null;var a=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Xu&6)throw Error(o(331));var c=Xu;if(Xu|=4,Gu(a.current),Lu(a,a.current,s,n),Xu=c,Ef(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,a)}catch{}return!0}finally{R.p=i,L.T=r,cf(e,t)}}function df(e,t,n){t=zi(n,t),t=wc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(lt(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=zi(n,e),n=Tc(2),r=mo(t,n,2),r!==null&&(Ec(n,r,t,e),lt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&(Z&n)===n&&(rd===4||rd===3&&(Z&62914560)===Z&&300>Le()-fd?Xu&2?od|=n:zd(e,0):od|=n,cd===Z&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=st()),e=wi(e,t),e!==null&&(lt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Ne(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Z,a=rt(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Le(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=Z,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Af.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Z;return r=rt(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){Xu&6?Ne(ze,Df):Of()})}function Nf(){if(wf===0){var e=Fa;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<di.length;If++){var Lf=di[If];fi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[St];n===void 0&&(n=t[St]=/* @__PURE__ */ new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=kt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),o=[];a:{var s=ui.get(e);if(s!==void 0){var c=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=er;break;case`focusin`:u=`focus`,c=Gn;break;case`focusout`:u=`blur`,c=Gn;break;case`beforeblur`:case`afterblur`:c=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=rr;break;case ri:case ii:case ai:c=Kn;break;case li:c=ir;break;case`scroll`:case`scrollend`:c=Rn;break;case`wheel`:c=ar;break;case`copy`:case`cut`:case`paste`:c=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=tr;break;case`submit`:c=nr;break;case`toggle`:case`beforetoggle`:c=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?kt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:jt(s),h=c==null?u:jt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,Jf):null,s!==null&&Yf(o,u,s,d,!1),c!==null&&f!==null&&Yf(o,f,c,d,!0)))}a:{if(s=r?jt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Er;else if(br(s)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&dn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?jt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(o,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(o,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
+ `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,a);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}H=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:un(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}H=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}H=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,a,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:ep(e,t,r,d,n,null)}}tn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:ep(e,t,s,c,n,null)}on(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ep(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(H=!0),a=m;break;case`name`:m!==f&&(H=!0),i=m;break;case`checked`:m!==f&&(H=!0),u=m;break;case`defaultChecked`:m!==f&&(H=!0),d=m;break;case`value`:m!==f&&(H=!0),s=m;break;case`defaultValue`:m!==f&&(H=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}en(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ep(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(H=!0),p=a;break;case`defaultValue`:a!==l&&(H=!0),c=a;break;case`multiple`:a!==l&&(H=!0),s=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(H=!0),p=i;break;case`defaultValue`:i!==a&&(H=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&ep(e,t,s,i,r,a)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(H=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[yt]=r,n[bt]=t,np(n,e,t),Nt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=/* @__PURE__ */ new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=/* @__PURE__ */ new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Ot(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var vm=/* @__PURE__ */ new Map,ym=/* @__PURE__ */ new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=R.d;R.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Mt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Nt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Mt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Nt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=xe.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Mt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Mt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Mt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+$t(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),np(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+$t(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Nt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Nt(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Nt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=/* @__PURE__ */ new Map,i=Wm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=/* @__PURE__ */ new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=/* @__PURE__ */ new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=/* @__PURE__ */ new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */ new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=/* @__PURE__ */ new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function uh(e){return e?(e=Di,e):Di}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Md(n,e,t),ho(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=mt(t);var n=wi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Xu&6)&&(md=Le()+500,Ef(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=_n(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=kt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=/* @__PURE__ */ new Map,kh=/* @__PURE__ */ new Map,Ah=[],jh=`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`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=kt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,_t(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=At(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[xt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=i.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));R.findDOMNode=function(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=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ke=Jh.inject(qh),qe=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=yc,a=bc,s=xc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,s,Uh),e[xt]=t.current,Uf(e),new Wh(t)}})),Se=/* @__PURE__ */ t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xe()})),B=/* @__PURE__ */ e(n(),1),V=a(),Ce=B.createContext(void 0),we=e=>{let t=B.useContext(Ce);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Te=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */ (0,V.jsx)(Ce.Provider,{value:e,children:t})),Ee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},De=new class{#e=Ee;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Oe(e){setTimeout(e,0)}var ke=typeof window>`u`||`Deno`in globalThis;function Ae(){}function je(e,t){return typeof e==`function`?e(t):e}function Me(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ne(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pe(e,t){return typeof e==`function`?e(t):e}function Fe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Le(o,t.options))return!1}else if(!ze(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ie(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Re(t.options.mutationKey)!==Re(a))return!1}else if(!ze(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Le(e,t){return(t?.queryKeyHashFn||Re)(e)}function Re(e){return JSON.stringify(e,(e,t)=>We(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ze(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ze(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ze(e[r],t[r]))return!1;return!0}return!1}var Be=Object.prototype.hasOwnProperty;function Ve(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ue(e)&&Ue(t);if(!r&&!(We(e)&&We(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Be.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ve(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function He(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function We(e){if(!Ge(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Ge(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Ge(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ke(e){return new Promise(t=>{De.setTimeout(t,e)})}function qe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ve(e,t)}function Je(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ye(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xe=Symbol();function Ze(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xe?()=>Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qe(e,t){return typeof e==`function`?e(...t):!!e}function $e(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var et=()=>ke,tt=()=>et(),nt=class{constructor(){this.listeners=/* @__PURE__ */ new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rt=new class extends nt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},it=Oe;function at(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=it,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ot=at(),st=new class extends nt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ct(e){return Math.min(1e3*2**e,3e4)}function lt(e){return(e??`online`)!==`online`||st.isOnline()}var ut=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function dt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Ae);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ut(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>rt.isFocused()&&(e.networkMode===`always`||st.isOnline())&&e.canRun(),p=()=>lt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(tt()?0:3),a=e.retryDelay??ct,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Ke(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var ft=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Me(this.gcTime)&&(this.#e=De.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tt()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(De.clearTimeout(this.#e),this.#e=void 0)}};function pt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{$e(e,()=>t.signal,()=>n=!0)},u=Ze(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ye:Je;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ht:mt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:mt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function mt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ht(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var gt=class extends ft{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=yt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=yt(this.options);e.data!==void 0&&(this.setState(vt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=qe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Pe(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ne(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ze(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?pt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=dt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ut&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ut){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,..._t(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...vt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ot.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function _t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function vt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function yt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var bt=class extends nt{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=/* @__PURE__ */ new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),St(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ct(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ct(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Pe(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!He(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&wt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||Pe(this.options.staleTime,this.#t)!==Pe(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Pe(this.options.enabled,this.#t)!==Pe(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ae)),t}#h(e){return!tt()&&Pe(this.options.enabled,this.#t)!==!1&&Me(e)}#g(){this.#b();let e=Pe(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ne(this.#r.dataUpdatedAt,e)+1;this.#u=De.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Pe(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=De.setInterval(()=>{(this.options.refetchIntervalInBackground||rt.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(De.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(De.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&St(e,t),o=i&&wt(e,n,t,r);(a||o)&&(l={...l,..._t(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=qe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=qe(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Tt(e,t),refetch:this.refetch,isEnabled:Pe(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),He(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ot.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function xt(e,t){return Pe(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Pe(t.retryOnMount,e)!==!1)}function St(e,t){return xt(e,t)||e.state.data!==void 0&&Ct(e,t,t.refetchOnMount)}function Ct(e,t,n){if(Pe(t.enabled,e)!==!1&&Pe(t.staleTime,e)!==`static`){let r=Pe(n,e);return r===`always`||r!==!1&&Tt(e,t)}return!1}function wt(e,t,n,r){return(e!==t||Pe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Tt(e,n)}function Tt(e,t){return Pe(t.enabled,e)!==!1&&e.isStaleByTime(Pe(t.staleTime,e))}var Et=class extends ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Dt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=dt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(/* @__PURE__ */ Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ot.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Dt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ot=class extends nt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Set,this.#t=/* @__PURE__ */ new Map,this.#n=0}build(e,t,n){let r=new Et({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ot.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ie(t,e))}findAll(e={}){return this.getAll().filter(t=>Ie(e,t))}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ot.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ae))))}};function kt(e){return e.options.scope?.id}var At=class extends nt{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),He(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Re(t.mutationKey)!==Re(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Dt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ot.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function jt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Mt=class extends nt{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=/* @__PURE__ */ new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ot.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!He(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(jt(e,n).forEach(e=>{e.destroy()}),jt(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=/* @__PURE__ */ new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ve(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=/* @__PURE__ */ new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new bt(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ot.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Nt=class extends nt{#e;constructor(e={}){super(),this.config=e,this.#e=/* @__PURE__ */ new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Le(r,t),a=this.get(i);return a||(a=new gt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ot.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Fe(e,t)):t}notify(e){ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Nt,this.#t=e.mutationCache||new Ot,this.#n=e.defaultOptions||{},this.#r=/* @__PURE__ */ new Map,this.#i=/* @__PURE__ */ new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=rt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=st.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Pe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=je(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ot.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ot.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ot.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return ot.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ae)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ae)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Pe(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Pe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return st.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Re(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ze(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Re(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ze(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Le(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Xe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ft=B.createContext(!1),It=()=>B.useContext(Ft);Ft.Provider;function Lt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rt=B.createContext(Lt()),zt=()=>B.useContext(Rt),Bt=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Qe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Vt=e=>{B.useEffect(()=>{e.clearReset()},[e])},Ht=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Qe(n,[e.error,r])),H=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ut=(e,t)=>e?.suspense&&t.isPending,Wt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Gt({queries:e,...t},n){let r=we(n),i=It(),a=zt(),o=t.subscribed!==!1,s=B.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{H(e);let t=r.getQueryCache().get(e.queryHash);Bt(e,a,t)}),Vt(a);let[c]=B.useState(()=>new Mt(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;B.useSyncExternalStore(B.useCallback(e=>f?c.subscribe(ot.batchCalls(e)):Ae,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),B.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Ut(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Ut(n,e)?Wt(n,new bt(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Ht({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function Kt(e,t,n){let r=It(),i=zt(),a=we(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,H(o),Bt(o,i,s),Vt(i);let[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(ot.batchCalls(e)):Ae;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),Ut(o,u))throw Wt(o,l,i);if(Ht({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function qt(e,t){return Kt(e,bt,t)}function Jt(e,t){let n=we(t),[r]=B.useState(()=>new At(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe(ot.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ae)},[r]);if(i.error&&Qe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
10
+ function Zt(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),o=/* @__PURE__ */ Xt(e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ (0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=C(t,i.collectionRef);return/* @__PURE__ */ (0,V.jsx)(u,{ref:o,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=l(f),h=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=C(t,o),c=a(f,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),/* @__PURE__ */ (0,V.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Xt(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},g,r]}Xt(Zt,`createCollection`);var Qt=/* @__PURE__ */ new WeakMap,$t=class e extends Map{static{Xt(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Qt.set(this,!0)}set(e,t){return Qt.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=nn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=en(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=en(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return en(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function en(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=tn(e,t);return n===-1?void 0:e[n]}Xt(en,`at`);function tn(e,t){let n=e.length,r=nn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Xt(tn,`toSafeIndex`);function nn(e){return e!==e||e===0?0:Math.trunc(e)}Xt(nn,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
11
+ function rn(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ Xt(({state:e,...t})=>e?/* @__PURE__ */ (0,V.jsx)(p,{...t,state:e}):/* @__PURE__ */ (0,V.jsx)(d,{...t}),`CollectionProvider`);u.displayName=t;let d=/* @__PURE__ */ Xt(e=>{let t=b();return/* @__PURE__ */ (0,V.jsx)(p,{...e,state:t})},`CollectionInit`);d.displayName=e+`CollectionInit`;let p=/* @__PURE__ */ Xt(e=>{let{scope:t,children:n,state:r}=e,a=B.useRef(null),[s,c]=B.useState(null),l=C(a,c),[u,d]=r,f=B.useRef(new $t),p=B.useCallback(()=>{let e=f.current;return sn(e)||e.sort(cn),e},[]);return B.useEffect(()=>{if(!s)return;let e=ln(()=>{d(e=>{let t=e.toSorted(cn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),/* @__PURE__ */ (0,V.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:/* @__PURE__ */ (0,V.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);p.displayName=e+`CollectionProviderImpl`;let m=e+`CollectionSlot`,h=l(m),g=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(m,n),o=C(t,i.collectionElementRef);return/* @__PURE__ */ (0,V.jsx)(h,{ref:o,children:r})});g.displayName=m;let _=e+`CollectionItemSlot`,v=l(_),y=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),{setCollection:s,registryRef:c}=a(_,n),l=B.useRef(i);an(l.current,i)||(l.current=i);let u=l.current,d=B.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),p=C(t,d,o);f(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let m=B.useRef(null);return B.useEffect(()=>{let e=o.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(m.current=e?{element:e,itemData:u}:null,s(n=>{let r=new $t(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(cn)}))}),B.useEffect(()=>()=>{let e=m.current;m.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new $t(t);return n.delete(e.element),n})},[s]),/* @__PURE__ */ (0,V.jsx)(v,{"data-radix-collection-item":``,ref:p,children:r})});y.displayName=_;function b(){return B.useState(new $t)}Xt(b,`useInitCollection`);function x(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Xt(x,`useCollection`);function S(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Xt(S,`useGetCollection`),[{Provider:u,Slot:g,ItemSlot:y},{createCollectionScope:r,useCollection:x,useGetCollection:S,useInitCollection:b}]}Xt(rn,`createCollection`);function an(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Xt(an,`shallowEqual`);function on(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Xt(on,`isElementPreceding`);function sn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Xt(sn,`isInDocumentOrder`);function cn(e,t){return!e[1].element||!t[1].element?0:on(e[1].element,t[1].element)?-1:1}Xt(cn,`sortByDocumentPosition`);function ln(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Xt(ln,`getChildListObserver`);var un=Object.defineProperty,dn=(e,t)=>un(e,`name`,{value:t,configurable:!0}),fn={LTR:`ltr`,RTL:`rtl`},pn=B.createContext(void 0);function mn(e){let t=B.useContext(pn);return e||t||fn.LTR}dn(mn,`useDirection`);var hn=/* @__PURE__ */ e(s(),1),gn=/* @__PURE__ */ e(Se(),1),_n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=0,bn=null;function xn(e){return Sn(),e.children}vn(xn,`FocusGuards`);function Sn(){B.useEffect(()=>{bn||={start:Cn(),end:Cn()};let{start:e,end:t}=bn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),yn++,()=>{yn===1&&(bn?.start.remove(),bn?.end.remove(),bn=null),yn=Math.max(0,yn-1)}},[])}vn(Sn,`useFocusGuards`);function Cn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}vn(Cn,`createFocusGuard`);var wn=function(){return wn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wn.apply(this,arguments)};function Tn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function En(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Dn=`right-scroll-bar-position`,On=`width-before-scroll-bar`,kn=`with-scroll-bars-hidden`,An=`--removed-body-scroll-bar-size`;function jn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Mn(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Nn=typeof window<`u`?B.useLayoutEffect:B.useEffect,Pn=/* @__PURE__ */ new WeakMap;function Fn(e,t){var n=Mn(t||null,function(t){return e.forEach(function(e){return jn(e,t)})});return Nn(function(){var t=Pn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||jn(e,null)}),i.forEach(function(e){r.has(e)||jn(e,a)})}Pn.set(n,e)},[e]),n}function In(e){return e}function Ln(e,t){t===void 0&&(t=In);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Rn(e){e===void 0&&(e={});var t=Ln(null);return t.options=wn({async:!0,ssr:!1},e),t}var zn=function(e){var t=e.sideCar,n=Tn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,wn({},n))};zn.isSideCarExport=!0;function Bn(e,t){return e.useMedium(t),zn}var Vn=Rn(),Hn=function(){},Un=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:Hn,onWheelCapture:Hn,onTouchMoveCapture:Hn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Tn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Fn([n,t]),C=wn(wn({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:Vn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),wn(wn({},C),{ref:S})):B.createElement(v,wn({},C,{className:c,ref:S}),s))});Un.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Un.classNames={fullWidth:On,zeroRight:Dn};var Wn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Gn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wn();return t&&e.setAttribute(`nonce`,t),e}function Kn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Jn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gn())&&(Kn(t,n),qn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yn=function(){var e=Jn();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xn=function(){var e=Yn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Zn={left:0,top:0,right:0,gap:0},Qn=function(e){return parseInt(e||``,10)||0},$n=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qn(n),Qn(r),Qn(i)]},er=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Zn;var t=$n(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tr=Xn(),nr=`data-scroll-locked`,rr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
+ .${kn} {
13
13
  overflow: hidden ${r};
14
14
  padding-right: ${s}px ${r};
15
15
  }
16
- body[${rr}] {
16
+ body[${nr}] {
17
17
  overflow: hidden ${r};
18
18
  overscroll-behavior: contain;
19
19
  ${[t&&`position: relative ${r};`,n===`margin`&&`
@@ -26,31 +26,31 @@ function an(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t);i.displayName=
26
26
  `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
27
27
  }
28
28
 
29
- .${On} {
29
+ .${Dn} {
30
30
  right: ${s}px ${r};
31
31
  }
32
32
 
33
- .${kn} {
33
+ .${On} {
34
34
  margin-right: ${s}px ${r};
35
35
  }
36
36
 
37
- .${On} .${On} {
37
+ .${Dn} .${Dn} {
38
38
  right: 0 ${r};
39
39
  }
40
40
 
41
- .${kn} .${kn} {
41
+ .${On} .${On} {
42
42
  margin-right: 0 ${r};
43
43
  }
44
44
 
45
- body[${rr}] {
46
- ${jn}: ${s}px;
45
+ body[${nr}] {
46
+ ${An}: ${s}px;
47
47
  }
48
- `},ar=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},or=function(){B.useEffect(function(){return document.body.setAttribute(rr,(ar()+1).toString()),function(){var e=ar()-1;e<=0?document.body.removeAttribute(rr):document.body.setAttribute(rr,e.toString())}},[])},sr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;or();var a=B.useMemo(function(){return tr(i)},[i]);return B.createElement(nr,{styles:ir(a,!t,i,n?``:`!important`)})},cr=!1;if(typeof window<`u`)try{var lr=Object.defineProperty({},"passive",{get:function(){return cr=!0,!0}});window.addEventListener(`test`,lr,lr),window.removeEventListener(`test`,lr,lr)}catch{cr=!1}var ur=cr?{passive:!1}:!1,dr=function(e){return e.tagName===`TEXTAREA`},fr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!dr(e)&&n[t]===`visible`)},pr=function(e){return fr(e,`overflowY`)},mr=function(e){return fr(e,`overflowX`)},hr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),vr(e,r)){var i=yr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_r=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},vr=function(e,t){return e===`v`?pr(t):mr(t)},yr=function(e,t){return e===`v`?gr(t):_r(t)},br=function(e,t){return e===`h`&&t===`rtl`?-1:1},xr=function(e,t,n,r,i){var a=br(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=yr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&vr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Sr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cr=function(e){return[e.deltaX,e.deltaY]},wr=function(e){return e&&`current`in e?e.current:e},Tr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Er=function(e){return`
48
+ `},ir=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ar=function(){B.useEffect(function(){return document.body.setAttribute(nr,(ir()+1).toString()),function(){var e=ir()-1;e<=0?document.body.removeAttribute(nr):document.body.setAttribute(nr,e.toString())}},[])},or=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ar();var a=B.useMemo(function(){return er(i)},[i]);return B.createElement(tr,{styles:rr(a,!t,i,n?``:`!important`)})},sr=!1;if(typeof window<`u`)try{var cr=Object.defineProperty({},"passive",{get:function(){return sr=!0,!0}});window.addEventListener(`test`,cr,cr),window.removeEventListener(`test`,cr,cr)}catch{sr=!1}var lr=sr?{passive:!1}:!1,ur=function(e){return e.tagName===`TEXTAREA`},dr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ur(e)&&n[t]===`visible`)},fr=function(e){return dr(e,`overflowY`)},pr=function(e){return dr(e,`overflowX`)},mr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_r(e,r)){var i=vr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},gr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_r=function(e,t){return e===`v`?fr(t):pr(t)},vr=function(e,t){return e===`v`?hr(t):gr(t)},yr=function(e,t){return e===`h`&&t===`rtl`?-1:1},br=function(e,t,n,r,i){var a=yr(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=vr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_r(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},xr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sr=function(e){return[e.deltaX,e.deltaY]},Cr=function(e){return e&&`current`in e?e.current:e},wr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tr=function(e){return`
49
49
  .block-interactivity-${e} {pointer-events: none;}
50
50
  .allow-interactivity-${e} {pointer-events: all;}
51
- `},Dr=0,Or=[];function kr(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Dr++)[0],a=B.useState(Zn)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Dn([e.lockRef.current],(e.shards||[]).map(wr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Sr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=hr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=hr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return xr(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(Or.length&&Or[Or.length-1]===a){var r=`deltaY`in n?Cr(n):Sr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Tr(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(wr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ar(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=Sr(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Cr(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,Sr(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Or.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ur),document.addEventListener(`touchmove`,c,ur),document.addEventListener(`touchstart`,u,ur),function(){Or=Or.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ur),document.removeEventListener(`touchmove`,c,ur),document.removeEventListener(`touchstart`,u,ur)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Er(i)}):null,p?B.createElement(sr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ar(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var jr=Vn(Hn,kr),Mr=B.forwardRef(function(e,t){return B.createElement(Wn,Tn({},e,{ref:t,sideCar:jr}))});Mr.classNames=Wn.classNames;var Nr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Pr=/* @__PURE__ */ new WeakMap,Fr=/* @__PURE__ */ new WeakMap,Ir={},Lr=0,Rr=function(e){return e&&(e.host||Rr(e.parentNode))},zr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Rr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Br=function(e,t,n,r){var i=zr(t,Array.isArray(e)?e:[e]);Ir[n]||(Ir[n]=/* @__PURE__ */ new WeakMap);var a=Ir[n],o=[],s=/* @__PURE__ */ new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Pr.get(e)||0)+1,l=(a.get(e)||0)+1;Pr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Fr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Lr++,function(){o.forEach(function(e){var t=Pr.get(e)-1,i=a.get(e)-1;Pr.set(e,t),a.set(e,i),t||(Fr.has(e)||e.removeAttribute(r),Fr.delete(e)),i||e.removeAttribute(n)}),Lr--,Lr||(Pr=/* @__PURE__ */ new WeakMap,Pr=/* @__PURE__ */ new WeakMap,Fr=/* @__PURE__ */ new WeakMap,Ir={})}},Vr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Nr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Br(r,i,n,`aria-hidden`)):function(){return null}},Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0}),Wr=`Dialog`,[Gr,Kr]=c(Wr),[qr,Jr]=Gr(Wr),Yr=/* @__PURE__ */ Ur(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),{nodes:l,registry:u}=T(),[d,f]=g({prop:r,defaultProp:i??!1,onChange:a,caller:Wr}),[p,m]=B.useState(0),[h,_]=B.useState(0);return/* @__PURE__ */ (0,V.jsx)(qr,{scope:t,triggerRef:s,contentRef:c,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Xr=`DialogPortal`,[Zr,Qr]=Gr(Xr,{forceMount:void 0}),$r=/* @__PURE__ */ Ur(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Jr(Xr,t);return/* @__PURE__ */ (0,V.jsx)(Zr,{scope:t,forceMount:n,children:B.Children.map(r,e=>/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ei=`DialogOverlay`,ti=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let n=Qr(ei,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Jr(ei,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)(ri,{...i,ref:t})}):null},`DialogOverlay`)),ni=l(`DialogOverlay.RemoveScroll`),ri=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let{__scopeDialog:n,...r}=e,i=Jr(ei,n),a=b(),o=C(t,a);return/* @__PURE__ */ (0,V.jsx)(Mr,{as:ni,allowPinchZoom:!0,shards:B.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-state":mi(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ii=`DialogContent`,ai=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let n=Qr(ii,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Jr(ii,e.__scopeDialog);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(oi,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(si,{...i,ref:t})})},`DialogContent`)),oi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let n=Jr(ii,e.__scopeDialog),r=B.useRef(null),i=C(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return Vr(e)},[]),/* @__PURE__ */ (0,V.jsx)(ci,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),si=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let n=Jr(ii,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(ci,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),ci=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Jr(ii,n);return Cn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?pi(o,l.descriptionId):o,"data-state":mi(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),li=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let{__scopeDialog:n,...r}=e,i=Jr(`DialogTitle`,n),{setTitleCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ui=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let{__scopeDialog:n,...r}=e,i=Jr(`DialogDescription`,n),{setDescriptionCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),di=`DialogClose`,fi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ur(function(e,t){let{__scopeDialog:n,...r}=e,i=Jr(di,n);return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,...r,ref:t,onClick:F(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function pi(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ur(pi,`concatAriaDescribedby`);function mi(e){return e?`open`:`closed`}Ur(mi,`getState`);var hi=Object.defineProperty,gi=(e,t)=>hi(e,`name`,{value:t,configurable:!0}),_i=!1;function vi(){let[e,t]=B.useState(_i);return B.useEffect(()=>{_i||(_i=!0,t(!0))},[]),e}gi(vi,`useIsHydrated`);var yi=B.useSyncExternalStore;function bi(){return()=>{}}gi(bi,`subscribe`);function xi(){return yi(bi,()=>!0,()=>!1)}gi(xi,`useIsHydratedModern`);var Si=typeof yi==`function`?xi:vi,Ci=Object.defineProperty,wi=(e,t)=>Ci(e,`name`,{value:t,configurable:!0});function Ti(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ei=`rovingFocusGroup.onEntryFocus`,Di={bubbles:!1,cancelable:!0},Oi=`RovingFocusGroup`,[ki,Ai,ji]=/* @__PURE__ */ Qt(Oi),[Mi,Ni]=c(Oi,[ji]),Pi={Vertical:`vertical`,Horizontal:`horizontal`},Fi={LTR:`ltr`,RTL:`rtl`},[Ii,Li]=Mi(Oi),Ri=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ wi(function(e,t){return/* @__PURE__ */ (0,V.jsx)(ki.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(ki.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(zi,{...e,ref:t})})})},`RovingFocusGroup`)),zi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ wi(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),h=C(t,f),_=hn(a),[v,y]=g({prop:o,defaultProp:s??null,onChange:c,caller:Oi}),[b,x]=B.useState(!1),S=m(l),w=Ai(n),T=B.useRef(!1),[E,D]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Ei,S),()=>e.removeEventListener(Ei,S)},[S]),/* @__PURE__ */ (0,V.jsx)(Ii,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:v,onItemFocus:B.useCallback(e=>y(e),[y]),onItemShiftTab:B.useCallback(()=>x(!0),[]),onFocusableItemAdd:B.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>D(e=>e-1),[]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{tabIndex:b||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:`none`,...e.style},onMouseDown:F(e.onMouseDown,()=>{T.current=!0}),onFocus:F(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Ei,Di);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);Gi([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}T.current=!1}),onBlur:F(e.onBlur,()=>x(!1))})})},`RovingFocusGroupImpl`)),Bi=`RovingFocusGroupItem`,Vi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ wi(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=N(),l=a||c,u=Li(Bi,n),d=u.currentTabStopId===l,m=Ai(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=u,v=Si();return f(()=>{if(v&&r)return h(),()=>g()},[v,r,h,g]),B.useEffect(()=>{if(!v&&r)return h(),()=>g()},[v,r,h,g]),/* @__PURE__ */ (0,V.jsx)(ki.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,V.jsx)(p.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:F(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:F(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:F(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Wi(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Ki(n,r+1):n.slice(r+1)}setTimeout(()=>Gi(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Hi={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ui(e,t){return t===Fi.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}wi(Ui,`getDirectionAwareKey`);function Wi(e,t,n){let r=Ui(e.key,n);if(!(t===Pi.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Pi.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Hi[r]}wi(Wi,`getFocusIntent`);function Gi(e,t=!1){let n=Ti();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Ti()!==n))return}wi(Gi,`focusFirst`);function Ki(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wi(Ki,`wrapArray`);var qi=Object.defineProperty,H=(e,t)=>qi(e,`name`,{value:t,configurable:!0});function Ji(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Yi=[`Enter`,` `],Xi=[`ArrowDown`,`PageUp`,`Home`],Zi=[`ArrowUp`,`PageDown`,`End`],Qi=[...Xi,...Zi];[...Yi],[...Yi];var $i=`Menu`,[ea,ta,U]=/* @__PURE__ */ Qt($i),[na,ra]=c($i,[U,_,Ni]),ia=_(),aa=Ni(),[oa,sa]=na($i),[ca,la]=na($i),ua=/* @__PURE__ */ H(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ia(t),[c,l]=B.useState(null),u=B.useRef(!1),d=m(a),f=hn(i);return B.useEffect(()=>{let e=/* @__PURE__ */ H(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ H(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),B.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */ H(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(oa,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:/* @__PURE__ */ (0,V.jsx)(ca,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),da=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let{__scopeMenu:n,...r}=e,i=ia(n);return/* @__PURE__ */ (0,V.jsx)(D,{...i,...r,ref:t})},`MenuAnchor`)),fa=`MenuPortal`,[pa,ma]=na(fa,{forceMount:void 0}),ha=/* @__PURE__ */ H(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=sa(fa,t);return/* @__PURE__ */ (0,V.jsx)(pa,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`MenuPortal`),ga=`MenuContent`,[_a,va]=na(ga),ya=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let n=ma(ga,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=sa(ga,e.__scopeMenu),o=la(ga,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)(ea.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)(ea.Slot,{scope:e.__scopeMenu,children:o.modal?/* @__PURE__ */ (0,V.jsx)(ba,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(xa,{...i,ref:t})})})})},`MenuContent`)),ba=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let n=sa(ga,e.__scopeMenu),r=B.useRef(null),i=C(t,r);return B.useEffect(()=>{let e=r.current;if(e)return Vr(e)},[]),/* @__PURE__ */ (0,V.jsx)(Ca,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),xa=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let n=sa(ga,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)(Ca,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Sa=l(`MenuContent.ScrollLock`),Ca=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=sa(ga,n),_=la(ga,n),b=ia(n),S=aa(n),w=ta(n),[E,D]=B.useState(null),k=B.useRef(null),[j,M]=B.useState(null);O(j);let{nodes:N,registry:P}=T(),I=!!(i||m),ee=C(t,k,g.onContentChange,M),te=B.useRef(0),ne=B.useRef(``),re=B.useRef(0),ie=B.useRef(null),ae=B.useRef(`right`),oe=B.useRef(0),se=B.useMemo(()=>m?[k,...N.map(e=>({current:e}))]:[],[k,N,m]),ce=m?Mr:B.Fragment,le=m?{as:Sa,allowPinchZoom:!0,shards:se}:void 0,ue=/* @__PURE__ */ H(e=>{let t=ne.current+e,n=w().filter(e=>!e.disabled),r=Ji(),i=n.find(e=>e.ref.current===r)?.textValue,a=Ba(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){ne.current=e,window.clearTimeout(te.current),e!==``&&(te.current=window.setTimeout(()=>s(``),1e3))}H(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);B.useEffect(()=>()=>window.clearTimeout(te.current),[]),Cn();let de=B.useCallback(e=>ae.current===ie.current?.side&&Ha(e,ie.current?.area),[]);return/* @__PURE__ */ (0,V.jsx)(_a,{scope:n,searchRef:ne,onItemEnter:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),onItemLeave:B.useCallback(e=>{de(e)||(k.current?.focus(),D(null))},[de]),onTriggerLeave:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),pointerGraceTimerRef:re,onPointerGraceIntentChange:B.useCallback(e=>{ie.current=e},[]),children:/* @__PURE__ */ (0,V.jsx)(y,{registry:I?P:null,children:/* @__PURE__ */ (0,V.jsx)(ce,{...le,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:i,branches:N,onMountAutoFocus:F(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:/* @__PURE__ */ (0,V.jsx)(Ri,{asChild:!0,...S,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:F(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{role:`menu`,"aria-orientation":`vertical`,"data-state":Fa(g.open),"data-radix-menu-content":``,dir:_.dir,...b,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:F(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ue(e.key));let i=k.current;if(e.target!==i||!Qi.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);Zi.includes(e.key)&&a.reverse(),Ra(a)}),onBlur:F(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(te.current),ne.current=``)}),onPointerMove:F(e.onPointerMove,Ua(e=>{let t=e.target,n=oe.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>oe.current?`right`:`left`;ae.current=t,oe.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),wa=`MenuItem`,Ta=`menu.itemSelect`,Ea=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=la(wa,e.__scopeMenu),s=va(wa,e.__scopeMenu),c=C(t,a),l=B.useRef(!1),d=/* @__PURE__ */ H(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ta,{bubbles:!0,cancelable:!0});e.addEventListener(Ta,e=>r?.(e),{once:!0}),u(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return/* @__PURE__ */ (0,V.jsx)(Da,{...i,ref:c,disabled:n,onClick:F(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:F(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:F(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Yi.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Da=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=va(wa,n),s=aa(n),c=B.useRef(null),l=C(t,c),[u,d]=B.useState(!1),[f,m]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),/* @__PURE__ */ (0,V.jsx)(ea.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:/* @__PURE__ */ (0,V.jsx)(Vi,{asChild:!0,...s,focusable:!r,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:F(e.onPointerMove,Ua(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:F(e.onPointerLeave,Ua(e=>o.onItemLeave(e))),onFocus:F(e.onFocus,()=>d(!0)),onBlur:F(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Oa,ka]=na(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ H(()=>{},`onValueChange`)}),[Aa,ja]=na(`MenuItemIndicator`,{checked:!1}),Ma=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ H(function(e,t){let{__scopeMenu:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Na,Pa]=na(`MenuSub`);function Fa(e){return e?`open`:`closed`}H(Fa,`getOpenState`);function Ia(e){return e===`indeterminate`}H(Ia,`isIndeterminate`);function La(e){return Ia(e)?`indeterminate`:e?`checked`:`unchecked`}H(La,`getCheckedState`);function Ra(e){let t=Ji();for(let n of e)if(n===t||(n.focus(),Ji()!==t))return}H(Ra,`focusFirst`);function za(e,t){return e.map((n,r)=>e[(t+r)%e.length])}H(za,`wrapArray`);function Ba(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=za(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}H(Ba,`getNextMatch`);function Va(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}H(Va,`isPointInPolygon`);function Ha(e,t){return t?Va({x:e.clientX,y:e.clientY},t):!1}H(Ha,`isPointerInGraceArea`);function Ua(e){return t=>t.pointerType===`mouse`?e(t):void 0}H(Ua,`whenMouse`);var Wa=Object.defineProperty,Ga=(e,t)=>Wa(e,`name`,{value:t,configurable:!0}),Ka=`DropdownMenu`,[qa,Ja]=c(Ka,[ra]),Ya=ra(),[Xa,Za]=qa(Ka),Qa=/* @__PURE__ */ Ga(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ya(t),l=B.useRef(null),[u,d]=g({prop:i,defaultProp:a??!1,onChange:o,caller:Ka});return/* @__PURE__ */ (0,V.jsx)(Xa,{scope:t,triggerId:N(),triggerRef:l,contentId:N(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:/* @__PURE__ */ (0,V.jsx)(ua,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),$a=`DropdownMenuTrigger`,eo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ga(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Za($a,n),o=Ya(n),s=C(t,a.triggerRef);return/* @__PURE__ */ (0,V.jsx)(da,{asChild:!0,...o,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:F(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:F(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),to=/* @__PURE__ */ Ga(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ya(t);return/* @__PURE__ */ (0,V.jsx)(ha,{...r,...n})},`DropdownMenuPortal`),no=`DropdownMenuContent`,ro=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ga(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Za(no,n),a=Ya(n),o=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(ya,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:F(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),io=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ga(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ya(n);return/* @__PURE__ */ (0,V.jsx)(Ea,{...i,...r,ref:t})},`DropdownMenuItem`)),ao=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ga(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ya(n);return/* @__PURE__ */ (0,V.jsx)(Ma,{...i,...r,ref:t})},`DropdownMenuSeparator`)),oo=Object.defineProperty,so=(e,t)=>oo(e,`name`,{value:t,configurable:!0});function co(e,[t,n]){return Math.min(n,Math.max(t,e))}so(co,`clamp`);var lo=Object.defineProperty,uo=(e,t)=>lo(e,`name`,{value:t,configurable:!0}),fo=`Popover`,[po,mo]=c(fo,[_]),ho=_(),[go,_o]=po(fo),vo=/* @__PURE__ */ uo(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ho(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=B.useState(0),[p,m]=B.useState(0),[_,v]=g({prop:r,defaultProp:i??!1,onChange:a,caller:fo});return/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(go,{scope:t,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:_,onOpenChange:v,onOpenToggle:B.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),yo=`PopoverTrigger`,bo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ uo(function(e,t){let{__scopePopover:n,...r}=e,i=_o(yo,n),a=ho(n),o=C(t,i.triggerRef),s=/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":jo(i.open),...r,ref:o,onClick:F(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:s})},`PopoverTrigger`)),xo=`PopoverPortal`,[So,Co]=po(xo,{forceMount:void 0}),wo=/* @__PURE__ */ uo(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=_o(xo,t);return/* @__PURE__ */ (0,V.jsx)(So,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),To=`PopoverContent`,Eo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ uo(function(e,t){let n=Co(To,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=_o(To,e.__scopePopover);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(Oo,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(ko,{...i,ref:t})})},`PopoverContent`)),Do=l(`PopoverContent.RemoveScroll`),Oo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ uo(function(e,t){let n=_o(To,e.__scopePopover),r=B.useRef(null),i=C(t,r),a=B.useRef(!1),{nodes:o,registry:s}=T();return B.useEffect(()=>{let e=r.current;if(e)return Vr(e)},[]),/* @__PURE__ */ (0,V.jsx)(Mr,{as:Do,allowPinchZoom:!0,shards:B.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,V.jsx)(Ao,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),ko=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ uo(function(e,t){let n=_o(To,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(Ao,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Ao=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ uo(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=_o(To,n),g=ho(n),[_,b]=B.useState(null),S=C(t,b);return O(_),Cn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:p,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{"data-state":jo(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?Mo(d,h.descriptionId):d,...g,...m,ref:S,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function jo(e){return e?`open`:`closed`}uo(jo,`getState`);function Mo(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}uo(Mo,`concatAriaDescribedby`);var No=Object.defineProperty,W=(e,t)=>No(e,`name`,{value:t,configurable:!0});function Po(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Fo={ItemAligned:`item-aligned`,Popper:`popper`},Io={LTR:`ltr`,RTL:`rtl`},Lo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ro=[` `,`Enter`],G=`Select`,[zo,Bo,Vo]=/* @__PURE__ */ Qt(G),[Ho,Uo]=c(G,[Vo,_]),Wo=_(),[Go,Ko]=Ho(G),[qo,Jo]=Ho(G);function Yo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:_}=e,v=Wo(t),[y,b]=B.useState(null),[x,S]=B.useState(null),[C,w]=B.useState(!1),T=hn(l),[E,D]=g({prop:r,defaultProp:i??!1,onChange:a,caller:G}),[O,k]=g({prop:o,defaultProp:s,onChange:c,caller:G}),A=B.useRef(null),j=B.useRef(!1),[M,P]=B.useState(null),F=/* @__PURE__ */ W(e=>{P({value:e,hasConsumerStoppedPropagation:j.current}),k(e)},`handleUserSelect`),I=B.useRef(O);B.useEffect(()=>{let e=m?y?.ownerDocument.getElementById(m):y?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ W(()=>k(I.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,y,k]);let ee=!y||!!m||!!y.closest(`form`),[te,ne]=B.useState(/* @__PURE__ */ new Set),re=N(),ie=Array.from(te).map(e=>e.props.value).join(`;`),ae=B.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),oe=B.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),se={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:re,value:O,onValueChange:k,hasConsumerStoppedPropagationRef:j,userSelection:M,onUserSelect:F,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ie,isFormControl:ee};return/* @__PURE__ */ (0,V.jsx)(h,{...v,children:/* @__PURE__ */ (0,V.jsx)(Go,{scope:t,...se,children:/* @__PURE__ */ (0,V.jsx)(zo.Provider,{scope:t,children:/* @__PURE__ */ (0,V.jsx)(qo,{scope:t,onNativeOptionAdd:ae,onNativeOptionRemove:oe,children:js(_)?_(se):n})})})})}W(Yo,`SelectProvider`);var Xo=/* @__PURE__ */ W(e=>{let{__scopeSelect:t,children:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(Yo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[n,e?/* @__PURE__ */ (0,V.jsx)(As,{__scopeSelect:t}):null]})})},`Select`),Zo=`SelectTrigger`,Qo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Wo(n),o=Ko(Zo,n),s=o.disabled||r,c=C(t,o.onTriggerChange),l=Bo(n),u=B.useRef(`touch`),[d,f,m]=Ns(e=>{let t=l().filter(e=>!e.disabled),n=Ps(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),h=/* @__PURE__ */ W(e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ms(o.value)?``:void 0,...i,ref:c,onClick:F(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:F(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:F(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),!(t&&e.key===` `)&&Lo.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),$o=`SelectValue`,es=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Ko($o,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=C(t,c.onValueNodeChange);f(()=>{l(u)},[l,u]);let m=Ms(c.value);return/* @__PURE__ */ (0,V.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:d,style:{pointerEvents:`none`},children:/* @__PURE__ */ (0,V.jsx)(B.Fragment,{children:m?o:a},m?`placeholder`:`value`)})},`SelectValue`)),ts=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[ns,rs]=Ho(`SelectPortal`,{forceMount:void 0}),is=/* @__PURE__ */ W(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(ns,{scope:e.__scopeSelect,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,...r})})},`SelectPortal`),as=`SelectContent`,os=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let n=rs(as,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Ko(as,e.__scopeSelect),[o,s]=B.useState();return f(()=>{s(new DocumentFragment)},[]),/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:({present:e})=>e?/* @__PURE__ */ (0,V.jsx)(fs,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(ss,{...i,fragment:o})})},`SelectContent`)),ss=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?gn.createPortal(/* @__PURE__ */ (0,V.jsx)(ls,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(zo.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),cs=10,[ls,us]=Ho(as),ds=l(`SelectContent.RemoveScroll`),fs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n}=e,{position:r=Fo.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Ko(as,n),[b,S]=B.useState(null),[w,T]=B.useState(null),E=C(t,S),[D,O]=B.useState(null),[k,A]=B.useState(null),j=Bo(n),[M,N]=B.useState(!1),P=B.useRef(!1),I=B.useRef(!1),ee=B.useRef(!1);B.useEffect(()=>{if(b)return Vr(b)},[b]),Cn();let te=B.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=Po();for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),Po()!==i))return},[j,w]),ne=B.useCallback(()=>te([D,b]),[te,D,b]);B.useEffect(()=>{M&&ne()},[M,ne]);let{onOpenChange:re,triggerPointerDownPosRef:ie}=y;B.useEffect(()=>{if(b){let e={x:0,y:0},t=/* @__PURE__ */ W(t=>{e={x:Math.abs(Math.round(t.pageX)-(ie.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ie.current?.y??0))}},`handlePointerMove`),n=/* @__PURE__ */ W(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||re(!1),document.removeEventListener(`pointermove`,t),ie.current=null},`handlePointerUp`);return ie.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,re,ie]),B.useEffect(()=>{let e=/* @__PURE__ */ W(()=>re(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[ae,oe]=Ns(e=>{let t=j().filter(e=>!e.disabled),n=Ps(t,e,t.find(e=>e.ref.current===Po()));n&&setTimeout(()=>n.ref.current?.focus())}),se=B.useCallback((e,t,n)=>{let r=!I.current;r&&(I.current=!0);let i=!P.current&&!n;y.value!==void 0&&y.value===t||i?(O(e),i&&(P.current=!0)):r&&O(e)},[y.value]),ce=B.useCallback(()=>b?.focus(),[b]),le=B.useCallback((e,t,n)=>{if(!e)return;let r=!ee.current;r&&(ee.current=!0);let i=!P.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&A(e)},[y.value]),ue=r===Fo.Popper?ms:ps,de=ue===ms?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return/* @__PURE__ */ (0,V.jsx)(ls,{scope:n,content:b,viewport:w,onViewportChange:T,itemRefCallback:se,selectedItem:D,onItemLeave:ce,itemTextRefCallback:le,focusSelectedItem:ne,selectedItemText:k,position:r,isPositioned:M,searchRef:ae,children:/* @__PURE__ */ (0,V.jsx)(Mr,{as:ds,allowPinchZoom:!0,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:F(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:/* @__PURE__ */ (0,V.jsx)(ue,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:F(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&oe(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ps=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ko(as,n),o=us(as,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=C(t,u),m=Bo(n),h=B.useRef(!1),g=B.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==Io.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-cs,d=co(a,[cs,Math.max(cs,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-cs,d=co(a,[cs,Math.max(cs,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-cs*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+p+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-cs,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${cs}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);f(()=>x(),[x]);let[S,w]=B.useState();f(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]);let T=B.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return/* @__PURE__ */ (0,V.jsx)(hs,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:/* @__PURE__ */ (0,V.jsx)(p.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),ms=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=cs,...a}=e,o=Wo(n);return/* @__PURE__ */ (0,V.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[hs,gs]=Ho(as,{}),_s=`SelectViewport`,vs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=us(_s,n),o=gs(_s,n),s=C(t,a.onViewportChange),c=B.useRef(0);return/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),/* @__PURE__ */ (0,V.jsx)(zo.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:F(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-cs*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[ys,bs]=Ho(`SelectGroup`),xs=`SelectItem`,[Ss,Cs]=Ho(xs),ws=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Ko(xs,n),c=us(xs,n),l=s.value===r,[u,d]=B.useState(a??``),[f,h]=B.useState(!1),g=m(e=>c.itemRefCallback?.(e,r,i)),_=C(t,g),v=N(),y=B.useRef(`touch`);function b(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return W(b,`handleSelect`),/* @__PURE__ */ (0,V.jsx)(Ss,{scope:n,value:r,disabled:i,textId:v,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:/* @__PURE__ */ (0,V.jsx)(zo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`option`,"aria-labelledby":v,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:F(o.onFocus,()=>h(!0)),onBlur:F(o.onBlur,()=>h(!1)),onClick:F(o.onClick,e=>{i||y.current!==`mouse`&&b(e)}),onPointerUp:F(o.onPointerUp,e=>{i||y.current===`mouse`&&b(e)}),onPointerDown:F(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:F(o.onPointerMove,e=>{y.current=e.pointerType,i?c.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(o.onPointerLeave,e=>{e.currentTarget===Po()&&c.onItemLeave?.()}),onKeyDown:F(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Ro.includes(e.key)&&b(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Ts=`SelectItemText`,Es=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Ko(Ts,n),s=us(Ts,n),c=Cs(Ts,n),l=Jo(Ts,n),[u,d]=B.useState(null),h=m(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=C(t,d,c.onItemTextChange,h),_=u?.textContent,v=B.useMemo(()=>/* @__PURE__ */ (0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return f(()=>(y(v),()=>b(v)),[y,b,v]),/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(p.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Ms(o.value)?gn.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ds=`SelectItemIndicator`,Os=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function(e,t){let{__scopeSelect:n,...r}=e;return Cs(Ds,n).isSelected?/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),ks=`SelectBubbleInput`,As=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ W(function({__scopeSelect:e,...t},n){let r=Ko(ks,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:m}=r,h=B.useRef(null),g=C(n,h),_=i??``,v=B.useRef(_),y=B.useRef(d),b=B.useRef(!1),x=Array.from(f).some(e=>(e.props.value??``)===``);return B.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==y.current;y.current=d;let i=v.current!==_;v.current=_;let a=r&&i;if(r&&!i&&d.value!==_&&!d.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,_)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,_),e.dispatchEvent(t)}},[_,d]),/* @__PURE__ */ (0,V.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{b.current||a(e.target.value)},...t,style:{...P,...t.style},ref:g,defaultValue:_,children:[Ms(i)&&!x?/* @__PURE__ */ (0,V.jsx)(`option`,{value:``}):null,Array.from(f)]},m)},`SelectBubbleInput`));function js(e){return typeof e==`function`}W(js,`isFunction`);function Ms(e){return e===``||e===void 0}W(Ms,`shouldShowPlaceholder`);function Ns(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}W(a,`updateSearch`),a(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}W(Ns,`useTypeaheadSearch`);function Ps(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Fs(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}W(Ps,`findNextItem`);function Fs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}W(Fs,`wrapArray`);var Is=Object.defineProperty,K=(e,t)=>Is(e,`name`,{value:t,configurable:!0}),Ls={Vertical:`vertical`,Horizontal:`horizontal`},Rs={LTR:`ltr`,RTL:`rtl`},zs=[`PageUp`,`PageDown`],Bs=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Vs={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Hs=`Slider`,[Us,Ws,Gs]=/* @__PURE__ */ Qt(Hs),[Ks,qs]=c(Hs,[Gs]),[Js,Ys]=Ks(Hs),Xs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=Ls.Horizontal,disabled:s=!1,minStepsBetweenThumbs:c=0,preserveThumbOrder:l=!1,defaultValue:u=[r],value:d,onValueChange:f=/* @__PURE__ */ K(()=>{},`onValueChange`),onValueCommit:p=/* @__PURE__ */ K(()=>{},`onValueCommit`),inverted:m=!1,form:h,..._}=e,v=B.useRef(/* @__PURE__ */ new Set),y=B.useRef(0),b=B.useRef(!1),[x,S]=B.useState(null),w=o===Ls.Horizontal?$s:ec,[T,E]=B.useState(null),D=C(t,E),[O=[],k]=g({prop:d,defaultProp:u,onChange:/* @__PURE__ */ K(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,f(e)},`onChange`)}),A=B.useRef(O),j=B.useRef(O);B.useEffect(()=>{let e=h?T?.ownerDocument.getElementById(h):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ K(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,h,k]);function M(e){I(e,vc(O,e))}K(M,`handleSlideStart`);function N(e){I(e,y.current)}K(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&p(O)}K(P,`handleSlideEnd`);function I(e,t,{commit:n}={commit:!1}){let o=Cc(a),s=co(wc(Math.round((e-r)/a)*a+r,o),[r,i]),u=c*a;function d(e){let n=l?co(s,[e[t-1]===void 0?r:e[t-1]+u,e[t+1]===void 0?i:e[t+1]-u]):s,a=hc(e,n,t);return xc(a,u)?{nextValues:a,changedIndex:l?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}K(d,`getNextValues`);let f=d(O);f?.hasChanged&&S(f.nextValues),k((e=[])=>{let t=d(e);return t?(y.current=t.changedIndex,t.hasChanged&&n&&p(t.nextValues),t.hasChanged?t.nextValues:e):e})}return K(I,`updateValues`),/* @__PURE__ */ (0,V.jsx)(Js,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:v.current,values:O,orientation:o,form:h,userRequestedValues:x,children:/* @__PURE__ */ (0,V.jsx)(Us.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(Us.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(w,{"aria-disabled":s,"data-disabled":s?``:void 0,..._,ref:D,onPointerDown:F(_.onPointerDown,()=>{s||(A.current=O,b.current=!1)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:M,onSlideMove:s?void 0:N,onSlideEnd:s?void 0:P,onHomeKeyDown:()=>{s||(b.current=!0,I(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(b.current=!0,I(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){b.current=!0;let n=zs.includes(e.key)||e.shiftKey&&Bs.includes(e.key)?10:1,i=y.current,o=O[i];I(Tc(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Zs,Qs]=Ks(Hs,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),$s=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=B.useState(null),p=C(t,f),m=B.useRef(void 0),h=hn(i),g=h===Rs.LTR,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=Sc([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return K(v,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Zs,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:/* @__PURE__ */ (0,V.jsx)(tc,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Vs[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),ec=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=B.useRef(null),d=C(t,u),f=B.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=Sc([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return K(m,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Zs,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:/* @__PURE__ */ (0,V.jsx)(tc,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Vs[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),tc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Ys(Hs,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{...l,ref:t,onKeyDown:F(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):zs.concat(Bs).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:F(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:F(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:F(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),nc=`SliderTrack`,rc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{__scopeSlider:n,...r}=e,i=Ys(nc,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),ic=`SliderRange`,ac=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{__scopeSlider:n,...r}=e,i=Ys(ic,n),a=Qs(ic,n),o=B.useRef(null),s=C(t,o),c=i.values.length,l=i.values.map(e=>gc(e,i.min,i.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:d+`%`}})},`SliderRange`)),[oc,sc]=Ks(`SliderThumb`),cc=`SliderThumbProvider`;function lc(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=Ys(cc,t),o=Ws(t),[s,c]=B.useState(null),l=B.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=w(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:gc(f,a.min,a.max);B.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return/* @__PURE__ */ (0,V.jsx)(oc,{scope:t,...h,children:Ec(i)?i(h):r})}K(lc,`SliderThumbProvider`);var uc=`SliderThumbTrigger`,dc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{__scopeSlider:n,...r}=e,i=Ys(uc,n),a=Qs(uc,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=sc(uc,n),d=C(t,u),f=_c(o,i.values.length),m=l?.[a.size],h=m?yc(m,c,a.direction):0;return/* @__PURE__ */ (0,V.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:/* @__PURE__ */ (0,V.jsx)(Us.ItemSlot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:F(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),fc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(lc,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(dc,{...i,ref:t,__scopeSlider:n}),r?/* @__PURE__ */ (0,V.jsx)(mc,{__scopeSlider:n},e):null]})})},`SliderThumb`)),pc=`SliderBubbleInput`,mc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ K(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=sc(pc,e),{userRequestedValues:c}=Ys(pc,e),l=B.useRef(null),u=C(l,r),d=B.useRef(!1),f=B.useRef(a),m=B.useRef(c),h=B.useRef(c);return B.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f.current,o=r!==a;f.current=a;let s=c!==h.current;if(h.current=c,o&&n){let t=c!==m.current;m.current=c;let o=c?.[i];d.current=!(t&&(s&&o!==r||o===a));let l=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(l),d.current=!1}},[i,a,c]),/* @__PURE__ */ (0,V.jsx)(p.input,{style:{display:`none`},name:o,form:s,...n,ref:u,defaultValue:a,onInput:F(t,e=>{d.current&&e.stopPropagation()})})},`SliderBubbleInput`));function hc(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}K(hc,`getNextSortedValues`);function gc(e,t,n){return co(100/(n-t)*(e-t),[0,100])}K(gc,`convertValueToPercentage`);function _c(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}K(_c,`getLabel`);function vc(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}K(vc,`getClosestValueIndex`);function yc(e,t,n){let r=e/2;return(r-Sc([0,50],[0,r])(t)*n)*n}K(yc,`getThumbInBoundsOffset`);function bc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}K(bc,`getStepsBetweenValues`);function xc(e,t){if(t>0){let n=bc(e);return Math.min(...n)>=t}return!0}K(xc,`hasMinStepsBetweenValues`);function Sc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}K(Sc,`linearScale`);function Cc(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}K(Cc,`getDecimalCount`);function wc(e,t){let n=10**t;return Math.round(e*n)/n}K(wc,`roundValue`);function Tc(e,{min:t,step:n,direction:r,multiplier:i}){let a=Cc(n),o=(e-t)/n,s=Math.round(o),c=wc(s*n+t,a)===wc(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),wc(l*n+t,a)}K(Tc,`getNextStepValue`);function Ec(e){return typeof e==`function`}K(Ec,`isFunction`);var Dc=Object.defineProperty,Oc=(e,t)=>Dc(e,`name`,{value:t,configurable:!0}),kc=`Toggle`,Ac=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Oc(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=g({prop:n,onChange:i,defaultProp:r??!1,caller:kc});return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:F(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),jc=Object.defineProperty,Mc=(e,t)=>jc(e,`name`,{value:t,configurable:!0}),Nc=`ToggleGroup`,Pc={Single:`single`,Multiple:`multiple`},[Fc,Ic]=c(Nc,[Ni]),Lc=Ni(),Rc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let{type:n,...r}=e;if(n===Pc.Single)return/* @__PURE__ */ (0,V.jsx)(Vc,{role:`radiogroup`,...r,ref:t});if(n===Pc.Multiple)return/* @__PURE__ */ (0,V.jsx)(Hc,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Nc}\``)},`ToggleGroup`)),[zc,Bc]=Fc(Nc),Vc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ Mc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??``,onChange:i,caller:Nc});return/* @__PURE__ */ (0,V.jsx)(zc,{scope:e.__scopeToggleGroup,type:Pc.Single,value:B.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:B.useCallback(()=>s(``),[s]),children:/* @__PURE__ */ (0,V.jsx)(Gc,{...a,ref:t})})},`ToggleGroupImplSingle`)),Hc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ Mc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??[],onChange:i,caller:Nc}),c=B.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=B.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return/* @__PURE__ */ (0,V.jsx)(zc,{scope:e.__scopeToggleGroup,type:Pc.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:/* @__PURE__ */ (0,V.jsx)(Gc,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[Uc,Wc]=Fc(Nc),Gc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Lc(n),u=hn(o),d={dir:u,...c};return/* @__PURE__ */ (0,V.jsx)(Uc,{scope:n,rovingFocus:i,disabled:r,children:i?/* @__PURE__ */ (0,V.jsx)(Ri,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})}):/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})})},`ToggleGroupImpl`)),Kc=`ToggleGroupItem`,qc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let n=Bc(Kc,e.__scopeToggleGroup),r=Wc(Kc,e.__scopeToggleGroup),i=Lc(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=B.useRef(null);return r.rovingFocus?/* @__PURE__ */ (0,V.jsx)(Vi,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:/* @__PURE__ */ (0,V.jsx)(Jc,{...s,ref:t})}):/* @__PURE__ */ (0,V.jsx)(Jc,{...s,ref:t})},`ToggleGroupItem`)),Jc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Mc(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=Bc(Kc,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Pc.Single?o:void 0;return/* @__PURE__ */ (0,V.jsx)(Ac,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Yc=/* @__PURE__ */ (0,B.createContext)({});function Xc(e){let t=(0,B.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Zc=typeof window<`u`?B.useLayoutEffect:B.useEffect,Qc=/* @__PURE__ */ (0,B.createContext)(null);function $c(e,t){e.indexOf(t)===-1&&e.push(t)}function el(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var tl=(e,t,n)=>n>t?t:n<e?e:n,nl={},rl=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),il=e=>typeof e==`object`&&!!e,al=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
52
- function ol(e){let t;return()=>(t===void 0&&(t=e()),t)}var sl=/* @__NO_SIDE_EFFECTS__ */ e=>e,cl=(...e)=>e.reduce((e,t)=>n=>t(e(n))),ll=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ul=class{constructor(){this.subscriptions=[]}add(e){return $c(this.subscriptions,e),()=>this.remove(e)}remove(e){el(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},dl=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,fl=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,pl=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,ml=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},hl=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
53
- function gl(e,t,n,r){return e===t&&n===r?sl:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=hl(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(hl(s+1e-7,e,n)-i-r)}return hl(s,t,r)}}var _l=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vl=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),yl=/*@__PURE__*/ gl(.33,1.53,.69,.99),bl=/*@__PURE__*/ vl(yl),xl=/*@__PURE__*/ _l(bl),Sl=e=>e>=1?1:(e*=2)<1?.5*bl(e):.5*(2-2**(-10*(e-1))),Cl=e=>1-Math.sin(Math.acos(e)),wl=/* @__PURE__ */ vl(Cl),Tl=/* @__PURE__ */ _l(Cl),El=/*@__PURE__*/ gl(.42,0,1,1),Dl=/*@__PURE__*/ gl(0,0,.58,1),Ol=/*@__PURE__*/ gl(.42,0,.58,1),kl=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`;/*#__NO_SIDE_EFFECTS__*/
54
- function Al(e,t){return/* @__PURE__ */ kl(e)?e[ml(0,e.length,t)]:e}var jl=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,Ml={linear:sl,easeIn:El,easeInOut:Ol,easeOut:Dl,circIn:Cl,circInOut:Tl,circOut:wl,backIn:bl,backInOut:xl,backOut:yl,anticipate:Sl},Nl=e=>typeof e==`string`,Pl=e=>{if(/* @__PURE__ */ jl(e)){let[t,n,r,i]=e;return/* @__PURE__ */ gl(t,n,r,i)}return Nl(e)?Ml[e]:e},Fl={delta:0,timestamp:0,isProcessing:!1},Il;function Ll(){Il=void 0}var q={now:()=>(Il===void 0&&q.set(Fl.isProcessing||nl.useManualTiming?Fl.timestamp:performance.now()),Il),set:e=>{Il=e,queueMicrotask(Ll)}},Rl=e=>Math.round(e*1e5)/1e5,zl=e=>t=>typeof t==`string`&&t.startsWith(e),Bl=/*@__PURE__*/ zl(`--`),Vl=/*@__PURE__*/ zl(`var(--`),Hl=e=>Vl(e)?Ul.test(e.split(`/*`)[0].trim()):!1,Ul=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Wl(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Gl={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Kl={...Gl,transform:e=>tl(0,1,e)},ql={...Gl,default:1},Jl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yl(e){return e==null}var Xl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zl=(e,t)=>n=>!!(typeof n==`string`&&Xl.test(n)&&n.startsWith(e)||t&&!Yl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ql=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Jl);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},$l=e=>tl(0,255,e),eu={...Gl,transform:e=>Math.round($l(e))},tu={test:/*@__PURE__*/ Zl(`rgb`,`red`),parse:/*@__PURE__*/ Ql(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+eu.transform(e)+`, `+eu.transform(t)+`, `+eu.transform(n)+`, `+Rl(Kl.transform(r))+`)`},J=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function nu(e){let t=e.length>5?2:1,n=J(e,3,t);return{red:parseInt(J(e,0,t),16),green:parseInt(J(e,1,t),16),blue:parseInt(J(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var ru={test:/*@__PURE__*/ Zl(`#`),parse:nu,transform:tu.transform},iu=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),au=/*@__PURE__*/ iu(`deg`),ou=/*@__PURE__*/ iu(`%`),Y=/*@__PURE__*/ iu(`px`),su=/*@__PURE__*/ iu(`vh`),cu=/*@__PURE__*/ iu(`vw`),lu={...ou,parse:e=>ou.parse(e)/100,transform:e=>ou.transform(e*100)},uu={test:/*@__PURE__*/ Zl(`hsl`,`hue`),parse:/*@__PURE__*/ Ql(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ou.transform(Rl(t))+`, `+ou.transform(Rl(n))+`, `+Rl(Kl.transform(r))+`)`},du={test:e=>tu.test(e)||ru.test(e)||uu.test(e),parse:e=>tu.test(e)?tu.parse(e):uu.test(e)?uu.parse(e):ru.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?tu.transform(e):uu.transform(e),getAnimatableNone:e=>{let t=du.parse(e);return t.alpha=0,du.transform(t)}},fu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,pu=/*@__PURE__*/ new RegExp(Jl.source),mu=/*@__PURE__*/ new RegExp(fu.source,`i`);function hu(e){return isNaN(e)&&typeof e==`string`&&(pu.test(e)||mu.test(e))}var gu=`number`,_u=`color`,vu=`var`,yu=`var(`,bu="${}",xu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Su(e){let t=e.toString();return pu.test(t)||mu.test(t)}function Cu(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(xu,e=>(du.test(e)?(r.color.push(a),i.push(_u),n.push(du.parse(e))):e.startsWith(yu)?(r.var.push(a),i.push(vu),n.push(e)):(r.number.push(a),i.push(gu),n.push(parseFloat(e))),++a,bu)).split(bu),indexes:r,types:i}}function wu(e){return Cu(e).values}function Tu({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===gu?Rl(r[a]):e===_u?du.transform(r[a]):r[a]}return i}}function Eu(e){return Tu(Cu(e))}var Du=e=>typeof e==`number`?0:du.test(e)?du.getAnimatableNone(e):e,Ou=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Du(e);function ku(e){let t=Cu(e);return Tu(t)(t.values.map((e,n)=>Ou(e,t.split[n])))}var Au={test:hu,parse:wu,createTransformer:Eu,getAnimatableNone:ku};function ju(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ju(s,r,e+1/3),a=ju(s,r,e),o=ju(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Nu(e,t){return n=>n>0?t:e}var Pu=(e,t,n)=>e+(t-e)*n,Fu=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Iu=[ru,tu,uu],Lu=e=>Iu.find(t=>t.test(e));function Ru(e){let t=Lu(e);if(!t)return!1;let n=t.parse(e);return t===uu&&(n=Mu(n)),n}var zu=(e,t)=>{let n=Ru(e),r=Ru(t);if(!n||!r)return Nu(e,t);let i={...n};return e=>(i.red=Fu(n.red,r.red,e),i.green=Fu(n.green,r.green,e),i.blue=Fu(n.blue,r.blue,e),i.alpha=Pu(n.alpha,r.alpha,e),tu.transform(i))},Bu=/* @__PURE__ */ new Set([`none`,`hidden`]);function Vu(e,t){return Bu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Hu(e,t){return n=>Pu(e,t,n)}function Uu(e){return typeof e==`number`?Hu:typeof e==`string`?Hl(e)?Nu:du.test(e)?zu:qu:Array.isArray(e)?Wu:typeof e==`object`?du.test(e)?zu:Gu:Nu}function Wu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Uu(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Gu(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Uu(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ku(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var qu=(e,t)=>{let n=Cu(e),r=Cu(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Bu.has(e)&&!r.values.length||Bu.has(t)&&!n.values.length?Vu(e,t):cl(Wu(Ku(n,r),r.values),Tu(r)):Nu(e,t)},Ju=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Yu(e,t){let n=Ju.exec(e);if(!n)return;let r=Ju.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Rl(Pu(a,o,e))+i}function Xu(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Pu(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Yu(e,t);if(n)return n}return Uu(e)(e,t)}var Zu=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function X(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a,o=/* @__PURE__ */ new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Z=40;function Qu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Zu.reduce((e,t)=>(e[t]=X(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=nl.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Z),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Zu.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Zu.length;t++)o[Zu[t]].cancel(e)},state:n,steps:o}}var{schedule:Q,cancel:$u,steps:ed}=/* @__PURE__ */ Qu(typeof requestAnimationFrame<`u`?requestAnimationFrame:sl,!0,Fl),td=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Q.update(t,e),stop:()=>$u(t),now:()=>Fl.isProcessing?Fl.timestamp:q.now()}},nd=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},rd=2e4;function id(e,t=50,n=rd,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ad(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(id(o),rd);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ fl(s)}}var od=100,sd=10,cd=1,ld=800,ud=.3,dd=.3,fd=.01,pd=2,md=.005,hd=.5,gd=.01,_d=10,vd=.05,yd=e=>e<0?1/Math.max(1+e,vd):Math.max(1-e,vd);function bd(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cd(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xd(e,t){return e*Math.sqrt(1-t*t)}var Sd=12;function Cd(e,t,n){let r=n;for(let n=1;n<Sd;n++)r-=e(r)/t(r);return r}var wd=.001;function Td({duration:e=ld,bounce:t=ud}){let n,r,i=yd(t);e=tl(gd,_d,/* @__PURE__ */ fl(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xd(t,i),o=Math.exp(-r);return wd-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xd(t*t,i);return(-n(t)+wd>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cd(n,r,a),s=o*bd(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ dl(e)}}var Ed=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dd(e,t){if(Ed(e,t))return e}function Od(e){let t=Dd(e.stiffness),n=Dd(e.damping,!0),r=Dd(e.mass),i={...e,stiffness:t??od,damping:n??sd,mass:r??cd,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yd(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bd(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Td(i)),i.isResolvedFromDuration=!0;Ed(i.stiffness)&&Ed(i.damping,!0)||(i.stiffness=od,i.damping=sd)}return i}function kd(e=dd,t=ud){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Od({...n}),f=e=>d?0:-/* @__PURE__ */ fl(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ fl(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?fd:pd),g.restDelta=n.restDelta||(e?md:hd)};_();let v,y,b;if(p<1){let e=xd(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ dl(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ dl(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(id(S),rd),t=nd(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var Ad=/* @__PURE__ */ Object.assign(kd,{applyToOptions:e=>{let t=ad(e,100,kd);return e.ease=t.ease,e.duration=/* @__PURE__ */ dl(t.duration),e.type=`keyframes`,e}});function jd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Ad({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Md(e,t,n){let r=[],i=n||nl.mix||Xu,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=cl(Array.isArray(t)?t[n]||sl:t,a)),r.push(a)}return r}function Nd(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Md(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ ll(e[r],e[r+1],n);return s[r](i)};return n?t=>l(tl(e[0],e[a-1],t)):l}function Pd(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ ll(0,t,r);e.push(Pu(n,1,i))}}function Fd(e){let t=[0];return Pd(t,e.length-1),t}function Id(e,t){return e.map(e=>e*t)}function Ld(e,t){return e.map(()=>t||Ol).splice(0,e.length-1)}function Rd({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ kl(r)?r.map(Pl):Pl(r)||Ol,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(nl.mix||Xu)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?tl(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Nd(Id(n&&n.length===t.length?n:Fd(t),e),t,{ease:Array.isArray(i)?i:Ld(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var zd=5;function Bd(e,t,n){let r=Math.max(t-zd,0);return/* @__PURE__ */ pl(n-e(r),t-r)}function Vd(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Bd(t=>e.next(t).value,t,e.next(t).value)}var Hd=e=>e!==null;function Ud(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Hd),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Wd={decay:jd,inertia:jd,tween:Rd,keyframes:Rd,spring:Ad};function Gd(e){typeof e.type==`string`&&(e.type=Wd[e.type])}var Kd=40,qd=(e,t)=>t-e>Kd&&!nl.useManualTiming?t:e;function Jd(e,t){return{kind:e,animation:t,timestamp:q.now(),frameTimestamp:Fl.timestamp,frameIsProcessing:Fl.isProcessing}}function Yd(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Jd(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Xd(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Jd(`layout-animation-start`,e),node:t})}catch{}}var Zd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Qd=e=>e/100,$d=e=>Math.round(e*1e4)/1e4,ef=class extends Zd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==q.now()&&this.tick(q.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Yd(this,this.options)}initAnimation(){let{options:e}=this;Gd(e);let{type:t=Rd,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Rd;s!==Rd&&typeof o[0]!=`number`&&(this.mixKeyframes=cl(Qd,Xu(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=id(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qd(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==jd&&(f.value=Ud(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??$d((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==jd?Ud(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=tl(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return/* @__PURE__ */ fl(this.calculatedDuration)}get iterationDuration(){return this.duration+/* @__PURE__ */ fl(this.options.delay??0)}get time(){return/* @__PURE__ */ fl(this.currentTime)}set time(e){e=/* @__PURE__ */ dl(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Vd(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(q.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ fl(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=td,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(q.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},tf=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function nf(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Jl)||[];if(!r)return e;let i=n.replace(r,``),a=+!!tf.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var rf=/\b([a-z-]*)\(.*?\)/gu,af={...Au,getAnimatableNone:e=>{let t=e.match(rf);return t?t.map(nf).join(` `):e}},of={...Au,getAnimatableNone:e=>{let t=Au.parse(e);return Au.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},sf={...Gl,transform:Math.round},cf={rotate:au,pathRotation:au,rotateX:au,rotateY:au,rotateZ:au,scale:ql,scaleX:ql,scaleY:ql,scaleZ:ql,skew:au,skewX:au,skewY:au,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:Kl,originX:lu,originY:lu,originZ:Y},lf={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...cf,zIndex:sf,fillOpacity:Kl,strokeOpacity:Kl,numOctaves:sf},uf={...lf,color:du,backgroundColor:du,outlineColor:du,fill:du,stroke:du,borderColor:du,borderTopColor:du,borderRightColor:du,borderBottomColor:du,borderLeftColor:du,filter:af,WebkitFilter:af,mask:of,WebkitMask:of},df=e=>uf[e],ff=/*@__PURE__*/ new Set([af,of]);function pf(e,t){let n=df(e);return ff.has(n)||(n=Au),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function mf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hf=e=>e*180/Math.PI,gf=e=>vf(hf(Math.atan2(e[1],e[0]))),_f={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gf,rotateZ:gf,skewX:e=>hf(Math.atan(e[1])),skewY:e=>hf(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vf=e=>(e%=360,e<0&&(e+=360),e),yf=gf,bf=e=>Math.hypot(e[0],e[1]),xf=e=>Math.hypot(e[4],e[5]),Sf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bf,scaleY:xf,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(bf(e)+xf(e))/2,rotateX:e=>vf(hf(Math.atan2(e[6],e[5]))),rotateY:e=>vf(hf(Math.atan2(-e[2],e[0]))),rotateZ:yf,rotate:yf,skewX:e=>hf(Math.atan(e[4])),skewY:e=>hf(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cf(e){return+!!e.includes(`scale`)}function wf(e,t){if(!e||e===`none`)return Cf(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Cf(t);let r=(n[1]?Sf:_f)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var Tf=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wf(n,t)},Ef=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Df=/* @__PURE__ */ new Set([...Ef,`pathRotation`]),Of=e=>e===Gl||e===Y,kf=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Af=/* @__PURE__ */ Ef.filter(e=>!kf.has(e));function jf(e){let t=[];return Af.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Mf=/* @__PURE__ */ new Set([`bottom`,`right`]);function Nf(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Pf=({transform:e})=>wf(e,`x`),Ff=({transform:e})=>wf(e,`y`),If={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Nf(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Nf(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Pf,y:Ff,translateX:Pf,translateY:Ff},Lf=/* @__PURE__ */ new Set,Rf=!1,zf=!1,Bf=!1;function $(){if(zf){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Lf.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Mf.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=jf(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}zf=!1,Rf=!1,Lf.forEach(e=>e.complete(Bf)),Lf.clear()}function Vf(){Lf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zf=!0)})}function Hf(){Bf=!0,Vf(),$(),Bf=!1}function Uf(e,t,n){if(typeof e==`string`){if(rl(e)||al(e))return parseFloat(e);if(!Au.test(e)&&Au.test(n))return pf(t,n)}return e??void 0}var Wf=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Lf.add(this),Rf||(Rf=!0,Q.read(Vf),Q.resolveKeyframes($))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Uf(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Lf.delete(this)}cancel(){this.state===`scheduled`&&(Lf.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Gf=e=>e.startsWith(`--`);function Kf(e,t,n){Gf(t)?e.style.setProperty(t,n):e.style[t]=n}var qf={};function Jf(e,t){let n=/* @__PURE__ */ ol(e);return()=>qf[t]??n()}var Yf=/* @__PURE__ */ Jf(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Xf=/*@__PURE__*/ Jf(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Zf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ Zf([0,.65,.55,1]),circOut:/*@__PURE__*/ Zf([.55,0,1,.45]),backIn:/*@__PURE__*/ Zf([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ Zf([.33,1.53,.69,.99])};function $f(e,t){if(e)return typeof e==`function`?Xf()?nd(e,t):`ease-out`:/* @__PURE__ */ jl(e)?Zf(e):Array.isArray(e)?e.map(e=>$f(e,t)||Qf.easeOut):Qf[e]}function ep(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=$f(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function tp(e){return typeof e==`function`&&`applyToOptions`in e}function np({type:e,...t}){return tp(e)&&Xf()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var rp=class extends Zd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=np(e);this.animation=ep(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ud(r,this.options,o,this.speed);this.updateMotionValue?.(e),Kf(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Yd(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ fl(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ fl(e)}get time(){return/* @__PURE__ */ fl(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ dl(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Yf()?(this.animation.timeline=e,t?.(this.animation),sl):n(this)}},ip={anticipate:Sl,backInOut:xl,circInOut:Tl};function ap(e){return e in ip}function op(e){typeof e.ease==`string`&&ap(e.ease)&&(e.ease=ip[e.ease])}var sp=class extends rp{constructor(e){op(e),Gd(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(q.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new ef({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?tl(0,10,a):0,s=this.sample(a);n&&r&&Kf(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},cp=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Au.test(e)||e===`0`)&&!e.startsWith(`url(`));function lp(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function up(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=cp(i,t),s=cp(a,t);return!o||!s?!1:lp(e)||(n===`spring`||tp(n))&&r}function dp(e){e.duration=0,e.type=`keyframes`}var fp=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`]),pp=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function mp(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&pp.test(e[t]))return!0;return!1}var hp=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),gp=()=>!nl.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function _p(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(fp.has(n)||hp.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return gp()&&(fp.has(n)||hp.has(n)&&mp(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var vp=(e,t)=>t&&typeof e==`number`?t.transform(e):e,yp={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},bp=Ef.length,xp={},Sp=(e,t,n=vp(t,cf[e]))=>(xp[e]||(xp[e]=(yp[e]||e)+`(`))+n+`)`,Cp=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function wp(e,t,n){let r=``;for(let i=0;i<bp;i++){let a=Ef[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=vp(o,lf[a]));Cp(a,o)||(r+=Sp(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=Sp(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var Tp=/* @__PURE__ */ new WeakMap,Ep=200,Dp=.001,Op=.1,kp=.001,Ap=100,jp=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Mp=(e,t)=>e-t,Np=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(Pu(e,t,i/n));return r},Pp=e=>e.motionValue.owner,Fp=e=>Tp.get(e),Ip=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Lp=({name:e,motionValue:t})=>e&&Ef.includes(e)&&t?.owner?.current instanceof HTMLElement&&gp()&&Xf();function Rp(e){let t=Pp(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Ip(t,`transform`)||`none`)===`none`&&!Ip(t,`pathRotation`)&&!t.projection?.isProjecting()}var zp=class extends ef{constructor(e){let t=Pp(e).current,{driver:n=td}=e,r,i=Rp(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Fp(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Fp(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Fp(Pp(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(q.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ jl(n)?Zf(n):jp(n)&&Qf[n];if(o&&!i&&!r&&e.length===2&&t===Rd&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Rd)===Rd?u||Fd(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=q.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||Bp(Pp(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(q.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ fl(tl(0,this.totalDuration,this.at(q.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function Bp(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?Ef:a){let a=r.get(s),c=t===void 0?Ip(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&Cp(r,i)||(n+=Sp(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=q.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),A.schedule(!1)}),e.oncancel=()=>s.includes(r)&&A.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(Ep,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Np(t,n,i).concat(r).sort(Mp),o=e=>/* @__PURE__ */ ll(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Dp>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=Dp)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=Dp)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=Dp))return`linear`;let l=[],u=(e,t=c(e))=>l.push($d(t)+` `+$d(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?kp:Op))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=Np(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Mp))e>c&&o(c,e,0),c=e;return i.sort(Mp)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},T=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>/* @__PURE__ */ ll(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},E=t=>{let c=t,l=0,u=0,d=[],f=[],p=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=Ef.filter(t=>{if(r.has(t))return!0;let n=i[t]=Ip(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(T(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(T(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(T(f,e,e+l,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},D=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},O=()=>!n.size&&(u=!0,Fp(t)===A&&Tp.delete(t),A.isJS||v(),!0),k=()=>{let t=q.now();if(A.isJS||(A.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Ip(e,n.name),o.has(n)||(c=!0))}),A.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),O()))return;for(let e of n)if(!e.canAccelerate)return A.demote(!0);A.isJS&&(A.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!D(t)){if(a){if(t-f<Ap)return A.demote();f=t}if(!E(t))return A.demote()}},A={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Fl.isProcessing?Q.render(k,!1,!0):queueMicrotask(k)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),O()||A.schedule(!0)},check(){if(!A.isJS){for(let t in i)if(Ip(e,t)!==i[t]&&!p(t))return A.schedule(!0,!0)}},demote(e){if(!(A.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),A.isJS=!0,o=/* @__PURE__ */ new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Tp.set(t,A),A}var Vp=class extends Zd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=q.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Wf;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=q.now();let u=up(e,i,a,o);u||((nl.instantAnimations||!s)&&l?.(Ud(e,n,t)),e[0]=e[e.length-1],dp(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&_p(n),p=!f&&Lp(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=qd(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new sp(n)}catch{m=new ef(n)}}else m=p?new zp(n):new ef(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Hp=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Up(this.animations,`duration`)}get iterationDuration(){return Up(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Up(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Wp=class extends Hp{then(e,t){return this.finished.finally(e).then(()=>{})}};function Gp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Kp=30,qp=e=>!isNaN(parseFloat(e)),Jp={current:void 0},Yp=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=q.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=q.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qp(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ul)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ul,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Q.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=/* @__PURE__ */ new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Jp.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=q.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Kp)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Kp);return/* @__PURE__ */ pl(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Xp(e,t){return new Yp(e,t)}function Zp(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Qp(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Zp(n,e)}var $p={type:`spring`,stiffness:500,damping:25,restSpeed:10},em=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tm={type:`keyframes`,duration:.8},nm={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},rm=(e,{keyframes:t})=>t.length>2?tm:Df.has(e)?e.startsWith(`scale`)?em(t[1]):$p:nm,im=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function am(e){for(let t in e)if(!im.has(t))return!0;return!1}var om=(e,t,n,r={},i,a)=>o=>{let s=Qp(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ dl(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};am(s)||Object.assign(u,rm(e,u)),u.duration&&=/* @__PURE__ */ dl(u.duration),u.repeatDelay&&=/* @__PURE__ */ dl(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(dp(u),u.delay===0&&(d=!0)),(nl.instantAnimations||nl.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,dp(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ud(u.keyframes,s);if(e!==void 0){Q.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ef(u):new Vp(u)},sm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cm(e){let t=sm.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function lm(e,t,n=1){let[r,i]=cm(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return rl(e)?parseFloat(e):e}return Hl(i)?lm(i,t,n+1):i}function um(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function dm(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...um(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function fm(e,t,n){return dm(e.getProps(),t,n,e)}var pm=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,mm=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ef]),hm=e=>Array.isArray(e);function gm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xp(n))}function _m(e){return hm(e)?e[e.length-1]||0:e}function vm(e,t){let{transitionEnd:n={},transition:r={},...i}=fm(e,t)||{};i={...i,...n};for(let t in i)gm(e,t,_m(i[t]))}var ym=e=>!!(e&&e.getVelocity);function bm(e){return!!(ym(e)&&e.add)}function xm(e,t){let n=e.getValue(`willChange`);if(bm(n))return n.add(t);if(!n&&nl.WillChange){let n=new nl.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var Sm=`data-framer-appear-id`;function Cm(e){return e.props[Sm]}var wm=typeof window<`u`;function Tm({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Em(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Zp(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Tm(f,t))continue;let o={delay:n,...Qp(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Q.update(()=>r.set(i));continue}let p=!1;if(wm&&window.MotionHandoffAnimation){let n=Cm(e);if(n){let e=window.MotionHandoffAnimation(n,t,Q);e!==null&&(o.startTime=e,p=!0)}}xm(e,t);let m=l??e.shouldReduceMotion;r.start(om(t,r,i,m&&mm.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Q.update(()=>{o&&vm(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Dm(e,t,n={}){let r=fm(e,t,pm(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Em(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Dm(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Gp(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Om(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Dm(e,t,n))):typeof t==`string`?Dm(e,t,n):Promise.all(Em(e,fm(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var km={test:e=>e===`auto`,parse:e=>e},Am=e=>t=>t.test(e),jm=[Gl,Y,ou,au,cu,su,km],Mm=e=>jm.find(Am(e));function Nm(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||al(e)}var Pm=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function Fm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Pm.has(t)&&Su(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=pf(n,i))}var Im=class extends Wf{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Wl(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Hl(r))){let i=lm(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!mm.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Mm(r),o=Mm(i);if(Wl(r)!==Wl(i)&&If[n])this.needsMeasurement=!0;else if(a!==o){if(Of(a)&&Of(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else If[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Nm(e[t]))&&n.push(t);n.length&&Fm(e,n,t)}measure(){let{element:e,name:t}=this;return If[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Lm=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],Rm=[];function zm(e){Bm(e),Rm.unshift(e)}function Bm(e){el(Rm,e)}function Vm(e){return Rm.find(t=>t.test(e))}function Hm(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Q.update(()=>l.set(c)):(l.start(om(o,l,c,s&&mm.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Q.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Um(e,t,n,r,i){return Hm(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=Wm(i)??e.read(t,r,i)}a=Xp(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function Wm(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Gm(e){return il(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Km(e){return il(e)&&`ownerSVGElement`in e}var qm={};function Jm(e){return qm.current?.add(e),e}var Ym=e=>qm.current?qm.current.bind(e):e;function Xm(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:qm.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Zm=class{constructor(e=Q.render){this.step=e,this.values=/* @__PURE__ */ new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=/* @__PURE__ */ new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Qm(e,{step:t,...n}={}){let r=/* @__PURE__ */ new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new Zm(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function $m(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(Cp(i,a)||(t+=(t&&` `)+Sp(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+Sp(`rotate`,i)),t||`none`}var eh=/* @__PURE__ */ new Set([`originX`,`originY`,`originZ`]),th=(e,t)=>vp(e.get(t)?.get(),lf[t]),nh=(e,t,n,r)=>{let i,a;if(Df.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>Ef.indexOf(e)-Ef.indexOf(t)))}t.get(`transform`)||(!Gm(e)&&!t.get(`transformBox`)&&nh(e,t,`transformBox`,new Yp(`fill-box`)),t.set(`transform`,new Yp(`none`),()=>{Tp.get(e)?.check(),e.style.transform=$m(t)})),a=t.get(`transform`)}else eh.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new Yp(``),()=>{let n=th(t,`originX`)??`50%`,r=th(t,`originY`)??`50%`,i=th(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Gf(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=vp(r.getCurrent(),lf[n])};return t.set(n,r,i,a)},rh=e=>Gm(e)||Km(e),ih=(e,t)=>{if(Df.has(t))return Tf(e,t);let n=getComputedStyle(e),r=Gf(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},ah=/*@__PURE__*/ Qm(nh,{test:rh,read:ih});function oh(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function sh(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Df.has(e))o=!0;else if(Bl(e))i[e]=n;else{let t=vp(n,lf[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=wp(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ch={offset:`stroke-dashoffset`,array:`stroke-dasharray`},lh={offset:`strokeDashoffset`,array:`strokeDasharray`};function uh(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ch:lh;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var dh=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function fh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sh(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of dh)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&uh(d,i,a,o,!1)}function ph(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var mh=(e,t,n,r,i=n)=>{let a=ph(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=oh(i));let o=lf[n]||lf[i],s=a?()=>{e[i]=vp(r.get(),lf[n])}:()=>{let t=vp(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function hh(e,t,n,r){return Q.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new Yp(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var gh=/*@__PURE__*/ Qm((e,t,n,r)=>n.startsWith(`path`)&&!Df.has(n)?hh(e,t,n,r):n.startsWith(`attr`)?mh(e,t,n,r,_h(n)):(Df.has(n)||eh.has(n)||Gf(n)||n in e.style?nh:mh)(e,t,n,r),{test:Km,read:(e,t)=>Df.has(t)?lf[t]?.default||0:Gf(t)||dh.includes(t)?ih(e,t)||e.getAttribute(oh(t))||0:(t=_h(t),e.getAttribute(oh(t))??e.getAttribute(t)??void 0)});function _h(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function vh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xh(e){return e===void 0||e===1}function Sh({scale:e,scaleX:t,scaleY:n}){return!xh(e)||!xh(t)||!xh(n)}var Ch=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function wh(e){return Sh(e)||Eh(e)||Th(e)}function Th(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function Eh(e){return Dh(e.x)||Dh(e.y)}function Dh(e){return e&&e!==`0%`}function Oh(e,t,n){return n+t*(e-n)}function kh(e,t,n,r,i){return i!==void 0&&(e=Oh(e,i,r)),Oh(e,n,r)+t}function Ah(e,t=0,n=1,r,i){e.min=kh(e.min,t,n,r,i),e.max=kh(e.max,t,n,r,i)}function jh(e,{x:t,y:n}){Ah(e.x,t.translate,t.scale,t.originPoint),Ah(e.y,n.translate,n.scale,n.originPoint)}var Mh=.999999999999,Nh=1.0000000000001;function Ph(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Fh(e.x,-a.scroll.offset.x),Fh(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,jh(e,o)),r&&(r.path?.[s]||r)!==a&&wh(a.latestValues)&&Rh(e,a.latestValues,a.layout?.layoutBox));t.x<Nh&&t.x>Mh&&(t.x=1),t.y<Nh&&t.y>Mh&&(t.y=1)}function Fh(e,t){e.min+=t,e.max+=t}function Ih(e,t,n,r,i=.5){Ah(e,t,n,Pu(e.min,e.max,i),r)}function Lh(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Rh(e,t,n){let r=n??e;Ih(e.x,Lh(t.x,r.x),t.scaleX,t.scale,t.originX),Ih(e.y,Lh(t.y,r.y),t.scaleY,t.scale,t.originY)}function zh(e,t){return vh(bh(e.getBoundingClientRect(),t))}function Bh(e,t,n){let r=zh(e,n),{scroll:i}=t;return i&&(Fh(r.x,i.offset.x),Fh(r.y,i.offset.y)),r}var Vh={},Hh=e=>Km(e)?gh:ah,Uh=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=Im}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return zh(this.current)}getProps(){return Vh}};function Wh(e,t,n,r){if(qm.current?.track(e),r)return Hm(e=>r.getValue(e,null),t,n,r);let i=Hh(e);return Um(i,e,t,n,new Uh(i,e))}var Gh=/*@__PURE__*/ Qm((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>il(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Kh,cancel:qh}=/* @__PURE__ */ Qu(queueMicrotask,!1);function Jh(e,t,n){let r=ym(e)?e:Xp(e);return r.start(om(``,r,t,n)),r.animation}var Yh={},Xh={value:null,addProjectionMetrics:null};function Zh(e,t){let n=q.now();e=Ym(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&($u(r),e(a-t))};return Q.setup(r,!0),Jm(()=>$u(r))}function Qh(e){return Km(e)&&e.tagName===`svg`}function $h(e){return ym(e)?e.get():e}var eg=e=>typeof e==`number`?e:parseFloat(e),tg=Lm.length,ng=e=>typeof e==`number`||Y.test(e);function rg(e,t,n,r,i,a){i?(e.opacity=Pu(0,n.opacity??1,ag(r)),e.opacityExit=Pu(t.opacity??1,0,og(r))):a&&(e.opacity=Pu(t.opacity??1,n.opacity??1,r));for(let i=0;i<tg;i++){let a=Lm[i],o=ig(t,a),s=ig(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ng(o)===ng(s)?(e[a]=Math.max(Pu(eg(o),eg(s),r),0),(ou.test(s)||ou.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<Ch.length;i++){let a=Ch[i];(t[a]||n[a])&&(e[a]=Pu(t[a]||0,n[a]||0,r))}}function ig(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ag=/*@__PURE__*/ sg(0,.5,wl),og=/*@__PURE__*/ sg(.5,.95,sl);function sg(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ ll(e,t,r))}function cg(e,t){e.min=t.min,e.max=t.max}function lg(e,t){cg(e.x,t.x),cg(e.y,t.y)}function ug(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var dg=.9999,fg=1.0001,pg=-.01,mg=.01;function hg(e){return e.max-e.min}function gg(e,t,n){return Math.abs(e-t)<=n}function _g(e,t,n,r=.5){e.origin=r,e.originPoint=Pu(t.min,t.max,e.origin),e.scale=hg(n)/hg(t),e.translate=Pu(n.min,n.max,e.origin)-e.originPoint,(e.scale>=dg&&e.scale<=fg||isNaN(e.scale))&&(e.scale=1),(e.translate>=pg&&e.translate<=mg||isNaN(e.translate))&&(e.translate=0)}function vg(e,t,n,r){_g(e.x,t.x,n.x,r?.originX),_g(e.y,t.y,n.y,r?.originY)}function yg(e,t,n,r=0){e.min=(r?Pu(n.min,n.max,r):n.min)+t.min,e.max=e.min+hg(t)}function bg(e,t,n,r){yg(e.x,t.x,n.x,r?.x),yg(e.y,t.y,n.y,r?.y)}function xg(e,t,n,r=0){let i=r?Pu(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+hg(t)}function Sg(e,t,n,r){xg(e.x,t.x,n.x,r?.x),xg(e.y,t.y,n.y,r?.y)}function Cg(e,t,n,r,i){return e-=t,e=Oh(e,1/n,r),i!==void 0&&(e=Oh(e,1/i,r)),e}function wg(e,t=0,n=1,r=.5,i,a=e,o=e){if(ou.test(t)&&(t=parseFloat(t),t=Pu(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Pu(a.min,a.max,r);e===a&&(s-=t),e.min=Cg(e.min,t,n,s,i),e.max=Cg(e.max,t,n,s,i)}function Tg(e,t,[n,r,i],a,o){wg(e,t[n],t[r],t[i],t.scale,a,o)}var Eg=[`x`,`scaleX`,`originX`],Dg=[`y`,`scaleY`,`originY`];function Og(e,t,n,r){Tg(e.x,t,Eg,n?.x,r?.x),Tg(e.y,t,Dg,n?.y,r?.y)}var kg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ag=()=>({x:kg(),y:kg()}),jg=()=>({min:0,max:0}),Mg=()=>({x:jg(),y:jg()});function Ng(e){return e.translate===0&&e.scale===1}function Pg(e){return Ng(e.x)&&Ng(e.y)}function Fg(e,t){return e.min===t.min&&e.max===t.max}function Ig(e,t){return Fg(e.x,t.x)&&Fg(e.y,t.y)}function Lg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rg(e,t){return Lg(e.x,t.x)&&Lg(e.y,t.y)}function zg(e){return hg(e.x)/hg(e.y)}function Bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Vg=class{constructor(){this.members=[]}add(e){$c(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(el(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(el(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Hg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ug={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Y.test(e))e=parseFloat(e);else return e}return`${Hg(e,t.target.x)}% ${Hg(e,t.target.y)}%`}},Wg={borderRadius:/* @__PURE__ */ Object.assign({},Ug,{applyTo:/* @__PURE__ */ Lm.slice()}),borderTopLeftRadius:Ug,borderTopRightRadius:Ug,borderBottomLeftRadius:Ug,borderBottomRightRadius:Ug,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Au.parse(e);if(i.length>5)return r;let a=Au.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Pu(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Gg(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<Ch.length;e++){let t=Ch[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Kg(e){return[e(`x`),e(`y`)]}var qg=(e,t)=>e.depth-t.depth,Jg=class{constructor(){this.children=[],this.isDirty=!1}add(e){$c(this.children,e),this.isDirty=!0}remove(e){el(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qg),this.isDirty=!1,this.children.forEach(e)}},Yg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xg={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Zg=[`z`,`skew`,`skewZ`],Qg=1e3,$g=0;function e_(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var t_=e=>e.instance&&Tp.get(e.instance)?.demote()&&e.resetSkewAndRotation();function n_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Cm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Q,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&n_(r)}function r_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Yh,{...Wg,...Yh}),class{constructor(e={},n=t?.()){this.id=$g++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xh.value&&(Xg.nodes=Xg.calculatedTargetDeltas=Xg.calculatedProjections=0),this.nodes.forEach(o_),this.nodes.forEach(__),this.nodes.forEach(v_),this.nodes.forEach(s_),Xh.addProjectionMetrics&&Xh.addProjectionMetrics(Xg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jg)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ul),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Km(t)&&!Qh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Q.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Zh(i,250),Yg.hasAnimatedSinceResize&&(Yg.hasAnimatedSinceResize=!1,this.nodes.forEach(g_)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||w_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Rg(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Qp(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||g_(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,$u(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(y_),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&n_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;t_(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t_(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(u_),this.nodes.forEach(l_);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d_);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p_),this.nodes.forEach(m_),this.nodes.forEach(h_),this.nodes.forEach(i_),this.nodes.forEach(a_)):this.nodes.forEach(d_),this.clearAllSnapshots();let e=q.now();Fl.delta=tl(0,1e3/60,e-Fl.timestamp),Fl.timestamp=e,Fl.isProcessing=!0,ed.update.process(Fl),ed.preRender.process(Fl),ed.render.process(Fl),Fl.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(c_),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!hg(this.snapshot.measuredBox.x)&&!hg(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Mg(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&t_(this);let t=this.projectionDelta&&!Pg(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||wh(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),O_(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Mg();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(j_))){let{scroll:e}=this.root;e&&(Fh(t.x,e.offset.x),Fh(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Mg();if(lg(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&lg(t,e),Fh(t.x,i.offset.x),Fh(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||Mg();lg(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Fh(a.x,-n.scroll.offset.x),Fh(a.y,-n.scroll.offset.y)),wh(n.latestValues)&&Rh(a,n.latestValues,n.layout?.layoutBox)}return!r&&wh(this.latestValues)&&Rh(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=Mg();lg(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!wh(n.latestValues))continue;let r;n.instance&&(Sh(n.latestValues)&&n.updateSnapshot(),r=Mg(),lg(r,n.measurePageBox())),Og(t,n.latestValues,n.snapshot?.layoutBox,r)}return wh(this.latestValues)&&Og(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Fl.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Fl.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Mg(),this.targetWithTransforms=Mg()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):lg(this.target,this.layout.layoutBox),jh(this.target,this.targetDelta)):lg(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Xh.value&&Xg.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Sh(this.parent.latestValues)||Eh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mg(),this.relativeTargetOrigin=Mg(),Sg(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),lg(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Fl.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;lg(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ph(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Mg());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ug(this.prevProjectionDelta.x,this.projectionDelta.x),ug(this.prevProjectionDelta.y,this.projectionDelta.y)),vg(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Bg(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bg(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Xh.value&&Xg.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ag(),this.projectionDelta=Ag(),this.projectionDeltaWithTransform=Ag()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ag();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Mg(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(C_));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);b_(o.x,e.x,n),b_(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sg(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),S_(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Ig(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Mg(),lg(f,this.relativeTarget)),c&&(this.animationValues=a,rg(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=($u(this.pendingAnimation),void 0),this.pendingAnimation=Q.update(()=>{Yg.hasAnimatedSinceResize=!0,this.motionValue||=Xp(0),this.motionValue.jump(0,!1),this.currentAnimation=Jh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Xd(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Qg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&A_(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||Mg(),k_(i.x,t.x,e.x),k_(i.y,t.y,e.y)}lg(t,i),Rh(t,r),vg(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vg),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!Th(t))return;let n={};for(let t=0;t<Zg.length;t++)e_(Zg[t],e,n,this.animationValues);for(let t=0;t<Ch.length;t++)e_(Ch[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=$h(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=$h(t?.pointerEvents)||``),this.hasProjected&&!wh(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Gg(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Yh){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Yh[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?$h(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(l_),this.root.sharedNodes.clear()}}}function i_(e){e.updateLayout(),f_(e)}function a_(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Kg(e=>{let t=hg(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;cg(r[e],a[e])}else A_(i,t.layoutBox,n)&&Kg(t=>{let n=hg(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Ag();vg(c,n,t.layoutBox);let l=Ag();vg(l,a?e.applyTransform(r,!0):n,s);let u=!Pg(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=Mg();Sg(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=Mg();Sg(l,n,i.layoutBox,s),a&&o(c,l),Rg(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function o_(e){Xh.value&&Xg.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function s_(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function c_(e){e.clearSnapshot()}function l_(e){e.clearMeasurements()}function u_(e){e.isLayoutDirty=!0,e.updateLayout()}function d_(e){e.isLayoutDirty=!1}function f_(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Kg(e=>Fh(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function p_(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function m_(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function h_(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function g_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function __(e){e.resolveTargetDelta()}function v_(e){e.calcProjection()}function y_(e){e.resetSkewAndRotation()}function b_(e,t,n){e.translate=Pu(t.translate,0,n),e.scale=Pu(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function x_(e,t,n,r){e.min=Pu(t.min,n.min,r),e.max=Pu(t.max,n.max,r)}function S_(e,t,n,r){x_(e.x,t.x,n.x,r),x_(e.y,t.y,n.y,r)}function C_(e){return e.animationValues?.opacityExit!==void 0}var w_={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),E_=T_(`applewebkit/`)&&!T_(`chrome/`)?Math.round:sl;function D_(e){e.min=E_(e.min),e.max=E_(e.max)}function O_(e){D_(e.x),D_(e.y)}function k_(e,t,n){e.max=hg(n)+(e.min=t.min)}function A_(e,t,n){return e===`position`||e===`preserve-aspect`&&!gg(zg(t),zg(n),.2)}function j_(e){return e!==e.root&&e.scroll?.wasRoot}function M_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var N_=/* @__PURE__ */ r_({attachResizeListener:(e,t)=>M_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),P_={current:void 0},F_=/* @__PURE__ */ r_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!P_.current){let e=new N_({});e.mount(window),e.setOptions({layoutScroll:!0}),P_.current=e}return P_.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),I_=/* @__PURE__ */ new WeakMap;function L_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function R_(e){return typeof e==`string`||Array.isArray(e)}var z_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],B_=/* @__PURE__ */ [`initial`].concat(z_);function V_(e){if(L_(e.animate))return!0;for(let t=0;t<B_.length;t++)if(R_(e[B_[t]]))return!0;return!1}function H_(e){return!!(V_(e)||e.variants)}function U_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ym(i))e.addValue(r,i);else if(ym(a))e.addValue(r,Xp(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Xp(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var W_={current:null},G_={current:!1},K_=typeof window<`u`;function q_(){if(G_.current=!0,K_){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>W_.current=e.matches;e.addEventListener(`change`,t),t()}else W_.current=!1}}var J_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Y_={};function X_(e){Y_=e}function Z_(){return Y_}var Q_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Wf,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=q.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Q.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=V_(t),this.isVariantNode=H_(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ym(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,I_.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(G_.current||q_(),this.shouldReduceMotion=W_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),$u(this.notifyUpdate),$u(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&fp.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new rp({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ dl(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Df.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Q.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Tp.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Y_){let t=Y_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mg()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Tp.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<J_.length;t++){let n=J_[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=U_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Xp(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(rl(n)||al(n))?n=parseFloat(n):typeof n!=`number`&&!Au.test(n)&&Au.test(t)&&(n=pf(e,t)),this.setBaseTarget(e,ym(n)?n.get():n)),ym(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ul)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Kh.render(this.render)}},$_=class extends Q_{constructor(){super(...arguments),this.KeyframeResolver=Im}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ym(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function ev(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function tv(e,{layout:t,layoutId:n}){return Df.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Yh[e]||e===`opacity`)}function nv(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ym(r[t])||i&&ym(i[t])||tv(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function rv(e){return window.getComputedStyle(e)}var iv=class extends $_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=ev}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Df.has(t))return this.projection?.isProjecting?Cf(t):Tf(e,t);{let n=rv(e),r=(Bl(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return zh(e,t)}build(e,t,n){sh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return nv(e,t,n)}},av=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function ov(e){return{point:{x:e.pageX,y:e.pageY}}}var sv=e=>t=>av(t)&&e(t,ov(t));function cv(e,t,n,r){return M_(e,t,sv(n),r)}var lv=/* @__PURE__ */ new WeakMap,uv,dv=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Km(r)&&`getBBox`in r?r.getBBox()[t]:r[n],fv=/*@__PURE__*/ dv(`inline`,`width`,`offsetWidth`),pv=/*@__PURE__*/ dv(`block`,`height`,`offsetHeight`);function mv({target:e,borderBoxSize:t}){lv.get(e)?.forEach(n=>{n(e,{get width(){return fv(e,t)},get height(){return pv(e,t)}})})}function hv(e){e.forEach(mv)}function gv(){typeof ResizeObserver<`u`&&(uv=new ResizeObserver(hv))}function _v(e,t){uv||gv();let n=Xm(e);return n.forEach(e=>{let n=lv.get(e);n||(n=/* @__PURE__ */ new Set,lv.set(e,n)),n.add(t),uv?.observe(e)}),()=>{n.forEach(e=>{let n=lv.get(e);n?.delete(t),n?.size||uv?.unobserve(e)})}}var vv=/* @__PURE__ */ new Set,yv;function bv(){yv=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};vv.forEach(t=>t(e))},window.addEventListener(`resize`,yv)}function xv(e){return vv.add(e),yv||bv(),()=>{vv.delete(e),!vv.size&&typeof yv==`function`&&(window.removeEventListener(`resize`,yv),yv=void 0)}}function Sv(e,t){return Jm(typeof e==`function`?xv(e):_v(e,t))}var Cv=(e,t)=>Math.abs(e-t);function wv(e,t){let n=Cv(e.x,t.x),r=Cv(e.y,t.y);return Math.sqrt(n**2+r**2)}var Tv=/*#__PURE__*/ new Set([`auto`,`scroll`]),Ev=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ov(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Av(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=wv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:q.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ov(t,this.transformPagePoint),this.hasPendingMove=!0,Q.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Av(e.type===`pointercancel`?this.lastMoveEventInfo:Ov(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!av(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Ov(ov(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:q.now()}];let{onSessionStart:l}=t;l&&l(e,Av(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=cl(cv(this.contextWindow,`pointermove`,this.handlePointerMove,u),cv(this.contextWindow,`pointerup`,this.handlePointerUp,u),cv(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Tv.has(e.overflowX)||Tv.has(e.overflowY))&&this.scrollPositions.set(t,Dv(t)),t=t.parentElement}this.scrollPositions.set(window,Dv(window)),this.removeScrollListeners=cl(M_(window,`scroll`,this.onElementScroll,{capture:!0}),M_(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=Dv(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),$u(this.updatePoint)}},Dv=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function Ov(e,t){return t?{point:t(e.point)}:e}function kv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Av({point:e},t){return{point:e,delta:kv(e,Mv(t)),offset:kv(e,jv(t)),velocity:Nv(t,.1)}}function jv(e){return e[0]}function Mv(e){return e[e.length-1]}function Nv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Mv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ dl(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ dl(t)*2&&(r=e[1]);let a=/* @__PURE__ */ fl(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Pv=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Fv(e){return Pv.has(e.tagName)||e.isContentEditable===!0}var Iv=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Lv(e){return Iv.has(e.tagName)||e.isContentEditable===!0}var Rv={x:!1,y:!1};function zv(){return Rv.x||Rv.y}function Bv(e){return e===`x`||e===`y`?Rv[e]?null:(Rv[e]=!0,()=>{Rv[e]=!1}):Rv.x||Rv.y?null:(Rv.x=Rv.y=!0,()=>{Rv.x=Rv.y=!1})}function Vv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pu(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pu(n,e,r.max):Math.min(e,n)),e}function Hv(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Uv(e,{top:t,left:n,bottom:r,right:i}){return{x:Hv(e.x,n,i),y:Hv(e.y,t,r)}}function Wv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Gv(e,t){return{x:Wv(e.x,t.x),y:Wv(e.y,t.y)}}function Kv(e,t){let n=.5,r=hg(e),i=hg(t);return i>r?n=/* @__PURE__ */ ll(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ ll(e.min,e.max-i,t.min)),tl(0,1,n)}function qv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Jv=.35;function Yv(e=Jv){return e===!1?e=0:e===!0&&(e=Jv),{x:Xv(e,`left`,`right`),y:Xv(e,`top`,`bottom`)}}function Xv(e,t,n){return{min:Zv(e,t),max:Zv(e,n)}}function Zv(e,t){return typeof e==`number`?e:e[t]||0}function Qv(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var $v=/* @__PURE__ */ new WeakMap,ey=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mg(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=Bv(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Kg(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Hl(t)&&(t=lm(t,this.visualElement.current)||0),Y.test(t))t=parseFloat(t);else if(ou.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=hg(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Q.update(()=>i(e,t),!1,!0),xm(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=oy(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Q.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ev(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Q.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!ay(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Vv(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;ty(e)?this.constraints&&this.scroll===Qv(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?Uv(r.layoutBox,e):!1,this.elastic=Yv(t),i!==this.constraints&&!ty(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Kg(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=qv(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!ty(e))return!1;let n=ny(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Qv(r);let i=Bh(n,r.root,this.visualElement.getTransformPagePoint()),a=Gv(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(yh(a));this.hasMutatedConstraints=!!e,e&&(a=vh(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Kg(s=>{if(!ay(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return xm(this.visualElement,e),n.start(om(e,n,0,t,this.visualElement,!1))}stopAnimation(){Kg(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Kg(e=>{if(!ay(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Pu(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ty(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Kg(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Kv({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Kg(t=>{let n=this.getAxisMotionValue(t);if(!ay(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Pu(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$v.set(this.visualElement,this);let e=this.visualElement.current,t=cv(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Lv(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=ty(t)&&ny(t);r&&(this.constraints=this.resolveRefConstraints(),n||=iy(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Q.read(r);let o=M_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Kg(t=>{if(!ay(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Jv,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function ty(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var ny=e=>`current`in e?e.current:e;function ry(e){let t=!0;return()=>{t?t=!1:e()}}function iy(e,t,n){let r=Sv(e,ry(n)),i=Sv(t,ry(n));return()=>{r(),i()}}function ay(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oy(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function sy(e,t){let n=Xm(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Jm(()=>r.abort())]}function cy(e){return!(e.pointerType===`touch`||zv())}function ly(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!cy(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var uy=(e,t)=>t?e===t||uy(e,t.parentElement):!1,dy=/* @__PURE__ */ new WeakSet;function fy(e){return t=>{t.key===`Enter`&&e(t)}}function py(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var my=(e,t)=>{let n=!1,r=fy(()=>{dy.has(e)||(n=!0,py(e,`down`))}),i=fy(()=>{n&&(n=!1,py(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&py(e,`cancel`)},{...t,once:!0})};function hy(e){return av(e)&&!zv()}var gy=/* @__PURE__ */ new WeakSet;function _y(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n),o=e=>{let r=e.currentTarget;if(!hy(e)||gy.has(e))return;dy.add(r),n.stopPropagation&&gy.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),dy.has(r)&&dy.delete(r),hy(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||uy(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Gm(e)&&(e.addEventListener(`focus`,()=>my(e,i),i),!Fv(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var vy=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},yy=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),by=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function xy(e,t,n,r){ev(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(yy.has(n)?n:oh(n),t.attrs[n])}function Sy(e,t,n){let r=nv(e,t,n);for(let n in e)if(n!==`children`&&(ym(e[n])||ym(t[n]))){let t=Ef.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Cy=class extends $_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Mg}getBaseTargetFromProps(e,t){return Df.has(t)?super.getBaseTargetFromProps(e,t)??Cf(t):e[t]}getDefaultValue(e){return Df.has(e)?this.latestValues[e]??Cf(e):void 0}readValueFromInstance(e,t){if(Df.has(t)){let e=df(t);return e&&e.default||0}if(dh.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=yy.has(t)?t:oh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Sy(e,t,n)}build(e,t,n){fh(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){xy(e,t,n,r)}mount(e){this.isSVGTag=by(e.tagName),super.mount(e)}};function wy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Ty=[...z_].reverse(),Ey=e=>e?.out===!0?e:e?.out;function Dy(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Om(e,t,n))),n=ky(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&fm(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&Ey(f(l??(g&&g.props.initial))?.transition);if(Ty.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?R_(f)||f===!1?f:void 0:l,y=R_(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||L_(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=Oy(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=fm(e,n,pm(e,t))||{};E={...E,...a,...i},D=Ey(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!wy(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=fm(s,n)?.transition?.delayChildren;r.delay=Gp(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!ym(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ky(),i=!0}}}function Oy(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wy(t,e):!1}function ky(){let e={};for(let t of z_)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var Ay=/* @__PURE__ */ (0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function jy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function My(...e){return t=>{let n=!1,r=e.map(e=>{let r=jy(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():jy(e[t],null)}}}}function Ny(...e){return B.useCallback(My(...e),e)}var Py=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},Fy=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=Py(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=Py(e.offsetParent);return[t/i,n/a]},Iy=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Gm(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Gm(e)&&e.offsetWidth||0,r=Gm(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=Fy(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function Ly({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,B.useId)(),c=(0,B.useRef)(null),l=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,B.useContext)(Ay),d=Ny(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,B.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Kh.setup(()=>{let[e,t]=Fy(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Kh.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,V.jsx)(Iy,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:B.cloneElement(e,{ref:d})})}var Ry=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Xc(zy),d=(0,B.useId)(),f=(0,B.useRef)(),p=(0,B.useRef)(n),m=(0,B.useRef)(r);Zc(()=>{p.current=n,m.current=r});let h=!0,g=(0,B.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(Ly,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,V.jsx)(Qc.Provider,{value:g,children:e})};function zy(){return/* @__PURE__ */ new Map}function By(e=!0){let t=(0,B.useContext)(Qc);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,B.useId)();(0,B.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,B.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Vy=e=>e.key||``;function Hy(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var Uy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=By(o),f=(0,B.useMemo)(()=>Hy(e),[e]),p=o&&!u?[]:f.map(Vy),m=(0,B.useRef)(!0),h=Xc(()=>/* @__PURE__ */ new Map),g=(0,B.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,B.useState)(f),[y,b]=(0,B.useState)(f);Zc(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,B.useRef)();(0,B.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),Zc(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=Vy(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(Vy(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Vy(e)))?e=f:a===`wait`&&(e=S),b(Hy(e)),v(f),null}let{forceRender:C}=(0,B.useContext)(Yc);return(0,V.jsx)(V.Fragment,{children:y.map(e=>{let _=Vy(e),b=o&&!u?!1:f===y||p.includes(_);return(0,V.jsx)(Ry,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Wy=/* @__PURE__ */ (0,B.createContext)({strict:!1}),Gy={animation:[`variants`,...z_],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Ky=!1;function qy(){if(Ky)return;let e={};for(let t in Gy)e[t]={isEnabled:e=>Gy[t].some(t=>!!e[t])};X_(e),Ky=!0}function Jy(){return qy(),Z_()}function Yy(e){let t=Jy();for(let n in e)t[n]={...t[n],...e[n]};X_(t)}function Xy({children:e,...t}){let n=(0,B.useContext)(Ay);t={...n,...t},t.transition=Zp(t.transition,n.transition),t.isStatic=Xc(()=>t.isStatic);let r=(0,B.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,V.jsx)(Ay.Provider,{value:r,children:e})}var Zy=/* @__PURE__ */ (0,B.createContext)({});function Qy(e,t){if(V_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||R_(t)?t:void 0,animate:R_(n)?n:void 0}}return e.inherit===!1?{}:t}function $y(e){let{initial:t,animate:n}=Qy(e,(0,B.useContext)(Zy));return(0,B.useMemo)(()=>({initial:t,animate:n}),[eb(t),eb(n)])}function eb(e){return Array.isArray(e)?e.join(` `):e}var tb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nb(e,t,n){for(let r in t)!ym(t[r])&&!tv(r,n)&&(e[r]=t[r])}function rb({transformTemplate:e},t){return(0,B.useMemo)(()=>{let n=tb();return sh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ib(e,t){let n=e.style||{},r={};return nb(r,n,e),Object.assign(r,rb(e,t)),r}function ab(e,t){let n={},r=ib(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var ob=()=>({...tb(),attrs:{}});function sb(e,t,n,r){let i=(0,B.useMemo)(()=>{let n=ob();return fh(n,t,by(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return nb(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var cb=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function lb(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||cb.has(e)}function ub(e,t){return e.startsWith(`on`)?!lb(e):t?.(e)??!lb(e)}function db(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||ym(e[a])||(ub(a,r)||n===!0&&lb(a)||!t&&!lb(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var fb=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function pb(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(fb.indexOf(e)>-1||/[A-Z]/u.test(e))}function mb(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??pb(e)?sb:ab)(t,r,i,e),l=db(t,typeof e==`string`,a,s),u=e===B.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,B.useMemo)(()=>ym(d)?d.get():d,[d]);return(0,B.createElement)(e,{...u,children:f})}function hb({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:gb(n,r,i,e),renderState:t()}}function gb(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=$h(a[e]);let{initial:o,animate:s}=e,c=V_(e),l=H_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!L_(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=dm(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var _b=e=>(t,n)=>{let r=(0,B.useContext)(Zy),i=(0,B.useContext)(Qc),a=()=>hb(e,t,r,i);return n?a():Xc(a)},vb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:nv,createRenderState:tb}),yb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:Sy,createRenderState:ob}),bb=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function xb(e,t,n){let r=(0,B.useRef)(n);(0,B.useInsertionEffect)(()=>{r.current=n});let i=(0,B.useRef)(null);return(0,B.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Sb=/* @__PURE__ */ (0,B.createContext)({});function Cb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function wb(e,t,n,r,i,a){let{visualElement:o}=(0,B.useContext)(Zy),s=(0,B.useContext)(Wy),c=(0,B.useContext)(Qc),l=(0,B.useContext)(Ay),u=l.reducedMotion,d=l.skipAnimations,f=(0,B.useRef)(null),p=(0,B.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,B.useContext)(Sb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Tb(f.current,n,i,h),(0,B.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[Sm],_=(0,B.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Zc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Zc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,B.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function Tb(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Eb(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Cb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function Eb(e){if(e)return e.options.allowProjection===!1?Eb(e.parent):e.projection}function Db(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Yy(r);let a=n?n===`svg`:pb(e),o=a?yb:vb;function s(n,s){let c,l=Ob(n);Xc(()=>!!P_.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,B.useContext)(Ay),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=$y(n),m=o(n,d);if(!d&&typeof window<`u`){kb(u,r);let t=Ab(u);p.visualElement=wb(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,V.jsxs)(Zy.Provider,{value:p,children:[c&&p.visualElement?(0,V.jsx)(c,{visualElement:p.visualElement,...u}):null,mb(e,n,xb(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,B.forwardRef)(s);return c[bb]=e,c}function Ob({layoutId:e}){let t=(0,B.useContext)(Yc).id;return t&&e!==void 0?t+`-`+e:e}function kb(e,t){(0,B.useContext)(Wy).strict}function Ab(e){let{drag:t,layout:n}=Jy();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function jb(e,t){if(typeof Proxy>`u`)return Db;let n=/* @__PURE__ */ new Map,r=(n,r)=>Db(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Db(a,void 0,e,t)),n.get(a))})}var Mb=(e,t)=>t.isSVG??pb(e)?new Cy(t):new iv(t,{allowProjection:e!==B.Fragment}),Nb=class extends vy{constructor(e){super(e),e.animationState||=Dy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();L_(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Pb=0,Fb={animation:{Feature:Nb},exit:{Feature:class extends vy{constructor(){super(...arguments),this.id=Pb++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=fm(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Ib=class extends vy{constructor(e){super(e),this.removeGroupControls=sl,this.removeListeners=sl,this.controls=new ey(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sl}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Lb=e=>(t,n)=>{e&&Q.update(()=>e(t,n),!1,!0)},Rb=class extends vy{constructor(){super(...arguments),this.removePointerDownListener=sl}onPointerDown(e){this.session=new Ev(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lb(e),onStart:Lb(t),onMove:Lb(n),onEnd:(e,t)=>{delete this.session,r&&Q.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=cv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},zb=!1,Bb=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Vb=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Hb=class extends B.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),zb&&i.root.didUpdate(),i.options.layoutId!==r&&Vb(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Bb(this.props),onExitComplete:()=>this.safeToRemove()})),Yg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Vb(o,n)),o.setOptions({...o.options,...Bb(this.props)}),zb=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Q.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Kh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;zb=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Ub(e){let[t,n]=By(),r=(0,B.useContext)(Yc);return(0,V.jsx)(Hb,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(Sb),isPresent:t,safeToRemove:n})}var Wb={pan:{Feature:Rb},drag:{Feature:Ib,ProjectionNode:F_,MeasureLayout:Ub}};function Gb(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Q.postRender(()=>o(t,ov(t)))}var Kb=class extends vy{mount(){let{current:e}=this.node;e&&(this.unmount=ly(e,(e,t)=>(Gb(this.node,t,`Hover`,`Start`),e=>Gb(this.node,e,`Hover`,`End`))))}unmount(){}},qb=class extends vy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=cl(M_(this.node.current,`focus`,()=>this.onFocus()),M_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jb(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Gb(e,t,`Tap`,n)}var Yb=class extends vy{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=_y(e,(e,t)=>(Jb(this.node,t,`Start`),(e,{success:t})=>Jb(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xb=/* @__PURE__ */ new WeakMap,Zb=/* @__PURE__ */ new WeakMap,Qb=e=>{let t=Xb.get(e.target);t&&t(e)},$b=e=>{e.forEach(Qb)};function ex({root:e,...t}){let n=e||document;Zb.has(n)||Zb.set(n,{});let r=Zb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($b,{root:e,...t})),r[i]}function tx(e,t,n){let r=ex(t);return Xb.set(e,n),r.observe(e),()=>{Xb.delete(e),r.unobserve(e)}}var nx={some:0,all:1},rx=class extends vy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nx[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=tx(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ix(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ix({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var ax=/*@__PURE__*/ jb(/* @__PURE__ */ Object.assign({},Fb,{inView:{Feature:rx},tap:{Feature:Yb},focus:{Feature:qb},hover:{Feature:Kb}},Wb,{layout:{ProjectionNode:F_,MeasureLayout:Ub}}),Mb);function ox(){!G_.current&&q_();let[e]=(0,B.useState)(W_.current);return e}function sx(e){return typeof e==`object`&&!Array.isArray(e)}function cx(e,t,n,r){return e==null?[]:typeof e==`string`&&sx(t)?Xm(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function lx(e,t,n){return e*(t+1)+n*t}function ux(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function dx(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):ux(t,r)??e}function fx(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(el(e,i),r--)}}function px(e,t,n,r,i,a){fx(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Pu(i,a,r[o]),easing:/* @__PURE__ */ Al(n,o)})}function mx(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function hx(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var gx=`easeInOut`,_x=20;function vx(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l={},u=/* @__PURE__ */ new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:dx(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=xx(e),{delay:l=0,times:u=Fd(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(a,s):l,S=c.length,C=tp(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&wx(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=/* @__PURE__ */ dl(b));let r=ad(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Pd(u,T),c.length===1&&c.unshift(null),m&&m<_x){let e=b>0?g/b:0;b=lx(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?/* @__PURE__ */ vl(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:/* @__PURE__ */ Al(f,e-1))}mx(u,m,e)}let E=w+b;px(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(ym(g)){let e=yx(g,c);b(_,v,bx(`default`,e))}else{let e=cx(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=yx(r,c);for(let e in _)b(_[e],Sx(v,e),bx(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(hx);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(/* @__PURE__ */ ll(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(gx)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,...n}}}),s}function yx(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function bx(e,t){return t[e]||(t[e]=[]),t[e]}function xx(e){return Array.isArray(e)?e:[e]}function Sx(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Cx=e=>typeof e==`number`,wx=e=>e.every(Cx);function Tx(e,t){return ym(e)||typeof e==`number`||typeof e==`string`&&!sx(t)}function Ex(e,t,n,r){let i=[];if(Tx(e,t))i.push(Jh(e,sx(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=cx(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Wh(r,t,s,I_.get(r))):i.push(...Um(Vm(r)??Gh,r,t,s))}}return i}function Dx(e,t,n,r){let i=[];return vx(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Xp(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ad},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...Ex(n,e,t))}),i}var Ox=0;function kx(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var Ax=(e,t)=>t===void 0?e:{name:e,at:t};function jx(e){e.pause(),e.time=0,e.stop()}var Mx=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=/* @__PURE__ */ new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new Wp(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>el(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+Ox++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+Ox++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&=(jx(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,jx(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=/* @__PURE__ */ new Map,f={},p=Dx(this.toSequence(d),{defaultTransition:n,...u},c,f),m=f.labels,h=u.duration??f.duration,g=f.duration?h/f.duration:1;if(m.forEach((e,t)=>m.set(t,e*g)),this.markers=[],d.forEach((e,t)=>{e.time=m.get(t),m.delete(t),h=Math.max(h,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=m,this.totalDuration=h,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Xp(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),p.unshift(this.clockAnimation=Jh(e,[0,h],{...u,duration:h,ease:`linear`}))}let _=this.group=new Wp(p);t=Math.min(t,h),this.isDone&&t<h&&this.newFinished(),this.scrollTimeline?this.detachScroll=_.attachTimeline(this.scrollTimeline):(_.speed=this.playbackSpeed,this.isPaused&&_.pause(),t&&(_.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),Ax(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?Ax(n,r):r===void 0?n:Array.isArray(n)?kx(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:ux(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}};function Nx(e){return Array.isArray(e)&&e.some(Array.isArray)}function Px(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=qm.current,s=o?.transition,c={};n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r);let l;if(Nx(e)){let n={...c,...i,scope:t};s&&(n.defaultTransition={...s,...n.defaultTransition}),l=new Mx(e,n)}else{let{onComplete:n,...r}=a||{},o={...c,...s,...r},{onUpdate:u}=r;l=new Mx([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...o,onUpdate:void 0}]:[e,i,o]],{...c,onComplete:n,scope:t},Ex(e,i,o,t))}return o&&l.finished.then(o.add(()=>l.stop())),l}return i}var Fx=/* @__PURE__ */ Object.assign(/* @__PURE__ */ Px(),{addEffect:zm,removeEffect:Bm}),Ix=ax;function Lx(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Rx=e=>{switch(e){case`success`:return Vx;case`info`:return Ux;case`warning`:return Hx;case`error`:return Wx;default:return null}},zx=Array(12).fill(0),Bx=({visible:e,className:t})=>/*#__PURE__*/ B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ B.createElement(`div`,{className:`sonner-spinner`},zx.map((e,t)=>/*#__PURE__*/ B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Vx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Hx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ux=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Wx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Gx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Kx=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},qx=1,Jx=100,Yx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:qx++,Xx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Jx;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Yx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Qx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Yx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},Zx=(e,t)=>Xx.message(e,t),Qx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,$x=Object.assign(Zx,{success:Xx.success,info:Xx.info,warning:Xx.warning,error:Xx.error,custom:Xx.custom,message:Xx.message,promise:Xx.promise,dismiss:Xx.dismiss,loading:Xx.loading},{getHistory:()=>Xx.toasts,getToasts:()=>Xx.getActiveToasts()});Lx(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function eS(e){return e.label!==void 0}var tS=3,nS=`24px`,rS=`16px`,iS=4e3,aS=356,oS=14,sS=45,cS=200;function lS(...e){return e.filter(Boolean).join(` `)}function uS(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var dS=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,j]=B.useState(!1),[M,N]=B.useState(!1),[P,F]=B.useState(!1),[I,ee]=B.useState(!1),[te,ne]=B.useState(!1),[re,ie]=B.useState(0),[ae,oe]=B.useState(0),se=B.useRef(n.duration||y||iS),ce=B.useRef(null),le=B.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=fe??`default`,L=n.dismissible!==!1,R=n.className||``,me=n.descriptionClassName||``,he=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),_e=B.useMemo(()=>n.duration||y||iS,[n.duration,y]),ve=B.useRef(0),z=B.useRef(0),ye=B.useRef(0),be=B.useRef(null),[xe,Se]=b.split(`-`),V=B.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Ce=Kx(),we=B.useMemo(()=>e.swipeDirections??uS(b),[e.swipeDirections,b]),Te=n.invert||t,Ee=fe===`loading`;z.current=B.useMemo(()=>he*x+V,[he,V]),B.useEffect(()=>{se.current=_e},[_e]),B.useEffect(()=>{j(!0)},[]),B.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=B.useCallback(()=>{N(!0),ie(z.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},cS)},[n,d,a,z]);B.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ye.current<ve.current){let e=(/* @__PURE__ */ new Date()).getTime()-ve.current;se.current-=e}ye.current=(/* @__PURE__ */ new Date()).getTime()})():se.current!==1/0&&(ve.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ce,De]),B.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?/*#__PURE__*/ B.createElement(`div`,{className:lS(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ B.createElement(Bx,{className:lS(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let ke=n.icon||w?.[fe]||Rx(fe);return/*#__PURE__*/ B.createElement(`li`,{tabIndex:0,ref:le,className:lS(_,R,C?.toast,n?.classNames?.toast,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":te,"data-removed":M,"data-visible":de,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ue,"data-swiping":P,"data-dismissible":L,"data-type":fe,"data-invert":Te,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:z.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&!Ee&&L&&(ce.current=/* @__PURE__ */ new Date,ie(z.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!L)return;be.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-ce.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?we.includes(e>0?`right`:`left`):we.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=sS||a>.11))ie(z.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!be.current||!L||window.getSelection()?.toString().length>0)return;let r=e.clientY-be.current.y,i=e.clientX-be.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(we.includes(`top`)||we.includes(`bottom`)){if(we.includes(`top`)&&r<0||we.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(we.includes(`left`)||we.includes(`right`))){if(we.includes(`left`)&&i<0||we.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=le.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=le.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ B.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!L?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:lS(C?.closeButton,n?.classNames?.closeButton)},w?.close??Gx):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ B.createElement(`div`,{"data-icon":``,className:lS(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Oe():n.promise?Oe():null,fe===`loading`?null:ke):null,/*#__PURE__*/ B.createElement(`div`,{"data-content":``,className:lS(C?.content,n?.classNames?.content)},/*#__PURE__*/ B.createElement(`div`,{"data-title":``,className:lS(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ B.createElement(`div`,{"data-description":``,className:lS(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ B.isValidElement(n.cancel)?n.cancel:n.cancel&&eS(n.cancel)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{eS(n.cancel)&&L&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:lS(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ B.isValidElement(n.action)?n.action:n.action&&eS(n.action)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{eS(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:lS(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function fS(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function pS(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?rS:nS;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var mS=/*#__PURE__*/ B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=tS,toastOptions:g,dir:_=fS(),gap:v=oS,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=B.useState([]),w=B.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=B.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=B.useState([]),[O,k]=B.useState(!1),[A,j]=B.useState(!1),[M,N]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=B.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=B.useRef(null),ee=B.useRef(!1),te=B.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Xx.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>Xx.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{gn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),B.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{S.length<=1&&k(!1)},[S]),B.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,ee.current=!1)}},[P.current]),/*#__PURE__*/ B.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ B.createElement(`ol`,{key:t,dir:_===`auto`?fS():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${aS}px`,"--gap":`${v}px`,...m,...pS(l,u)},onBlur:e=>{ee.current&&!e.currentTarget.contains(e.relatedTarget)&&(ee.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee.current||(ee.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ B.createElement(dS,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),hS=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),gS=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function _S(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&yS(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),yS(r,`relativePath`,a),r}function vS(e,t=hS){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function yS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var bS=[`.DS_Store`,`Thumbs.db`];async function xS(e,{mimeTypes:t=hS}={}){return(await SS(e)).map(e=>e instanceof File?vS(e,t):e)}async function SS(e){return ES(e)&&CS(e.dataTransfer)?kS(e.dataTransfer,e.type):wS(e)?AS(e.clipboardData):TS(e)?DS(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?OS(e):[]}function CS(e){return ES(e)}function wS(e){return ES(e)&&CS(e.clipboardData)}function TS(e){return ES(e)&&ES(e.target)}function ES(e){return typeof e==`object`&&!!e}function DS(e){return MS(e.target.files).map(e=>_S(e))}async function OS(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>_S(e))}async function kS(e,t){let n=MS(e.items).filter(e=>e.kind===`file`);return t===`drop`?jS(PS(await Promise.all(n.map(NS)))):n}function AS(e){let t=MS(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return jS((t.length>0?t:MS(e.files)).map(e=>_S(e)))}function jS(e){return e.filter(e=>bS.indexOf(e.name)===-1)}function MS(e){return e===null?[]:Array.from(e)}async function NS(e){if(typeof e.webkitGetAsEntry!=`function`)return FS(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await IS(e);return n?.kind===`directory`?LS(n,`/${n.name}`):zS(t)}return FS(e,t)}function PS(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...PS(n)):t.push(n);return t}async function FS(e,t){let n=e.getAsFile(),r=await IS(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,_S(e)}if(!n)throw new gS(e);return _S(n,t?.fullPath??void 0)}async function IS(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function LS(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await LS(r,e));else{let t=await r.getFile();n.push(_S(t,e,r))}}return n}async function RS(e){return e.isDirectory?zS(e):BS(e)}function zS(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(RS));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function BS(e){return new Promise((t,n)=>{e.file(n=>{t(_S(n,e.fullPath))},e=>{n(e)})})}function VS(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var HS=typeof VS==`function`?VS:VS.default,US=`file-invalid-type`,WS=`file-too-large`,GS=`file-too-small`,KS=`too-many-files`;function qS(e=``){let t=e.split(`,`);return{code:US,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var JS=[`KB`,`MB`,`GB`,`TB`,`PB`];function YS(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<JS.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${JS[n]}`}function XS(e){return{code:WS,message:`File is larger than ${YS(e)}`}}function ZS(e){return{code:GS,message:`File is smaller than ${YS(e)}`}}var QS={code:KS,message:`Too many files`};function $S(e){return e.type===``&&typeof e.getAsFile==`function`}function eC(e,t){let n=e.type===`application/x-moz-file`||HS(e,t??``)||$S(e);return[n,n?null:qS(t)]}function tC(e,t,n){if(nC(e.size)){if(nC(t)&&nC(n)){if(e.size>n)return[!1,XS(n)];if(e.size<t)return[!1,ZS(t)]}else if(nC(t)&&e.size<t)return[!1,ZS(t)];else if(nC(n)&&e.size>n)return[!1,XS(n)]}return[!0,null]}function nC(e){return e!=null}function rC(e){return e!=null&&typeof e.then==`function`}function iC({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=eC(e,t),[o,s]=tC(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(QS,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function aC(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function oC(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],sC):!!e.target&&!!e.target.files}function sC(e){return typeof e==`object`&&!!e&&e.kind===`file`}function cC(e){e.preventDefault()}function lC(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function uC(e){return e.indexOf(`Edge/`)!==-1}function dC(e=window.navigator.userAgent){return lC(e)||uC(e)}function fC(...e){return(t,...n)=>e.some(e=>(!aC(t)&&e&&e(t,...n),aC(t)))}function pC(){return`showOpenFilePicker`in window}function mC(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function hC(e){if(nC(e))return Array.isArray(e)?e.filter(e=>nC(e)&&nC(e.accept)):[{accept:e}]}function gC(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of mC(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function _C(e){let t=hC(e);if(!nC(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of mC(r))e.includes(t)||e.push(t)}return n}function vC(e){let t=hC(e);if(!nC(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return CC(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&mC(t).every(TC)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=mC(n),e),{});return{description:nC(e.description)&&e.description!==``?e.description:gC(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function yC(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(nC(e))return Object.entries(e).reduce((e,[n,r])=>{let i=mC(r);return t&&wC(n)&&i.some(TC)?e.push(...i):e.push(n,...i),e},[]).filter(e=>CC(e)||TC(e)).join(`,`)}function bC(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function xC(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function SC(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function CC(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function wC(e){return e.endsWith(`/*`)}function TC(e){return/^.*\.[\w]+$/.test(e)}var EC=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=OC(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,V.jsx)(V.Fragment,{children:e?.({...i,open:r})})});EC.displayName=`Dropzone`;var DC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function OC(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=xS,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>_C(t),[t]),O=(0,B.useMemo)(()=>yC(D),[D]),k=(0,B.useMemo)(()=>yC(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,B.useMemo)(()=>vC(t),[t]),j=(0,B.useMemo)(()=>typeof h==`function`?h:AC,[h]),M=(0,B.useMemo)(()=>typeof m==`function`?m:AC,[m]),N=(0,B.useRef)(null),P=(0,B.useRef)(null),[F,I]=(0,B.useReducer)(kC,DC),{isFocused:ee,isFileDialogActive:te}=F,ne=(0,B.useRef)(te);ne.current=te;let re=(0,B.useRef)(null),ie=(0,B.useCallback)(()=>{re.current?.abort();let e=new AbortController;return re.current=e,I({type:`setProcessing`,isProcessing:!0}),e.signal},[]),ae=(0,B.useCallback)(e=>{e.aborted||I({type:`setProcessing`,isProcessing:!1})},[]);(0,B.useEffect)(()=>()=>re.current?.abort(),[]);let oe=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&pC()),se=()=>{!oe.current&&te&&setTimeout(()=>{if(P.current){let{files:e}=P.current;e?.length||(I({type:`closeDialog`}),M())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,se,!1),()=>{window.removeEventListener(`focus`,se,!1)}),[P,te,M,oe]);let ce=(0,B.useRef)([]),le=(0,B.useRef)([]),ue=e=>{N.current&&e.target&&N.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ce.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,cC,!1),document.addEventListener(`drop`,ue,!1)),()=>{v&&(document.removeEventListener(`dragover`,cC),document.removeEventListener(`drop`,ue))}),[N,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(le.current=[...le.current,e.target]),oC(e)&&I({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{le.current=le.current.filter(t=>t!==e.target&&t!==null),!(le.current.length>0)&&I({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[N]),(0,B.useEffect)(()=>(!n&&_&&N.current&&N.current.focus(),()=>{}),[N,_,n]);let de=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e),!ne.current&&(ce.current=[...ce.current,e.target],oC(e)&&Promise.resolve(r(e)).then(t=>{if(aC(e)&&!S)return;let n=t.length>0?iC({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;I({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>de(e)))},[r,c,de,S,O,a,i,o,s,T,E]),pe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ne.current)return!1;let t=oC(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),L=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e);let t=ce.current.filter(e=>N.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),ce.current=t,!(t.length>0)&&(I({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),oC(e)&&l&&l(e))},[N,l,S]),R=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(QS,e)]})}),I({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=eC(e,k),[r,o]=tC(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>rC(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(ae(n),de(e));return}n.aborted||c(u)},[I,o,k,a,i,s,d,f,p,T,E,de,ae]),me=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ce.current=[],!(ne.current&&e.dataTransfer)&&(I({type:`reset`}),oC(e))){let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})}},[r,R,de,S,ie,ae]),he=(0,B.useCallback)(e=>{if(!oC(e))return;e.preventDefault(),e.persist?.(),Ce(e);let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})},[r,R,de,S,ie,ae]),ge=(0,B.useCallback)(()=>{if(oe.current){I({type:`openDialog`}),j();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ie(),r(e))).then(e=>{if(I({type:`closeDialog`}),!t.aborted)return R(e,null,t)}).catch(e=>{t&&ae(t),bC(e)?(M(e),I({type:`closeDialog`})):xC(e)||SC(e)?(oe.current=!1,P.current?(P.current.value=``,P.current.click()):de(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):de(e)})}else P.current&&(I({type:`openDialog`}),j(),P.current.value=``,P.current.click())},[I,j,M,g,R,de,A,o,ie,ae]),_e=(0,B.useCallback)(e=>{N.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[N,ge]),ve=(0,B.useCallback)(()=>{I({type:`focus`})},[]),z=(0,B.useCallback)(()=>{I({type:`blur`})},[]),ye=(0,B.useCallback)(()=>{y||(dC()?setTimeout(ge,0):ge())},[y,ge]),be=e=>n?null:e,xe=e=>b?null:be(e),Se=e=>x?null:be(e),V=e=>C?null:be(e),Ce=e=>{S&&e.stopPropagation()},we=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:xe(fC(r,_e)),onFocus:xe(fC(i,ve)),onBlur:xe(fC(a,z)),onClick:be(fC(o,ye)),onDragEnter:Se(fC(s,fe)),onDragOver:Se(fC(c,pe)),onDragLeave:Se(fC(l,L)),onDrop:Se(fC(u,me)),onPaste:V(fC(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:N,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[N,_e,ve,z,ye,fe,pe,L,me,he,b,x,C,n]),Te=(0,B.useCallback)(e=>{e.stopPropagation()},[]),Ee=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:be(fC(t,me)),onClick:be(fC(n,Te)),tabIndex:-1,[e]:P,...r}),[P,t,o,me,n]);return{...F,isFocused:ee&&!n,getRootProps:we,getInputProps:Ee,rootRef:N,inputRef:P,open:be(ge)}}function kC(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...DC,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...DC};default:return e}}function AC(){}var jC={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};jC.node;var MC=k(jC),NC={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};NC.node;var PC=k(NC),FC={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};FC.node;var IC=k(FC),LC={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};LC.node;var RC=k(LC),zC={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};zC.node;var BC=k(zC),VC={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};VC.node;var HC=k(VC),UC={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};UC.node;var WC=k(UC),GC={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};GC.node;var KC=k(GC),qC={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};qC.node;var JC=k(qC),YC={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};YC.node;var XC=k(YC),ZC={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ZC.node;var QC=k(ZC),$C={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};$C.node;var ew=k($C),tw={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};tw.node;var nw=k(tw),rw={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};rw.node;var iw=k(rw),aw={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};aw.node;var ow=k(aw),sw={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};sw.node;var cw=k(sw),lw={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};lw.node;var uw=k(lw),dw={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};dw.node;var fw=k(dw),pw={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};pw.node;var mw=k(pw),hw={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};hw.node;var gw=k(hw),_w={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};_w.node;var vw=k(_w),yw={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};yw.node;var bw=k(yw),xw={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};xw.node;var Sw=k(xw),Cw={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Cw.node;var ww=k(Cw),Tw={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Tw.node;var Ew=k(Tw),Dw={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Dw.node;var Ow=k(Dw),kw={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};kw.node;var Aw=k(kw),jw={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};jw.node;var Mw=k(jw);function Nw({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,B.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,B.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,V.jsx)(Yr,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,V.jsxs)($r,{container:r,children:[/* @__PURE__ */ (0,V.jsx)(ti,{className:`fixed inset-0 z-50 bg-black/40`}),/* @__PURE__ */ (0,V.jsxs)(ai,{className:`fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-5 shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsx)(li,{className:`text-[16px] font-semibold`,children:`Which plate?`}),/* @__PURE__ */ (0,V.jsx)(ui,{className:`mt-1 text-[13px] text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,V.jsx)(fi,{className:`grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`overflow-hidden rounded-xl border border-rule bg-raise text-left transition-colors hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,V.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,V.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num block px-3 py-2 text-[13px] font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function Pw({show:e,text:t}){return/* @__PURE__ */ (0,V.jsx)(Uy,{children:e&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`rounded-2xl border-2 border-dashed border-ink px-8 py-6 font-display text-[18px] font-semibold`,children:t})})})}function Fw({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:`border-b border-rule px-5 py-5 last:border-b-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3.5 flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`num grid size-6 shrink-0 place-items-center rounded-full text-[12px] font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-3.5`,strokeWidth:3}):e}),/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:t}),r&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-auto truncate text-[13px] text-muted`,children:r})]}),i]})}function Iw({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-medium`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] text-muted`,children:t})]}),n]})}var Lw={primary:`bg-ink text-ink-contrast hover:opacity-90 disabled:opacity-40`,secondary:`bg-panel text-ink border border-rule hover:border-muted disabled:opacity-50`,ghost:`text-ink hover:bg-raise disabled:opacity-40`},Rw={md:`h-9 px-3.5 gap-2 text-[14px]`,lg:`h-11 px-5 gap-2.5 text-[15px]`,icon:`size-9 justify-center`};function zw({variant:e=`secondary`,size:t=`md`,className:n,...r}){return/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:E(`inline-flex shrink-0 items-center rounded-lg font-medium transition-[opacity,border-color,background-color]`,Lw[e],Rw[t],n),...r})}var Bw=1e6,Vw={plates:[],files:{},selected:{plate:null,object:null}},Hw=(e,t,n={x:0,y:0},r=0,i=L)=>({id:e,fileId:t,x:n.x,y:n.y,spin:r,orient:i}),Uw=(e,t,n)=>({...e,plates:e.plates.map(e=>e.id===t?n(e):e)}),Ww=(e,t)=>({...e,plates:e.plates.map(e=>({...e,objects:e.objects.map(t)}))});function Gw(e){let t=new Set(e.plates.flatMap(e=>e.objects.map(e=>e.fileId))),n=Object.fromEntries(Object.entries(e.files).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e.files).length?e:{...e,files:n}}function Kw(e){let{plate:t,object:n}=e.selected,r=e.plates.find(e=>e.objects.some(e=>e.id===n));if(r)return r.id===t?e:{...e,selected:{plate:r.id,object:n}};let i=e.plates.find(e=>e.id===t)||e.plates[0]||null;return{...e,selected:{plate:i?i.id:null,object:null}}}function qw(e,t){switch(t.type){case`addPlate`:return e.plates.length>=10?e:{...e,plates:[...e.plates,{id:t.id,settings:t.settings,objects:[],result:null,error:null}],selected:{plate:t.id,object:null}};case`removePlate`:return Kw(Gw({...e,plates:e.plates.filter(e=>e.id!==t.id)}));case`selectPlate`:return e.plates.some(e=>e.id===t.id)?{...e,selected:{plate:t.id,object:null}}:e;case`selectObject`:return Kw({...e,selected:{...e.selected,object:t.id}});case`addObjects`:{let n=e.plates.find(e=>e.id===t.plate);if(!n||!t.objects.length)return e;let r=50-n.objects.length,i=t.objects.slice(0,Math.max(0,r));return i.length?{...Uw({...e,files:{...e.files,...t.files}},t.plate,e=>({...e,objects:[...e.objects,...i]})),selected:{plate:t.plate,object:i[0].id}}:e}case`updateObject`:return Ww(e,e=>e.id===t.id?{...e,...t.patch}:e);case`updateObjects`:return Ww(e,e=>t.patches[e.id]?{...e,...t.patches[e.id]}:e);case`removeObjects`:{let n=new Set(t.ids);return Kw(Gw({...e,plates:e.plates.map(e=>({...e,objects:e.objects.filter(e=>!n.has(e.id))}))}))}case`moveObjects`:{let n=new Set(t.ids);if(!e.plates.find(e=>e.id===t.to))return e;let r=e.plates.flatMap(e=>e.objects.filter(e=>n.has(e.id))).map(e=>({...e,...t.positions[e.id]})),i=e.plates.map(e=>{let i=e.objects.filter(e=>!n.has(e.id));return e.id===t.to?{...e,objects:[...i,...r]}:i.length===e.objects.length?e:{...e,objects:i}});return{...e,plates:i,selected:{plate:t.to,object:r.length?r[0].id:null}}}case`settings`:return Uw(e,t.plate,e=>({...e,settings:{...e.settings,...t.patch}}));case`settingsForAll`:{let n=e.plates.find(e=>e.id===t.from);return n?{...e,plates:e.plates.map(e=>({...e,settings:{...n.settings}}))}:e}case`result`:return Uw(e,t.plate,e=>({...e,result:t.result,error:null}));case`error`:return Uw(e,t.plate,e=>({...e,error:t.error}));default:return e}}var Jw=e=>Math.round(e*100)/100,Yw=e=>e?[e.name,e.size,e.lastModified]:null,Xw=(e,t)=>JSON.stringify([e.settings,e.objects.map(e=>[Yw(t[e.fileId]),Jw(e.x),Jw(e.y),Jw(e.spin),e.orient.map(e=>Math.round(e*1e6)/1e6)])]),Zw=(e,t)=>e.objects.length>0&&(!e.result||e.result.sig!==Xw(e,t)||!!e.error);function Qw(e){let t=/* @__PURE__ */ new Map;for(let n of e.objects)t.has(n.fileId)||t.set(n.fileId,[]),t.get(n.fileId).push(n);return[...t].map(([e,t])=>({fileId:e,objects:t}))}var $w=(e,t,n)=>e.filter(e=>!Object.hasOwn(t,e)&&!n.has(e)),eT=(e,t)=>`${e}|${t.join(`,`)}`,tT=e=>e.slice(0,e.indexOf(`|`)),nT={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},rT={sliced:[`bg-ok`,`sliced`],stale:[`bg-warn`,`changed since slicing`],failed:[`bg-danger`,`failed`]};function iT({n:e,on:t,state:n,onClick:r}){let[i,a]=rT[n]||[];return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-pressed":t,"aria-label":`Plate ${e}${a?`, ${a}`:``}`,onClick:r,className:E(`num relative h-9 min-w-9 rounded-lg border px-3 text-[14px] font-medium transition-colors`,t?`border-ink bg-ink text-ink-contrast`:`border-rule hover:border-muted`),children:[e,i&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-panel`,i),"aria-hidden":!0})]})}function aT({name:e,value:t,disabled:n,onChange:r}){let i=`grid size-7 place-items-center rounded-md text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-lg bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:n||t<=1,onClick:()=>r(t-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-6 text-center text-[13px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:n||t>=50,onClick:()=>r(t+1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-3`,"aria-hidden":!0})})]})}function oT({name:e,others:t,canAdd:n,onMove:r,onRemove:a}){let{portal:o}=i(),s=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[disabled]:cursor-default data-[disabled]:opacity-50 data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Qa,{children:[/* @__PURE__ */ (0,V.jsx)(eo,{"aria-label":`More for ${e}`,className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(to,{container:o,children:/* @__PURE__ */ (0,V.jsxs)(ro,{align:`end`,sideOffset:4,className:`z-50 min-w-[220px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t.map(e=>/* @__PURE__ */ (0,V.jsxs)(io,{className:s,onSelect:()=>r(e.id),children:[`Move to plate `,e.n]},e.id)),/* @__PURE__ */ (0,V.jsx)(io,{className:s,disabled:!n,onSelect:()=>r(`new`),children:`Move to a new plate`}),/* @__PURE__ */ (0,V.jsx)(ao,{className:`my-1 h-px bg-rule`}),/* @__PURE__ */ (0,V.jsx)(io,{className:E(s,`text-danger`),onSelect:a,children:`Remove from this plate`})]})})]})}var sT=e=>e?`${e.map(e=>e.toFixed(1)).join(` × `)} mm`:null;function cT({plates:e,selected:t,files:n,loading:r,summary:i,onSelectPlate:a,onNewPlate:o,onRemovePlate:s,onSettingsForAll:c,onFiles:l,onChoose:u,onSelectFile:d,onCopies:f,onMove:p,onRemove:m}){let{getRootProps:h,getInputProps:g,isDragActive:_}=OC({accept:nT,multiple:!0,noClick:!0,noKeyboard:!0,noDragEventsBubbling:!0,onDrop:e=>{e.length&&l(e)}}),v=e.find(e=>e.id===t),y=n.reduce((e,t)=>e+t.copies,0),b=e.filter(e=>e.id!==t);return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:1,title:`Plates`,done:y>0,aside:y?`${y} ${y===1?`object`:`objects`}`:void 0,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-1.5`,children:[e.map(e=>/* @__PURE__ */ (0,V.jsx)(iT,{n:e.n,on:e.id===t,state:e.state,onClick:()=>a(e.id)},e.id)),/* @__PURE__ */ (0,V.jsx)(j,{label:`New plate`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,"aria-label":`New plate`,disabled:e.length>=10,onClick:o,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...h(),className:E(`rounded-xl outline-none`,_&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{...g()}),n.length||r.length?/* @__PURE__ */ (0,V.jsxs)(`ul`,{className:`space-y-1.5`,children:[n.map(t=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex items-center gap-1.5 rounded-xl border bg-raise py-1 pr-1 pl-1 transition-colors`,t.on?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":t.on||void 0,onClick:()=>d(t.firstId),className:`flex min-w-0 flex-1 items-center gap-2.5 rounded-lg py-1.5 pl-2 text-left`,children:[/* @__PURE__ */ (0,V.jsx)(te,{className:E(`size-5 shrink-0`,t.on?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:t.name,children:t.name}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[12px] text-muted`,children:t.cad?`Placed by the slicer`:sT(t.size)})]})]}),/* @__PURE__ */ (0,V.jsx)(aT,{name:t.name,value:t.copies,disabled:t.cad,onChange:e=>f(t.fileId,e)}),/* @__PURE__ */ (0,V.jsx)(oT,{name:t.name,others:b,canAdd:e.length<10,onMove:e=>p(t.fileId,e),onRemove:()=>m(t.fileId)})]},t.fileId)),r.map((e,t)=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl border border-dashed border-rule px-3 py-2.5 text-[13px] text-muted`,children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`truncate`,children:[`Reading `,e]})]},`${e}-${t}`))]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:u,className:E(`flex w-full flex-col items-center gap-2 rounded-xl border-2 border-dashed border-rule px-4 py-6 text-center transition-colors hover:border-muted`,_&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[14px] font-medium`,children:_?`Drop the files to place them`:`Drop models here, or choose them`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:`STL, 3MF, OBJ, STEP or IGES, up to 10 files of 50 MB each`})]})]}),i&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:E(`mt-2.5 text-[13px]`,i.warn?`text-warn`:`text-muted`),children:i.text}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1`,children:[(n.length>0||r.length>0)&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:u,children:[/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0}),` Add files`]}),e.length>1&&v&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:c,children:`Use these settings for all plates`}),/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px] text-danger`,onClick:()=>s(v.id),children:[`Remove plate `,v.n]})]})]})]})}var lT=e=>String(Math.round(e*10)/10);function uT({label:e,value:t,unit:n,onCommit:r}){let[i,a]=(0,B.useState)(lT(t));return(0,B.useEffect)(()=>a(lT(t)),[t]),/* @__PURE__ */ (0,V.jsxs)(`label`,{className:`flex h-9 min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-rule bg-panel px-2.5 focus-within:border-muted`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:e}),/* @__PURE__ */ (0,V.jsx)(`input`,{inputMode:`decimal`,"aria-label":e,value:i,onChange:e=>a(e.target.value),onBlur:()=>{let e=parseFloat(i.replace(`,`,`.`));Number.isFinite(e)&&Math.abs(e-t)>.04?r(e):a(lT(t))},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(a(lT(t)),e.currentTarget.blur())},className:`num min-w-0 flex-1 bg-transparent text-right text-[14px] outline-none`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:n})]})}var dT=`h-8 px-2.5 text-[13px]`;function fT({n:e,item:t,copy:n,problem:r,layMode:i,canArrange:a,onLayMode:o,onMoveTo:s,onSpin:c,onSpinBy:l,onTip:u,onReset:d,onCentre:f,onArrange:p}){let m=t?`${t.name}${n&&n.of>1?`, copy ${n.k} of ${n.of}`:``}`:void 0;return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:e,title:`Position`,done:!!t&&!r,aside:m,children:[!t&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Click an object on the plate, or in the list, to move or turn it. Drag it on the plate to move it.`}),t&&t.cad&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`STEP and IGES files are placed by the slicer, in the middle of the bed, as the file has them.`}),t&&!t.cad&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Where`,hint:`mm, from the printer's origin`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(uT,{label:`X`,value:t.at[0],unit:`mm`,onCommit:e=>s(e,t.at[1])}),/* @__PURE__ */ (0,V.jsx)(uT,{label:`Y`,value:t.at[1],unit:`mm`,onCommit:e=>s(t.at[0],e)})]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Spin`,hint:`about the plate`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(`div`,{className:`w-[104px] shrink-0`,children:/* @__PURE__ */ (0,V.jsx)(uT,{label:`Spin`,value:t.spin,unit:`°`,onCommit:c})}),[-90,-15,15,90].map(e=>/* @__PURE__ */ (0,V.jsxs)(zw,{className:E(dT,`num min-w-0 flex-1 justify-center px-1`),onClick:()=>l(e),"aria-label":`Spin ${e>0?`left`:`right`} ${Math.abs(e)} degrees`,children:[e>0?`+${e}`:e,`°`]},e))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Turn`,hint:t.size?`${t.size.map(e=>e.toFixed(1)).join(` × `)} mm`:void 0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it toward you, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:dT,onClick:()=>u(`forward`),children:`Tip forward`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it onto its side, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:dT,onClick:()=>u(`sideways`),children:`Tip sideways`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Then click a face on the plate to stand the object on it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:E(dT,i&&`border-ink bg-ink text-ink-contrast hover:border-ink`),"aria-pressed":i,onClick:()=>o(!i),children:`Lay on face`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Undo turns`,onClick:d,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-4`,"aria-hidden":!0})})})]})}),r&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-danger`,role:`status`,children:r})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,children:[t&&!t.cad&&/* @__PURE__ */ (0,V.jsx)(zw,{className:dT,onClick:f,children:`Centre`}),/* @__PURE__ */ (0,V.jsx)(zw,{className:dT,disabled:!a,onClick:p,children:`Arrange plate`})]})]})}var pT=1,mT=.9,hT=.8,gT=.17,_T=.1,vT=.999,yT=.9999,bT=.99,xT=/[\\\/_+.#"@\[\(\{&]/,ST=/[\\\/_+.#"@\[\(\{&]/g,CT=/[\s-]/,wT=/[\s-]/g;function TT(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?pT:bT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=TT(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=pT:xT.test(e.charAt(l-1))?(d*=hT,p=e.slice(i,l-1).match(ST),p&&i>0&&(d*=vT**+p.length)):CT.test(e.charAt(l-1))?(d*=mT,m=e.slice(i,l-1).match(wT),m&&i>0&&(d*=vT**+m.length)):(d*=gT,i>0&&(d*=vT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=yT)),(d<_T&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=TT(e,t,n,r,l+1,a+2,o),f*_T>d&&(d=f*_T)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ET(e){return e.toLowerCase().replace(wT,` `)}function DT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,TT(e,t,ET(e),ET(t),0,0,{})}var OT=`[cmdk-group=""]`,kT=`[cmdk-group-items=""]`,AT=`[cmdk-group-heading=""]`,jT=`[cmdk-item=""]`,MT=`${jT}:not([aria-disabled="true"])`,NT=`cmdk-item-select`,PT=`data-value`,FT=(e,t,n)=>DT(e,t,n),IT=B.createContext(void 0),LT=()=>B.useContext(IT),RT=B.createContext(void 0),zT=()=>B.useContext(RT),BT=B.createContext(void 0),VT=B.forwardRef((e,t)=>{let n=tE(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=tE(()=>/* @__PURE__ */ new Set),i=tE(()=>/* @__PURE__ */ new Map),a=tE(()=>/* @__PURE__ */ new Map),o=tE(()=>/* @__PURE__ */ new Set),s=$T(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=N(),b=N(),x=N(),S=B.useRef(null),C=iE();eE(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),eE(()=>{C(6,A)},[]);let w=B.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=B.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??FT;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(kT);t?t.appendChild(e.parentElement===t?e:e.closest(`${kT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${kT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${OT}[${PT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(PT);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(OT)?.querySelector(AT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${jT}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(MT)||[])}function P(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(PT))}function F(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(PT))}function I(e){let t=j()?.closest(OT),n;for(;t&&!n;)t=e>0?ZT(t,OT):QT(t,OT),n=t?.querySelector(MT);n?w.setState(`value`,n.getAttribute(PT)):F(e)}let ee=()=>P(M().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?I(1):F(1)},ne=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return B.createElement(p.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(NT);t.dispatchEvent(e)}}}}},B.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:sE},c),oE(e,e=>B.createElement(RT.Provider,{value:w},B.createElement(IT.Provider,{value:T},e))))}),HT=B.forwardRef((e,t)=>{let n=N(),r=B.useRef(null),i=B.useContext(BT),a=LT(),o=$T(e),s=o.current?.forceMount??i?.forceMount;eE(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=rE(n,r,[e.value,e.children,r],e.keywords),l=zT(),u=nE(e=>e.value&&e.value===c.current),f=nE(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);B.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(NT,m),()=>t.removeEventListener(NT,m)},[f,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function h(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return B.createElement(p.div,{ref:d(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!u,"data-disabled":!!g,"data-selected":!!u,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),UT=B.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=N(),s=B.useRef(null),c=B.useRef(null),l=N(),u=LT(),f=nE(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));eE(()=>u.group(o),[]),rE(o,s,[e.value,e.heading,c]);let m=B.useMemo(()=>({id:o,forceMount:i}),[i]);return B.createElement(p.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&B.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),oE(e,e=>B.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},B.createElement(BT.Provider,{value:m},e))))}),WT=B.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=B.useRef(null),a=nE(e=>!e.search);return!n&&!a?null:B.createElement(p.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),GT=B.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=zT(),o=nE(e=>e.search),s=nE(e=>e.selectedItemId),c=LT();return B.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),B.createElement(p.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),KT=B.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=B.useRef(null),o=B.useRef(null),s=nE(e=>e.selectedItemId),c=LT();return B.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),B.createElement(p.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},oE(e,e=>B.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),qT=B.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return B.createElement(Yr,{open:n,onOpenChange:r},B.createElement($r,{container:o},B.createElement(ti,{"cmdk-overlay":``,className:i}),B.createElement(ai,{"aria-label":e.label,"cmdk-dialog":``,className:a},B.createElement(VT,{ref:t,...s}))))}),JT=B.forwardRef((e,t)=>nE(e=>e.filtered.count===0)?B.createElement(p.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),YT=B.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return B.createElement(p.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},oE(e,e=>B.createElement(`div`,{"aria-hidden":!0},e)))}),XT=Object.assign(VT,{List:KT,Item:HT,Input:GT,Group:UT,Separator:WT,Dialog:qT,Empty:JT,Loading:YT});function ZT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function QT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $T(e){let t=B.useRef(e);return eE(()=>{t.current=e}),t}var eE=typeof window>`u`?B.useEffect:B.useLayoutEffect;function tE(e){let t=B.useRef();return t.current===void 0&&(t.current=e()),t}function nE(e){let t=zT(),n=()=>e(t.snapshot());return B.useSyncExternalStore(t.subscribe,n,n)}function rE(e,t,n,r=[]){let i=B.useRef(),a=LT();return eE(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(PT,s),i.current=s}),i}var iE=()=>{let[e,t]=B.useState(),n=tE(()=>/* @__PURE__ */ new Map);return eE(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function aE(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function oE({asChild:e,children:t},n){return e&&B.isValidElement(t)?B.cloneElement(aE(t),{ref:t.ref},n(t.props.children)):n(t)}var sE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function cE(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function lE({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,B.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,V.jsxs)(vo,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,V.jsx)(bo,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted disabled:opacity-50`,l),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,V.jsx)(BC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,V.jsx)(wo,{container:f,children:/* @__PURE__ */ (0,V.jsx)(Eo,{align:`start`,sideOffset:6,className:`z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsxs)(XT,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,V.jsx)(ww,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(XT.Input,{placeholder:a,className:`h-10 w-full bg-transparent text-[14px] outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,V.jsxs)(XT.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,V.jsx)(XT.Empty,{className:`px-3 py-6 text-center text-[13px] text-muted`,children:o}),cE(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,V.jsxs)(XT.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-[14px] data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(MC,{className:E(`size-4 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num ml-auto shrink-0 text-[12px] text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,V.jsx)(XT.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var uE=`__empty`;function dE({value:e,onChange:t,options:n,label:r,className:i}){return/* @__PURE__ */ (0,V.jsx)(Rc,{type:`single`,"aria-label":r,value:e===``?uE:String(e),onValueChange:e=>{e&&t(e===uE?``:e)},className:E(`grid auto-cols-fr grid-flow-col rounded-lg bg-raise p-0.5`,i),children:n.map(e=>/* @__PURE__ */ (0,V.jsx)(qc,{value:e.value===``?uE:String(e.value),className:`num h-8 rounded-md px-2 text-[13px] text-muted transition-colors hover:text-ink data-[state=on]:bg-panel data-[state=on]:text-ink data-[state=on]:shadow-[0_1px_2px_rgb(0_0_0/0.08)]`,children:e.label},e.value))})}var fE={BBL:`Bambu Lab`},pE=e=>fE[e]||e,mE=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function hE(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:pE(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:gE(e)})).sort(mE)})).sort(mE)}function gE(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||mE(e,t))}function _E(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var vE=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function yE(e){return e.isLoading?`Loading printers…`:e.error?`The full printer list didn’t load, so only our printers are listed.`:null}function bE({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=e.data,a=(0,B.useMemo)(()=>i&&n?_E(i,n):null,[i,n]),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``);(0,B.useEffect)(()=>{a?(s(a.brand.id),l(a.model.id)):n===``&&(s(``),l(``))},[a,n]);let u=i&&i.find(e=>e.id===o),d=u&&u.models.find(e=>e.id===c),f=(e,t=u)=>{let n=t.models.find(t=>t.id===e);l(e),r(vE(n).name)},p=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));s(e),l(``);let t=i.find(t=>t.id===e);t.models.length===1?f(t.models[0].id,t):r(null)},m=[...t.map(e=>({...e,group:`Our printers`})),...(i||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],h=yE(e),g=t.find(e=>e.value===`printer:${n}`),_=d?`${u.label} ${d.label}`:u?.label??g?.label;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:3,title:`Printer`,done:n!==null,aside:_,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Brand`,children:/* @__PURE__ */ (0,V.jsx)(lE,{label:`Printer brand`,value:a||!g?o:g.value,onChange:p,items:m,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!m.length})}),h&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:h}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:u&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Model`,children:/* @__PURE__ */ (0,V.jsx)(lE,{label:`Printer model`,value:c,onChange:e=>f(e),placeholder:`Choose a ${u.label} model`,items:u.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),d&&/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(dE,{label:`Nozzle size`,value:n||``,onChange:r,className:d.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:d.nozzles.map(e=>({value:e.name,label:e.label}))})})]},u.id)})]})})}var xE=`__empty`;function SE({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,V.jsxs)(Xo,{value:e===``?xE:e,onValueChange:e=>t(e===xE?``:e),children:[/* @__PURE__ */ (0,V.jsxs)(Qo,{"aria-label":r,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted`,a),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,V.jsx)(es,{})}),/* @__PURE__ */ (0,V.jsx)(ts,{children:/* @__PURE__ */ (0,V.jsx)(PC,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(is,{container:o,children:/* @__PURE__ */ (0,V.jsx)(os,{position:`popper`,sideOffset:6,className:`z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsx)(vs,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,V.jsxs)(ws,{value:e.value===``?xE:e.value,className:`relative flex cursor-pointer items-center rounded-md py-2 pr-2.5 pl-8 text-[14px] outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(Os,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(Es,{children:e.label})]},e.value))})})})]})}function CE({settings:e,onChange:t,options:n}){let[r,i]=(0,B.useState)(!1),a=n.data,o=a?a.materials:[e.material],s=o.map(e=>({value:e,label:e})),c=e.process||e.filament;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:4,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Material`,children:o.length>8?/* @__PURE__ */ (0,V.jsx)(lE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:s,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,V.jsx)(SE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:s})}),a&&/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex items-center gap-1 text-[13px] font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,V.jsx)(IC,{className:E(`size-4 transition-transform`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,c&&!r?`, changed`:``]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Process`,children:/* @__PURE__ */ (0,V.jsx)(SE,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${a.defaultProcess?` (${a.defaultProcess})`:``}`},...a.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Filament`,hint:`${a.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,V.jsx)(lE,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...a.filaments.map(e=>({value:e.name,label:e.name}))]})})]})})})]})]})})}function wE({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:d?`num text-[13px] font-semibold`:`text-[13px] text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to default`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,V.jsxs)(Xs,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,V.jsx)(rc,{className:`relative h-2 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(ac,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,V.jsx)(fc,{"aria-valuetext":d?a(Number(n)):s,className:d?`block size-5 rounded-full border-2 border-accent bg-panel shadow-sm`:`block size-5 rounded-full border-2 border-rule bg-panel`})]}),c&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`grid text-[11px] text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,V.jsx)(`span`,{className:a,children:e},i)})})]})}var TE={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},EE=[10,15,20,30,40,50,60,70,80,90];function DE(e,t,n=[0,0,0]){let r={filename:e.name,size:e.size};for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`mode`])t[e]!=null&&t[e]!==``&&(r[e]=t[e]);return t.supports&&(r.supports=t.supports===`true`),t.gcode&&(r.gcode=!0),t.plate&&(r.plate=!0),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&(r[e]=n[t])}),r}var OE=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],kE=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],AE=[1,2,3,4,5,6],jE={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function ME(e){let t=OE.filter(t=>e.includes(t.id)),n=e.filter(e=>!OE.some(t=>t.id===e)).map(e=>({id:e,hint:``}));return[...t,...n]}var NE=(e,t)=>({uploading:`Uploading`,waiting:`Waiting for a free slot`})[e]||t;function PE(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function FE(e,t){return e===`ABS`&&PE(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}function IE(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function LE(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var RE=e=>Math.round(e*100)/100;function zE(e,t){return e==null?null:t?{low:Math.floor(RE(e)),high:Math.ceil(RE(e*(100+t)/100))}:{low:e,high:e}}function BE(e,t){if(!t)return{low:e,high:e};let n=zE(e/60,t);return{low:n.low*60,high:n.high*60}}function VE(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return e.low===e.high?n(e.low):`${n(e.low)} – ${n(e.high)}`}var HE=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function UE(e){return e.low===e.high?LE(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${LE(e.low)} – ${LE(e.high)}`}function WE(e,t,n,r){let i=RE(e.weightG*t),a=e.seconds*t,o=r&&r.range;return{grams:i,seconds:a,currency:n?n.currency:null,range:n?{low:n.min*t,high:n.max*t}:null,gramsRange:zE(i,o),secondsRange:BE(a,o)}}function GE(e,t){let n=e.map(e=>WE(e.stats,e.copies,e.price,t)),r=[...new Set(e.filter(e=>!e.price).map(e=>e.material))],i=e=>RE(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:n.map(e=>e.currency).find(Boolean)??null,unpriced:r,range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var KE=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],qE=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],JE=e=>`${e} ${e===1?`wall`:`walls`}`;function YE({settings:e,onChange:t}){return/* @__PURE__ */ (0,V.jsx)(Fw,{n:5,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(dE,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:KE})}),/* @__PURE__ */ (0,V.jsx)(wE,{label:`Infill`,values:EE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(wE,{label:`Walls`,values:AE,value:e.walls,onChange:e=>t({walls:e}),format:JE,defaultValue:3,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Supports`,children:/* @__PURE__ */ (0,V.jsx)(dE,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:qE})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Default keeps the printer’s own process, and the shop’s setting for supports.`})]})})}function XE(e){let[t,n]=(0,B.useState)(()=>matchMedia(e).matches);return(0,B.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function ZE({theme:e,onTheme:t}){let n=XE(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`relative inline-flex h-7 w-[52px] shrink-0 items-center rounded-full bg-raise p-0.5 transition-colors hover:bg-rule`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{"aria-hidden":!0,className:E(`absolute top-0.5 left-0.5 size-6 rounded-full bg-accent transition-transform duration-200`,r&&`translate-x-6`)}),/* @__PURE__ */ (0,V.jsx)(Ew,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(fw,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function QE(e){let[t,n]=(0,B.useState)(Date.now);return(0,B.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function $E({plates:e,position:t,settings:n,onSettings:r,printers:i,ourPrinters:a=[],options:o,toSlice:s,slicingSince:c,phase:l,blocker:u,onSlice:d,onOpenGcode:f,theme:p,onTheme:m}){let h=QE(c);return/* @__PURE__ */ (0,V.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel md:min-h-0 md:w-[340px] md:shrink-0 md:border-r lg:w-[380px]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`md:min-h-0 md:flex-1 md:overflow-y-auto`,children:[/* @__PURE__ */ (0,V.jsx)(cT,{...e}),/* @__PURE__ */ (0,V.jsx)(fT,{n:2,...t}),/* @__PURE__ */ (0,V.jsx)(bE,{printers:i,ourPrinters:a,printer:n.printer,onChange:e=>r({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,V.jsx)(CE,{settings:n,onChange:r,options:o}),/* @__PURE__ */ (0,V.jsx)(YE,{settings:n,onChange:r})]}),/* @__PURE__ */ (0,V.jsxs)(`footer`,{className:`sticky bottom-0 border-t border-rule bg-panel px-5 py-4`,children:[u&&!c&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-2.5 text-[13px] text-muted`,children:u}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Open G-code`,side:`top`,children:/* @__PURE__ */ (0,V.jsx)(zw,{size:`icon`,className:`size-11`,"aria-label":`Open G-code`,onClick:f,children:/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-[18px]`,"aria-hidden":!0})})}),m&&/* @__PURE__ */ (0,V.jsx)(ZE,{theme:p,onTheme:m}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`primary`,size:`lg`,className:`min-w-0 flex-1 justify-center px-3`,disabled:!!u||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:NE(l,`Slicing`)}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[h,` s`]})]}):/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`size-[18px] shrink-0`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:s>1?`Slice ${s} plates`:`Slice plate`})]})})]})]})]})}var eD=e=>{let t=ge.indexOf(e);return t<0?ge.length-1:t};function tD({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>eD(e.name)-eD(t.name)),s=e.map((e,t)=>t),c=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:E(`overflow-hidden rounded-xl border border-rule bg-panel/90 backdrop-blur`,r?`w-64`:`w-auto`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-[14px] font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,V.jsx)(PC,{className:E(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.2,ease:`easeOut`},children:[/* @__PURE__ */ (0,V.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,V.jsx)(`li`,{children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:t=>c(t,e.i),"aria-pressed":!n,className:E(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`size-3 shrink-0 rounded-[3px]`,style:{background:me(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:he(e.name)}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,V.jsx)(XC,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,V.jsx)(QC,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`border-t border-rule px-3.5 py-2 text-[12px] text-muted`,children:t.size?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function nD(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function rD({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-md bg-ink px-2 py-1 text-ink-contrast shadow-sm`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[11px] opacity-70`,children:[t.toFixed(2),` mm`]})]})}function iD({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,B.useMemo)(()=>nD(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,V.jsx)(`div`,{className:E(`flex rounded-xl border border-rule bg-panel/90 backdrop-blur`,i?`h-full w-16 flex-col items-center py-4`:`h-14 w-full items-center px-5`),children:/* @__PURE__ */ (0,V.jsxs)(Xs,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:E(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,V.jsx)(rc,{className:E(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,V.jsx)(ac,{className:E(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-center gap-1 text-[10px] text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,V.jsx)(fc,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,V.jsx)(rD,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,V.jsx)(fc,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,V.jsx)(rD,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var aD=e=>e==null?null:`${+e.toFixed(3)} mm`;function oD(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return[n&&`${n}h`,(n||r)&&`${r}m`,`${i}s`].filter(Boolean).join(` `)}function sD(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function cD({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num display text-[20px] leading-none font-semibold whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-0.5 text-[13px] font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:n})]})}function lD({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,aD(n.layerHeight)],[`Nozzle`,aD(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,sD(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,V.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-[13px]`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,V.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,V.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function uD({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&oD(o.seconds);return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-start gap-3 rounded-xl border border-rule bg-panel/90 px-4 py-3 backdrop-blur lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,V.jsx)(cD,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,V.jsx)(cD,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,V.jsx)(cD,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,V.jsx)(cD,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,V.jsxs)(vo,{children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Print details`,children:/* @__PURE__ */ (0,V.jsx)(bo,{asChild:!0,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`ml-auto grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-[18px]`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,V.jsx)(wo,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(Eo,{side:`top`,align:`start`,sideOffset:10,className:`z-50 w-80 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-3 text-[14px] font-semibold`,children:`Print details`}),n&&/* @__PURE__ */ (0,V.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-3 aspect-[4/3] w-full rounded-lg bg-viewer object-contain`}),/* @__PURE__ */ (0,V.jsx)(lD,{result:e,quote:t})]})})]})]})}function dD(){let{layout:e}=i(),[t,n]=(0,B.useState)(()=>({width:e.clientWidth,height:e.clientHeight}));return(0,B.useEffect)(()=>{let t=new ResizeObserver(()=>n(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[e]),t}var fD=(0,B.lazy)(()=>import(`./chunks/Viewer3D-MGmKZLAb.js`)),pD=(0,B.lazy)(()=>import(`./chunks/PlateEditor-BbouIi-O.js`)),mD=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function hD({children:e}){return/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2},className:`absolute top-1/2 left-1/2 z-20 w-[min(360px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-6 text-center`,children:e})}function gD({slicing:e}){let t=QE(e.since);return/* @__PURE__ */ (0,V.jsxs)(hD,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`mx-auto size-7 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold`,children:e.title}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:e.printer}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(Ix.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num mt-2 text-[12px] text-muted`,children:[t,` s`]})]})}function _D({title:e,text:t,onChooseModel:n,onOpenGcode:r}){return/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`pointer-events-auto max-w-sm rounded-2xl bg-panel/85 p-5 text-center backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`mx-auto size-9 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`display mt-3 text-[18px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2 text-[14px] text-muted`,children:t}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-center gap-2`,children:[n&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`primary`,onClick:n,children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-4`,"aria-hidden":!0}),` Choose models`]}),/* @__PURE__ */ (0,V.jsxs)(zw,{onClick:r,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function vD({mode:e,onMode:t}){return/* @__PURE__ */ (0,V.jsx)(dE,{label:`Prepare or preview`,value:e,onChange:t,className:`w-[188px] border border-rule bg-panel/90 backdrop-blur`,options:[{value:`prepare`,label:`Prepare`},{value:`preview`,label:`Preview`}]})}function yD({label:e,pressed:t,onClick:n,children:r,...i}){return/* @__PURE__ */ (0,V.jsx)(j,{label:e,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,onClick:n,...i,className:E(`grid size-9 place-items-center rounded-lg border border-rule bg-panel/90 text-muted backdrop-blur hover:text-ink`,t&&`border-ink text-ink`),children:r})})}function bD({gcode:e,slicing:t,mode:n,onMode:r,editor:i,emptyPlate:a,note:o,onChooseModel:s,onOpenGcode:c}){let{status:l,result:u}=e,d=l===`ready`,f=dD(),p=f.width>=1024,m=f.height<520,h=f.width<768?Math.max(300,Math.round(Math.min(f.height,window.innerHeight)*.58)):void 0,g=ox(),[_,v]=(0,B.useState)([1,1]),[y,b]=(0,B.useState)(()=>/* @__PURE__ */ new Set),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(`iso`),[T,E]=(0,B.useState)(0),[D,O]=(0,B.useState)(p&&!m),k=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!u)return;let e=Math.max(1,u.layers.length);if(b(/* @__PURE__ */ new Set),w(`iso`),g||e<3){v([1,e]);return}v([1,1]);let t=Fx(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>v([1,Math.round(e)])});return k.current=t,()=>t.stop()},[u,g]);let A=n===`preview`,M=A&&d,N=(0,B.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,B.useEffect)(()=>()=>{N&&URL.revokeObjectURL(N)},[N]),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative flex min-h-0 flex-col md:h-full`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative overflow-hidden bg-viewer md:flex-1`,style:{height:h},children:[M&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(fD,{result:u,layerMin:_[0]-1,layerMax:_[1]-1,hidden:y,showTravels:x,view:C,fitKey:T})})}),!A&&i&&/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(pD,{...i})}),!A&&a&&!t&&/* @__PURE__ */ (0,V.jsx)(_D,{title:`Put models on the plate`,onChooseModel:s,onOpenGcode:c,text:`Drop models anywhere on the page (STL, 3MF, OBJ, STEP or IGES), or choose them. Each lands where there is room, then you can move it.`}),!A&&o&&!t&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-16 z-10 flex justify-center px-4`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-md rounded-xl bg-panel/90 px-4 py-2.5 text-center text-[13px] text-muted backdrop-blur`,children:o})}),A&&l===`empty`&&!t&&/* @__PURE__ */ (0,V.jsx)(_D,{title:`Slice a plate to see how it prints`,onOpenGcode:c,text:`Its G-code shows here, layer by layer. Already have G-code or a sliced 3MF? Open it to inspect it.`}),t&&/* @__PURE__ */ (0,V.jsx)(gD,{slicing:t}),A&&l===`loading`&&!t&&/* @__PURE__ */ (0,V.jsxs)(hD,{children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[15px] font-semibold`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),A&&l===`error`&&!t&&/* @__PURE__ */ (0,V.jsxs)(hD,{children:[/* @__PURE__ */ (0,V.jsx)(ne,{className:`mx-auto size-7 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[14px]`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(zw,{onClick:c,children:`Open another file`}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 left-3 z-20 flex flex-col items-start gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(vD,{mode:n,onMode:r}),M&&/* @__PURE__ */ (0,V.jsx)(tD,{features:u.features,hidden:y,onHidden:b,open:D,onOpen:O})]}),M&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,V.jsx)(dE,{label:`View`,value:C,onChange:e=>{w(e),E(e=>e+1)},options:mD,className:`w-40 border border-rule bg-panel/90 backdrop-blur`}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(yD,{label:x?`Hide travel moves`:`Show travel moves`,pressed:x,onClick:()=>S(e=>!e),children:/* @__PURE__ */ (0,V.jsx)(vw,{className:`size-[18px]`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(yD,{label:`Fit to model`,onClick:()=>E(e=>e+1),children:/* @__PURE__ */ (0,V.jsx)(Sw,{className:`size-[18px]`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:p?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,V.jsx)(iD,{layers:u.layers,fallbackZ:u.bounds?u.bounds.max[2]:0,value:_,vertical:p,onChange:e=>{k.current?.stop(),v(e)}})})]})]}),M&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-xl border border-rule bg-panel/90 py-1.5 pr-1.5 pl-3 backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`max-w-[220px] truncate text-[13px] font-medium`,title:e.name,children:e.name}),N&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Download G-code`,children:/* @__PURE__ */ (0,V.jsx)(`a`,{href:N,download:e.name,"aria-label":`Download G-code`,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(KC,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Close`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsx)(uD,{result:u,quote:e.quote,thumbnail:e.thumbnail})]})]})}var xD=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function SD(e,{body:t,csrf:n,...r}={}){let i={Accept:`application/json`};t&&(i[`Content-Type`]=`application/json`),n&&(i[`X-CSRF-TOKEN`]=n);let a=await fetch(e,{...r,headers:i,...t&&{body:JSON.stringify(t)}}).catch(()=>{throw Error(`The server can’t be reached.`)}),o=null;try{o=await a.json()}catch{}if(!a.ok){let e=Number(a.headers.get(`Retry-After`))||void 0;throw Object.assign(Error(o&&o.message||`Request failed (HTTP ${a.status})`),{status:a.status,retryAfter:e})}return o}var CD=e=>({401:`Sign in to slice`,403:`Your account can’t slice models`,419:`Your session has expired. Reload the page`})[e]||null;function wD(e,t){return e?t.error?t.error.status===503?`Slicing is off on this server`:CD(t.error.status)||`The server can’t be reached`:t.data&&!t.data.slicer?`Slicing is off on this server`:null:`Slicing isn’t set up on this page`}var TD=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],ED=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function DD(e){if(typeof e!=`string`||!e.trim())return null;try{let{protocol:t}=new URL(e.trim(),`https://page.invalid/`);return t===`https:`||t===`http:`?e.trim():null}catch{return null}}function OD(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!ED(n))return t(`config must be an object`),{};let{realtime:r,staffApi:i,contact:a,defaultPrinter:o,defaults:s,cards:c,button:l,advanced:u,...d}=n;for(let e of Object.keys(d))t(`unknown config key "${e}" left out`);let f={};if(r!==void 0){let{key:e,host:n,port:i,cluster:a,tls:o}=ED(r)?r:{};typeof e==`string`&&e.trim()?(f.realtime={key:e.trim()},typeof n==`string`&&n.trim()&&(f.realtime.host=n.trim()),Number.isInteger(i)&&i>0&&(f.realtime.port=i),typeof a==`string`&&a.trim()&&(f.realtime.cluster=a.trim()),typeof o==`boolean`&&(f.realtime.tls=o)):t(`realtime left out: it needs a key`)}if(i!==void 0){let{url:e,csrfToken:n}=ED(i)?i:{};typeof e==`string`&&e.trim()?f.staffApi={url:e.trim(),csrfToken:typeof n==`string`?n.trim():``}:t(`staffApi left out: it needs a url`)}if(ED(a)&&(f.contact={},typeof a.name==`string`&&(f.contact.name=a.name.trim()),typeof a.email==`string`&&a.email.includes(`@`)?f.contact.email=a.email.trim():a.email!==void 0&&t(`contact.email "${a.email}" left out: it is not an email address`)),typeof o==`string`&&o.trim()&&(f.defaultPrinter=o.trim()),ED(s)){f.defaults={},typeof s.material==`string`&&(f.defaults.material=s.material.toUpperCase());let e=(e,n)=>{n.includes(s[e])?f.defaults[e]=s[e]:s[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,kE.map(e=>e.id)),e(`infill`,EE),e(`walls`,AE)}if(Array.isArray(c)){f.cards=c.filter(e=>TD.includes(e));for(let e of c)TD.includes(e)||t(`card "${e}" left out: it must be one of ${TD.join(`, `)}`);!f.cards.includes(`model`)&&!f.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),f.cards.push(`model`))}if(l!==void 0){let e=ED(l)&&typeof l.label==`string`?l.label.trim():``;if(!e||e.length>40)t(`button left out: it needs a label of 1 to 40 characters`);else if(f.button={label:e},l.url!==void 0){let e=DD(l.url);e?f.button.url=e:t(`button.url "${l.url}" left out: it must be an http(s) or relative address`)}}if(u!==void 0){let e=e=>{let n=ED(u)?u[e]:void 0;return typeof n==`string`&&n.trim()?n.trim():(t(`advanced.${e} must be a URL: Advanced stays closed until it is`),``)};f.advanced={authUrl:e(`authUrl`),verifyUrl:e(`verifyUrl`)}}return f}var kD=e=>new Set(e.cards||TD);function AD(e,t){return{...e,defaultPrinter:t.defaultPrinter||e.defaultPrinter||e.printers&&e.printers[0]||``,regularMode:{...e.regularMode},contact:{...e.contact,...t.contact}}}var jD=5e3,MD=3e4,ND=/* @__PURE__ */ new Map;async function PD({key:t,host:n,port:r=443,cluster:i=`mt1`,tls:a=!0}){let{default:o}=await import(`./chunks/pusher-BoV3x8Qs.js`).then(t=>/* @__PURE__ */ e(t.default,1));return new o(t,{cluster:i,wsHost:n,wsPort:r,wssPort:r,forceTLS:a,enabledTransports:[`ws`,`wss`],disableStats:!0})}function FD(e,t){let n=JSON.stringify(e),r=ND.get(n)||{pusher:t(e),users:0,idle:null};return ND.set(n,r),clearTimeout(r.idle),r.users++,{pusher:r.pusher,release:()=>{--r.users||(r.idle=setTimeout(()=>{ND.delete(n),r.pusher.then(e=>e.disconnect(),()=>{})},MD))}}}function ID(e,t,n,r,i=PD){if(!e)return{ready:Promise.resolve(!1),close:()=>{}};let{pusher:a,release:o}=FD(e,i),s=()=>{};return{ready:a.then(e=>new Promise(i=>{let a=e.subscribe(t),o=null,c=t=>{o!==null&&(clearTimeout(o),o=null,e.connection.bind(`connected`,r),i(t))};o=setTimeout(()=>c(!1),jD),a.bind(`quote.updated`,n),a.bind(`pusher:subscription_succeeded`,()=>c(!0)),a.bind(`pusher:subscription_error`,()=>c(!1)),s=()=>{e.connection.unbind(`connected`,r),a.unbind(),e.unsubscribe(t)}})).catch(()=>!1),close:()=>{s(),o()}}}var LD=6e4,RD=[1e3,2e3,4e3,8e3,15e3,3e4],zD=54e5,BD=60,VD=(e,t)=>t?LD:RD[e]??LD;async function HD(e,t,n,r){let i=()=>SD(e(`/quotes`),{method:`POST`,body:n,csrf:t});try{return await i()}catch(e){if(!e.retryAfter||e.retryAfter>BD)throw e;return r(`waiting`),await new Promise(t=>setTimeout(t,e.retryAfter*1e3)),i()}}async function UD({url:e,fields:t},n){let r=new FormData;Object.entries(t).forEach(([e,t])=>r.append(e,t)),r.append(`file`,n);let i=await fetch(e,{method:`POST`,body:r}).catch(()=>null);if(!i||!i.ok)throw Error(`The file could not be uploaded, please try again`)}async function WD({base:e,csrf:t,realtime:n,file:r,settings:i,rot:a,onStep:o=()=>{},watch:s=ID}){let c=t=>xD(e,t),l=await HD(c,t,DE(r,i,a),o);o(`uploading`);let u,d,f=new Promise((e,t)=>{u=e,d=t});f.catch(()=>{});let p=async()=>{try{let e=await SD(c(`/quotes/${l.id}`));(e.status===`done`||e.status===`failed`)&&u(e)}catch(e){e.status===404?d(/* @__PURE__ */ Error(`This quote has expired, please try again`)):e.status>=400&&e.status<500&&e.status!==429&&d(e)}},m=s(n,l.channel,p,p),h,g,_=!1,v=(e,t)=>{h=setTimeout(async()=>{await p(),_||v(e+1,t)},VD(e,t))};try{let e=await m.ready;e||console.warn(`slicer-studio: live updates are off, so prices are checked every few seconds at first, then each minute. Check the realtime option and connect-src.`),await UD(l.upload,r),o(`working`),await SD(c(`/quotes/${l.id}/start`),{method:`POST`,csrf:t}).catch(e=>{if(e.status!==409)throw e}),v(0,e),g=setTimeout(()=>d(/* @__PURE__ */ Error(`This is taking too long, please try again`)),zD);let n=await f;if(n.status===`failed`)throw Error(n.errorDetail||n.error||`This model could not be priced`);return n}finally{_=!0,clearTimeout(h),clearTimeout(g),m.close()}}async function GD(e,t){let n=await fetch(xD(e,`/quotes/${t}/gcode`)).catch(()=>null);if(!n||!n.ok)throw Error(`The G-code could not be downloaded`);return n.blob()}var KD=()=>{let{apiUrl:e}=i();return t=>xD(e,t)};function qD(){let e=KD(),{config:t}=i();return Jt({queryKey:[`config`],queryFn:()=>SD(e(`/config`)),select:e=>AD(e,t)})}function JD(e){let t=KD();return Jt({queryKey:[`materials`,e],queryFn:()=>SD(t(`/options?printer=${encodeURIComponent(e)}`)),enabled:!!e})}function YD(){let{apiUrl:e,config:t}=i();return Yt({mutationFn:({model:n,settings:r,rot:i,onStep:a})=>WD({base:e,realtime:t.realtime,file:n,settings:r,rot:i,onStep:a})})}function XD(){let{staffApi:e}=i().config;return Jt({queryKey:[`health`,e?.url],queryFn:()=>SD(xD(e.url,`/health`)),enabled:!!e,staleTime:6e4})}function ZD(){let{staffApi:e}=i().config;return Jt({queryKey:[`printers`,e?.url],queryFn:()=>SD(xD(e.url,`/printers`)),enabled:!!e,select:e=>hE(e.printers)})}function QD(e,t){let{staffApi:n}=i().config;return Jt({queryKey:[`options`,n?.url,e,t],queryFn:()=>SD(xD(n.url,`/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`)),enabled:!!n&&!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}function $D(e){let{staffApi:t}=i().config,n=Kt({queries:e.map(e=>({queryKey:[`bed`,t?.url,e],queryFn:()=>SD(xD(t.url,`/options?printer=${encodeURIComponent(e)}`)),enabled:!!t&&!!e}))}),r=e.map((e,t)=>[e,n[t].data&&n[t].data.bed]).filter(([,e])=>e),a=JSON.stringify(r);return(0,B.useMemo)(()=>Object.fromEntries(r),[a])}function eO(){let{staffApi:e,realtime:t}=i().config;return Yt({mutationFn:async({model:n,settings:r,rot:i,onStep:a})=>{let{url:o,csrfToken:s}=e,c=await WD({base:o,csrf:s,realtime:t,file:n,settings:{...r,mode:`exact`,gcode:!0},rot:i,onStep:a});if(!c.hasGcode)throw Error(`No G-code came back for this model`);return{...c,gcode:await GD(o,c.id)}}})}var tO='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),W=(1<<U)-1,ee=S(V,U,1),H=0;H<z;){var G=ee[O(e,g,W)];g+=G&15;var P=G>>4;if(P<16)B[H++]=P;else{var K=0,q=0;for(P==16?(q=3+O(e,g,3),g+=2,K=B[H-1]):P==17?(q=3+O(e,g,7),g+=3):P==18&&(q=11+O(e,g,127),g+=7);q--;)B[H++]=K}}var te=B.subarray(0,L),J=B.subarray(L);x=D(te),C=D(J),y=S(te,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var K=y[k(e,g)&ne],X=K>>4;if(g+=K&15,g>w){l&&N(0);break}if(K||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},W=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?ee(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},ee=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function G(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=W(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}Object.keys({stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`}).map(e=>`.`+e).join(`,`);function K(e,t,n=()=>{}){try{return G(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function q(e,t){let n=K(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=q(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',nO=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,tO],{type:`text/javascript;charset=utf-8`});function rO(e){let t;try{if(t=nO&&(self.URL||self.webkitURL).createObjectURL(nO),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(tO),{type:`module`,name:e?.name})}}function iO(){let[e,t]=(0,B.useState)({status:`empty`}),n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,B.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new rO;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,B.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,B.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var aO=52428800,oO=e=>Math.max(1,Math.ceil(e/2)),sO=e=>Math.floor(e/2),cO={items:[],selected:null},lO=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function uO(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return lO(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return lO(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return lO(e,t.id,e=>({...e,rot:t.rot}));case`result`:return lO(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return lO(e,t.id,e=>({...e,error:t.error}));default:return e}}var dO=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),fO=(e,t)=>!e.result||e.result.sig!==t||!!e.error,pO=5e5,mO=e=>!!e&&[`step`,`iges`].includes(ye(e.name).format),hO={outside:`is off the bed`,excluded:`is in a part of the bed the printer keeps clear`,tall:`is taller than the printer can print`},gO=e=>e.toLocaleString(`en`);function _O({defaults:e,slice:t}){let[n,r]=(0,B.useReducer)(qw,Vw),i=$D([.../* @__PURE__ */ new Set([...n.plates.map(e=>e.settings.printer),e.printer])].filter(Boolean)),a=(0,B.useRef)(n);a.current=n;let o=(0,B.useRef)(0),s=e=>`${e}-${++o.current}`,[c,l]=(0,B.useState)({}),u=(0,B.useRef)(c);u.current={...c,...u.current};let d=(0,B.useRef)(/* @__PURE__ */ new Map),f=(0,B.useRef)(/* @__PURE__ */ new Set),[p,m]=(0,B.useState)([]),[h,g]=(0,B.useState)(null);(0,B.useEffect)(()=>{for(let e of f.current)Object.hasOwn(n.files,e)&&f.current.delete(e);let e=new Set($w(Object.keys(u.current),n.files,f.current));if(!e.size)return;let t=t=>Object.fromEntries(Object.entries(t).filter(([t])=>!e.has(t)));u.current=t(u.current),l(t);for(let t of[...d.current.keys()])e.has(tT(t))&&d.current.delete(t)},[n.files,p]);let _=e=>se(e&&i[e.settings.printer]),v=(e,t)=>{let n=u.current[e];if(!n)return null;let r=eT(e,t);return d.current.has(r)||d.current.set(r,ue(n.positions,t)),d.current.get(r)},y=(e,t)=>{let n=v(e.fileId,e.orient);return n?ce(n.hull,e.spin,t.center[0]+e.x,t.center[1]+e.y):null},b=(e,t,n=null)=>e.objects.filter(e=>e.id!==n).map(e=>y(e,t)).filter(Boolean),x=e=>e.objects.reduce((e,t)=>e+(u.current[t.fileId]?.triangles||0),0),S=(e,t)=>e.objects.some(e=>mO(t[e.fileId])),C=e=>{for(let t of a.current.plates){let n=t.objects.find(t=>t.id===e);if(n)return{plate:t,o:n}}return{}},w=t=>{let n=/* @__PURE__ */ new Set,i=a.current,o={...i.files,...Object.fromEntries(t.map(e=>[e.fileId,e.file]))},c=i.plates.map(e=>({...e,objects:[...e.objects]})),l=c.find(e=>e.id===i.selected.plate)||null,d=[],f=()=>{if(c.length>=10)return null;let t={id:s(`plate`),settings:{...l?l.settings:e},objects:[]};return c.push(t),d.push({type:`addPlate`,id:t.id,settings:t.settings}),t};for(let e of t){let t=null,r=null;if(e.cad)t=l&&!l.objects.length?l:f(),r={x:0,y:0};else{let n=v(e.fileId,L),i=u.current[e.fileId].triangles;if(l&&!S(l,o)&&l.objects.length<50&&x(l)+i<=1e6){let e=_(l);r=re(n.hull,0,b(l,e),e),r&&(t=l)}t||(t=f(),t&&(r=re(n.hull,0,[],_(t))||{x:0,y:0}))}if(!t){$x.error(`Up to 10 plates. Remove one to add more.`);break}let i=Hw(s(`object`),e.fileId,r);t.objects.push(i),d.push({type:`addObjects`,plate:t.id,files:{[e.fileId]:e.file},objects:[i]}),n.add(e.fileId),l=t}return d.forEach(r),n},T=async e=>{let t=10-Object.keys(a.current.files).length;if(t<=0){$x.error(`Up to 10 files at a time. Remove one to add another.`);return}let n=e.filter(e=>e.size>aO);n.length&&$x.error(`${n.map(e=>e.name).join(`, `)}: over the 50 MB limit. Please choose a smaller file.`);let r=e.filter(e=>e.size<=aO);r.length>t&&$x.error(`Up to 10 files at a time, so ${r.length-t} ${r.length-t===1?`was`:`were`} left out.`);let i=[];for(let e of r.slice(0,t)){let t=s(`file`);if(mO(e))i.push({fileId:t,file:e,cad:!0});else{m(t=>[...t,e.name]);try{let{loadMesh:n}=await import(`./chunks/plate-mesh-BoEG27Tx.js`),r=await n(e);if(r.triangles>pO){$x.error(`${e.name} has ${gO(r.triangles)} triangles, and the slicer takes up to ${gO(pO)}.`);continue}u.current={...u.current,[t]:r},l(e=>({...e,[t]:r})),f.current.add(t),i.push({fileId:t,file:e})}catch{$x.error(`${e.name} could not be read. Is it a 3D model?`)}finally{m(t=>{let n=t.indexOf(e.name);return n<0?t:[...t.slice(0,n),...t.slice(n+1)]})}}}let o=/* @__PURE__ */ new Set;try{i.length&&(o=w(i))}finally{for(let e of i)o.has(e.fileId)||f.current.delete(e.fileId)}},E=(e,t,n)=>{let i=a.current,o=i.plates.find(t=>t.id===e);if(!o)return;let c=o.objects.filter(e=>e.fileId===t);if(n<c.length){r({type:`removeObjects`,ids:c.slice(n).map(e=>e.id)});return}if(n===c.length||mO(i.files[t]))return;let l=_(o),d=c[c.length-1],f=v(t,d.orient),p=b(o,l),m=u.current[t].triangles,h=x(o),g=[];for(let e=c.length;e<n;e++){if(o.objects.length+g.length>=50){$x.error(`Up to 50 objects on a plate.`);break}if(h+m>1e6){$x.error(`A plate takes up to ${gO(Bw)} triangles, copies included.`);break}let e=re(f.hull,d.spin,p,l);if(!e){$x.error(`No room for another copy of ${i.files[t].name} on this plate.`);break}g.push(Hw(s(`object`),t,e,d.spin,d.orient)),p.push(ce(f.hull,d.spin,l.center[0]+e.x,l.center[1]+e.y)),h+=m}g.length&&r({type:`addObjects`,plate:e,files:{},objects:g})},D=(e,t)=>r({type:`updateObject`,id:e,patch:t}),O=(e,t,n)=>{let{plate:r}=C(e);if(!r)return;let i=_(r);D(e,{x:t-i.center[0],y:n-i.center[1]})},k=(e,t,n)=>{let{o:r}=C(e);r&&D(e,{x:r.x+t,y:r.y+n})},A=(e,t)=>D(e,{spin:(Math.round(t*100)/100%360+360)%360}),j=(e,t)=>{let{o:n}=C(e);n&&A(e,n.spin+t)},M=(e,t)=>{let{o:n}=C(e);n&&D(e,{orient:pe(t===`forward`?ae(90):oe(90),n.orient)})},N=(e,t)=>{let{o:n}=C(e);n&&D(e,{orient:le(n.orient,n.spin,de(t))})},P=e=>D(e,{orient:L}),F=e=>{let{o:t}=C(e),n=t&&v(t.fileId,t.orient);if(!n)return;let r=ce(n.hull,t.spin,0,0),i=r.map(e=>e[0]),a=r.map(e=>e[1]);D(e,{x:-(Math.min(...i)+Math.max(...i))/2,y:-(Math.min(...a)+Math.max(...a))/2})},I=e=>{let t=a.current.plates.find(t=>t.id===e);if(!t)return;let n=_(t),i=t.objects.map(e=>({id:e.id,points:v(e.fileId,e.orient)?.hull,spin:e.spin})).filter(e=>e.points),{positions:o,overflow:c}=fe(i,n);if(r({type:`updateObjects`,patches:o}),!c.length)return;if(a.current.plates.length>=10){$x.error(`${c.length} ${c.length===1?`object doesn’t`:`objects don’t`} fit, and there are already 10 plates.`);return}let l=s(`plate`);r({type:`addPlate`,id:l,settings:{...t.settings}});let u=fe(i.filter(e=>c.includes(e.id)),n);r({type:`moveObjects`,ids:c,to:l,positions:u.positions}),$x(`${c.length} ${c.length===1?`object didn’t`:`objects didn’t`} fit, so ${c.length===1?`it`:`they`} moved to a new plate.`)},ee=(e,t,n)=>{let i=a.current,o=i.plates.find(t=>t.id===e);if(!o)return;let c=o.objects.filter(e=>e.fileId===t),l;if(n===`new`){if(i.plates.length>=10){$x.error(`Up to 10 plates.`);return}l={id:s(`plate`),settings:{...o.settings},objects:[]},r({type:`addPlate`,id:l.id,settings:l.settings})}else l=i.plates.find(e=>e.id===n);if(!l)return;if(mO(i.files[t])||S(l,i.files)){if(l.objects.length){$x.error(`STEP and IGES files need a plate of their own.`);return}r({type:`moveObjects`,ids:c.map(e=>e.id),to:l.id,positions:{[c[0].id]:{x:0,y:0}}});return}let u=_(l),d=b(l,u),f={};for(let e of c){let n=v(e.fileId,e.orient),r=n&&re(n.hull,e.spin,d,u);if(!r){$x.error(`No room for ${Object.keys(f).length?`more copies of `:``}${i.files[t].name} on that plate.`);break}f[e.id]=r,d.push(ce(n.hull,e.spin,u.center[0]+r.x,u.center[1]+r.y))}let p=Object.keys(f);p.length&&r({type:`moveObjects`,ids:p,to:l.id,positions:f})},te=()=>{if(a.current.plates.length>=10){$x.error(`Up to 10 plates.`);return}let t=a.current.plates.find(e=>e.id===a.current.selected.plate);r({type:`addPlate`,id:s(`plate`),settings:{...t?t.settings:e}})},ne=(e,t)=>{if(!e.objects.length||S(e,t))return null;let n=a.current.plates.indexOf(e)+1,r=a.current.plates.length>1?` on plate ${n}`:``;if(e.objects.some(e=>!u.current[e.fileId]))return`A model${r} is still loading`;let i=_(e);if(i.standIn)return`The printer’s bed size hasn’t loaded yet${r?` for plate ${n}`:``}`;let o=x(e);if(o>1e6)return`Plate ${n} has ${gO(o)} triangles, and the limit is ${gO(Bw)}`;let s=R(e.objects.map(e=>({id:e.id,points:y(e,i),height:v(e.fileId,e.orient).size[2]})),i),c=e.objects.find(e=>s[e.id].problem);return c?`${t[c.fileId].name}${r} ${hO[s[c.id].problem]}`:null},me=async(e,t,n)=>{let r=n[e.objects[0].fileId];if(mO(r))return{model:r,settings:e.settings};let{plate3mf:i}=await import(`./chunks/plate-3mf-GYeMGaLV.js`),a=_(e),o=[...new Set(e.objects.map(e=>e.fileId))],s=i(o.map((e,t)=>({id:t+1,name:n[e].name,...u.current[e]})),e.objects.map(e=>({objectId:o.indexOf(e.fileId)+1,...ie(e,v(e.fileId,e.orient).shift,a.center)})));return{model:new File([s],`plate-${t}.3mf`,{type:`model/3mf`}),settings:{...e.settings,plate:!0}}},he=async()=>{let e=a.current,n=e.plates.filter(t=>Zw(t,e.files)),i=e.plates.find(t=>t.id===e.selected.plate),o=(n.length?n:i&&i.objects.length?[i]:[]).slice().sort((e,t)=>(t===i)-(e===i));if(!o.length)return;let s=Date.now(),c=0,l=null;for(let[n,i]of o.entries()){let a=e.plates.indexOf(i)+1,u=ne(i,e.files);if(u)l=Error(u),r({type:`error`,plate:i.id,error:u});else{g({since:s,step:n+1,of:o.length,plate:a,printer:i.settings.printer,phase:`uploading`});try{let{model:n,settings:o}=await me(i,a,e.files),s=await t.mutateAsync({model:n,settings:o,rot:[0,0,0],onStep:e=>g(t=>t&&{...t,phase:e})});r({type:`result`,plate:i.id,result:{stats:s.stats,used:s.used,price:s.price,quoteId:s.id,gcode:s.gcode||null,name:`plate-${a}.gcode`,sig:Xw(i,e.files)}}),c++}catch(e){l=e;let t=CD(e.status);if(r({type:`error`,plate:i.id,error:t||e.message}),t)break}}}g(null);let u=Math.max(1,Math.round((Date.now()-s)/1e3));l&&CD(l.status)?$x.error(CD(l.status)):c===o.length?$x.success(`Sliced ${o.length===1?`plate ${e.plates.indexOf(o[0])+1}`:`${o.length} plates`} in ${u} s`):o.length===1?$x.error(l.message):$x.error(c?`${c} of ${o.length} plates sliced. Each plate says what went wrong.`:`None of the ${o.length} plates could be sliced. Each plate says why.`)},{plates:ge,files:_e,selected:ve}=n,z=ge.find(e=>e.id===ve.plate)||null,ye=z&&z.objects.find(e=>e.id===ve.object)||null,be=(0,B.useMemo)(()=>_(z||{settings:e}),[z?z.settings.printer:e.printer,i]);return{plates:ge,files:_e,meshes:c,loading:p,slicing:h,plate:z,object:ye,bed:be,scene:(0,B.useMemo)(()=>{if(!z)return[];let e=z.objects.map(e=>{let t=v(e.fileId,e.orient);return{o:e,f:t,points:t&&ce(t.hull,e.spin,be.center[0]+e.x,be.center[1]+e.y)}}),t=R(e.filter(e=>e.f).map(e=>({id:e.o.id,points:e.points,height:e.f.size[2]})),be);return e.map(({o:e,f:n})=>({id:e.id,fileId:e.fileId,name:_e[e.fileId].name,cad:mO(_e[e.fileId]),loaded:!!n,...n?ie(e,n.shift,be.center):{},size:n?n.size:null,at:[be.center[0]+e.x,be.center[1]+e.y],spin:e.spin,problem:t[e.id]?t[e.id].problem:null,overlap:!!(t[e.id]&&t[e.id].overlap)}))},[z,be,c,_e]),plateFiles:z?Qw(z):[],toSlice:ge.filter(e=>Zw(e,_e)).length,stale:e=>Zw(e,_e),blocker:()=>{for(let e of ge.filter(e=>Zw(e,_e))){let t=ne(e,_e);if(t)return t}return null},addFiles:T,setCopies:E,moveTo:O,moveBy:k,setSpin:A,spinBy:j,tip:M,layFlat:N,resetTurns:P,centre:F,arrangePlate:I,moveFile:ee,newPlate:te,sliceAll:he,selectPlate:e=>r({type:`selectPlate`,id:e}),selectObject:e=>r({type:`selectObject`,id:e}),removeFile:(e,t)=>{let n=a.current.plates.find(t=>t.id===e);n&&r({type:`removeObjects`,ids:n.objects.filter(e=>e.fileId===t).map(e=>e.id)})},removePlate:e=>r({type:`removePlate`,id:e}),setSettings:e=>z&&r({type:`settings`,plate:z.id,patch:e}),settingsForAll:()=>z&&r({type:`settingsForAll`,from:z.id})}}var vO=`print-preview.theme`,yO=()=>{try{return localStorage.getItem(vO)||`system`}catch{return`system`}};function bO(){let{root:e,theme:t}=i(),[n,r]=(0,B.useState)(yO),a=t||n;return(0,B.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,B.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(vO):localStorage.setItem(vO,n)}catch{}},[n,t]),[a,t?null:r]}var xO=`print-preview.printer`,SO=()=>{try{return localStorage.getItem(xO)||null}catch{return null}};function CO(e,t){return e.error?`failed`:e.result?t?`stale`:`sliced`:null}function wO(e,t){if(!e.objects.length)return null;if(e.error)return{text:e.error,warn:!0};if(!e.result)return{text:`Not sliced yet.`};if(t)return{text:`Changed since it was sliced. Slice it again to see the change.`,warn:!0};let{stats:n,price:r}=e.result;return{text:`${n.weightG} g, ${LE(n.seconds)}${r?`, ${VE({low:r.min,high:r.max},r.currency)}`:``}`}}function TO(){let[e,t]=bO(),{staffApi:n}=i().config,r=XD(),a=qD(),o=ZD(),s=iO(),c=eO(),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(`prepare`),[p,m]=(0,B.useState)(!1),h=(0,B.useRef)(null),g=(0,B.useRef)(null),[_,v]=(0,B.useState)(()=>({...TE,printer:SO()??``})),y=(0,B.useRef)(SO()!==null),b=_O({defaults:_,slice:c}),{plate:x,object:S}=b,C=x?x.settings:_,w=e=>x?b.setSettings(e):v(t=>({...t,...e})),T=QD(C.printer,C.material);(0,B.useEffect)(()=>{if(C.printer)try{localStorage.setItem(xO,C.printer)}catch{}},[C.printer]),(0,B.useEffect)(()=>{!y.current&&a.data&&(y.current=!0,a.data.defaultPrinter&&w({printer:a.data.defaultPrinter,process:``,filament:``}))},[a.data]),(0,B.useEffect)(()=>{a.data&&C.printer&&!o.isLoading&&(a.data.printers.includes(C.printer)||o.data&&_E(o.data,C.printer)||w({printer:a.data.defaultPrinter,process:``,filament:``}))},[a.data,o.data,o.isLoading,x&&x.id]);let E=T.data&&T.data.materials;(0,B.useEffect)(()=>{E&&E.length&&!E.includes(C.material)&&w({material:E.includes(`PLA`)?`PLA`:E[0],filament:``})},[E,C.material]);let D=(0,B.useRef)(!1),O=async e=>{let{models:t,others:n}=await z(e);if(t.length){f(`prepare`),b.addFiles(t),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0],a=(...e)=>{D.current=!1,s.open(...e),f(`preview`)};i.kind===`gcode`?a(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?a(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?u({file:r,plates:i.plates}):$x.error(`${r.name} is not a model or G-code file. Use STL, 3MF, OBJ, STEP, IGES or G-code.`)},k=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:O}),A=x&&x.result,j=(0,B.useRef)({plate:null,result:null});(0,B.useEffect)(()=>{let e=j.current;j.current={plate:x&&x.id,result:A},A&&A.gcode?(D.current=!0,s.open(A.gcode,A.name,{stats:A.stats,used:A.used}),e.plate===(x&&x.id)&&e.result!==A&&f(`preview`)):D.current&&(D.current=!1,s.close())},[x&&x.id,A]);let M=e=>(...t)=>{f(`prepare`),e(...t)},N=wD(n,r),P=N?`${N}. You can still open G-code files.`:b.plates.some(e=>e.objects.length)?C.printer===null?`Choose a model for this brand.`:b.blocker():`Add a model to the plate.`,F=b.slicing&&{...b.slicing,title:`${NE(b.slicing.phase,`Slicing`)} plate ${b.slicing.plate}${b.slicing.of>1?` (${b.slicing.step} of ${b.slicing.of})`:``}`,printer:b.slicing.printer||`The default printer`},I=S&&b.scene.find(e=>e.id===S.id),ee=S?x.objects.filter(e=>e.fileId===S.fileId):[],te=b.scene.find(e=>e.cad),ne={plates:b.plates.map((e,t)=>({id:e.id,n:t+1,state:CO(e,b.stale(e))})),selected:x&&x.id,files:b.plateFiles.map(e=>{let t=b.scene.find(t=>t.id===e.objects[0].id);return{fileId:e.fileId,name:b.files[e.fileId].name,copies:e.objects.length,cad:t&&t.cad,size:t&&t.size,on:!!S&&S.fileId===e.fileId,firstId:e.objects[0].id}}),loading:b.loading,summary:x&&wO(x,b.stale(x)),onSelectPlate:b.selectPlate,onNewPlate:M(b.newPlate),onRemovePlate:b.removePlate,onSettingsForAll:()=>{b.settingsForAll(),$x.success(`Every plate now has these settings`)},onFiles:O,onChoose:()=>g.current.click(),onSelectFile:M(b.selectObject),onCopies:M((e,t)=>b.setCopies(x.id,e,t)),onMove:(e,t)=>b.moveFile(x.id,e,t),onRemove:e=>b.removeFile(x.id,e)},re={item:I,layMode:p,canArrange:!!x&&x.objects.length>0&&!te,copy:S?{k:ee.indexOf(S)+1,of:ee.length}:null,problem:I&&(I.problem?`It ${hO[I.problem]}. Move it, or turn it.`:I.overlap?`It overlaps another object.`:null),onLayMode:M(m),onMoveTo:M((e,t)=>b.moveTo(S.id,e,t)),onSpin:M(e=>b.setSpin(S.id,e)),onSpinBy:M(e=>b.spinBy(S.id,e)),onTip:M(e=>b.tip(S.id,e)),onReset:M(()=>b.resetTurns(S.id)),onCentre:M(()=>b.centre(S.id)),onArrange:M(()=>b.arrangePlate(x.id))},ie={bed:b.bed,scene:b.scene,meshes:b.meshes,selected:S&&S.id,layMode:p,onSelect:e=>b.selectObject(e),onMove:(e,t,n)=>b.moveBy(e,t,n),onLay:(e,t)=>{b.layFlat(e,t),m(!1)},onLayMode:m};return/* @__PURE__ */ (0,V.jsxs)(`div`,{...k.getRootProps({className:`flex min-h-[max(100%,360px)] flex-col outline-none md:h-full`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:h,type:`file`,accept:be,hidden:!0,onChange:e=>{O([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`input`,{ref:g,type:`file`,accept:ve,multiple:!0,hidden:!0,onChange:e=>{O([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-1 flex-col md:min-h-0 md:flex-row`,children:[/* @__PURE__ */ (0,V.jsx)(`main`,{className:`min-w-0 md:order-2 md:flex-1`,children:/* @__PURE__ */ (0,V.jsx)(bD,{gcode:s,slicing:F,mode:d,onMode:f,editor:ie,emptyPlate:!x||!x.objects.length&&!b.loading.length,note:te?`${te.name} is placed by the slicer, in the middle of the bed. Its shape shows in Preview once it is sliced.`:null,onOpenGcode:()=>h.current.click(),onChooseModel:()=>g.current.click()})}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`md:order-1 md:flex md:min-h-0`,children:/* @__PURE__ */ (0,V.jsx)($E,{plates:ne,position:re,settings:C,onSettings:w,printers:o,ourPrinters:IE(a.data),options:T,toSlice:b.toSlice,slicingSince:b.slicing&&b.slicing.since,phase:b.slicing&&b.slicing.phase,blocker:P,onSlice:b.sliceAll,onOpenGcode:()=>h.current.click(),theme:e,onTheme:t})})]}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:k.isDragActive,text:`Drop models to put them on the plate, or G-code to open it`}),/* @__PURE__ */ (0,V.jsx)(Nw,{pick:l,onClose:()=>u(null),onPick:e=>{D.current=!1,s.open(l.file,`${l.file.name}, plate ${e}`,null,{plate:e}),u(null),f(`preview`)}})]})}var EO=8e3;async function DO(e,t,n,r){n?.throwIfAborted();let i=new AbortController,a=()=>i.abort(),o=setTimeout(a,r);n?.addEventListener(`abort`,a);try{let n=await fetch(e,{...t,method:`POST`,headers:{"content-type":`application/json`},signal:i.signal});return n.status===200?await n.json():null}catch(e){if(e.name===`SyntaxError`)return null;throw e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}async function OO({authUrl:e,verifyUrl:t},n,r=EO){if(!e||!t)return`not-set-up`;try{let i=await DO(e,{credentials:`include`,body:`{}`},n,r);if(!i||typeof i.token!=`string`||!i.token)return`refused`;let a=await DO(t,{credentials:`omit`,body:JSON.stringify({token:i.token})},n,r);return a&&a.valid===!0?`granted`:`refused`}catch{return`unreachable`}}var kO={refused:`Advanced is for staff. Sign in and try again.`,unreachable:`We couldn’t check your access. Please try again.`,"not-set-up":`Advanced isn’t set up on this page.`};function AO(){return bO(),/* @__PURE__ */ (0,V.jsx)(`div`,{role:`status`,className:`flex h-full min-h-[240px] items-center justify-center text-[14px] text-muted`,children:`Checking your access…`})}function jO({reason:e,onRetry:t}){return bO(),/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`alert`,className:`flex h-full min-h-[240px] flex-col items-center justify-center gap-4 p-6 text-center`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-sm text-[15px] font-medium`,children:kO[e]}),e!==`not-set-up`&&/* @__PURE__ */ (0,V.jsx)(zw,{onClick:t,children:`Try again`})]})}function MO(){let{config:e,emit:t}=i(),{advanced:n}=e,r=n?JSON.stringify(n):null,[a,o]=(0,B.useState)(0),s=`${r} ${a}`,[c,l]=(0,B.useState)(null);return(0,B.useEffect)(()=>{if(!r)return;let e=new AbortController;return OO(n,e.signal).then(n=>{e.signal.aborted||(l({asking:s,result:n}),n!==`granted`&&t(`advanceddenied`,{reason:n}))}),()=>e.abort()},[s]),r?!c||c.asking!==s?/* @__PURE__ */ (0,V.jsx)(AO,{}):c.result===`granted`?/* @__PURE__ */ (0,V.jsx)(TO,{}):/* @__PURE__ */ (0,V.jsx)(jO,{reason:c.result,onRetry:()=>o(e=>e+1)}):/* @__PURE__ */ (0,V.jsx)(TO,{})}function NO({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`font-display text-[16px] leading-tight font-semibold tracking-[-0.01em]`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 text-right text-[11px] text-muted`,children:t}),n]})}function PO({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:E(`min-w-0 rounded-[20px] bg-panel p-5`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,V.jsx)(NO,{title:t,aside:n,action:r}),a]})}function FO({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,V.jsx)(Rc,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,V.jsxs)(qc,{value:String(e.value),className:E(`flex min-h-10 items-center justify-between gap-3 rounded-[12px] bg-raise px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[12px] font-normal opacity-75`,children:e.aside})]},e.value))})}var IO=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function LO(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
55
- `)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function RO({id:e}){let t={width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M18 4h4`})]})}function zO({value:e,onChange:t,action:n}){let r=IO.find(t=>t.id===e);return/* @__PURE__ */ (0,V.jsxs)(PO,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,V.jsx)(Rc,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:IO.map(e=>/* @__PURE__ */ (0,V.jsxs)(qc,{value:e.id,className:`flex flex-col items-start gap-2 rounded-[16px] bg-raise p-3 text-left outline-offset-2 transition-colors hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(RO,{id:e.id})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block font-display text-[18px] leading-none font-semibold`,children:e.id}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 block text-[12px] text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[13px] text-muted`,children:[r.hint,`.`,!r.priced&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink`,children:` Quoted by our team.`})]})]})}var BO=(0,B.lazy)(()=>import(`./chunks/ModelPreview-b3D28pKp.js`));function VO({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,V.jsx)(`section`,{style:{gridArea:`model`},className:E(`relative overflow-hidden rounded-[28px] lg:min-h-[480px]`,e?`min-h-[480px] bg-viewer`:`min-h-[360px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(BO,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-3 bottom-3 rounded-xl bg-panel px-3.5 py-2 text-[13px] font-medium transition-colors hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[336px] w-full flex-col items-center justify-center gap-3 rounded-[20px] border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[456px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`28px 28px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-14 place-items-center rounded-2xl bg-accent text-accent-contrast transition-transform group-hover:-translate-y-0.5`,children:/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 font-display text-[24px] leading-tight font-semibold`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 text-[14px] text-muted`,children:[`or `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. STL, 3MF, OBJ or STEP, up to `,t?`50 MB`:`10 files of 50 MB`]})]})})}function HO({icon:e,children:t}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,V.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function UO({name:e,value:t,onChange:n}){let r=e=>n(t=>Math.min(50,Math.max(1,t+e))),i=`grid size-9 place-items-center rounded-lg text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-xl bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:t<=1,onClick:()=>r(-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-8 text-center text-[14px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:t>=50,onClick:()=>r(1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]})}function WO({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Qa,{children:[/* @__PURE__ */ (0,V.jsx)(eo,{"aria-label":`More for ${e}`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(to,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(ro,{align:`end`,sideOffset:4,className:`z-50 min-w-[240px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t&&/* @__PURE__ */ (0,V.jsx)(io,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,V.jsx)(io,{className:E(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function GO({row:{item:e,stale:t},line:n,thumb:r,on:i,priced:a,onSelect:o,onRemove:s,onCopies:c,onApplyAll:l}){let u=e.file.name,d=e.result&&e.result.stats.sizeMm||r&&r.size,f=d?/* @__PURE__ */ (0,V.jsxs)(HO,{icon:bw,children:[d.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,V.jsx)(`span`,{children:_e(e.file.size)}),p=a&&n&&!t&&!e.error;return/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-2xl border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:o,className:`flex min-w-0 flex-1 basis-full items-center gap-3.5 rounded-xl text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-[62px] shrink-0 place-items-center overflow-hidden rounded-xl bg-raise`,children:r?/* @__PURE__ */ (0,V.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,V.jsx)(te,{className:`size-6 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:u,children:u}),e.error?/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[13px] text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12px] text-muted`,children:[p&&/* @__PURE__ */ (0,V.jsx)(HO,{icon:te,children:HE(n.gramsRange)}),p&&/* @__PURE__ */ (0,V.jsx)(HO,{icon:WC,children:UE(n.secondsRange)}),f,a&&!n&&/* @__PURE__ */ (0,V.jsx)(`span`,{children:`Not priced yet`}),a&&t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Changed, update the price`}),p&&e.result.stats.watertight===!1&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Has holes, so it may not print as expected`})]})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[p&&n.range&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num mr-auto text-[14px] font-semibold whitespace-nowrap @xl:mr-1`,children:VE(n.range,n.currency)}),a&&/* @__PURE__ */ (0,V.jsx)(UO,{name:u,value:e.copies,onChange:c}),/* @__PURE__ */ (0,V.jsx)(WO,{name:u,onApplyAll:a?l:void 0,onRemove:s})]})]})}function KO({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`grid size-8 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink disabled:opacity-40 disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,V.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[13px] text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,V.jsx)(RC,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:E(`num grid size-8 place-items-center rounded-lg text-[13px] font-medium transition-colors`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,V.jsx)(IC,{className:`size-4`,"aria-hidden":!0})})]})]})}function qO({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=oO(i),[o,s]=(0,B.useState)(0),c=Math.min(o,a-1);(0,B.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(sO(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num rounded-full border border-rule px-2.5 py-0.5 text-[13px] text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,V.jsx)(PO,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`flex w-full items-center gap-4 rounded-2xl border border-dashed border-rule p-2.5 text-left transition-colors hover:border-accent`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-12 shrink-0 place-items-center rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block text-[14px] font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Upload STL, 3MF, OBJ or STEP (max `,e.max,` files)`]})]})]}),i>0&&/* @__PURE__ */ (0,V.jsx)(`ul`,{className:E(`space-y-2`,a>1&&`min-h-[284px] @xl:min-h-[188px]`),children:l.map(a=>/* @__PURE__ */ (0,V.jsx)(GO,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,V.jsx)(KO,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function JO({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=FE(e.material,r),o=Math.max(0,kE.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,V.jsxs)(PO,{area:`material`,children:[/* @__PURE__ */ (0,V.jsx)(NO,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,V.jsx)(FO,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2.5 text-[13px] text-warn`,children:a}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-5 border-t border-rule pt-4`,children:[/* @__PURE__ */ (0,V.jsx)(NO,{title:`Finish`,aside:`${kE[o].mm} mm layers`}),/* @__PURE__ */ (0,V.jsx)(wE,{bare:!0,label:`Finish`,values:kE.map((e,t)=>t),value:o,onChange:e=>t({quality:kE[e].id}),format:e=>kE[e].label,valueText:e=>`${kE[e].label}, ${kE[e].mm} mm layers`,captions:kE.map(e=>e.label)})]})]})}function YO({simple:e,onSimple:t}){return/* @__PURE__ */ (0,V.jsx)(PO,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,V.jsx)(wE,{label:`Infill`,values:EE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,V.jsx)(wE,{label:`Walls`,values:AE,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[AE[0],AE[AE.length-1]]})]})})})}var XO=`silver-fill inline-flex h-11 w-full items-center justify-center gap-2 rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90 disabled:opacity-50`;function ZO({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,V.jsxs)(vo,{children:[/* @__PURE__ */ (0,V.jsx)(bo,{"aria-label":`How this price is worked out`,className:`grid size-6 place-items-center rounded-full opacity-75 transition-opacity hover:opacity-100`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(wo,{container:t,children:/* @__PURE__ */ (0,V.jsx)(Eo,{side:`top`,sideOffset:4,collisionPadding:12,className:`z-50 max-w-[260px] space-y-1.5 rounded-xl border border-rule bg-panel p-3 text-[13px] text-ink shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:e})})]})}function QO({children:e}){return/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-hero-warn`,children:[/* @__PURE__ */ (0,V.jsx)(HC,{className:`mt-px size-4 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{children:e})]})}function $O({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,button:u,onEstimate:d,onButton:f}){let p=QE(c&&c.since),m=i+r>0,h=e&&e.range,g=s&&e&&!c;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-5 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[14px] font-medium opacity-75`,children:`Estimated price`}),e&&(h||o)&&/* @__PURE__ */ (0,V.jsxs)(ZO,{children:[h&&/* @__PURE__ */ (0,V.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,V.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[h?/* @__PURE__ */ (0,V.jsx)(Ix.p,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35},className:`num mt-1.5 font-display text-[34px] leading-[1.05] font-semibold tracking-[-0.02em] @sm:text-[40px]`,children:VE(h,e.currency)},`${h.low}-${h.high}`):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-1.5 font-display text-[24px] leading-tight font-semibold`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[13px] opacity-85`,children:[/* @__PURE__ */ (0,V.jsxs)(HO,{icon:te,children:[HE(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,V.jsxs)(HO,{icon:WC,children:[`About `,UE(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,V.jsxs)(HO,{icon:nw,children:[n,` files, `,a,` pieces`]}),o&&/* @__PURE__ */ (0,V.jsx)(HO,{icon:Mw,children:`Quick estimate`})]})]}):/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1.5 text-[15px] opacity-85`,children:n?`Your files are ready. Get the price when your choices are set.`:`Upload a model, and its price shows here.`}),m&&!c&&e&&/* @__PURE__ */ (0,V.jsxs)(QO,{children:[r?`${r} ${r===1?`file has`:`files have`} no price yet.`:`Your choices changed.`,` Update the price to include `,r+i===1?`it`:`them`,`.`]}),l&&!c&&n>0&&/* @__PURE__ */ (0,V.jsx)(QO,{children:l})]}),g?u&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:XO,disabled:!h||e.unpriced.length>0,onClick:f,children:u.label}):/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:XO,disabled:!n||!!l||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` `,NE(c.phase,`Working it out`),c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[p,` s`]})]}):e?`Update the price`:`Get the price`})]})}var ek={SLA:`Resin is cured layer by layer with light, for fine detail and smooth surfaces: miniatures, small precise parts, moulds.`,SLS:`A laser fuses nylon powder, for tough, functional parts with no supports: clips, hinges, housings that take a beating.`};function tk({process:e,contact:t,fileNames:n}){let r=IO.find(t=>t.id===e),i=LO(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-6 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,V.jsxs)(`h2`,{className:`font-display text-[24px] leading-tight font-semibold`,children:[r.id,` prints are quoted by our team`]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:ek[e]}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before you send it.`:``]})]}),i?/* @__PURE__ */ (0,V.jsxs)(`a`,{href:i,className:`silver-fill inline-flex h-11 items-center justify-center gap-2 self-start rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90`,children:[/* @__PURE__ */ (0,V.jsx)(cw,{className:`size-[18px]`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[14px] font-medium`,children:[`Ask at `,a,` for a price.`]})]})}var nk=e=>e.replace(/\.\w+$/,``);function rk(e){let t=e.filter(e=>e.size<=aO),n=e.filter(e=>e.size>aO).map(e=>e.name);return n.length&&$x.error(`${n.join(`, `)}: over the 50 MB limit. Please choose a smaller file.`),t}function ik({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,B.useReducer)(uO,cO),a=(0,B.useRef)(0),[o,s]=(0,B.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>dO(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>fO(e,l(e))),f=t=>{let n=rk(t);if(!n.length)return;let o=10-r.items.length;if(o<=0)return $x.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:n.slice(0,o).map(e=>({id:`file-${++a.current}`,file:e}))});let s=n.length-o;s>0&&$x.error(`Up to 10 files at a time, so ${s} ${s===1?`was`:`were`} left out.`)},p=t=>{rk([t]).length&&i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t})},m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,file:r.file.name,printer:c.printer,phase:`uploading`});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot,onStep:e=>s(t=>t&&{...t,phase:e})}),n={stats:e.stats,used:e.used,price:e.price,quoteId:e.id,gcode:e.gcode||null,name:nk(r.file.name)+`.gcode`,material:c.material,sig:d};i({type:`result`,id:r.id,result:n}),u++}catch(e){f=e;let t=CD(e.status);if(i({type:`error`,id:r.id,error:t||e.message}),t)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&CD(f.status)?$x.error(CD(f.status)):u===a.length?$x.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?$x.error(f.message):$x.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),$x.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}function ak(e){let[t,n]=(0,B.useState)({}),r=(0,B.useRef)(/* @__PURE__ */ new Set),i=(0,B.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,B.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-RKI9IqqD.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var ok=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),sk=(e,t)=>Array(t).fill(e);function ck(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>sk(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:sk(e,4)):r?[sk(r,4)]:[],f=i?o?[[i,i,o,o]]:[sk(i,4)]:[];return{one:ok(s.map(e=>[e])),two:ok(l),four:ok([...d,...f])}}function lk(e,t){let n=GE(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=WE(e.result.stats,e.copies,e.result.price,t);return{name:e.file.name,file:e.file,quoteId:e.result.quoteId,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function uk(e,t,n){let r=new URL(e,n);return r.searchParams.set(`quotes`,t.map(e=>`${e.quoteId}:${e.copies}`).join(`,`)),r.href}function dk(){let{config:e,emit:t,actions:n}=i(),[r,a]=bO(),o=qD(),s=YD(),[c,l]=(0,B.useState)(`FDM`),[u,d]=(0,B.useState)(()=>({...jE,...e.defaults})),f=(0,B.useRef)(null),p=JSON.stringify(e.defaults);(0,B.useEffect)(()=>d(t=>({...t,...e.defaults})),[p]);let m=o.data,h=m?m.defaultPrinter:``,g=m?m.pricing:null,_=ik({defaults:u,slice:s,requestFor:e=>({...e.settings,printer:h})}),{selected:v}=_,y=v?v.settings:u,b=e=>v?_.setSettings(e):d(t=>({...t,...e})),x=ak(_.items),S=kD(e),C=!S.has(`files`),w=JD(h),T=ME(w.data?w.data.materials:OE.map(e=>e.id)),E=T.map(e=>e.id).join();(0,B.useEffect)(()=>{T.length&&!T.some(e=>e.id===y.material)&&b({material:T[0].id})},[E,y.material]);let D=async e=>{let{models:t,others:n}=await z(e);t.length&&(C?_.replace(t[0]):_.add(t)),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use STL, 3MF, OBJ, STEP or IGES.`)},O=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:D}),k=_.items.filter(e=>e.result),A=k.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),j=e=>WE(e.result.stats,e.copies,e.result.price,g),M=_.items.length?o.isError?`The server can’t be reached.`:w.error&&w.error.status===503?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,N={..._.list,onAdd:()=>f.current.click()},P=IO.find(e=>e.id===c).priced,F=ck(S,P),I=()=>_.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),ee=P&&k.length===_.items.length&&!_.todo.length&&!_.slicing&&_.items.length>0,te=(0,B.useRef)(null),ne=e=>{let n=lk(_.items,g),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==te.current)&&t(`estimate`,n),te.current=r};(0,B.useEffect)(()=>{ee&&ne(!1)});let re=()=>{if(!ee||!e.button)return;let n=lk(_.items,g);t(`buttonclick`,n,{cancelable:!0})&&e.button.url&&location.assign(uk(e.button.url,n.files,document.baseURI))};return(0,B.useEffect)(()=>{n.getPrice=()=>{if(P&&_.items.length&&!_.slicing&&!M)return _.todo.length?I():ne(!0)}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...O.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:f,type:`file`,accept:ve,multiple:!C,hidden:!0,onChange:e=>{D([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`main`,{className:`mx-auto w-full p-3 sm:p-4`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`bento`,style:{"--areas-one":F.one,"--areas-two":F.two,"--areas-four":F.four},children:[S.has(`process`)&&/* @__PURE__ */ (0,V.jsx)(zO,{value:c,onChange:l,action:a&&/* @__PURE__ */ (0,V.jsx)(ZE,{theme:r,onTheme:a})}),S.has(`model`)&&/* @__PURE__ */ (0,V.jsx)(VO,{model:v&&v.file,single:C,onChoose:()=>f.current.click()}),S.has(`files`)&&/* @__PURE__ */ (0,V.jsx)(qO,{files:N,lineCost:j,thumbs:x,priced:P}),P?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[S.has(`material`)&&/* @__PURE__ */ (0,V.jsx)(JO,{simple:y,onSimple:b,materials:T,printer:h}),S.has(`strength`)&&/* @__PURE__ */ (0,V.jsx)(YO,{simple:y,onSimple:b}),S.has(`cost`)&&/* @__PURE__ */ (0,V.jsx)($O,{estimate:A.length?GE(A,g):null,percent:g?g.range:0,files:_.items.length,missing:_.items.length-k.length,stale:_.rows.filter(e=>e.stale).length,pieces:_.items.reduce((e,t)=>e+t.copies,0),quick:k.some(e=>e.result.stats.estimated),ready:!_.todo.length,slicing:_.slicing,blocker:M,button:e.button,onEstimate:I,onButton:re})]}):S.has(`contact`)&&/* @__PURE__ */ (0,V.jsx)(tk,{process:c,contact:m&&m.contact,fileNames:_.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:O.isDragActive,text:`Drop your models to get a price`})]})}var fk=()=>new Pt({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function pk({mode:e,...t}){let[n]=(0,B.useState)(fk);return/* @__PURE__ */ (0,V.jsx)(o.Provider,{value:t,children:/* @__PURE__ */ (0,V.jsx)(Te,{client:n,children:/* @__PURE__ */ (0,V.jsx)(Xy,{reducedMotion:`user`,children:/* @__PURE__ */ (0,V.jsxs)(S,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,V.jsx)(MO,{}):/* @__PURE__ */ (0,V.jsx)(dk,{}),(0,gn.createPortal)(/* @__PURE__ */ (0,V.jsx)(mS,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule`}}),t.portal)]})})})})}var mk=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
56
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);height:100%;min-height:0;color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;flex-direction:column;flex:auto;font-size:14px;line-height:1.45;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.-top-1{top:calc(var(--spacing) * -1)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-16{top:calc(var(--spacing) * 16)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.-right-1{right:calc(var(--spacing) * -1)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-14{left:calc(var(--spacing) * 14)}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-1{margin:var(--spacing)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-px{margin-top:1px}.mr-auto{margin-right:auto}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\\.5{margin-bottom:calc(var(--spacing) * 3.5)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[18px\\]{width:18px;height:18px}.size-\\[62px\\]{width:62px;height:62px}.size-full{width:100%;height:100%}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\\[240px\\]{min-height:240px}.min-h-\\[284px\\]{min-height:284px}.min-h-\\[336px\\]{min-height:336px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[480px\\]{min-height:480px}.min-h-\\[max\\(100\\%\\,360px\\)\\]{min-height:max(100%,360px)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[52px\\]{width:52px}.w-\\[104px\\]{width:104px}.w-\\[188px\\]{width:188px}.w-\\[min\\(360px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(360px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[240px\\]{min-width:240px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-panel{border-color:var(--panel)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink{background-color:var(--ink)}.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel,.bg-panel\\/85{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/85{background-color:color-mix(in oklab, var(--panel) 85%, transparent)}}.bg-panel\\/90{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/90{background-color:color-mix(in oklab, var(--panel) 90%, transparent)}}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[24px\\]{font-size:24px}.text-\\[34px\\]{font-size:34px}.leading-\\[1\\.05\\]{--tw-leading:1.05;line-height:1.05}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.display{letter-spacing:-.01em;font-stretch:118%}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:#f4f4f5;box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-warn{color:var(--warn)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.3\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.35\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_24px_64px_-24px_rgb\\(0_0_0\\/0\\.5\\)\\]{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,border-color\\,background-color\\]{transition-property:opacity,border-color,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\\:text-muted::placeholder{color:var(--muted)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-muted:focus-within{border-color:var(--muted)}@media (hover:hover){.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-ink:hover{background-color:var(--ink)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}}.disabled\\:text-muted:disabled{color:var(--muted)}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.data-\\[disabled\\]\\:cursor-default[data-disabled]{cursor:default}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.08\\)\\][data-state=on]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@sm\\:text-\\[40px\\]{font-size:40px}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[188px\\]{min-height:188px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}}@container studio (width>=640px){.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=768px){.md\\:order-1{order:1}.md\\:order-2{order:2}.md\\:flex{display:flex}.md\\:h-full{height:100%}.md\\:min-h-0{min-height:0}.md\\:w-\\[340px\\]{width:340px}.md\\:flex-1{flex:1}.md\\:shrink-0{flex-shrink:0}.md\\:flex-row{flex-direction:row}.md\\:overflow-y-auto{overflow-y:auto}.md\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:flex{display:flex}.lg\\:min-h-\\[456px\\]{min-height:456px}.lg\\:min-h-\\[480px\\]{min-height:480px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-\\[12px\\] [cmdk-group-heading]{font-size:12px}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * .05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`,hk=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function gk(e){let t=e.match(hk)||[];return{shadow:e.replace(hk,``),page:t.join(``)}}var _k=e=>e===`advanced`?`advanced`:`simple`,vk=[`light`,`dark`,`system`],yk=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},bk=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},xk=null;function Sk(){if(xk)return xk;let{shadow:e,page:t}=gk(mk);return xk=yk(e),bk(yk(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>bk(yk(e))),xk}function Ck(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={};get config(){return this.#r}set config(e){this.#r=OD(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,_n.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[Sk()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,B.createElement)(B.StrictMode,null,(0,B.createElement)(pk,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:_k(this.getAttribute(`mode`)),theme:vk.includes(t)?t:null,emit:(e,t,{cancelable:n=!1}={})=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:n}))})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&Ck();
51
+ `},Er=0,Dr=[];function Or(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Er++)[0],a=B.useState(Xn)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=En([e.lockRef.current],(e.shards||[]).map(Cr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=xr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=mr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=mr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return br(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(Dr.length&&Dr[Dr.length-1]===a){var r=`deltaY`in n?Sr(n):xr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wr(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Cr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:kr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=xr(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Sr(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,xr(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Dr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,lr),document.addEventListener(`touchmove`,c,lr),document.addEventListener(`touchstart`,u,lr),function(){Dr=Dr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,lr),document.removeEventListener(`touchmove`,c,lr),document.removeEventListener(`touchstart`,u,lr)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Tr(i)}):null,p?B.createElement(or,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ar=Bn(Vn,Or),jr=B.forwardRef(function(e,t){return B.createElement(Un,wn({},e,{ref:t,sideCar:Ar}))});jr.classNames=Un.classNames;var Mr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Nr=/* @__PURE__ */ new WeakMap,Pr=/* @__PURE__ */ new WeakMap,Fr={},Ir=0,Lr=function(e){return e&&(e.host||Lr(e.parentNode))},Rr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Lr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},zr=function(e,t,n,r){var i=Rr(t,Array.isArray(e)?e:[e]);Fr[n]||(Fr[n]=/* @__PURE__ */ new WeakMap);var a=Fr[n],o=[],s=/* @__PURE__ */ new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Nr.get(e)||0)+1,l=(a.get(e)||0)+1;Nr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ir++,function(){o.forEach(function(e){var t=Nr.get(e)-1,i=a.get(e)-1;Nr.set(e,t),a.set(e,i),t||(Pr.has(e)||e.removeAttribute(r),Pr.delete(e)),i||e.removeAttribute(n)}),Ir--,Ir||(Nr=/* @__PURE__ */ new WeakMap,Nr=/* @__PURE__ */ new WeakMap,Pr=/* @__PURE__ */ new WeakMap,Fr={})}},Br=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Mr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),zr(r,i,n,`aria-hidden`)):function(){return null}},Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=`Dialog`,[Wr,Gr]=c(Ur),[Kr,qr]=Wr(Ur),Jr=/* @__PURE__ */ Hr(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),{nodes:l,registry:u}=T(),[d,f]=g({prop:r,defaultProp:i??!1,onChange:a,caller:Ur}),[p,m]=B.useState(0),[h,_]=B.useState(0);return/* @__PURE__ */ (0,V.jsx)(Kr,{scope:t,triggerRef:s,contentRef:c,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Yr=`DialogPortal`,[Xr,Zr]=Wr(Yr,{forceMount:void 0}),Qr=/* @__PURE__ */ Hr(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=qr(Yr,t);return/* @__PURE__ */ (0,V.jsx)(Xr,{scope:t,forceMount:n,children:B.Children.map(r,e=>/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),$r=`DialogOverlay`,ei=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=Zr($r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qr($r,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)(ni,{...i,ref:t})}):null},`DialogOverlay`)),ti=l(`DialogOverlay.RemoveScroll`),ni=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr($r,n),a=b(),o=C(t,a);return/* @__PURE__ */ (0,V.jsx)(jr,{as:ti,allowPinchZoom:!0,shards:B.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-state":pi(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ri=`DialogContent`,ii=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=Zr(ri,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qr(ri,e.__scopeDialog);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(ai,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(oi,{...i,ref:t})})},`DialogContent`)),ai=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=qr(ri,e.__scopeDialog),r=B.useRef(null),i=C(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(si,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),oi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let n=qr(ri,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(si,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),si=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=qr(ri,n);return Sn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?fi(o,l.descriptionId):o,"data-state":pi(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),ci=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(`DialogTitle`,n),{setTitleCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),li=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(`DialogDescription`,n),{setDescriptionCount:a}=i;return f(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,V.jsx)(p.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ui=`DialogClose`,di=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Hr(function(e,t){let{__scopeDialog:n,...r}=e,i=qr(ui,n);return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,...r,ref:t,onClick:F(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function fi(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Hr(fi,`concatAriaDescribedby`);function pi(e){return e?`open`:`closed`}Hr(pi,`getState`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0}),gi=!1;function _i(){let[e,t]=B.useState(gi);return B.useEffect(()=>{gi||(gi=!0,t(!0))},[]),e}hi(_i,`useIsHydrated`);var vi=B.useSyncExternalStore;function yi(){return()=>{}}hi(yi,`subscribe`);function bi(){return vi(yi,()=>!0,()=>!1)}hi(bi,`useIsHydratedModern`);var xi=typeof vi==`function`?bi:_i,Si=Object.defineProperty,Ci=(e,t)=>Si(e,`name`,{value:t,configurable:!0});function wi(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ti=`rovingFocusGroup.onEntryFocus`,Ei={bubbles:!1,cancelable:!0},Di=`RovingFocusGroup`,[Oi,ki,Ai]=/* @__PURE__ */ Zt(Di),[ji,Mi]=c(Di,[Ai]),Ni={Vertical:`vertical`,Horizontal:`horizontal`},Pi={LTR:`ltr`,RTL:`rtl`},[Fi,Ii]=ji(Di),Li=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){return/* @__PURE__ */ (0,V.jsx)(Oi.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(Oi.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,V.jsx)(Ri,{...e,ref:t})})})},`RovingFocusGroup`)),Ri=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),h=C(t,f),_=mn(a),[v,y]=g({prop:o,defaultProp:s??null,onChange:c,caller:Di}),[b,x]=B.useState(!1),S=m(l),w=ki(n),T=B.useRef(!1),[E,D]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Ti,S),()=>e.removeEventListener(Ti,S)},[S]),/* @__PURE__ */ (0,V.jsx)(Fi,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:v,onItemFocus:B.useCallback(e=>y(e),[y]),onItemShiftTab:B.useCallback(()=>x(!0),[]),onFocusableItemAdd:B.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>D(e=>e-1),[]),children:/* @__PURE__ */ (0,V.jsx)(p.div,{tabIndex:b||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:`none`,...e.style},onMouseDown:F(e.onMouseDown,()=>{T.current=!0}),onFocus:F(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Ti,Ei);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);Wi([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}T.current=!1}),onBlur:F(e.onBlur,()=>x(!1))})})},`RovingFocusGroupImpl`)),zi=`RovingFocusGroupItem`,Bi=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Ci(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=N(),l=a||c,u=Ii(zi,n),d=u.currentTabStopId===l,m=ki(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=u,v=xi();return f(()=>{if(v&&r)return h(),()=>g()},[v,r,h,g]),B.useEffect(()=>{if(!v&&r)return h(),()=>g()},[v,r,h,g]),/* @__PURE__ */ (0,V.jsx)(Oi.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,V.jsx)(p.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:F(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:F(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:F(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ui(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Gi(n,r+1):n.slice(r+1)}setTimeout(()=>Wi(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Vi={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Hi(e,t){return t===Pi.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ci(Hi,`getDirectionAwareKey`);function Ui(e,t,n){let r=Hi(e.key,n);if(!(t===Ni.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Ni.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Vi[r]}Ci(Ui,`getFocusIntent`);function Wi(e,t=!1){let n=wi();for(let r of e)if(r===n||(r.focus({preventScroll:t}),wi()!==n))return}Ci(Wi,`focusFirst`);function Gi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ci(Gi,`wrapArray`);var Ki=Object.defineProperty,U=(e,t)=>Ki(e,`name`,{value:t,configurable:!0});function qi(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ji=[`Enter`,` `],Yi=[`ArrowDown`,`PageUp`,`Home`],Xi=[`ArrowUp`,`PageDown`,`End`],Zi=[...Yi,...Xi];[...Ji],[...Ji];var Qi=`Menu`,[$i,ea,W]=/* @__PURE__ */ Zt(Qi),[ta,na]=c(Qi,[W,_,Mi]),ra=_(),ia=Mi(),[aa,oa]=ta(Qi),[sa,ca]=ta(Qi),la=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ra(t),[c,l]=B.useState(null),u=B.useRef(!1),d=m(a),f=mn(i);return B.useEffect(()=>{let e=/* @__PURE__ */ U(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ U(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),B.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */ U(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(aa,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:/* @__PURE__ */ (0,V.jsx)(sa,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),ua=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,...r}=e,i=ra(n);return/* @__PURE__ */ (0,V.jsx)(D,{...i,...r,ref:t})},`MenuAnchor`)),da=`MenuPortal`,[fa,pa]=ta(da,{forceMount:void 0}),ma=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=oa(da,t);return/* @__PURE__ */ (0,V.jsx)(fa,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`MenuPortal`),ha=`MenuContent`,[ga,_a]=ta(ha),va=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=pa(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=oa(ha,e.__scopeMenu),o=ca(ha,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)($i.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:/* @__PURE__ */ (0,V.jsx)($i.Slot,{scope:e.__scopeMenu,children:o.modal?/* @__PURE__ */ (0,V.jsx)(ya,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(ba,{...i,ref:t})})})})},`MenuContent`)),ya=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=oa(ha,e.__scopeMenu),r=B.useRef(null),i=C(t,r);return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(Sa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ba=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let n=oa(ha,e.__scopeMenu);return/* @__PURE__ */ (0,V.jsx)(Sa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),xa=l(`MenuContent.ScrollLock`),Sa=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=oa(ha,n),_=ca(ha,n),b=ra(n),S=ia(n),w=ea(n),[E,D]=B.useState(null),k=B.useRef(null),[j,M]=B.useState(null);O(j);let{nodes:N,registry:P}=T(),I=!!(i||m),ee=C(t,k,g.onContentChange,M),te=B.useRef(0),ne=B.useRef(``),re=B.useRef(0),ie=B.useRef(null),ae=B.useRef(`right`),oe=B.useRef(0),se=B.useMemo(()=>m?[k,...N.map(e=>({current:e}))]:[],[k,N,m]),ce=m?jr:B.Fragment,le=m?{as:xa,allowPinchZoom:!0,shards:se}:void 0,ue=/* @__PURE__ */ U(e=>{let t=ne.current+e,n=w().filter(e=>!e.disabled),r=qi(),i=n.find(e=>e.ref.current===r)?.textValue,a=za(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){ne.current=e,window.clearTimeout(te.current),e!==``&&(te.current=window.setTimeout(()=>s(``),1e3))}U(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);B.useEffect(()=>()=>window.clearTimeout(te.current),[]),Sn();let de=B.useCallback(e=>ae.current===ie.current?.side&&Va(e,ie.current?.area),[]);return/* @__PURE__ */ (0,V.jsx)(ga,{scope:n,searchRef:ne,onItemEnter:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),onItemLeave:B.useCallback(e=>{de(e)||(k.current?.focus(),D(null))},[de]),onTriggerLeave:B.useCallback(e=>{de(e)&&e.preventDefault()},[de]),pointerGraceTimerRef:re,onPointerGraceIntentChange:B.useCallback(e=>{ie.current=e},[]),children:/* @__PURE__ */ (0,V.jsx)(y,{registry:I?P:null,children:/* @__PURE__ */ (0,V.jsx)(ce,{...le,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:i,branches:N,onMountAutoFocus:F(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:/* @__PURE__ */ (0,V.jsx)(Li,{asChild:!0,...S,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:F(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{role:`menu`,"aria-orientation":`vertical`,"data-state":Pa(g.open),"data-radix-menu-content":``,dir:_.dir,...b,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:F(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ue(e.key));let i=k.current;if(e.target!==i||!Zi.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);Xi.includes(e.key)&&a.reverse(),La(a)}),onBlur:F(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(te.current),ne.current=``)}),onPointerMove:F(e.onPointerMove,Ha(e=>{let t=e.target,n=oe.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>oe.current?`right`:`left`;ae.current=t,oe.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Ca=`MenuItem`,wa=`menu.itemSelect`,Ta=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=ca(Ca,e.__scopeMenu),s=_a(Ca,e.__scopeMenu),c=C(t,a),l=B.useRef(!1),d=/* @__PURE__ */ U(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(wa,{bubbles:!0,cancelable:!0});e.addEventListener(wa,e=>r?.(e),{once:!0}),u(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return/* @__PURE__ */ (0,V.jsx)(Ea,{...i,ref:c,disabled:n,onClick:F(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:F(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:F(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Ji.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ea=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=_a(Ca,n),s=ia(n),c=B.useRef(null),l=C(t,c),[u,d]=B.useState(!1),[f,m]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),/* @__PURE__ */ (0,V.jsx)($i.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:/* @__PURE__ */ (0,V.jsx)(Bi,{asChild:!0,...s,focusable:!r,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:F(e.onPointerMove,Ha(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:F(e.onPointerLeave,Ha(e=>o.onItemLeave(e))),onFocus:F(e.onFocus,()=>d(!0)),onBlur:F(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Da,Oa]=ta(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ U(()=>{},`onValueChange`)}),[ka,Aa]=ta(`MenuItemIndicator`,{checked:!1}),ja=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Ma,Na]=ta(`MenuSub`);function Pa(e){return e?`open`:`closed`}U(Pa,`getOpenState`);function Fa(e){return e===`indeterminate`}U(Fa,`isIndeterminate`);function Ia(e){return Fa(e)?`indeterminate`:e?`checked`:`unchecked`}U(Ia,`getCheckedState`);function La(e){let t=qi();for(let n of e)if(n===t||(n.focus(),qi()!==t))return}U(La,`focusFirst`);function Ra(e,t){return e.map((n,r)=>e[(t+r)%e.length])}U(Ra,`wrapArray`);function za(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ra(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}U(za,`getNextMatch`);function Ba(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}U(Ba,`isPointInPolygon`);function Va(e,t){return t?Ba({x:e.clientX,y:e.clientY},t):!1}U(Va,`isPointerInGraceArea`);function Ha(e){return t=>t.pointerType===`mouse`?e(t):void 0}U(Ha,`whenMouse`);var Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0}),Ga=`DropdownMenu`,[Ka,qa]=c(Ga,[na]),Ja=na(),[Ya,Xa]=Ka(Ga),Za=/* @__PURE__ */ Wa(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ja(t),l=B.useRef(null),[u,d]=g({prop:i,defaultProp:a??!1,onChange:o,caller:Ga});return/* @__PURE__ */ (0,V.jsx)(Ya,{scope:t,triggerId:N(),triggerRef:l,contentId:N(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:/* @__PURE__ */ (0,V.jsx)(la,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Qa=`DropdownMenuTrigger`,$a=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Xa(Qa,n),o=Ja(n),s=C(t,a.triggerRef);return/* @__PURE__ */ (0,V.jsx)(ua,{asChild:!0,...o,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:F(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:F(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),eo=/* @__PURE__ */ Wa(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ja(t);return/* @__PURE__ */ (0,V.jsx)(ma,{...r,...n})},`DropdownMenuPortal`),to=`DropdownMenuContent`,no=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Xa(to,n),a=Ja(n),o=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(va,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:F(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),ro=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ja(n);return/* @__PURE__ */ (0,V.jsx)(Ta,{...i,...r,ref:t})},`DropdownMenuItem`)),io=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Wa(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ja(n);return/* @__PURE__ */ (0,V.jsx)(ja,{...i,...r,ref:t})},`DropdownMenuSeparator`)),ao=Object.defineProperty,oo=(e,t)=>ao(e,`name`,{value:t,configurable:!0});function so(e,[t,n]){return Math.min(n,Math.max(t,e))}oo(so,`clamp`);var co=Object.defineProperty,lo=(e,t)=>co(e,`name`,{value:t,configurable:!0}),uo=`Popover`,[fo,po]=c(uo,[_]),mo=_(),[ho,go]=fo(uo),_o=/* @__PURE__ */ lo(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=mo(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=B.useState(0),[p,m]=B.useState(0),[_,v]=g({prop:r,defaultProp:i??!1,onChange:a,caller:uo});return/* @__PURE__ */ (0,V.jsx)(h,{...s,children:/* @__PURE__ */ (0,V.jsx)(ho,{scope:t,contentId:N(),titleId:N(),descriptionId:N(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:_,onOpenChange:v,onOpenToggle:B.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),vo=`PopoverTrigger`,yo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let{__scopePopover:n,...r}=e,i=go(vo,n),a=mo(n),o=C(t,i.triggerRef),s=/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ao(i.open),...r,ref:o,onClick:F(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:s})},`PopoverTrigger`)),bo=`PopoverPortal`,[xo,So]=fo(bo,{forceMount:void 0}),Co=/* @__PURE__ */ lo(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=go(bo,t);return/* @__PURE__ */ (0,V.jsx)(xo,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(I,{present:n||a.open,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),wo=`PopoverContent`,To=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=So(wo,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=go(wo,e.__scopePopover);return/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,V.jsx)(Do,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(Oo,{...i,ref:t})})},`PopoverContent`)),Eo=l(`PopoverContent.RemoveScroll`),Do=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=go(wo,e.__scopePopover),r=B.useRef(null),i=C(t,r),a=B.useRef(!1),{nodes:o,registry:s}=T();return B.useEffect(()=>{let e=r.current;if(e)return Br(e)},[]),/* @__PURE__ */ (0,V.jsx)(jr,{as:Eo,allowPinchZoom:!0,shards:B.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,V.jsx)(ko,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Oo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let n=go(wo,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return/* @__PURE__ */ (0,V.jsx)(ko,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),ko=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ lo(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=go(wo,n),g=mo(n),[_,b]=B.useState(null),S=C(t,b);return O(_),Sn(),/* @__PURE__ */ (0,V.jsx)(y,{registry:p,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,V.jsx)(A,{"data-state":Ao(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?jo(d,h.descriptionId):d,...g,...m,ref:S,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function Ao(e){return e?`open`:`closed`}lo(Ao,`getState`);function jo(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}lo(jo,`concatAriaDescribedby`);var Mo=Object.defineProperty,G=(e,t)=>Mo(e,`name`,{value:t,configurable:!0});function No(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Po={ItemAligned:`item-aligned`,Popper:`popper`},Fo={LTR:`ltr`,RTL:`rtl`},Io=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Lo=[` `,`Enter`],K=`Select`,[Ro,zo,Bo]=/* @__PURE__ */ Zt(K),[Vo,Ho]=c(K,[Bo,_]),Uo=_(),[Wo,Go]=Vo(K),[Ko,qo]=Vo(K);function Jo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:_}=e,v=Uo(t),[y,b]=B.useState(null),[x,S]=B.useState(null),[C,w]=B.useState(!1),T=mn(l),[E,D]=g({prop:r,defaultProp:i??!1,onChange:a,caller:K}),[O,k]=g({prop:o,defaultProp:s,onChange:c,caller:K}),A=B.useRef(null),j=B.useRef(!1),[M,P]=B.useState(null),F=/* @__PURE__ */ G(e=>{P({value:e,hasConsumerStoppedPropagation:j.current}),k(e)},`handleUserSelect`),I=B.useRef(O);B.useEffect(()=>{let e=m?y?.ownerDocument.getElementById(m):y?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ G(()=>k(I.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,y,k]);let ee=!y||!!m||!!y.closest(`form`),[te,ne]=B.useState(/* @__PURE__ */ new Set),re=N(),ie=Array.from(te).map(e=>e.props.value).join(`;`),ae=B.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),oe=B.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),se={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:re,value:O,onValueChange:k,hasConsumerStoppedPropagationRef:j,userSelection:M,onUserSelect:F,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ie,isFormControl:ee};return/* @__PURE__ */ (0,V.jsx)(h,{...v,children:/* @__PURE__ */ (0,V.jsx)(Wo,{scope:t,...se,children:/* @__PURE__ */ (0,V.jsx)(Ro.Provider,{scope:t,children:/* @__PURE__ */ (0,V.jsx)(Ko,{scope:t,onNativeOptionAdd:ae,onNativeOptionRemove:oe,children:As(_)?_(se):n})})})})}G(Jo,`SelectProvider`);var Yo=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,children:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(Jo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[n,e?/* @__PURE__ */ (0,V.jsx)(ks,{__scopeSelect:t}):null]})})},`Select`),Xo=`SelectTrigger`,Zo=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Uo(n),o=Go(Xo,n),s=o.disabled||r,c=C(t,o.onTriggerChange),l=zo(n),u=B.useRef(`touch`),[d,f,m]=Ms(e=>{let t=l().filter(e=>!e.disabled),n=Ns(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),h=/* @__PURE__ */ G(e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return/* @__PURE__ */ (0,V.jsx)(D,{asChild:!0,...a,children:/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":js(o.value)?``:void 0,...i,ref:c,onClick:F(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:F(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:F(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),!(t&&e.key===` `)&&Io.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),Qo=`SelectValue`,$o=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Go(Qo,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=C(t,c.onValueNodeChange);f(()=>{l(u)},[l,u]);let m=js(c.value);return/* @__PURE__ */ (0,V.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:d,style:{pointerEvents:`none`},children:/* @__PURE__ */ (0,V.jsx)(B.Fragment,{children:m?o:a},m?`placeholder`:`value`)})},`SelectValue`)),es=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[ts,ns]=Vo(`SelectPortal`,{forceMount:void 0}),rs=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return/* @__PURE__ */ (0,V.jsx)(ts,{scope:e.__scopeSelect,forceMount:n,children:/* @__PURE__ */ (0,V.jsx)(M,{asChild:!0,...r})})},`SelectPortal`),is=`SelectContent`,as=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let n=ns(is,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Go(is,e.__scopeSelect),[o,s]=B.useState();return f(()=>{s(new DocumentFragment)},[]),/* @__PURE__ */ (0,V.jsx)(I,{present:r||a.open,children:({present:e})=>e?/* @__PURE__ */ (0,V.jsx)(ds,{...i,ref:t}):/* @__PURE__ */ (0,V.jsx)(os,{...i,fragment:o})})},`SelectContent`)),os=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?hn.createPortal(/* @__PURE__ */ (0,V.jsx)(cs,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(Ro.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),ss=10,[cs,ls]=Vo(is),us=l(`SelectContent.RemoveScroll`),ds=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n}=e,{position:r=Po.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Go(is,n),[b,S]=B.useState(null),[w,T]=B.useState(null),E=C(t,S),[D,O]=B.useState(null),[k,A]=B.useState(null),j=zo(n),[M,N]=B.useState(!1),P=B.useRef(!1),I=B.useRef(!1),ee=B.useRef(!1);B.useEffect(()=>{if(b)return Br(b)},[b]),Sn();let te=B.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=No();for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),No()!==i))return},[j,w]),ne=B.useCallback(()=>te([D,b]),[te,D,b]);B.useEffect(()=>{M&&ne()},[M,ne]);let{onOpenChange:re,triggerPointerDownPosRef:ie}=y;B.useEffect(()=>{if(b){let e={x:0,y:0},t=/* @__PURE__ */ G(t=>{e={x:Math.abs(Math.round(t.pageX)-(ie.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ie.current?.y??0))}},`handlePointerMove`),n=/* @__PURE__ */ G(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||re(!1),document.removeEventListener(`pointermove`,t),ie.current=null},`handlePointerUp`);return ie.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,re,ie]),B.useEffect(()=>{let e=/* @__PURE__ */ G(()=>re(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[ae,oe]=Ms(e=>{let t=j().filter(e=>!e.disabled),n=Ns(t,e,t.find(e=>e.ref.current===No()));n&&setTimeout(()=>n.ref.current?.focus())}),se=B.useCallback((e,t,n)=>{let r=!I.current;r&&(I.current=!0);let i=!P.current&&!n;y.value!==void 0&&y.value===t||i?(O(e),i&&(P.current=!0)):r&&O(e)},[y.value]),ce=B.useCallback(()=>b?.focus(),[b]),le=B.useCallback((e,t,n)=>{if(!e)return;let r=!ee.current;r&&(ee.current=!0);let i=!P.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&A(e)},[y.value]),ue=r===Po.Popper?ps:fs,de=ue===ps?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return/* @__PURE__ */ (0,V.jsx)(cs,{scope:n,content:b,viewport:w,onViewportChange:T,itemRefCallback:se,selectedItem:D,onItemLeave:ce,itemTextRefCallback:le,focusSelectedItem:ne,selectedItemText:k,position:r,isPositioned:M,searchRef:ae,children:/* @__PURE__ */ (0,V.jsx)(jr,{as:us,allowPinchZoom:!0,children:/* @__PURE__ */ (0,V.jsx)(v,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:F(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:/* @__PURE__ */ (0,V.jsx)(x,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:/* @__PURE__ */ (0,V.jsx)(ue,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:F(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&oe(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),fs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Go(is,n),o=ls(is,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=C(t,u),m=zo(n),h=B.useRef(!1),g=B.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==Fo.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ss,d=so(a,[ss,Math.max(ss,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ss,d=so(a,[ss,Math.max(ss,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-ss*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+p+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-ss,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${ss}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);f(()=>x(),[x]);let[S,w]=B.useState();f(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]);let T=B.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return/* @__PURE__ */ (0,V.jsx)(ms,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:/* @__PURE__ */ (0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:/* @__PURE__ */ (0,V.jsx)(p.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),ps=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=ss,...a}=e,o=Uo(n);return/* @__PURE__ */ (0,V.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[ms,hs]=Vo(is,{}),gs=`SelectViewport`,_s=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=ls(gs,n),o=hs(gs,n),s=C(t,a.onViewportChange),c=B.useRef(0);return/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),/* @__PURE__ */ (0,V.jsx)(Ro.Slot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:F(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-ss*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[vs,ys]=Vo(`SelectGroup`),bs=`SelectItem`,[xs,Ss]=Vo(bs),Cs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Go(bs,n),c=ls(bs,n),l=s.value===r,[u,d]=B.useState(a??``),[f,h]=B.useState(!1),g=m(e=>c.itemRefCallback?.(e,r,i)),_=C(t,g),v=N(),y=B.useRef(`touch`);function b(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return G(b,`handleSelect`),/* @__PURE__ */ (0,V.jsx)(xs,{scope:n,value:r,disabled:i,textId:v,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:/* @__PURE__ */ (0,V.jsx)(Ro.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:/* @__PURE__ */ (0,V.jsx)(p.div,{role:`option`,"aria-labelledby":v,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:F(o.onFocus,()=>h(!0)),onBlur:F(o.onBlur,()=>h(!1)),onClick:F(o.onClick,e=>{i||y.current!==`mouse`&&b(e)}),onPointerUp:F(o.onPointerUp,e=>{i||y.current===`mouse`&&b(e)}),onPointerDown:F(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:F(o.onPointerMove,e=>{y.current=e.pointerType,i?c.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(o.onPointerLeave,e=>{e.currentTarget===No()&&c.onItemLeave?.()}),onKeyDown:F(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Lo.includes(e.key)&&b(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),ws=`SelectItemText`,Ts=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Go(ws,n),s=ls(ws,n),c=Ss(ws,n),l=qo(ws,n),[u,d]=B.useState(null),h=m(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=C(t,d,c.onItemTextChange,h),_=u?.textContent,v=B.useMemo(()=>/* @__PURE__ */ (0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return f(()=>(y(v),()=>b(v)),[y,b,v]),/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(p.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!js(o.value)?hn.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Es=`SelectItemIndicator`,Ds=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,...r}=e;return Ss(Es,n).isSelected?/* @__PURE__ */ (0,V.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Os=`SelectBubbleInput`,ks=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ G(function({__scopeSelect:e,...t},n){let r=Go(Os,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:m}=r,h=B.useRef(null),g=C(n,h),_=i??``,v=B.useRef(_),y=B.useRef(d),b=B.useRef(!1),x=Array.from(f).some(e=>(e.props.value??``)===``);return B.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==y.current;y.current=d;let i=v.current!==_;v.current=_;let a=r&&i;if(r&&!i&&d.value!==_&&!d.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,_)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,_),e.dispatchEvent(t)}},[_,d]),/* @__PURE__ */ (0,V.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{b.current||a(e.target.value)},...t,style:{...P,...t.style},ref:g,defaultValue:_,children:[js(i)&&!x?/* @__PURE__ */ (0,V.jsx)(`option`,{value:``}):null,Array.from(f)]},m)},`SelectBubbleInput`));function As(e){return typeof e==`function`}G(As,`isFunction`);function js(e){return e===``||e===void 0}G(js,`shouldShowPlaceholder`);function Ms(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}G(a,`updateSearch`),a(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}G(Ms,`useTypeaheadSearch`);function Ns(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ps(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}G(Ns,`findNextItem`);function Ps(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(Ps,`wrapArray`);var Fs=Object.defineProperty,q=(e,t)=>Fs(e,`name`,{value:t,configurable:!0}),Is={Vertical:`vertical`,Horizontal:`horizontal`},Ls={LTR:`ltr`,RTL:`rtl`},Rs=[`PageUp`,`PageDown`],zs=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Bs={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Vs=`Slider`,[Hs,Us,Ws]=/* @__PURE__ */ Zt(Vs),[Gs,Ks]=c(Vs,[Ws]),[qs,Js]=Gs(Vs),Ys=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=Is.Horizontal,disabled:s=!1,minStepsBetweenThumbs:c=0,preserveThumbOrder:l=!1,defaultValue:u=[r],value:d,onValueChange:f=/* @__PURE__ */ q(()=>{},`onValueChange`),onValueCommit:p=/* @__PURE__ */ q(()=>{},`onValueCommit`),inverted:m=!1,form:h,..._}=e,v=B.useRef(/* @__PURE__ */ new Set),y=B.useRef(0),b=B.useRef(!1),[x,S]=B.useState(null),w=o===Is.Horizontal?Qs:$s,[T,E]=B.useState(null),D=C(t,E),[O=[],k]=g({prop:d,defaultProp:u,onChange:/* @__PURE__ */ q(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,f(e)},`onChange`)}),A=B.useRef(O),j=B.useRef(O);B.useEffect(()=>{let e=h?T?.ownerDocument.getElementById(h):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,h,k]);function M(e){I(e,_c(O,e))}q(M,`handleSlideStart`);function N(e){I(e,y.current)}q(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&p(O)}q(P,`handleSlideEnd`);function I(e,t,{commit:n}={commit:!1}){let o=Sc(a),s=so(Cc(Math.round((e-r)/a)*a+r,o),[r,i]),u=c*a;function d(e){let n=l?so(s,[e[t-1]===void 0?r:e[t-1]+u,e[t+1]===void 0?i:e[t+1]-u]):s,a=mc(e,n,t);return bc(a,u)?{nextValues:a,changedIndex:l?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}q(d,`getNextValues`);let f=d(O);f?.hasChanged&&S(f.nextValues),k((e=[])=>{let t=d(e);return t?(y.current=t.changedIndex,t.hasChanged&&n&&p(t.nextValues),t.hasChanged?t.nextValues:e):e})}return q(I,`updateValues`),/* @__PURE__ */ (0,V.jsx)(qs,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:v.current,values:O,orientation:o,form:h,userRequestedValues:x,children:/* @__PURE__ */ (0,V.jsx)(Hs.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(Hs.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,V.jsx)(w,{"aria-disabled":s,"data-disabled":s?``:void 0,..._,ref:D,onPointerDown:F(_.onPointerDown,()=>{s||(A.current=O,b.current=!1)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:M,onSlideMove:s?void 0:N,onSlideEnd:s?void 0:P,onHomeKeyDown:()=>{s||(b.current=!0,I(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(b.current=!0,I(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){b.current=!0;let n=Rs.includes(e.key)||e.shiftKey&&zs.includes(e.key)?10:1,i=y.current,o=O[i];I(wc(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Xs,Zs]=Gs(Vs,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Qs=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=B.useState(null),p=C(t,f),m=B.useRef(void 0),h=mn(i),g=h===Ls.LTR,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=xc([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return q(v,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Xs,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:/* @__PURE__ */ (0,V.jsx)(ec,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Bs[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),$s=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=B.useRef(null),d=C(t,u),f=B.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=xc([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return q(m,`getValueFromPointer`),/* @__PURE__ */ (0,V.jsx)(Xs,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:/* @__PURE__ */ (0,V.jsx)(ec,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Bs[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),ec=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Js(Vs,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{...l,ref:t,onKeyDown:F(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Rs.concat(zs).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:F(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:F(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:F(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),tc=`SliderTrack`,nc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(tc,n);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),rc=`SliderRange`,ic=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(rc,n),a=Zs(rc,n),o=B.useRef(null),s=C(t,o),c=i.values.length,l=i.values.map(e=>hc(e,i.min,i.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return/* @__PURE__ */ (0,V.jsx)(p.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:d+`%`}})},`SliderRange`)),[ac,oc]=Gs(`SliderThumb`),sc=`SliderThumbProvider`;function cc(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=Js(sc,t),o=Us(t),[s,c]=B.useState(null),l=B.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=w(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:hc(f,a.min,a.max);B.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return/* @__PURE__ */ (0,V.jsx)(ac,{scope:t,...h,children:Tc(i)?i(h):r})}q(cc,`SliderThumbProvider`);var lc=`SliderThumbTrigger`,uc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,...r}=e,i=Js(lc,n),a=Zs(lc,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=oc(lc,n),d=C(t,u),f=gc(o,i.values.length),m=l?.[a.size],h=m?vc(m,c,a.direction):0;return/* @__PURE__ */ (0,V.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:/* @__PURE__ */ (0,V.jsx)(Hs.ItemSlot,{scope:n,children:/* @__PURE__ */ (0,V.jsx)(p.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:F(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),dc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return/* @__PURE__ */ (0,V.jsx)(cc,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(uc,{...i,ref:t,__scopeSlider:n}),r?/* @__PURE__ */ (0,V.jsx)(pc,{__scopeSlider:n},e):null]})})},`SliderThumb`)),fc=`SliderBubbleInput`,pc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ q(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=oc(fc,e),{userRequestedValues:c}=Js(fc,e),l=B.useRef(null),u=C(l,r),d=B.useRef(!1),f=B.useRef(a),m=B.useRef(c),h=B.useRef(c);return B.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f.current,o=r!==a;f.current=a;let s=c!==h.current;if(h.current=c,o&&n){let t=c!==m.current;m.current=c;let o=c?.[i];d.current=!(t&&(s&&o!==r||o===a));let l=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(l),d.current=!1}},[i,a,c]),/* @__PURE__ */ (0,V.jsx)(p.input,{style:{display:`none`},name:o,form:s,...n,ref:u,defaultValue:a,onInput:F(t,e=>{d.current&&e.stopPropagation()})})},`SliderBubbleInput`));function mc(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}q(mc,`getNextSortedValues`);function hc(e,t,n){return so(100/(n-t)*(e-t),[0,100])}q(hc,`convertValueToPercentage`);function gc(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}q(gc,`getLabel`);function _c(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}q(_c,`getClosestValueIndex`);function vc(e,t,n){let r=e/2;return(r-xc([0,50],[0,r])(t)*n)*n}q(vc,`getThumbInBoundsOffset`);function yc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}q(yc,`getStepsBetweenValues`);function bc(e,t){if(t>0){let n=yc(e);return Math.min(...n)>=t}return!0}q(bc,`hasMinStepsBetweenValues`);function xc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}q(xc,`linearScale`);function Sc(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}q(Sc,`getDecimalCount`);function Cc(e,t){let n=10**t;return Math.round(e*n)/n}q(Cc,`roundValue`);function wc(e,{min:t,step:n,direction:r,multiplier:i}){let a=Sc(n),o=(e-t)/n,s=Math.round(o),c=Cc(s*n+t,a)===Cc(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),Cc(l*n+t,a)}q(wc,`getNextStepValue`);function Tc(e){return typeof e==`function`}q(Tc,`isFunction`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`Toggle`,kc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ Dc(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=g({prop:n,onChange:i,defaultProp:r??!1,caller:Oc});return/* @__PURE__ */ (0,V.jsx)(p.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:F(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Ac=Object.defineProperty,jc=(e,t)=>Ac(e,`name`,{value:t,configurable:!0}),Mc=`ToggleGroup`,Nc={Single:`single`,Multiple:`multiple`},[Pc,Fc]=c(Mc,[Mi]),Ic=Mi(),Lc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{type:n,...r}=e;if(n===Nc.Single)return/* @__PURE__ */ (0,V.jsx)(Bc,{role:`radiogroup`,...r,ref:t});if(n===Nc.Multiple)return/* @__PURE__ */ (0,V.jsx)(Vc,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Mc}\``)},`ToggleGroup`)),[Rc,zc]=Pc(Mc),Bc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ jc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??``,onChange:i,caller:Mc});return/* @__PURE__ */ (0,V.jsx)(Rc,{scope:e.__scopeToggleGroup,type:Nc.Single,value:B.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:B.useCallback(()=>s(``),[s]),children:/* @__PURE__ */ (0,V.jsx)(Wc,{...a,ref:t})})},`ToggleGroupImplSingle`)),Vc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ jc(()=>{},`onValueChange`),...a}=e,[o,s]=g({prop:n,defaultProp:r??[],onChange:i,caller:Mc}),c=B.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=B.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return/* @__PURE__ */ (0,V.jsx)(Rc,{scope:e.__scopeToggleGroup,type:Nc.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:/* @__PURE__ */ (0,V.jsx)(Wc,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[Hc,Uc]=Pc(Mc),Wc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Ic(n),u=mn(o),d={dir:u,...c};return/* @__PURE__ */ (0,V.jsx)(Hc,{scope:n,rovingFocus:i,disabled:r,children:i?/* @__PURE__ */ (0,V.jsx)(Li,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})}):/* @__PURE__ */ (0,V.jsx)(p.div,{...d,ref:t})})},`ToggleGroupImpl`)),Gc=`ToggleGroupItem`,Kc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let n=zc(Gc,e.__scopeToggleGroup),r=Uc(Gc,e.__scopeToggleGroup),i=Ic(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=B.useRef(null);return r.rovingFocus?/* @__PURE__ */ (0,V.jsx)(Bi,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:/* @__PURE__ */ (0,V.jsx)(qc,{...s,ref:t})}):/* @__PURE__ */ (0,V.jsx)(qc,{...s,ref:t})},`ToggleGroupItem`)),qc=/* @__PURE__ */ B.forwardRef(/* @__PURE__ */ jc(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=zc(Gc,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Nc.Single?o:void 0;return/* @__PURE__ */ (0,V.jsx)(kc,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Jc=/* @__PURE__ */ (0,B.createContext)({});function Yc(e){let t=(0,B.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Xc=typeof window<`u`?B.useLayoutEffect:B.useEffect,Zc=/* @__PURE__ */ (0,B.createContext)(null);function Qc(e,t){e.indexOf(t)===-1&&e.push(t)}function $c(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var el=(e,t,n)=>n>t?t:n<e?e:n,tl={},nl=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),rl=e=>typeof e==`object`&&!!e,il=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
52
+ function al(e){let t;return()=>(t===void 0&&(t=e()),t)}var ol=/* @__NO_SIDE_EFFECTS__ */ e=>e,sl=(...e)=>e.reduce((e,t)=>n=>t(e(n))),cl=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ll=class{constructor(){this.subscriptions=[]}add(e){return Qc(this.subscriptions,e),()=>this.remove(e)}remove(e){$c(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},ul=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,dl=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,fl=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,pl=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},ml=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
53
+ function hl(e,t,n,r){return e===t&&n===r?ol:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=ml(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(ml(s+1e-7,e,n)-i-r)}return ml(s,t,r)}}var gl=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_l=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),vl=/*@__PURE__*/ hl(.33,1.53,.69,.99),yl=/*@__PURE__*/ _l(vl),bl=/*@__PURE__*/ gl(yl),xl=e=>e>=1?1:(e*=2)<1?.5*yl(e):.5*(2-2**(-10*(e-1))),Sl=e=>1-Math.sin(Math.acos(e)),Cl=/* @__PURE__ */ _l(Sl),wl=/* @__PURE__ */ gl(Sl),Tl=/*@__PURE__*/ hl(.42,0,1,1),El=/*@__PURE__*/ hl(0,0,.58,1),Dl=/*@__PURE__*/ hl(.42,0,.58,1),Ol=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`;/*#__NO_SIDE_EFFECTS__*/
54
+ function kl(e,t){return/* @__PURE__ */ Ol(e)?e[pl(0,e.length,t)]:e}var Al=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,jl={linear:ol,easeIn:Tl,easeInOut:Dl,easeOut:El,circIn:Sl,circInOut:wl,circOut:Cl,backIn:yl,backInOut:bl,backOut:vl,anticipate:xl},Ml=e=>typeof e==`string`,Nl=e=>{if(/* @__PURE__ */ Al(e)){let[t,n,r,i]=e;return/* @__PURE__ */ hl(t,n,r,i)}return Ml(e)?jl[e]:e},Pl={delta:0,timestamp:0,isProcessing:!1},Fl;function Il(){Fl=void 0}var J={now:()=>(Fl===void 0&&J.set(Pl.isProcessing||tl.useManualTiming?Pl.timestamp:performance.now()),Fl),set:e=>{Fl=e,queueMicrotask(Il)}},Ll=e=>Math.round(e*1e5)/1e5,Rl=e=>t=>typeof t==`string`&&t.startsWith(e),zl=/*@__PURE__*/ Rl(`--`),Bl=/*@__PURE__*/ Rl(`var(--`),Vl=e=>Bl(e)?Hl.test(e.split(`/*`)[0].trim()):!1,Hl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ul(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Wl={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Gl={...Wl,transform:e=>el(0,1,e)},Kl={...Wl,default:1},ql=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Jl(e){return e==null}var Yl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xl=(e,t)=>n=>!!(typeof n==`string`&&Yl.test(n)&&n.startsWith(e)||t&&!Jl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Zl=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ql);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ql=e=>el(0,255,e),$l={...Wl,transform:e=>Math.round(Ql(e))},eu={test:/*@__PURE__*/ Xl(`rgb`,`red`),parse:/*@__PURE__*/ Zl(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+$l.transform(e)+`, `+$l.transform(t)+`, `+$l.transform(n)+`, `+Ll(Gl.transform(r))+`)`},tu=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function nu(e){let t=e.length>5?2:1,n=tu(e,3,t);return{red:parseInt(tu(e,0,t),16),green:parseInt(tu(e,1,t),16),blue:parseInt(tu(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var ru={test:/*@__PURE__*/ Xl(`#`),parse:nu,transform:eu.transform},iu=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),au=/*@__PURE__*/ iu(`deg`),ou=/*@__PURE__*/ iu(`%`),Y=/*@__PURE__*/ iu(`px`),su=/*@__PURE__*/ iu(`vh`),cu=/*@__PURE__*/ iu(`vw`),lu={...ou,parse:e=>ou.parse(e)/100,transform:e=>ou.transform(e*100)},uu={test:/*@__PURE__*/ Xl(`hsl`,`hue`),parse:/*@__PURE__*/ Zl(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ou.transform(Ll(t))+`, `+ou.transform(Ll(n))+`, `+Ll(Gl.transform(r))+`)`},du={test:e=>eu.test(e)||ru.test(e)||uu.test(e),parse:e=>eu.test(e)?eu.parse(e):uu.test(e)?uu.parse(e):ru.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?eu.transform(e):uu.transform(e),getAnimatableNone:e=>{let t=du.parse(e);return t.alpha=0,du.transform(t)}},fu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,pu=/*@__PURE__*/ new RegExp(ql.source),mu=/*@__PURE__*/ new RegExp(fu.source,`i`);function hu(e){return isNaN(e)&&typeof e==`string`&&(pu.test(e)||mu.test(e))}var gu=`number`,_u=`color`,vu=`var`,yu=`var(`,bu="${}",xu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Su(e){let t=e.toString();return pu.test(t)||mu.test(t)}function Cu(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(xu,e=>(du.test(e)?(r.color.push(a),i.push(_u),n.push(du.parse(e))):e.startsWith(yu)?(r.var.push(a),i.push(vu),n.push(e)):(r.number.push(a),i.push(gu),n.push(parseFloat(e))),++a,bu)).split(bu),indexes:r,types:i}}function wu(e){return Cu(e).values}function Tu({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===gu?Ll(r[a]):e===_u?du.transform(r[a]):r[a]}return i}}function Eu(e){return Tu(Cu(e))}var Du=e=>typeof e==`number`?0:du.test(e)?du.getAnimatableNone(e):e,Ou=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Du(e);function ku(e){let t=Cu(e);return Tu(t)(t.values.map((e,n)=>Ou(e,t.split[n])))}var Au={test:hu,parse:wu,createTransformer:Eu,getAnimatableNone:ku};function ju(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ju(s,r,e+1/3),a=ju(s,r,e),o=ju(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Nu(e,t){return n=>n>0?t:e}var Pu=(e,t,n)=>e+(t-e)*n,Fu=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Iu=[ru,eu,uu],Lu=e=>Iu.find(t=>t.test(e));function Ru(e){let t=Lu(e);if(!t)return!1;let n=t.parse(e);return t===uu&&(n=Mu(n)),n}var zu=(e,t)=>{let n=Ru(e),r=Ru(t);if(!n||!r)return Nu(e,t);let i={...n};return e=>(i.red=Fu(n.red,r.red,e),i.green=Fu(n.green,r.green,e),i.blue=Fu(n.blue,r.blue,e),i.alpha=Pu(n.alpha,r.alpha,e),eu.transform(i))},Bu=/* @__PURE__ */ new Set([`none`,`hidden`]);function Vu(e,t){return Bu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Hu(e,t){return n=>Pu(e,t,n)}function Uu(e){return typeof e==`number`?Hu:typeof e==`string`?Vl(e)?Nu:du.test(e)?zu:qu:Array.isArray(e)?Wu:typeof e==`object`?du.test(e)?zu:Gu:Nu}function Wu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Uu(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Gu(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Uu(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ku(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var qu=(e,t)=>{let n=Cu(e),r=Cu(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Bu.has(e)&&!r.values.length||Bu.has(t)&&!n.values.length?Vu(e,t):sl(Wu(Ku(n,r),r.values),Tu(r)):Nu(e,t)},Ju=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Yu(e,t){let n=Ju.exec(e);if(!n)return;let r=Ju.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Ll(Pu(a,o,e))+i}function Xu(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Pu(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Yu(e,t);if(n)return n}return Uu(e)(e,t)}var Zu=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function X(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a,o=/* @__PURE__ */ new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Z=40;function Qu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Zu.reduce((e,t)=>(e[t]=X(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=tl.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Z),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Zu.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Zu.length;t++)o[Zu[t]].cancel(e)},state:n,steps:o}}var{schedule:Q,cancel:$u,steps:ed}=/* @__PURE__ */ Qu(typeof requestAnimationFrame<`u`?requestAnimationFrame:ol,!0,Pl),td=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Q.update(t,e),stop:()=>$u(t),now:()=>Pl.isProcessing?Pl.timestamp:J.now()}},nd=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},rd=2e4;function id(e,t=50,n=rd,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ad(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(id(o),rd);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ dl(s)}}var od=100,sd=10,cd=1,ld=800,ud=.3,dd=.3,fd=.01,pd=2,md=.005,hd=.5,gd=.01,_d=10,vd=.05,yd=e=>e<0?1/Math.max(1+e,vd):Math.max(1-e,vd);function bd(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cd(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xd(e,t){return e*Math.sqrt(1-t*t)}var Sd=12;function Cd(e,t,n){let r=n;for(let n=1;n<Sd;n++)r-=e(r)/t(r);return r}var wd=.001;function Td({duration:e=ld,bounce:t=ud}){let n,r,i=yd(t);e=el(gd,_d,/* @__PURE__ */ dl(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xd(t,i),o=Math.exp(-r);return wd-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xd(t*t,i);return(-n(t)+wd>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cd(n,r,a),s=o*bd(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ ul(e)}}var Ed=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dd(e,t){if(Ed(e,t))return e}function Od(e){let t=Dd(e.stiffness),n=Dd(e.damping,!0),r=Dd(e.mass),i={...e,stiffness:t??od,damping:n??sd,mass:r??cd,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yd(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bd(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Td(i)),i.isResolvedFromDuration=!0;Ed(i.stiffness)&&Ed(i.damping,!0)||(i.stiffness=od,i.damping=sd)}return i}function kd(e=dd,t=ud){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Od({...n}),f=e=>d?0:-/* @__PURE__ */ dl(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ dl(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?fd:pd),g.restDelta=n.restDelta||(e?md:hd)};_();let v,y,b;if(p<1){let e=xd(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ ul(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ ul(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(id(S),rd),t=nd(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var Ad=/* @__PURE__ */ Object.assign(kd,{applyToOptions:e=>{let t=ad(e,100,kd);return e.ease=t.ease,e.duration=/* @__PURE__ */ ul(t.duration),e.type=`keyframes`,e}});function jd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Ad({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Md(e,t,n){let r=[],i=n||tl.mix||Xu,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=sl(Array.isArray(t)?t[n]||ol:t,a)),r.push(a)}return r}function Nd(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Md(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ cl(e[r],e[r+1],n);return s[r](i)};return n?t=>l(el(e[0],e[a-1],t)):l}function Pd(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ cl(0,t,r);e.push(Pu(n,1,i))}}function Fd(e){let t=[0];return Pd(t,e.length-1),t}function Id(e,t){return e.map(e=>e*t)}function Ld(e,t){return e.map(()=>t||Dl).splice(0,e.length-1)}function Rd({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ Ol(r)?r.map(Nl):Nl(r)||Dl,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(tl.mix||Xu)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?el(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Nd(Id(n&&n.length===t.length?n:Fd(t),e),t,{ease:Array.isArray(i)?i:Ld(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var zd=5;function Bd(e,t,n){let r=Math.max(t-zd,0);return/* @__PURE__ */ fl(n-e(r),t-r)}function Vd(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Bd(t=>e.next(t).value,t,e.next(t).value)}var Hd=e=>e!==null;function Ud(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Hd),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Wd={decay:jd,inertia:jd,tween:Rd,keyframes:Rd,spring:Ad};function Gd(e){typeof e.type==`string`&&(e.type=Wd[e.type])}var Kd=40,qd=(e,t)=>t-e>Kd&&!tl.useManualTiming?t:e;function Jd(e,t){return{kind:e,animation:t,timestamp:J.now(),frameTimestamp:Pl.timestamp,frameIsProcessing:Pl.isProcessing}}function Yd(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Jd(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Xd(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Jd(`layout-animation-start`,e),node:t})}catch{}}var Zd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Qd=e=>e/100,$d=e=>Math.round(e*1e4)/1e4,ef=class extends Zd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==J.now()&&this.tick(J.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Yd(this,this.options)}initAnimation(){let{options:e}=this;Gd(e);let{type:t=Rd,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Rd;s!==Rd&&typeof o[0]!=`number`&&(this.mixKeyframes=sl(Qd,Xu(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=id(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qd(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==jd&&(f.value=Ud(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??$d((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==jd?Ud(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=el(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return/* @__PURE__ */ dl(this.calculatedDuration)}get iterationDuration(){return this.duration+/* @__PURE__ */ dl(this.options.delay??0)}get time(){return/* @__PURE__ */ dl(this.currentTime)}set time(e){e=/* @__PURE__ */ ul(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Vd(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(J.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ dl(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=td,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(J.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},tf=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function nf(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ql)||[];if(!r)return e;let i=n.replace(r,``),a=+!!tf.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var rf=/\b([a-z-]*)\(.*?\)/gu,af={...Au,getAnimatableNone:e=>{let t=e.match(rf);return t?t.map(nf).join(` `):e}},of={...Au,getAnimatableNone:e=>{let t=Au.parse(e);return Au.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},sf={...Wl,transform:Math.round},cf={rotate:au,pathRotation:au,rotateX:au,rotateY:au,rotateZ:au,scale:Kl,scaleX:Kl,scaleY:Kl,scaleZ:Kl,skew:au,skewX:au,skewY:au,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:Gl,originX:lu,originY:lu,originZ:Y},lf={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...cf,zIndex:sf,fillOpacity:Gl,strokeOpacity:Gl,numOctaves:sf},uf={...lf,color:du,backgroundColor:du,outlineColor:du,fill:du,stroke:du,borderColor:du,borderTopColor:du,borderRightColor:du,borderBottomColor:du,borderLeftColor:du,filter:af,WebkitFilter:af,mask:of,WebkitMask:of},df=e=>uf[e],ff=/*@__PURE__*/ new Set([af,of]);function pf(e,t){let n=df(e);return ff.has(n)||(n=Au),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function mf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hf=e=>e*180/Math.PI,gf=e=>vf(hf(Math.atan2(e[1],e[0]))),_f={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gf,rotateZ:gf,skewX:e=>hf(Math.atan(e[1])),skewY:e=>hf(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vf=e=>(e%=360,e<0&&(e+=360),e),yf=gf,bf=e=>Math.hypot(e[0],e[1]),xf=e=>Math.hypot(e[4],e[5]),Sf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bf,scaleY:xf,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(bf(e)+xf(e))/2,rotateX:e=>vf(hf(Math.atan2(e[6],e[5]))),rotateY:e=>vf(hf(Math.atan2(-e[2],e[0]))),rotateZ:yf,rotate:yf,skewX:e=>hf(Math.atan(e[4])),skewY:e=>hf(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cf(e){return+!!e.includes(`scale`)}function wf(e,t){if(!e||e===`none`)return Cf(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Cf(t);let r=(n[1]?Sf:_f)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var Tf=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wf(n,t)},Ef=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Df=/* @__PURE__ */ new Set([...Ef,`pathRotation`]),Of=e=>e===Wl||e===Y,kf=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Af=/* @__PURE__ */ Ef.filter(e=>!kf.has(e));function jf(e){let t=[];return Af.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Mf=/* @__PURE__ */ new Set([`bottom`,`right`]);function Nf(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Pf=({transform:e})=>wf(e,`x`),Ff=({transform:e})=>wf(e,`y`),If={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Nf(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Nf(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Pf,y:Ff,translateX:Pf,translateY:Ff},Lf=/* @__PURE__ */ new Set,Rf=!1,zf=!1,Bf=!1;function $(){if(zf){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Lf.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Mf.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=jf(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}zf=!1,Rf=!1,Lf.forEach(e=>e.complete(Bf)),Lf.clear()}function Vf(){Lf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zf=!0)})}function Hf(){Bf=!0,Vf(),$(),Bf=!1}function Uf(e,t,n){if(typeof e==`string`){if(nl(e)||il(e))return parseFloat(e);if(!Au.test(e)&&Au.test(n))return pf(t,n)}return e??void 0}var Wf=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Lf.add(this),Rf||(Rf=!0,Q.read(Vf),Q.resolveKeyframes($))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Uf(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Lf.delete(this)}cancel(){this.state===`scheduled`&&(Lf.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Gf=e=>e.startsWith(`--`);function Kf(e,t,n){Gf(t)?e.style.setProperty(t,n):e.style[t]=n}var qf={};function Jf(e,t){let n=/* @__PURE__ */ al(e);return()=>qf[t]??n()}var Yf=/* @__PURE__ */ Jf(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Xf=/*@__PURE__*/ Jf(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Zf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ Zf([0,.65,.55,1]),circOut:/*@__PURE__*/ Zf([.55,0,1,.45]),backIn:/*@__PURE__*/ Zf([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ Zf([.33,1.53,.69,.99])};function $f(e,t){if(e)return typeof e==`function`?Xf()?nd(e,t):`ease-out`:/* @__PURE__ */ Al(e)?Zf(e):Array.isArray(e)?e.map(e=>$f(e,t)||Qf.easeOut):Qf[e]}function ep(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=$f(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function tp(e){return typeof e==`function`&&`applyToOptions`in e}function np({type:e,...t}){return tp(e)&&Xf()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var rp=class extends Zd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=np(e);this.animation=ep(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ud(r,this.options,o,this.speed);this.updateMotionValue?.(e),Kf(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Yd(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ dl(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ dl(e)}get time(){return/* @__PURE__ */ dl(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ ul(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Yf()?(this.animation.timeline=e,t?.(this.animation),ol):n(this)}},ip={anticipate:xl,backInOut:bl,circInOut:wl};function ap(e){return e in ip}function op(e){typeof e.ease==`string`&&ap(e.ease)&&(e.ease=ip[e.ease])}var sp=class extends rp{constructor(e){op(e),Gd(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(J.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new ef({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?el(0,10,a):0,s=this.sample(a);n&&r&&Kf(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},cp=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Au.test(e)||e===`0`)&&!e.startsWith(`url(`));function lp(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function up(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=cp(i,t),s=cp(a,t);return!o||!s?!1:lp(e)||(n===`spring`||tp(n))&&r}function dp(e){e.duration=0,e.type=`keyframes`}var fp=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`]),pp=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function mp(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&pp.test(e[t]))return!0;return!1}var hp=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),gp=()=>!tl.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function _p(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(fp.has(n)||hp.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return gp()&&(fp.has(n)||hp.has(n)&&mp(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var vp=(e,t)=>t&&typeof e==`number`?t.transform(e):e,yp={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},bp=Ef.length,xp={},Sp=(e,t,n=vp(t,cf[e]))=>(xp[e]||(xp[e]=(yp[e]||e)+`(`))+n+`)`,Cp=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function wp(e,t,n){let r=``;for(let i=0;i<bp;i++){let a=Ef[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=vp(o,lf[a]));Cp(a,o)||(r+=Sp(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=Sp(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var Tp=/* @__PURE__ */ new WeakMap,Ep=200,Dp=.001,Op=.1,kp=.001,Ap=100,jp=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Mp=(e,t)=>e-t,Np=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(Pu(e,t,i/n));return r},Pp=e=>e.motionValue.owner,Fp=e=>Tp.get(e),Ip=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Lp=({name:e,motionValue:t})=>e&&Ef.includes(e)&&t?.owner?.current instanceof HTMLElement&&gp()&&Xf();function Rp(e){let t=Pp(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Ip(t,`transform`)||`none`)===`none`&&!Ip(t,`pathRotation`)&&!t.projection?.isProjecting()}var zp=class extends ef{constructor(e){let t=Pp(e).current,{driver:n=td}=e,r,i=Rp(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Fp(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Fp(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Fp(Pp(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(J.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ Al(n)?Zf(n):jp(n)&&Qf[n];if(o&&!i&&!r&&e.length===2&&t===Rd&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Rd)===Rd?u||Fd(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=J.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||Bp(Pp(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(J.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ dl(el(0,this.totalDuration,this.at(J.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function Bp(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?Ef:a){let a=r.get(s),c=t===void 0?Ip(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&Cp(r,i)||(n+=Sp(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=J.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),A.schedule(!1)}),e.oncancel=()=>s.includes(r)&&A.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(Ep,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Np(t,n,i).concat(r).sort(Mp),o=e=>/* @__PURE__ */ cl(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Dp>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=Dp)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=Dp)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=Dp))return`linear`;let l=[],u=(e,t=c(e))=>l.push($d(t)+` `+$d(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?kp:Op))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=Np(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Mp))e>c&&o(c,e,0),c=e;return i.sort(Mp)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},T=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>/* @__PURE__ */ cl(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},E=t=>{let c=t,l=0,u=0,d=[],f=[],p=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=Ef.filter(t=>{if(r.has(t))return!0;let n=i[t]=Ip(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(T(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(T(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(T(f,e,e+l,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},D=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},O=()=>!n.size&&(u=!0,Fp(t)===A&&Tp.delete(t),A.isJS||v(),!0),k=()=>{let t=J.now();if(A.isJS||(A.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Ip(e,n.name),o.has(n)||(c=!0))}),A.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),O()))return;for(let e of n)if(!e.canAccelerate)return A.demote(!0);A.isJS&&(A.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!D(t)){if(a){if(t-f<Ap)return A.demote();f=t}if(!E(t))return A.demote()}},A={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Pl.isProcessing?Q.render(k,!1,!0):queueMicrotask(k)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),O()||A.schedule(!0)},check(){if(!A.isJS){for(let t in i)if(Ip(e,t)!==i[t]&&!p(t))return A.schedule(!0,!0)}},demote(e){if(!(A.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),A.isJS=!0,o=/* @__PURE__ */ new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Tp.set(t,A),A}var Vp=class extends Zd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=J.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Wf;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=J.now();let u=up(e,i,a,o);u||((tl.instantAnimations||!s)&&l?.(Ud(e,n,t)),e[0]=e[e.length-1],dp(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&_p(n),p=!f&&Lp(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=qd(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new sp(n)}catch{m=new ef(n)}}else m=p?new zp(n):new ef(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Hp=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Up(this.animations,`duration`)}get iterationDuration(){return Up(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Up(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Wp=class extends Hp{then(e,t){return this.finished.finally(e).then(()=>{})}};function Gp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Kp=30,qp=e=>!isNaN(parseFloat(e)),Jp={current:void 0},Yp=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=J.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=J.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qp(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ll)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ll,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Q.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=/* @__PURE__ */ new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Jp.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=J.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Kp)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Kp);return/* @__PURE__ */ fl(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Xp(e,t){return new Yp(e,t)}function Zp(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Qp(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Zp(n,e)}var $p={type:`spring`,stiffness:500,damping:25,restSpeed:10},em=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tm={type:`keyframes`,duration:.8},nm={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},rm=(e,{keyframes:t})=>t.length>2?tm:Df.has(e)?e.startsWith(`scale`)?em(t[1]):$p:nm,im=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function am(e){for(let t in e)if(!im.has(t))return!0;return!1}var om=(e,t,n,r={},i,a)=>o=>{let s=Qp(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ ul(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};am(s)||Object.assign(u,rm(e,u)),u.duration&&=/* @__PURE__ */ ul(u.duration),u.repeatDelay&&=/* @__PURE__ */ ul(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(dp(u),u.delay===0&&(d=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,dp(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ud(u.keyframes,s);if(e!==void 0){Q.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ef(u):new Vp(u)},sm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cm(e){let t=sm.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function lm(e,t,n=1){let[r,i]=cm(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return nl(e)?parseFloat(e):e}return Vl(i)?lm(i,t,n+1):i}function um(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function dm(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...um(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function fm(e,t,n){return dm(e.getProps(),t,n,e)}var pm=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,mm=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ef]),hm=e=>Array.isArray(e);function gm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xp(n))}function _m(e){return hm(e)?e[e.length-1]||0:e}function vm(e,t){let{transitionEnd:n={},transition:r={},...i}=fm(e,t)||{};i={...i,...n};for(let t in i)gm(e,t,_m(i[t]))}var ym=e=>!!(e&&e.getVelocity);function bm(e){return!!(ym(e)&&e.add)}function xm(e,t){let n=e.getValue(`willChange`);if(bm(n))return n.add(t);if(!n&&tl.WillChange){let n=new tl.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var Sm=`data-framer-appear-id`;function Cm(e){return e.props[Sm]}var wm=typeof window<`u`;function Tm({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Em(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Zp(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Tm(f,t))continue;let o={delay:n,...Qp(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Q.update(()=>r.set(i));continue}let p=!1;if(wm&&window.MotionHandoffAnimation){let n=Cm(e);if(n){let e=window.MotionHandoffAnimation(n,t,Q);e!==null&&(o.startTime=e,p=!0)}}xm(e,t);let m=l??e.shouldReduceMotion;r.start(om(t,r,i,m&&mm.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Q.update(()=>{o&&vm(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Dm(e,t,n={}){let r=fm(e,t,pm(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Em(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Dm(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Gp(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Om(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Dm(e,t,n))):typeof t==`string`?Dm(e,t,n):Promise.all(Em(e,fm(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var km={test:e=>e===`auto`,parse:e=>e},Am=e=>t=>t.test(e),jm=[Wl,Y,ou,au,cu,su,km],Mm=e=>jm.find(Am(e));function Nm(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||il(e)}var Pm=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function Fm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Pm.has(t)&&Su(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=pf(n,i))}var Im=class extends Wf{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Ul(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Vl(r))){let i=lm(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!mm.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Mm(r),o=Mm(i);if(Ul(r)!==Ul(i)&&If[n])this.needsMeasurement=!0;else if(a!==o){if(Of(a)&&Of(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else If[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Nm(e[t]))&&n.push(t);n.length&&Fm(e,n,t)}measure(){let{element:e,name:t}=this;return If[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Lm=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],Rm=[];function zm(e){Bm(e),Rm.unshift(e)}function Bm(e){$c(Rm,e)}function Vm(e){return Rm.find(t=>t.test(e))}function Hm(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Q.update(()=>l.set(c)):(l.start(om(o,l,c,s&&mm.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Q.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Um(e,t,n,r,i){return Hm(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=Wm(i)??e.read(t,r,i)}a=Xp(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function Wm(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Gm(e){return rl(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Km(e){return rl(e)&&`ownerSVGElement`in e}var qm={};function Jm(e){return qm.current?.add(e),e}var Ym=e=>qm.current?qm.current.bind(e):e;function Xm(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:qm.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Zm=class{constructor(e=Q.render){this.step=e,this.values=/* @__PURE__ */ new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=/* @__PURE__ */ new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Qm(e,{step:t,...n}={}){let r=/* @__PURE__ */ new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new Zm(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function $m(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(Cp(i,a)||(t+=(t&&` `)+Sp(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+Sp(`rotate`,i)),t||`none`}var eh=/* @__PURE__ */ new Set([`originX`,`originY`,`originZ`]),th=(e,t)=>vp(e.get(t)?.get(),lf[t]),nh=(e,t,n,r)=>{let i,a;if(Df.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>Ef.indexOf(e)-Ef.indexOf(t)))}t.get(`transform`)||(!Gm(e)&&!t.get(`transformBox`)&&nh(e,t,`transformBox`,new Yp(`fill-box`)),t.set(`transform`,new Yp(`none`),()=>{Tp.get(e)?.check(),e.style.transform=$m(t)})),a=t.get(`transform`)}else eh.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new Yp(``),()=>{let n=th(t,`originX`)??`50%`,r=th(t,`originY`)??`50%`,i=th(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Gf(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=vp(r.getCurrent(),lf[n])};return t.set(n,r,i,a)},rh=e=>Gm(e)||Km(e),ih=(e,t)=>{if(Df.has(t))return Tf(e,t);let n=getComputedStyle(e),r=Gf(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},ah=/*@__PURE__*/ Qm(nh,{test:rh,read:ih});function oh(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function sh(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Df.has(e))o=!0;else if(zl(e))i[e]=n;else{let t=vp(n,lf[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=wp(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ch={offset:`stroke-dashoffset`,array:`stroke-dasharray`},lh={offset:`strokeDashoffset`,array:`strokeDasharray`};function uh(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ch:lh;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var dh=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function fh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sh(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of dh)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&uh(d,i,a,o,!1)}function ph(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var mh=(e,t,n,r,i=n)=>{let a=ph(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=oh(i));let o=lf[n]||lf[i],s=a?()=>{e[i]=vp(r.get(),lf[n])}:()=>{let t=vp(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function hh(e,t,n,r){return Q.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new Yp(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var gh=/*@__PURE__*/ Qm((e,t,n,r)=>n.startsWith(`path`)&&!Df.has(n)?hh(e,t,n,r):n.startsWith(`attr`)?mh(e,t,n,r,_h(n)):(Df.has(n)||eh.has(n)||Gf(n)||n in e.style?nh:mh)(e,t,n,r),{test:Km,read:(e,t)=>Df.has(t)?lf[t]?.default||0:Gf(t)||dh.includes(t)?ih(e,t)||e.getAttribute(oh(t))||0:(t=_h(t),e.getAttribute(oh(t))??e.getAttribute(t)??void 0)});function _h(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function vh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xh(e){return e===void 0||e===1}function Sh({scale:e,scaleX:t,scaleY:n}){return!xh(e)||!xh(t)||!xh(n)}var Ch=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function wh(e){return Sh(e)||Eh(e)||Th(e)}function Th(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function Eh(e){return Dh(e.x)||Dh(e.y)}function Dh(e){return e&&e!==`0%`}function Oh(e,t,n){return n+t*(e-n)}function kh(e,t,n,r,i){return i!==void 0&&(e=Oh(e,i,r)),Oh(e,n,r)+t}function Ah(e,t=0,n=1,r,i){e.min=kh(e.min,t,n,r,i),e.max=kh(e.max,t,n,r,i)}function jh(e,{x:t,y:n}){Ah(e.x,t.translate,t.scale,t.originPoint),Ah(e.y,n.translate,n.scale,n.originPoint)}var Mh=.999999999999,Nh=1.0000000000001;function Ph(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Fh(e.x,-a.scroll.offset.x),Fh(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,jh(e,o)),r&&(r.path?.[s]||r)!==a&&wh(a.latestValues)&&Rh(e,a.latestValues,a.layout?.layoutBox));t.x<Nh&&t.x>Mh&&(t.x=1),t.y<Nh&&t.y>Mh&&(t.y=1)}function Fh(e,t){e.min+=t,e.max+=t}function Ih(e,t,n,r,i=.5){Ah(e,t,n,Pu(e.min,e.max,i),r)}function Lh(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Rh(e,t,n){let r=n??e;Ih(e.x,Lh(t.x,r.x),t.scaleX,t.scale,t.originX),Ih(e.y,Lh(t.y,r.y),t.scaleY,t.scale,t.originY)}function zh(e,t){return vh(bh(e.getBoundingClientRect(),t))}function Bh(e,t,n){let r=zh(e,n),{scroll:i}=t;return i&&(Fh(r.x,i.offset.x),Fh(r.y,i.offset.y)),r}var Vh={},Hh=e=>Km(e)?gh:ah,Uh=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=Im}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return zh(this.current)}getProps(){return Vh}};function Wh(e,t,n,r){if(qm.current?.track(e),r)return Hm(e=>r.getValue(e,null),t,n,r);let i=Hh(e);return Um(i,e,t,n,new Uh(i,e))}var Gh=/*@__PURE__*/ Qm((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>rl(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Kh,cancel:qh}=/* @__PURE__ */ Qu(queueMicrotask,!1);function Jh(e,t,n){let r=ym(e)?e:Xp(e);return r.start(om(``,r,t,n)),r.animation}var Yh={},Xh={value:null,addProjectionMetrics:null};function Zh(e,t){let n=J.now();e=Ym(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&($u(r),e(a-t))};return Q.setup(r,!0),Jm(()=>$u(r))}function Qh(e){return Km(e)&&e.tagName===`svg`}function $h(e){return ym(e)?e.get():e}var eg=e=>typeof e==`number`?e:parseFloat(e),tg=Lm.length,ng=e=>typeof e==`number`||Y.test(e);function rg(e,t,n,r,i,a){i?(e.opacity=Pu(0,n.opacity??1,ag(r)),e.opacityExit=Pu(t.opacity??1,0,og(r))):a&&(e.opacity=Pu(t.opacity??1,n.opacity??1,r));for(let i=0;i<tg;i++){let a=Lm[i],o=ig(t,a),s=ig(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ng(o)===ng(s)?(e[a]=Math.max(Pu(eg(o),eg(s),r),0),(ou.test(s)||ou.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<Ch.length;i++){let a=Ch[i];(t[a]||n[a])&&(e[a]=Pu(t[a]||0,n[a]||0,r))}}function ig(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ag=/*@__PURE__*/ sg(0,.5,Cl),og=/*@__PURE__*/ sg(.5,.95,ol);function sg(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ cl(e,t,r))}function cg(e,t){e.min=t.min,e.max=t.max}function lg(e,t){cg(e.x,t.x),cg(e.y,t.y)}function ug(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var dg=.9999,fg=1.0001,pg=-.01,mg=.01;function hg(e){return e.max-e.min}function gg(e,t,n){return Math.abs(e-t)<=n}function _g(e,t,n,r=.5){e.origin=r,e.originPoint=Pu(t.min,t.max,e.origin),e.scale=hg(n)/hg(t),e.translate=Pu(n.min,n.max,e.origin)-e.originPoint,(e.scale>=dg&&e.scale<=fg||isNaN(e.scale))&&(e.scale=1),(e.translate>=pg&&e.translate<=mg||isNaN(e.translate))&&(e.translate=0)}function vg(e,t,n,r){_g(e.x,t.x,n.x,r?.originX),_g(e.y,t.y,n.y,r?.originY)}function yg(e,t,n,r=0){e.min=(r?Pu(n.min,n.max,r):n.min)+t.min,e.max=e.min+hg(t)}function bg(e,t,n,r){yg(e.x,t.x,n.x,r?.x),yg(e.y,t.y,n.y,r?.y)}function xg(e,t,n,r=0){let i=r?Pu(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+hg(t)}function Sg(e,t,n,r){xg(e.x,t.x,n.x,r?.x),xg(e.y,t.y,n.y,r?.y)}function Cg(e,t,n,r,i){return e-=t,e=Oh(e,1/n,r),i!==void 0&&(e=Oh(e,1/i,r)),e}function wg(e,t=0,n=1,r=.5,i,a=e,o=e){if(ou.test(t)&&(t=parseFloat(t),t=Pu(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Pu(a.min,a.max,r);e===a&&(s-=t),e.min=Cg(e.min,t,n,s,i),e.max=Cg(e.max,t,n,s,i)}function Tg(e,t,[n,r,i],a,o){wg(e,t[n],t[r],t[i],t.scale,a,o)}var Eg=[`x`,`scaleX`,`originX`],Dg=[`y`,`scaleY`,`originY`];function Og(e,t,n,r){Tg(e.x,t,Eg,n?.x,r?.x),Tg(e.y,t,Dg,n?.y,r?.y)}var kg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ag=()=>({x:kg(),y:kg()}),jg=()=>({min:0,max:0}),Mg=()=>({x:jg(),y:jg()});function Ng(e){return e.translate===0&&e.scale===1}function Pg(e){return Ng(e.x)&&Ng(e.y)}function Fg(e,t){return e.min===t.min&&e.max===t.max}function Ig(e,t){return Fg(e.x,t.x)&&Fg(e.y,t.y)}function Lg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rg(e,t){return Lg(e.x,t.x)&&Lg(e.y,t.y)}function zg(e){return hg(e.x)/hg(e.y)}function Bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Vg=class{constructor(){this.members=[]}add(e){Qc(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||($c(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if($c(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Hg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ug={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Y.test(e))e=parseFloat(e);else return e}return`${Hg(e,t.target.x)}% ${Hg(e,t.target.y)}%`}},Wg={borderRadius:/* @__PURE__ */ Object.assign({},Ug,{applyTo:/* @__PURE__ */ Lm.slice()}),borderTopLeftRadius:Ug,borderTopRightRadius:Ug,borderBottomLeftRadius:Ug,borderBottomRightRadius:Ug,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Au.parse(e);if(i.length>5)return r;let a=Au.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Pu(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Gg(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<Ch.length;e++){let t=Ch[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Kg(e){return[e(`x`),e(`y`)]}var qg=(e,t)=>e.depth-t.depth,Jg=class{constructor(){this.children=[],this.isDirty=!1}add(e){Qc(this.children,e),this.isDirty=!0}remove(e){$c(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qg),this.isDirty=!1,this.children.forEach(e)}},Yg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xg={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Zg=[`z`,`skew`,`skewZ`],Qg=1e3,$g=0;function e_(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var t_=e=>e.instance&&Tp.get(e.instance)?.demote()&&e.resetSkewAndRotation();function n_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Cm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Q,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&n_(r)}function r_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Yh,{...Wg,...Yh}),class{constructor(e={},n=t?.()){this.id=$g++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xh.value&&(Xg.nodes=Xg.calculatedTargetDeltas=Xg.calculatedProjections=0),this.nodes.forEach(o_),this.nodes.forEach(__),this.nodes.forEach(v_),this.nodes.forEach(s_),Xh.addProjectionMetrics&&Xh.addProjectionMetrics(Xg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jg)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ll),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Km(t)&&!Qh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Q.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Zh(i,250),Yg.hasAnimatedSinceResize&&(Yg.hasAnimatedSinceResize=!1,this.nodes.forEach(g_)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||w_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Rg(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Qp(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||g_(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,$u(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(y_),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&n_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;t_(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t_(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(u_),this.nodes.forEach(l_);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d_);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p_),this.nodes.forEach(m_),this.nodes.forEach(h_),this.nodes.forEach(i_),this.nodes.forEach(a_)):this.nodes.forEach(d_),this.clearAllSnapshots();let e=J.now();Pl.delta=el(0,1e3/60,e-Pl.timestamp),Pl.timestamp=e,Pl.isProcessing=!0,ed.update.process(Pl),ed.preRender.process(Pl),ed.render.process(Pl),Pl.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(c_),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!hg(this.snapshot.measuredBox.x)&&!hg(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Mg(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&t_(this);let t=this.projectionDelta&&!Pg(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||wh(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),O_(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Mg();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(j_))){let{scroll:e}=this.root;e&&(Fh(t.x,e.offset.x),Fh(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Mg();if(lg(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&lg(t,e),Fh(t.x,i.offset.x),Fh(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||Mg();lg(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Fh(a.x,-n.scroll.offset.x),Fh(a.y,-n.scroll.offset.y)),wh(n.latestValues)&&Rh(a,n.latestValues,n.layout?.layoutBox)}return!r&&wh(this.latestValues)&&Rh(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=Mg();lg(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!wh(n.latestValues))continue;let r;n.instance&&(Sh(n.latestValues)&&n.updateSnapshot(),r=Mg(),lg(r,n.measurePageBox())),Og(t,n.latestValues,n.snapshot?.layoutBox,r)}return wh(this.latestValues)&&Og(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pl.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Pl.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Mg(),this.targetWithTransforms=Mg()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):lg(this.target,this.layout.layoutBox),jh(this.target,this.targetDelta)):lg(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Xh.value&&Xg.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Sh(this.parent.latestValues)||Eh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mg(),this.relativeTargetOrigin=Mg(),Sg(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),lg(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Pl.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;lg(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ph(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Mg());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ug(this.prevProjectionDelta.x,this.projectionDelta.x),ug(this.prevProjectionDelta.y,this.projectionDelta.y)),vg(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Bg(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bg(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Xh.value&&Xg.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ag(),this.projectionDelta=Ag(),this.projectionDeltaWithTransform=Ag()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ag();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Mg(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(C_));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);b_(o.x,e.x,n),b_(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sg(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),S_(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Ig(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Mg(),lg(f,this.relativeTarget)),c&&(this.animationValues=a,rg(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=($u(this.pendingAnimation),void 0),this.pendingAnimation=Q.update(()=>{Yg.hasAnimatedSinceResize=!0,this.motionValue||=Xp(0),this.motionValue.jump(0,!1),this.currentAnimation=Jh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Xd(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Qg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&A_(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||Mg(),k_(i.x,t.x,e.x),k_(i.y,t.y,e.y)}lg(t,i),Rh(t,r),vg(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vg),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!Th(t))return;let n={};for(let t=0;t<Zg.length;t++)e_(Zg[t],e,n,this.animationValues);for(let t=0;t<Ch.length;t++)e_(Ch[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=$h(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=$h(t?.pointerEvents)||``),this.hasProjected&&!wh(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Gg(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Yh){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Yh[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?$h(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(l_),this.root.sharedNodes.clear()}}}function i_(e){e.updateLayout(),f_(e)}function a_(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Kg(e=>{let t=hg(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;cg(r[e],a[e])}else A_(i,t.layoutBox,n)&&Kg(t=>{let n=hg(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Ag();vg(c,n,t.layoutBox);let l=Ag();vg(l,a?e.applyTransform(r,!0):n,s);let u=!Pg(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=Mg();Sg(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=Mg();Sg(l,n,i.layoutBox,s),a&&o(c,l),Rg(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function o_(e){Xh.value&&Xg.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function s_(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function c_(e){e.clearSnapshot()}function l_(e){e.clearMeasurements()}function u_(e){e.isLayoutDirty=!0,e.updateLayout()}function d_(e){e.isLayoutDirty=!1}function f_(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Kg(e=>Fh(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function p_(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function m_(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function h_(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function g_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function __(e){e.resolveTargetDelta()}function v_(e){e.calcProjection()}function y_(e){e.resetSkewAndRotation()}function b_(e,t,n){e.translate=Pu(t.translate,0,n),e.scale=Pu(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function x_(e,t,n,r){e.min=Pu(t.min,n.min,r),e.max=Pu(t.max,n.max,r)}function S_(e,t,n,r){x_(e.x,t.x,n.x,r),x_(e.y,t.y,n.y,r)}function C_(e){return e.animationValues?.opacityExit!==void 0}var w_={duration:.45,ease:[.4,0,.1,1]},T_=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),E_=T_(`applewebkit/`)&&!T_(`chrome/`)?Math.round:ol;function D_(e){e.min=E_(e.min),e.max=E_(e.max)}function O_(e){D_(e.x),D_(e.y)}function k_(e,t,n){e.max=hg(n)+(e.min=t.min)}function A_(e,t,n){return e===`position`||e===`preserve-aspect`&&!gg(zg(t),zg(n),.2)}function j_(e){return e!==e.root&&e.scroll?.wasRoot}function M_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var N_=/* @__PURE__ */ r_({attachResizeListener:(e,t)=>M_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),P_={current:void 0},F_=/* @__PURE__ */ r_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!P_.current){let e=new N_({});e.mount(window),e.setOptions({layoutScroll:!0}),P_.current=e}return P_.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),I_=/* @__PURE__ */ new WeakMap;function L_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function R_(e){return typeof e==`string`||Array.isArray(e)}var z_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],B_=/* @__PURE__ */ [`initial`].concat(z_);function V_(e){if(L_(e.animate))return!0;for(let t=0;t<B_.length;t++)if(R_(e[B_[t]]))return!0;return!1}function H_(e){return!!(V_(e)||e.variants)}function U_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ym(i))e.addValue(r,i);else if(ym(a))e.addValue(r,Xp(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Xp(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var W_={current:null},G_={current:!1},K_=typeof window<`u`;function q_(){if(G_.current=!0,K_){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>W_.current=e.matches;e.addEventListener(`change`,t),t()}else W_.current=!1}}var J_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Y_={};function X_(e){Y_=e}function Z_(){return Y_}var Q_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Wf,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=J.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Q.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=V_(t),this.isVariantNode=H_(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ym(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,I_.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(G_.current||q_(),this.shouldReduceMotion=W_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),$u(this.notifyUpdate),$u(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&fp.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new rp({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ ul(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Df.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Q.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Tp.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Y_){let t=Y_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mg()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Tp.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<J_.length;t++){let n=J_[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=U_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Xp(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(nl(n)||il(n))?n=parseFloat(n):typeof n!=`number`&&!Au.test(n)&&Au.test(t)&&(n=pf(e,t)),this.setBaseTarget(e,ym(n)?n.get():n)),ym(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ll)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Kh.render(this.render)}},$_=class extends Q_{constructor(){super(...arguments),this.KeyframeResolver=Im}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ym(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function ev(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function tv(e,{layout:t,layoutId:n}){return Df.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Yh[e]||e===`opacity`)}function nv(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ym(r[t])||i&&ym(i[t])||tv(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function rv(e){return window.getComputedStyle(e)}var iv=class extends $_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=ev}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Df.has(t))return this.projection?.isProjecting?Cf(t):Tf(e,t);{let n=rv(e),r=(zl(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return zh(e,t)}build(e,t,n){sh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return nv(e,t,n)}},av=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function ov(e){return{point:{x:e.pageX,y:e.pageY}}}var sv=e=>t=>av(t)&&e(t,ov(t));function cv(e,t,n,r){return M_(e,t,sv(n),r)}var lv=/* @__PURE__ */ new WeakMap,uv,dv=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Km(r)&&`getBBox`in r?r.getBBox()[t]:r[n],fv=/*@__PURE__*/ dv(`inline`,`width`,`offsetWidth`),pv=/*@__PURE__*/ dv(`block`,`height`,`offsetHeight`);function mv({target:e,borderBoxSize:t}){lv.get(e)?.forEach(n=>{n(e,{get width(){return fv(e,t)},get height(){return pv(e,t)}})})}function hv(e){e.forEach(mv)}function gv(){typeof ResizeObserver<`u`&&(uv=new ResizeObserver(hv))}function _v(e,t){uv||gv();let n=Xm(e);return n.forEach(e=>{let n=lv.get(e);n||(n=/* @__PURE__ */ new Set,lv.set(e,n)),n.add(t),uv?.observe(e)}),()=>{n.forEach(e=>{let n=lv.get(e);n?.delete(t),n?.size||uv?.unobserve(e)})}}var vv=/* @__PURE__ */ new Set,yv;function bv(){yv=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};vv.forEach(t=>t(e))},window.addEventListener(`resize`,yv)}function xv(e){return vv.add(e),yv||bv(),()=>{vv.delete(e),!vv.size&&typeof yv==`function`&&(window.removeEventListener(`resize`,yv),yv=void 0)}}function Sv(e,t){return Jm(typeof e==`function`?xv(e):_v(e,t))}var Cv=(e,t)=>Math.abs(e-t);function wv(e,t){let n=Cv(e.x,t.x),r=Cv(e.y,t.y);return Math.sqrt(n**2+r**2)}var Tv=/*#__PURE__*/ new Set([`auto`,`scroll`]),Ev=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ov(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Av(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=wv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:J.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Ov(t,this.transformPagePoint),this.hasPendingMove=!0,Q.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Av(e.type===`pointercancel`?this.lastMoveEventInfo:Ov(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!av(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Ov(ov(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:J.now()}];let{onSessionStart:l}=t;l&&l(e,Av(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=sl(cv(this.contextWindow,`pointermove`,this.handlePointerMove,u),cv(this.contextWindow,`pointerup`,this.handlePointerUp,u),cv(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Tv.has(e.overflowX)||Tv.has(e.overflowY))&&this.scrollPositions.set(t,Dv(t)),t=t.parentElement}this.scrollPositions.set(window,Dv(window)),this.removeScrollListeners=sl(M_(window,`scroll`,this.onElementScroll,{capture:!0}),M_(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=Dv(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),$u(this.updatePoint)}},Dv=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function Ov(e,t){return t?{point:t(e.point)}:e}function kv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Av({point:e},t){return{point:e,delta:kv(e,Mv(t)),offset:kv(e,jv(t)),velocity:Nv(t,.1)}}function jv(e){return e[0]}function Mv(e){return e[e.length-1]}function Nv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Mv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ ul(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ ul(t)*2&&(r=e[1]);let a=/* @__PURE__ */ dl(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Pv=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Fv(e){return Pv.has(e.tagName)||e.isContentEditable===!0}var Iv=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Lv(e){return Iv.has(e.tagName)||e.isContentEditable===!0}var Rv={x:!1,y:!1};function zv(){return Rv.x||Rv.y}function Bv(e){return e===`x`||e===`y`?Rv[e]?null:(Rv[e]=!0,()=>{Rv[e]=!1}):Rv.x||Rv.y?null:(Rv.x=Rv.y=!0,()=>{Rv.x=Rv.y=!1})}function Vv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pu(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pu(n,e,r.max):Math.min(e,n)),e}function Hv(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Uv(e,{top:t,left:n,bottom:r,right:i}){return{x:Hv(e.x,n,i),y:Hv(e.y,t,r)}}function Wv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Gv(e,t){return{x:Wv(e.x,t.x),y:Wv(e.y,t.y)}}function Kv(e,t){let n=.5,r=hg(e),i=hg(t);return i>r?n=/* @__PURE__ */ cl(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ cl(e.min,e.max-i,t.min)),el(0,1,n)}function qv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Jv=.35;function Yv(e=Jv){return e===!1?e=0:e===!0&&(e=Jv),{x:Xv(e,`left`,`right`),y:Xv(e,`top`,`bottom`)}}function Xv(e,t,n){return{min:Zv(e,t),max:Zv(e,n)}}function Zv(e,t){return typeof e==`number`?e:e[t]||0}function Qv(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var $v=/* @__PURE__ */ new WeakMap,ey=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mg(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=Bv(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Kg(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Vl(t)&&(t=lm(t,this.visualElement.current)||0),Y.test(t))t=parseFloat(t);else if(ou.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=hg(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Q.update(()=>i(e,t),!1,!0),xm(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=oy(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Q.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ev(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Q.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!ay(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Vv(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;ty(e)?this.constraints&&this.scroll===Qv(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?Uv(r.layoutBox,e):!1,this.elastic=Yv(t),i!==this.constraints&&!ty(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Kg(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=qv(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!ty(e))return!1;let n=ny(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Qv(r);let i=Bh(n,r.root,this.visualElement.getTransformPagePoint()),a=Gv(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(yh(a));this.hasMutatedConstraints=!!e,e&&(a=vh(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Kg(s=>{if(!ay(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return xm(this.visualElement,e),n.start(om(e,n,0,t,this.visualElement,!1))}stopAnimation(){Kg(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Kg(e=>{if(!ay(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Pu(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ty(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Kg(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Kv({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Kg(t=>{let n=this.getAxisMotionValue(t);if(!ay(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Pu(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$v.set(this.visualElement,this);let e=this.visualElement.current,t=cv(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Lv(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=ty(t)&&ny(t);r&&(this.constraints=this.resolveRefConstraints(),n||=iy(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Q.read(r);let o=M_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Kg(t=>{if(!ay(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Jv,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function ty(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var ny=e=>`current`in e?e.current:e;function ry(e){let t=!0;return()=>{t?t=!1:e()}}function iy(e,t,n){let r=Sv(e,ry(n)),i=Sv(t,ry(n));return()=>{r(),i()}}function ay(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oy(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function sy(e,t){let n=Xm(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Jm(()=>r.abort())]}function cy(e){return!(e.pointerType===`touch`||zv())}function ly(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!cy(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var uy=(e,t)=>t?e===t||uy(e,t.parentElement):!1,dy=/* @__PURE__ */ new WeakSet;function fy(e){return t=>{t.key===`Enter`&&e(t)}}function py(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var my=(e,t)=>{let n=!1,r=fy(()=>{dy.has(e)||(n=!0,py(e,`down`))}),i=fy(()=>{n&&(n=!1,py(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&py(e,`cancel`)},{...t,once:!0})};function hy(e){return av(e)&&!zv()}var gy=/* @__PURE__ */ new WeakSet;function _y(e,t,n={}){t=Ym(t);let[r,i,a]=sy(e,n),o=e=>{let r=e.currentTarget;if(!hy(e)||gy.has(e))return;dy.add(r),n.stopPropagation&&gy.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),dy.has(r)&&dy.delete(r),hy(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||uy(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Gm(e)&&(e.addEventListener(`focus`,()=>my(e,i),i),!Fv(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var vy=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},yy=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),by=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function xy(e,t,n,r){ev(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(yy.has(n)?n:oh(n),t.attrs[n])}function Sy(e,t,n){let r=nv(e,t,n);for(let n in e)if(n!==`children`&&(ym(e[n])||ym(t[n]))){let t=Ef.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Cy=class extends $_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Mg}getBaseTargetFromProps(e,t){return Df.has(t)?super.getBaseTargetFromProps(e,t)??Cf(t):e[t]}getDefaultValue(e){return Df.has(e)?this.latestValues[e]??Cf(e):void 0}readValueFromInstance(e,t){if(Df.has(t)){let e=df(t);return e&&e.default||0}if(dh.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=yy.has(t)?t:oh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Sy(e,t,n)}build(e,t,n){fh(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){xy(e,t,n,r)}mount(e){this.isSVGTag=by(e.tagName),super.mount(e)}};function wy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Ty=[...z_].reverse(),Ey=e=>e?.out===!0?e:e?.out;function Dy(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Om(e,t,n))),n=ky(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&fm(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&Ey(f(l??(g&&g.props.initial))?.transition);if(Ty.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?R_(f)||f===!1?f:void 0:l,y=R_(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||L_(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=Oy(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=fm(e,n,pm(e,t))||{};E={...E,...a,...i},D=Ey(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!wy(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=fm(s,n)?.transition?.delayChildren;r.delay=Gp(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!ym(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ky(),i=!0}}}function Oy(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wy(t,e):!1}function ky(){let e={};for(let t of z_)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var Ay=/* @__PURE__ */ (0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function jy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function My(...e){return t=>{let n=!1,r=e.map(e=>{let r=jy(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():jy(e[t],null)}}}}function Ny(...e){return B.useCallback(My(...e),e)}var Py=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},Fy=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=Py(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=Py(e.offsetParent);return[t/i,n/a]},Iy=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Gm(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Gm(e)&&e.offsetWidth||0,r=Gm(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=Fy(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function Ly({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,B.useId)(),c=(0,B.useRef)(null),l=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,B.useContext)(Ay),d=Ny(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,B.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Kh.setup(()=>{let[e,t]=Fy(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Kh.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,V.jsx)(Iy,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:B.cloneElement(e,{ref:d})})}var Ry=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Yc(zy),d=(0,B.useId)(),f=(0,B.useRef)(),p=(0,B.useRef)(n),m=(0,B.useRef)(r);Xc(()=>{p.current=n,m.current=r});let h=!0,g=(0,B.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(Ly,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,V.jsx)(Zc.Provider,{value:g,children:e})};function zy(){return/* @__PURE__ */ new Map}function By(e=!0){let t=(0,B.useContext)(Zc);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,B.useId)();(0,B.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,B.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Vy=e=>e.key||``;function Hy(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var Uy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=By(o),f=(0,B.useMemo)(()=>Hy(e),[e]),p=o&&!u?[]:f.map(Vy),m=(0,B.useRef)(!0),h=Yc(()=>/* @__PURE__ */ new Map),g=(0,B.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,B.useState)(f),[y,b]=(0,B.useState)(f);Xc(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,B.useRef)();(0,B.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),Xc(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=Vy(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(Vy(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Vy(e)))?e=f:a===`wait`&&(e=S),b(Hy(e)),v(f),null}let{forceRender:C}=(0,B.useContext)(Jc);return(0,V.jsx)(V.Fragment,{children:y.map(e=>{let _=Vy(e),b=o&&!u?!1:f===y||p.includes(_);return(0,V.jsx)(Ry,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Wy=/* @__PURE__ */ (0,B.createContext)({strict:!1}),Gy={animation:[`variants`,...z_],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Ky=!1;function qy(){if(Ky)return;let e={};for(let t in Gy)e[t]={isEnabled:e=>Gy[t].some(t=>!!e[t])};X_(e),Ky=!0}function Jy(){return qy(),Z_()}function Yy(e){let t=Jy();for(let n in e)t[n]={...t[n],...e[n]};X_(t)}function Xy({children:e,...t}){let n=(0,B.useContext)(Ay);t={...n,...t},t.transition=Zp(t.transition,n.transition),t.isStatic=Yc(()=>t.isStatic);let r=(0,B.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,V.jsx)(Ay.Provider,{value:r,children:e})}var Zy=/* @__PURE__ */ (0,B.createContext)({});function Qy(e,t){if(V_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||R_(t)?t:void 0,animate:R_(n)?n:void 0}}return e.inherit===!1?{}:t}function $y(e){let{initial:t,animate:n}=Qy(e,(0,B.useContext)(Zy));return(0,B.useMemo)(()=>({initial:t,animate:n}),[eb(t),eb(n)])}function eb(e){return Array.isArray(e)?e.join(` `):e}var tb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nb(e,t,n){for(let r in t)!ym(t[r])&&!tv(r,n)&&(e[r]=t[r])}function rb({transformTemplate:e},t){return(0,B.useMemo)(()=>{let n=tb();return sh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ib(e,t){let n=e.style||{},r={};return nb(r,n,e),Object.assign(r,rb(e,t)),r}function ab(e,t){let n={},r=ib(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var ob=()=>({...tb(),attrs:{}});function sb(e,t,n,r){let i=(0,B.useMemo)(()=>{let n=ob();return fh(n,t,by(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return nb(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var cb=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function lb(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||cb.has(e)}function ub(e,t){return e.startsWith(`on`)?!lb(e):t?.(e)??!lb(e)}function db(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||ym(e[a])||(ub(a,r)||n===!0&&lb(a)||!t&&!lb(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var fb=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function pb(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(fb.indexOf(e)>-1||/[A-Z]/u.test(e))}function mb(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??pb(e)?sb:ab)(t,r,i,e),l=db(t,typeof e==`string`,a,s),u=e===B.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,B.useMemo)(()=>ym(d)?d.get():d,[d]);return(0,B.createElement)(e,{...u,children:f})}function hb({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:gb(n,r,i,e),renderState:t()}}function gb(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=$h(a[e]);let{initial:o,animate:s}=e,c=V_(e),l=H_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!L_(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=dm(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var _b=e=>(t,n)=>{let r=(0,B.useContext)(Zy),i=(0,B.useContext)(Zc),a=()=>hb(e,t,r,i);return n?a():Yc(a)},vb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:nv,createRenderState:tb}),yb=/*@__PURE__*/ _b({scrapeMotionValuesFromProps:Sy,createRenderState:ob}),bb=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function xb(e,t,n){let r=(0,B.useRef)(n);(0,B.useInsertionEffect)(()=>{r.current=n});let i=(0,B.useRef)(null);return(0,B.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Sb=/* @__PURE__ */ (0,B.createContext)({});function Cb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function wb(e,t,n,r,i,a){let{visualElement:o}=(0,B.useContext)(Zy),s=(0,B.useContext)(Wy),c=(0,B.useContext)(Zc),l=(0,B.useContext)(Ay),u=l.reducedMotion,d=l.skipAnimations,f=(0,B.useRef)(null),p=(0,B.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,B.useContext)(Sb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Tb(f.current,n,i,h),(0,B.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[Sm],_=(0,B.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Xc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Xc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,B.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function Tb(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Eb(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Cb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function Eb(e){if(e)return e.options.allowProjection===!1?Eb(e.parent):e.projection}function Db(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Yy(r);let a=n?n===`svg`:pb(e),o=a?yb:vb;function s(n,s){let c,l=Ob(n);Yc(()=>!!P_.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,B.useContext)(Ay),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=$y(n),m=o(n,d);if(!d&&typeof window<`u`){kb(u,r);let t=Ab(u);p.visualElement=wb(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,V.jsxs)(Zy.Provider,{value:p,children:[c&&p.visualElement?(0,V.jsx)(c,{visualElement:p.visualElement,...u}):null,mb(e,n,xb(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,B.forwardRef)(s);return c[bb]=e,c}function Ob({layoutId:e}){let t=(0,B.useContext)(Jc).id;return t&&e!==void 0?t+`-`+e:e}function kb(e,t){(0,B.useContext)(Wy).strict}function Ab(e){let{drag:t,layout:n}=Jy();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function jb(e,t){if(typeof Proxy>`u`)return Db;let n=/* @__PURE__ */ new Map,r=(n,r)=>Db(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Db(a,void 0,e,t)),n.get(a))})}var Mb=(e,t)=>t.isSVG??pb(e)?new Cy(t):new iv(t,{allowProjection:e!==B.Fragment}),Nb=class extends vy{constructor(e){super(e),e.animationState||=Dy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();L_(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Pb=0,Fb={animation:{Feature:Nb},exit:{Feature:class extends vy{constructor(){super(...arguments),this.id=Pb++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=fm(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Ib=class extends vy{constructor(e){super(e),this.removeGroupControls=ol,this.removeListeners=ol,this.controls=new ey(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ol}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Lb=e=>(t,n)=>{e&&Q.update(()=>e(t,n),!1,!0)},Rb=class extends vy{constructor(){super(...arguments),this.removePointerDownListener=ol}onPointerDown(e){this.session=new Ev(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lb(e),onStart:Lb(t),onMove:Lb(n),onEnd:(e,t)=>{delete this.session,r&&Q.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=cv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},zb=!1,Bb=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Vb=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Hb=class extends B.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),zb&&i.root.didUpdate(),i.options.layoutId!==r&&Vb(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Bb(this.props),onExitComplete:()=>this.safeToRemove()})),Yg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Vb(o,n)),o.setOptions({...o.options,...Bb(this.props)}),zb=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Q.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Kh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;zb=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Ub(e){let[t,n]=By(),r=(0,B.useContext)(Jc);return(0,V.jsx)(Hb,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(Sb),isPresent:t,safeToRemove:n})}var Wb={pan:{Feature:Rb},drag:{Feature:Ib,ProjectionNode:F_,MeasureLayout:Ub}};function Gb(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Q.postRender(()=>o(t,ov(t)))}var Kb=class extends vy{mount(){let{current:e}=this.node;e&&(this.unmount=ly(e,(e,t)=>(Gb(this.node,t,`Hover`,`Start`),e=>Gb(this.node,e,`Hover`,`End`))))}unmount(){}},qb=class extends vy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=sl(M_(this.node.current,`focus`,()=>this.onFocus()),M_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jb(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Gb(e,t,`Tap`,n)}var Yb=class extends vy{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=_y(e,(e,t)=>(Jb(this.node,t,`Start`),(e,{success:t})=>Jb(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xb=/* @__PURE__ */ new WeakMap,Zb=/* @__PURE__ */ new WeakMap,Qb=e=>{let t=Xb.get(e.target);t&&t(e)},$b=e=>{e.forEach(Qb)};function ex({root:e,...t}){let n=e||document;Zb.has(n)||Zb.set(n,{});let r=Zb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($b,{root:e,...t})),r[i]}function tx(e,t,n){let r=ex(t);return Xb.set(e,n),r.observe(e),()=>{Xb.delete(e),r.unobserve(e)}}var nx={some:0,all:1},rx=class extends vy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nx[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=tx(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ix(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ix({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var ax=/*@__PURE__*/ jb(/* @__PURE__ */ Object.assign({},Fb,{inView:{Feature:rx},tap:{Feature:Yb},focus:{Feature:qb},hover:{Feature:Kb}},Wb,{layout:{ProjectionNode:F_,MeasureLayout:Ub}}),Mb);function ox(){!G_.current&&q_();let[e]=(0,B.useState)(W_.current);return e}function sx(e){return typeof e==`object`&&!Array.isArray(e)}function cx(e,t,n,r){return e==null?[]:typeof e==`string`&&sx(t)?Xm(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function lx(e,t,n){return e*(t+1)+n*t}function ux(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function dx(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):ux(t,r)??e}function fx(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&($c(e,i),r--)}}function px(e,t,n,r,i,a){fx(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Pu(i,a,r[o]),easing:/* @__PURE__ */ kl(n,o)})}function mx(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function hx(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var gx=`easeInOut`,_x=20;function vx(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l={},u=/* @__PURE__ */ new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:dx(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=xx(e),{delay:l=0,times:u=Fd(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(a,s):l,S=c.length,C=tp(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&wx(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=/* @__PURE__ */ ul(b));let r=ad(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Pd(u,T),c.length===1&&c.unshift(null),m&&m<_x){let e=b>0?g/b:0;b=lx(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?/* @__PURE__ */ _l(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:/* @__PURE__ */ kl(f,e-1))}mx(u,m,e)}let E=w+b;px(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(ym(g)){let e=yx(g,c);b(_,v,bx(`default`,e))}else{let e=cx(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=yx(r,c);for(let e in _)b(_[e],Sx(v,e),bx(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(hx);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(/* @__PURE__ */ cl(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(gx)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,...n}}}),s}function yx(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function bx(e,t){return t[e]||(t[e]=[]),t[e]}function xx(e){return Array.isArray(e)?e:[e]}function Sx(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Cx=e=>typeof e==`number`,wx=e=>e.every(Cx);function Tx(e,t){return ym(e)||typeof e==`number`||typeof e==`string`&&!sx(t)}function Ex(e,t,n,r){let i=[];if(Tx(e,t))i.push(Jh(e,sx(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=cx(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Wh(r,t,s,I_.get(r))):i.push(...Um(Vm(r)??Gh,r,t,s))}}return i}function Dx(e,t,n,r){let i=[];return vx(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Xp(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ad},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...Ex(n,e,t))}),i}var Ox=0;function kx(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var Ax=(e,t)=>t===void 0?e:{name:e,at:t};function jx(e){e.pause(),e.time=0,e.stop()}var Mx=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=/* @__PURE__ */ new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new Wp(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>$c(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+Ox++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+Ox++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&=(jx(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,jx(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=/* @__PURE__ */ new Map,f={},p=Dx(this.toSequence(d),{defaultTransition:n,...u},c,f),m=f.labels,h=u.duration??f.duration,g=f.duration?h/f.duration:1;if(m.forEach((e,t)=>m.set(t,e*g)),this.markers=[],d.forEach((e,t)=>{e.time=m.get(t),m.delete(t),h=Math.max(h,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=m,this.totalDuration=h,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Xp(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),p.unshift(this.clockAnimation=Jh(e,[0,h],{...u,duration:h,ease:`linear`}))}let _=this.group=new Wp(p);t=Math.min(t,h),this.isDone&&t<h&&this.newFinished(),this.scrollTimeline?this.detachScroll=_.attachTimeline(this.scrollTimeline):(_.speed=this.playbackSpeed,this.isPaused&&_.pause(),t&&(_.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),Ax(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?Ax(n,r):r===void 0?n:Array.isArray(n)?kx(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:ux(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}};function Nx(e){return Array.isArray(e)&&e.some(Array.isArray)}function Px(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=qm.current,s=o?.transition,c={};n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r);let l;if(Nx(e)){let n={...c,...i,scope:t};s&&(n.defaultTransition={...s,...n.defaultTransition}),l=new Mx(e,n)}else{let{onComplete:n,...r}=a||{},o={...c,...s,...r},{onUpdate:u}=r;l=new Mx([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...o,onUpdate:void 0}]:[e,i,o]],{...c,onComplete:n,scope:t},Ex(e,i,o,t))}return o&&l.finished.then(o.add(()=>l.stop())),l}return i}var Fx=/* @__PURE__ */ Object.assign(/* @__PURE__ */ Px(),{addEffect:zm,removeEffect:Bm}),Ix=ax;function Lx(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Rx=e=>{switch(e){case`success`:return Vx;case`info`:return Ux;case`warning`:return Hx;case`error`:return Wx;default:return null}},zx=Array(12).fill(0),Bx=({visible:e,className:t})=>/*#__PURE__*/ B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ B.createElement(`div`,{className:`sonner-spinner`},zx.map((e,t)=>/*#__PURE__*/ B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Vx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Hx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ux=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Wx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Gx=/*#__PURE__*/ B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},/*#__PURE__*/ B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Kx=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},qx=1,Jx=100,Yx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:qx++,Xx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Jx;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Yx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Qx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Yx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},Zx=(e,t)=>Xx.message(e,t),Qx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,$x=Object.assign(Zx,{success:Xx.success,info:Xx.info,warning:Xx.warning,error:Xx.error,custom:Xx.custom,message:Xx.message,promise:Xx.promise,dismiss:Xx.dismiss,loading:Xx.loading},{getHistory:()=>Xx.toasts,getToasts:()=>Xx.getActiveToasts()});Lx(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function eS(e){return e.label!==void 0}var tS=3,nS=`24px`,rS=`16px`,iS=4e3,aS=356,oS=14,sS=45,cS=200;function lS(...e){return e.filter(Boolean).join(` `)}function uS(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var dS=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,j]=B.useState(!1),[M,N]=B.useState(!1),[P,F]=B.useState(!1),[I,ee]=B.useState(!1),[te,ne]=B.useState(!1),[re,ie]=B.useState(0),[ae,oe]=B.useState(0),se=B.useRef(n.duration||y||iS),ce=B.useRef(null),le=B.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=fe??`default`,L=n.dismissible!==!1,R=n.className||``,me=n.descriptionClassName||``,he=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),_e=B.useMemo(()=>n.duration||y||iS,[n.duration,y]),ve=B.useRef(0),z=B.useRef(0),ye=B.useRef(0),be=B.useRef(null),[xe,Se]=b.split(`-`),V=B.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Ce=Kx(),we=B.useMemo(()=>e.swipeDirections??uS(b),[e.swipeDirections,b]),Te=n.invert||t,Ee=fe===`loading`;z.current=B.useMemo(()=>he*x+V,[he,V]),B.useEffect(()=>{se.current=_e},[_e]),B.useEffect(()=>{j(!0)},[]),B.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=B.useCallback(()=>{N(!0),ie(z.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},cS)},[n,d,a,z]);B.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ye.current<ve.current){let e=(/* @__PURE__ */ new Date()).getTime()-ve.current;se.current-=e}ye.current=(/* @__PURE__ */ new Date()).getTime()})():se.current!==1/0&&(ve.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ce,De]),B.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?/*#__PURE__*/ B.createElement(`div`,{className:lS(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ B.createElement(Bx,{className:lS(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let ke=n.icon||w?.[fe]||Rx(fe);return/*#__PURE__*/ B.createElement(`li`,{tabIndex:0,ref:le,className:lS(_,R,C?.toast,n?.classNames?.toast,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":te,"data-removed":M,"data-visible":de,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ue,"data-swiping":P,"data-dismissible":L,"data-type":fe,"data-invert":Te,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:z.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&!Ee&&L&&(ce.current=/* @__PURE__ */ new Date,ie(z.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!L)return;be.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-ce.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?we.includes(e>0?`right`:`left`):we.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=sS||a>.11))ie(z.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!be.current||!L||window.getSelection()?.toString().length>0)return;let r=e.clientY-be.current.y,i=e.clientX-be.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(we.includes(`top`)||we.includes(`bottom`)){if(we.includes(`top`)&&r<0||we.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(we.includes(`left`)||we.includes(`right`))){if(we.includes(`left`)&&i<0||we.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=le.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=le.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ B.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!L?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:lS(C?.closeButton,n?.classNames?.closeButton)},w?.close??Gx):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ B.createElement(`div`,{"data-icon":``,className:lS(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Oe():n.promise?Oe():null,fe===`loading`?null:ke):null,/*#__PURE__*/ B.createElement(`div`,{"data-content":``,className:lS(C?.content,n?.classNames?.content)},/*#__PURE__*/ B.createElement(`div`,{"data-title":``,className:lS(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ B.createElement(`div`,{"data-description":``,className:lS(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ B.isValidElement(n.cancel)?n.cancel:n.cancel&&eS(n.cancel)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{eS(n.cancel)&&L&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:lS(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ B.isValidElement(n.action)?n.action:n.action&&eS(n.action)?/*#__PURE__*/ B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{eS(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:lS(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function fS(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function pS(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?rS:nS;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var mS=/*#__PURE__*/ B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=tS,toastOptions:g,dir:_=fS(),gap:v=oS,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=B.useState([]),w=B.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=B.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=B.useState([]),[O,k]=B.useState(!1),[A,j]=B.useState(!1),[M,N]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=B.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=B.useRef(null),ee=B.useRef(!1),te=B.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Xx.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>Xx.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{hn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),B.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{S.length<=1&&k(!1)},[S]),B.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,ee.current=!1)}},[P.current]),/*#__PURE__*/ B.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ B.createElement(`ol`,{key:t,dir:_===`auto`?fS():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${aS}px`,"--gap":`${v}px`,...m,...pS(l,u)},onBlur:e=>{ee.current&&!e.currentTarget.contains(e.relatedTarget)&&(ee.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee.current||(ee.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ B.createElement(dS,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),hS=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),gS=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function _S(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&yS(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),yS(r,`relativePath`,a),r}function vS(e,t=hS){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function yS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var bS=[`.DS_Store`,`Thumbs.db`];async function xS(e,{mimeTypes:t=hS}={}){return(await SS(e)).map(e=>e instanceof File?vS(e,t):e)}async function SS(e){return ES(e)&&CS(e.dataTransfer)?kS(e.dataTransfer,e.type):wS(e)?AS(e.clipboardData):TS(e)?DS(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?OS(e):[]}function CS(e){return ES(e)}function wS(e){return ES(e)&&CS(e.clipboardData)}function TS(e){return ES(e)&&ES(e.target)}function ES(e){return typeof e==`object`&&!!e}function DS(e){return MS(e.target.files).map(e=>_S(e))}async function OS(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>_S(e))}async function kS(e,t){let n=MS(e.items).filter(e=>e.kind===`file`);return t===`drop`?jS(PS(await Promise.all(n.map(NS)))):n}function AS(e){let t=MS(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return jS((t.length>0?t:MS(e.files)).map(e=>_S(e)))}function jS(e){return e.filter(e=>bS.indexOf(e.name)===-1)}function MS(e){return e===null?[]:Array.from(e)}async function NS(e){if(typeof e.webkitGetAsEntry!=`function`)return FS(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await IS(e);return n?.kind===`directory`?LS(n,`/${n.name}`):zS(t)}return FS(e,t)}function PS(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...PS(n)):t.push(n);return t}async function FS(e,t){let n=e.getAsFile(),r=await IS(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,_S(e)}if(!n)throw new gS(e);return _S(n,t?.fullPath??void 0)}async function IS(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function LS(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await LS(r,e));else{let t=await r.getFile();n.push(_S(t,e,r))}}return n}async function RS(e){return e.isDirectory?zS(e):BS(e)}function zS(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(RS));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function BS(e){return new Promise((t,n)=>{e.file(n=>{t(_S(n,e.fullPath))},e=>{n(e)})})}function VS(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var HS=typeof VS==`function`?VS:VS.default,US=`file-invalid-type`,WS=`file-too-large`,GS=`file-too-small`,KS=`too-many-files`;function qS(e=``){let t=e.split(`,`);return{code:US,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var JS=[`KB`,`MB`,`GB`,`TB`,`PB`];function YS(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<JS.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${JS[n]}`}function XS(e){return{code:WS,message:`File is larger than ${YS(e)}`}}function ZS(e){return{code:GS,message:`File is smaller than ${YS(e)}`}}var QS={code:KS,message:`Too many files`};function $S(e){return e.type===``&&typeof e.getAsFile==`function`}function eC(e,t){let n=e.type===`application/x-moz-file`||HS(e,t??``)||$S(e);return[n,n?null:qS(t)]}function tC(e,t,n){if(nC(e.size)){if(nC(t)&&nC(n)){if(e.size>n)return[!1,XS(n)];if(e.size<t)return[!1,ZS(t)]}else if(nC(t)&&e.size<t)return[!1,ZS(t)];else if(nC(n)&&e.size>n)return[!1,XS(n)]}return[!0,null]}function nC(e){return e!=null}function rC(e){return e!=null&&typeof e.then==`function`}function iC({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=eC(e,t),[o,s]=tC(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(QS,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function aC(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function oC(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],sC):!!e.target&&!!e.target.files}function sC(e){return typeof e==`object`&&!!e&&e.kind===`file`}function cC(e){e.preventDefault()}function lC(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function uC(e){return e.indexOf(`Edge/`)!==-1}function dC(e=window.navigator.userAgent){return lC(e)||uC(e)}function fC(...e){return(t,...n)=>e.some(e=>(!aC(t)&&e&&e(t,...n),aC(t)))}function pC(){return`showOpenFilePicker`in window}function mC(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function hC(e){if(nC(e))return Array.isArray(e)?e.filter(e=>nC(e)&&nC(e.accept)):[{accept:e}]}function gC(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of mC(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function _C(e){let t=hC(e);if(!nC(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of mC(r))e.includes(t)||e.push(t)}return n}function vC(e){let t=hC(e);if(!nC(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return CC(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&mC(t).every(TC)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=mC(n),e),{});return{description:nC(e.description)&&e.description!==``?e.description:gC(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function yC(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(nC(e))return Object.entries(e).reduce((e,[n,r])=>{let i=mC(r);return t&&wC(n)&&i.some(TC)?e.push(...i):e.push(n,...i),e},[]).filter(e=>CC(e)||TC(e)).join(`,`)}function bC(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function xC(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function SC(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function CC(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function wC(e){return e.endsWith(`/*`)}function TC(e){return/^.*\.[\w]+$/.test(e)}var EC=(0,B.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=OC(t);return(0,B.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,V.jsx)(V.Fragment,{children:e?.({...i,open:r})})});EC.displayName=`Dropzone`;var DC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function OC(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=xS,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,B.useMemo)(()=>_C(t),[t]),O=(0,B.useMemo)(()=>yC(D),[D]),k=(0,B.useMemo)(()=>yC(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,B.useMemo)(()=>vC(t),[t]),j=(0,B.useMemo)(()=>typeof h==`function`?h:AC,[h]),M=(0,B.useMemo)(()=>typeof m==`function`?m:AC,[m]),N=(0,B.useRef)(null),P=(0,B.useRef)(null),[F,I]=(0,B.useReducer)(kC,DC),{isFocused:ee,isFileDialogActive:te}=F,ne=(0,B.useRef)(te);ne.current=te;let re=(0,B.useRef)(null),ie=(0,B.useCallback)(()=>{re.current?.abort();let e=new AbortController;return re.current=e,I({type:`setProcessing`,isProcessing:!0}),e.signal},[]),ae=(0,B.useCallback)(e=>{e.aborted||I({type:`setProcessing`,isProcessing:!1})},[]);(0,B.useEffect)(()=>()=>re.current?.abort(),[]);let oe=(0,B.useRef)(typeof window<`u`&&window.isSecureContext&&g&&pC()),se=()=>{!oe.current&&te&&setTimeout(()=>{if(P.current){let{files:e}=P.current;e?.length||(I({type:`closeDialog`}),M())}},300)};(0,B.useEffect)(()=>(window.addEventListener(`focus`,se,!1),()=>{window.removeEventListener(`focus`,se,!1)}),[P,te,M,oe]);let ce=(0,B.useRef)([]),le=(0,B.useRef)([]),ue=e=>{N.current&&e.target&&N.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ce.current=[])};(0,B.useEffect)(()=>(v&&(document.addEventListener(`dragover`,cC,!1),document.addEventListener(`drop`,ue,!1)),()=>{v&&(document.removeEventListener(`dragover`,cC),document.removeEventListener(`drop`,ue))}),[N,v]),(0,B.useEffect)(()=>{let e=e=>{e.target&&(le.current=[...le.current,e.target]),oC(e)&&I({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{le.current=le.current.filter(t=>t!==e.target&&t!==null),!(le.current.length>0)&&I({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{le.current=[],I({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[N]),(0,B.useEffect)(()=>(!n&&_&&N.current&&N.current.focus(),()=>{}),[N,_,n]);let de=(0,B.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e),!ne.current&&(ce.current=[...ce.current,e.target],oC(e)&&Promise.resolve(r(e)).then(t=>{if(aC(e)&&!S)return;let n=t.length>0?iC({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;I({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>de(e)))},[r,c,de,S,O,a,i,o,s,T,E]),pe=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ne.current)return!1;let t=oC(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),L=(0,B.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e);let t=ce.current.filter(e=>N.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),ce.current=t,!(t.length>0)&&(I({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),oC(e)&&l&&l(e))},[N,l,S]),R=(0,B.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(QS,e)]})}),I({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=eC(e,k),[r,o]=tC(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>rC(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(ae(n),de(e));return}n.aborted||c(u)},[I,o,k,a,i,s,d,f,p,T,E,de,ae]),me=(0,B.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),ce.current=[],!(ne.current&&e.dataTransfer)&&(I({type:`reset`}),oC(e))){let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})}},[r,R,de,S,ie,ae]),he=(0,B.useCallback)(e=>{if(!oC(e))return;e.preventDefault(),e.persist?.(),Ce(e);let t=ie();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(aC(e)&&!S)ae(t);else return R(n,e,t)}}).catch(e=>{t.aborted||(ae(t),de(e))})},[r,R,de,S,ie,ae]),ge=(0,B.useCallback)(()=>{if(oe.current){I({type:`openDialog`}),j();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ie(),r(e))).then(e=>{if(I({type:`closeDialog`}),!t.aborted)return R(e,null,t)}).catch(e=>{t&&ae(t),bC(e)?(M(e),I({type:`closeDialog`})):xC(e)||SC(e)?(oe.current=!1,P.current?(P.current.value=``,P.current.click()):de(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):de(e)})}else P.current&&(I({type:`openDialog`}),j(),P.current.value=``,P.current.click())},[I,j,M,g,R,de,A,o,ie,ae]),_e=(0,B.useCallback)(e=>{N.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[N,ge]),ve=(0,B.useCallback)(()=>{I({type:`focus`})},[]),z=(0,B.useCallback)(()=>{I({type:`blur`})},[]),ye=(0,B.useCallback)(()=>{y||(dC()?setTimeout(ge,0):ge())},[y,ge]),be=e=>n?null:e,xe=e=>b?null:be(e),Se=e=>x?null:be(e),V=e=>C?null:be(e),Ce=e=>{S&&e.stopPropagation()},we=(0,B.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:xe(fC(r,_e)),onFocus:xe(fC(i,ve)),onBlur:xe(fC(a,z)),onClick:be(fC(o,ye)),onDragEnter:Se(fC(s,fe)),onDragOver:Se(fC(c,pe)),onDragLeave:Se(fC(l,L)),onDrop:Se(fC(u,me)),onPaste:V(fC(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:N,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[N,_e,ve,z,ye,fe,pe,L,me,he,b,x,C,n]),Te=(0,B.useCallback)(e=>{e.stopPropagation()},[]),Ee=(0,B.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:be(fC(t,me)),onClick:be(fC(n,Te)),tabIndex:-1,[e]:P,...r}),[P,t,o,me,n]);return{...F,isFocused:ee&&!n,getRootProps:we,getInputProps:Ee,rootRef:N,inputRef:P,open:be(ge)}}function kC(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...DC,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...DC};default:return e}}function AC(){}var jC={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};jC.node;var MC=k(jC),NC={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};NC.node;var PC=k(NC),FC={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};FC.node;var IC=k(FC),LC={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};LC.node;var RC=k(LC),zC={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};zC.node;var BC=k(zC),VC={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};VC.node;var HC=k(VC),UC={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};UC.node;var WC=k(UC),GC={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};GC.node;var KC=k(GC),qC={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};qC.node;var JC=k(qC),YC={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};YC.node;var XC=k(YC),ZC={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ZC.node;var QC=k(ZC),$C={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};$C.node;var ew=k($C),tw={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};tw.node;var nw=k(tw),rw={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};rw.node;var iw=k(rw),aw={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};aw.node;var ow=k(aw),sw={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};sw.node;var cw=k(sw),lw={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};lw.node;var uw=k(lw),dw={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};dw.node;var fw=k(dw),pw={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};pw.node;var mw=k(pw),hw={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};hw.node;var gw=k(hw),_w={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};_w.node;var vw=k(_w),yw={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};yw.node;var bw=k(yw),xw={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};xw.node;var Sw=k(xw),Cw={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Cw.node;var ww=k(Cw),Tw={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Tw.node;var Ew=k(Tw),Dw={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Dw.node;var Ow=k(Dw),kw={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};kw.node;var Aw=k(kw),jw={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};jw.node;var Mw=k(jw);function Nw({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,B.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,B.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,V.jsx)(Jr,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,V.jsxs)(Qr,{container:r,children:[/* @__PURE__ */ (0,V.jsx)(ei,{className:`fixed inset-0 z-50 bg-black/40`}),/* @__PURE__ */ (0,V.jsxs)(ii,{className:`fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-5 shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsx)(ci,{className:`text-[16px] font-semibold`,children:`Which plate?`}),/* @__PURE__ */ (0,V.jsx)(li,{className:`mt-1 text-[13px] text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,V.jsx)(di,{className:`grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`overflow-hidden rounded-xl border border-rule bg-raise text-left transition-colors hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,V.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,V.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num block px-3 py-2 text-[13px] font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function Pw({show:e,text:t}){return/* @__PURE__ */ (0,V.jsx)(Uy,{children:e&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`rounded-2xl border-2 border-dashed border-ink px-8 py-6 font-display text-[18px] font-semibold`,children:t})})})}function Fw({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:`border-b border-rule px-5 py-5 last:border-b-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3.5 flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`num grid size-6 shrink-0 place-items-center rounded-full text-[12px] font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-3.5`,strokeWidth:3}):e}),/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:t}),r&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-auto truncate text-[13px] text-muted`,children:r})]}),i]})}function Iw({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-medium`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] text-muted`,children:t})]}),n]})}var Lw={primary:`bg-ink text-ink-contrast hover:opacity-90 disabled:opacity-40`,secondary:`bg-panel text-ink border border-rule hover:border-muted disabled:opacity-50`,ghost:`text-ink hover:bg-raise disabled:opacity-40`},Rw={md:`h-9 px-3.5 gap-2 text-[14px]`,lg:`h-11 px-5 gap-2.5 text-[15px]`,icon:`size-9 justify-center`};function zw({variant:e=`secondary`,size:t=`md`,className:n,...r}){return/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:E(`inline-flex shrink-0 items-center rounded-lg font-medium transition-[opacity,border-color,background-color]`,Lw[e],Rw[t],n),...r})}var Bw=1e6,Vw={plates:[],files:{},selected:{plate:null,object:null}},Hw=(e,t,n={x:0,y:0},r=0,i=L)=>({id:e,fileId:t,x:n.x,y:n.y,spin:r,orient:i}),Uw=(e,t,n)=>({...e,plates:e.plates.map(e=>e.id===t?n(e):e)}),Ww=(e,t)=>({...e,plates:e.plates.map(e=>({...e,objects:e.objects.map(t)}))});function Gw(e){let t=new Set(e.plates.flatMap(e=>e.objects.map(e=>e.fileId))),n=Object.fromEntries(Object.entries(e.files).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e.files).length?e:{...e,files:n}}function Kw(e){let{plate:t,object:n}=e.selected,r=e.plates.find(e=>e.objects.some(e=>e.id===n));if(r)return r.id===t?e:{...e,selected:{plate:r.id,object:n}};let i=e.plates.find(e=>e.id===t)||e.plates[0]||null;return{...e,selected:{plate:i?i.id:null,object:null}}}function qw(e,t){switch(t.type){case`addPlate`:return e.plates.length>=10?e:{...e,plates:[...e.plates,{id:t.id,settings:t.settings,objects:[],result:null,error:null}],selected:{plate:t.id,object:null}};case`removePlate`:return Kw(Gw({...e,plates:e.plates.filter(e=>e.id!==t.id)}));case`selectPlate`:return e.plates.some(e=>e.id===t.id)?{...e,selected:{plate:t.id,object:null}}:e;case`selectObject`:return Kw({...e,selected:{...e.selected,object:t.id}});case`addObjects`:{let n=e.plates.find(e=>e.id===t.plate);if(!n||!t.objects.length)return e;let r=50-n.objects.length,i=t.objects.slice(0,Math.max(0,r));return i.length?{...Uw({...e,files:{...e.files,...t.files}},t.plate,e=>({...e,objects:[...e.objects,...i]})),selected:{plate:t.plate,object:i[0].id}}:e}case`updateObject`:return Ww(e,e=>e.id===t.id?{...e,...t.patch}:e);case`updateObjects`:return Ww(e,e=>t.patches[e.id]?{...e,...t.patches[e.id]}:e);case`removeObjects`:{let n=new Set(t.ids);return Kw(Gw({...e,plates:e.plates.map(e=>({...e,objects:e.objects.filter(e=>!n.has(e.id))}))}))}case`moveObjects`:{let n=new Set(t.ids);if(!e.plates.find(e=>e.id===t.to))return e;let r=e.plates.flatMap(e=>e.objects.filter(e=>n.has(e.id))).map(e=>({...e,...t.positions[e.id]})),i=e.plates.map(e=>{let i=e.objects.filter(e=>!n.has(e.id));return e.id===t.to?{...e,objects:[...i,...r]}:i.length===e.objects.length?e:{...e,objects:i}});return{...e,plates:i,selected:{plate:t.to,object:r.length?r[0].id:null}}}case`settings`:return Uw(e,t.plate,e=>({...e,settings:{...e.settings,...t.patch}}));case`settingsForAll`:{let n=e.plates.find(e=>e.id===t.from);return n?{...e,plates:e.plates.map(e=>({...e,settings:{...n.settings}}))}:e}case`result`:return Uw(e,t.plate,e=>({...e,result:t.result,error:null}));case`error`:return Uw(e,t.plate,e=>({...e,error:t.error}));default:return e}}var Jw=e=>Math.round(e*100)/100,Yw=e=>e?[e.name,e.size,e.lastModified]:null,Xw=(e,t)=>JSON.stringify([e.settings,e.objects.map(e=>[Yw(t[e.fileId]),Jw(e.x),Jw(e.y),Jw(e.spin),e.orient.map(e=>Math.round(e*1e6)/1e6)])]),Zw=(e,t)=>e.objects.length>0&&(!e.result||e.result.sig!==Xw(e,t)||!!e.error);function Qw(e){let t=/* @__PURE__ */ new Map;for(let n of e.objects)t.has(n.fileId)||t.set(n.fileId,[]),t.get(n.fileId).push(n);return[...t].map(([e,t])=>({fileId:e,objects:t}))}var $w=(e,t,n)=>e.filter(e=>!Object.hasOwn(t,e)&&!n.has(e)),eT=(e,t)=>`${e}|${t.join(`,`)}`,tT=e=>e.slice(0,e.indexOf(`|`));function nT(e,t,n){let r=[],i=e;for(;i.length&&r.length<n;){let e=[],n=0;for(let t of i){if(e.length>=50||e.length&&n+t.triangles>1e6)break;e.push(t),n+=t.triangles}let{positions:a,overflow:o}=fe(e.map(e=>({id:e.id,points:e.points,spin:0})),t),s=e.map(e=>e.id).filter(e=>!o.includes(e));s.length||(s=[e[0].id],a[s[0]]={x:0,y:0}),r.push({ids:s,positions:Object.fromEntries(s.map(e=>[e,a[e]]))});let c=new Set(s);i=i.filter(e=>!c.has(e.id))}return{plates:r,left:i.map(e=>e.id)}}var rT={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},iT={sliced:[`bg-ok`,`sliced`],stale:[`bg-warn`,`changed since slicing`],failed:[`bg-danger`,`failed`]};function aT({n:e,on:t,state:n,onClick:r}){let[i,a]=iT[n]||[];return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-pressed":t,"aria-label":`Plate ${e}${a?`, ${a}`:``}`,onClick:r,className:E(`num relative h-9 min-w-9 rounded-lg border px-3 text-[14px] font-medium transition-colors`,t?`border-ink bg-ink text-ink-contrast`:`border-rule hover:border-muted`),children:[e,i&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-panel`,i),"aria-hidden":!0})]})}function oT({name:e,value:t,disabled:n,onChange:r}){let i=`grid size-7 place-items-center rounded-md text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-lg bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:n||t<=1,onClick:()=>r(t-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-6 text-center text-[13px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:n||t>=50,onClick:()=>r(t+1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-3`,"aria-hidden":!0})})]})}function sT({name:e,others:t,canAdd:n,onMove:r,onRemove:a}){let{portal:o}=i(),s=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[disabled]:cursor-default data-[disabled]:opacity-50 data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Za,{children:[/* @__PURE__ */ (0,V.jsx)($a,{"aria-label":`More for ${e}`,className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(eo,{container:o,children:/* @__PURE__ */ (0,V.jsxs)(no,{align:`end`,sideOffset:4,className:`z-50 min-w-[220px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t.map(e=>/* @__PURE__ */ (0,V.jsxs)(ro,{className:s,onSelect:()=>r(e.id),children:[`Move to plate `,e.n]},e.id)),/* @__PURE__ */ (0,V.jsx)(ro,{className:s,disabled:!n,onSelect:()=>r(`new`),children:`Move to a new plate`}),/* @__PURE__ */ (0,V.jsx)(io,{className:`my-1 h-px bg-rule`}),/* @__PURE__ */ (0,V.jsx)(ro,{className:E(s,`text-danger`),onSelect:a,children:`Remove from this plate`})]})})]})}var cT=e=>e?`${e.map(e=>e.toFixed(1)).join(` × `)} mm`:null;function lT({plates:e,selected:t,files:n,loading:r,summary:i,onSelectPlate:a,onNewPlate:o,onRemovePlate:s,onSettingsForAll:c,onFiles:l,onChoose:u,onSelectFile:d,onCopies:f,onMove:p,onRemove:m}){let{getRootProps:h,getInputProps:g,isDragActive:_}=OC({accept:rT,multiple:!0,noClick:!0,noKeyboard:!0,noDragEventsBubbling:!0,onDrop:e=>{e.length&&l(e)}}),v=e.find(e=>e.id===t),y=n.reduce((e,t)=>e+t.copies,0),b=e.filter(e=>e.id!==t);return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:1,title:`Plates`,done:y>0,aside:y?`${y} ${y===1?`object`:`objects`}`:void 0,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-1.5`,children:[e.map(e=>/* @__PURE__ */ (0,V.jsx)(aT,{n:e.n,on:e.id===t,state:e.state,onClick:()=>a(e.id)},e.id)),/* @__PURE__ */ (0,V.jsx)(j,{label:`New plate`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,"aria-label":`New plate`,disabled:e.length>=10,onClick:o,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...h(),className:E(`rounded-xl outline-none`,_&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{...g()}),n.length||r.length?/* @__PURE__ */ (0,V.jsxs)(`ul`,{className:`space-y-1.5`,children:[n.map(t=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex items-center gap-1.5 rounded-xl border bg-raise py-1 pr-1 pl-1 transition-colors`,t.on?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":t.on||void 0,onClick:()=>d(t.firstId),className:`flex min-w-0 flex-1 items-center gap-2.5 rounded-lg py-1.5 pl-2 text-left`,children:[/* @__PURE__ */ (0,V.jsx)(te,{className:E(`size-5 shrink-0`,t.on?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:t.name,children:t.name}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[12px] text-muted`,children:t.cad?`Placed by the slicer`:cT(t.size)})]})]}),/* @__PURE__ */ (0,V.jsx)(oT,{name:t.name,value:t.copies,disabled:t.cad,onChange:e=>f(t.fileId,e)}),/* @__PURE__ */ (0,V.jsx)(sT,{name:t.name,others:b,canAdd:e.length<10,onMove:e=>p(t.fileId,e),onRemove:()=>m(t.fileId)})]},t.fileId)),r.map((e,t)=>/* @__PURE__ */ (0,V.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl border border-dashed border-rule px-3 py-2.5 text-[13px] text-muted`,children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`truncate`,children:[`Reading `,e]})]},`${e}-${t}`))]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:u,className:E(`flex w-full flex-col items-center gap-2 rounded-xl border-2 border-dashed border-rule px-4 py-6 text-center transition-colors hover:border-muted`,_&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[14px] font-medium`,children:_?`Drop the files to place them`:`Drop models here, or choose them`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:`STL, 3MF, OBJ, STEP or IGES, up to 10 files of 50 MB each`})]})]}),i&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:E(`mt-2.5 text-[13px]`,i.warn?`text-warn`:`text-muted`),children:i.text}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1`,children:[(n.length>0||r.length>0)&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:u,children:[/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0}),` Add files`]}),e.length>1&&v&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:c,children:`Use these settings for all plates`}),/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`ghost`,className:`h-8 px-2.5 text-[13px] text-danger`,onClick:()=>s(v.id),children:[`Remove plate `,v.n]})]})]})]})}var uT=e=>String(Math.round(e*10)/10);function dT({label:e,value:t,unit:n,onCommit:r}){let[i,a]=(0,B.useState)(uT(t));return(0,B.useEffect)(()=>a(uT(t)),[t]),/* @__PURE__ */ (0,V.jsxs)(`label`,{className:`flex h-9 min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-rule bg-panel px-2.5 focus-within:border-muted`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:e}),/* @__PURE__ */ (0,V.jsx)(`input`,{inputMode:`decimal`,"aria-label":e,value:i,onChange:e=>a(e.target.value),onBlur:()=>{let e=parseFloat(i.replace(`,`,`.`));Number.isFinite(e)&&Math.abs(e-t)>.04?r(e):a(uT(t))},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(a(uT(t)),e.currentTarget.blur())},className:`num min-w-0 flex-1 bg-transparent text-right text-[14px] outline-none`}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[12px] text-muted`,children:n})]})}var fT=`h-8 px-2.5 text-[13px]`;function pT({n:e,item:t,copy:n,problem:r,layMode:i,canArrange:a,onLayMode:o,onMoveTo:s,onSpin:c,onSpinBy:l,onTip:u,onReset:d,onCentre:f,onArrange:p}){let m=t?`${t.name}${n&&n.of>1?`, copy ${n.k} of ${n.of}`:``}`:void 0;return/* @__PURE__ */ (0,V.jsxs)(Fw,{n:e,title:`Position`,done:!!t&&!r,aside:m,children:[!t&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Click an object on the plate, or in the list, to move or turn it. Drag it on the plate to move it.`}),t&&t.cad&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`STEP and IGES files are placed by the slicer, in the middle of the bed, as the file has them.`}),t&&!t.cad&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Where`,hint:`mm, from the printer's origin`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(dT,{label:`X`,value:t.at[0],unit:`mm`,onCommit:e=>s(e,t.at[1])}),/* @__PURE__ */ (0,V.jsx)(dT,{label:`Y`,value:t.at[1],unit:`mm`,onCommit:e=>s(t.at[0],e)})]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Spin`,hint:`about the plate`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(`div`,{className:`w-[104px] shrink-0`,children:/* @__PURE__ */ (0,V.jsx)(dT,{label:`Spin`,value:t.spin,unit:`°`,onCommit:c})}),[-90,-15,15,90].map(e=>/* @__PURE__ */ (0,V.jsxs)(zw,{className:E(fT,`num min-w-0 flex-1 justify-center px-1`),onClick:()=>l(e),"aria-label":`Spin ${e>0?`left`:`right`} ${Math.abs(e)} degrees`,children:[e>0?`+${e}`:e,`°`]},e))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Turn`,hint:t.size?`${t.size.map(e=>e.toFixed(1)).join(` × `)} mm`:void 0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it toward you, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:()=>u(`forward`),children:`Tip forward`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Tip it onto its side, a quarter turn`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:()=>u(`sideways`),children:`Tip sideways`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Then click a face on the plate to stand the object on it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{className:E(fT,i&&`border-ink bg-ink text-ink-contrast hover:border-ink`),"aria-pressed":i,onClick:()=>o(!i),children:`Lay on face`})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Undo turns`,onClick:d,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-4`,"aria-hidden":!0})})})]})}),r&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-danger`,role:`status`,children:r})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,children:[t&&!t.cad&&/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,onClick:f,children:`Centre`}),/* @__PURE__ */ (0,V.jsx)(zw,{className:fT,disabled:!a,onClick:p,children:`Arrange plate`})]})]})}var mT=1,hT=.9,gT=.8,_T=.17,vT=.1,yT=.999,bT=.9999,xT=.99,ST=/[\\\/_+.#"@\[\(\{&]/,CT=/[\\\/_+.#"@\[\(\{&]/g,wT=/[\s-]/,TT=/[\s-]/g;function ET(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?mT:xT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ET(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=mT:ST.test(e.charAt(l-1))?(d*=gT,p=e.slice(i,l-1).match(CT),p&&i>0&&(d*=yT**+p.length)):wT.test(e.charAt(l-1))?(d*=hT,m=e.slice(i,l-1).match(TT),m&&i>0&&(d*=yT**+m.length)):(d*=_T,i>0&&(d*=yT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=bT)),(d<vT&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ET(e,t,n,r,l+1,a+2,o),f*vT>d&&(d=f*vT)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function DT(e){return e.toLowerCase().replace(TT,` `)}function OT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ET(e,t,DT(e),DT(t),0,0,{})}var kT=`[cmdk-group=""]`,AT=`[cmdk-group-items=""]`,jT=`[cmdk-group-heading=""]`,MT=`[cmdk-item=""]`,NT=`${MT}:not([aria-disabled="true"])`,PT=`cmdk-item-select`,FT=`data-value`,IT=(e,t,n)=>OT(e,t,n),LT=B.createContext(void 0),RT=()=>B.useContext(LT),zT=B.createContext(void 0),BT=()=>B.useContext(zT),VT=B.createContext(void 0),HT=B.forwardRef((e,t)=>{let n=nE(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=nE(()=>/* @__PURE__ */ new Set),i=nE(()=>/* @__PURE__ */ new Map),a=nE(()=>/* @__PURE__ */ new Map),o=nE(()=>/* @__PURE__ */ new Set),s=eE(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=N(),b=N(),x=N(),S=B.useRef(null),C=aE();tE(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),tE(()=>{C(6,A)},[]);let w=B.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=B.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??IT;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(AT);t?t.appendChild(e.parentElement===t?e:e.closest(`${AT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${AT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${kT}[${FT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(FT);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(kT)?.querySelector(jT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${MT}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(NT)||[])}function P(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(FT))}function F(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(FT))}function I(e){let t=j()?.closest(kT),n;for(;t&&!n;)t=e>0?QT(t,kT):$T(t,kT),n=t?.querySelector(NT);n?w.setState(`value`,n.getAttribute(FT)):F(e)}let ee=()=>P(M().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?I(1):F(1)},ne=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return B.createElement(p.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(PT);t.dispatchEvent(e)}}}}},B.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:cE},c),sE(e,e=>B.createElement(zT.Provider,{value:w},B.createElement(LT.Provider,{value:T},e))))}),UT=B.forwardRef((e,t)=>{let n=N(),r=B.useRef(null),i=B.useContext(VT),a=RT(),o=eE(e),s=o.current?.forceMount??i?.forceMount;tE(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=iE(n,r,[e.value,e.children,r],e.keywords),l=BT(),u=rE(e=>e.value&&e.value===c.current),f=rE(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);B.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(PT,m),()=>t.removeEventListener(PT,m)},[f,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function h(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return B.createElement(p.div,{ref:d(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!u,"data-disabled":!!g,"data-selected":!!u,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),WT=B.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=N(),s=B.useRef(null),c=B.useRef(null),l=N(),u=RT(),f=rE(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));tE(()=>u.group(o),[]),iE(o,s,[e.value,e.heading,c]);let m=B.useMemo(()=>({id:o,forceMount:i}),[i]);return B.createElement(p.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&B.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),sE(e,e=>B.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},B.createElement(VT.Provider,{value:m},e))))}),GT=B.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=B.useRef(null),a=rE(e=>!e.search);return!n&&!a?null:B.createElement(p.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),KT=B.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=BT(),o=rE(e=>e.search),s=rE(e=>e.selectedItemId),c=RT();return B.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),B.createElement(p.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qT=B.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=B.useRef(null),o=B.useRef(null),s=rE(e=>e.selectedItemId),c=RT();return B.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),B.createElement(p.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},sE(e,e=>B.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),JT=B.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return B.createElement(Jr,{open:n,onOpenChange:r},B.createElement(Qr,{container:o},B.createElement(ei,{"cmdk-overlay":``,className:i}),B.createElement(ii,{"aria-label":e.label,"cmdk-dialog":``,className:a},B.createElement(HT,{ref:t,...s}))))}),YT=B.forwardRef((e,t)=>rE(e=>e.filtered.count===0)?B.createElement(p.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),XT=B.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return B.createElement(p.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sE(e,e=>B.createElement(`div`,{"aria-hidden":!0},e)))}),ZT=Object.assign(HT,{List:qT,Item:UT,Input:KT,Group:WT,Separator:GT,Dialog:JT,Empty:YT,Loading:XT});function QT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $T(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eE(e){let t=B.useRef(e);return tE(()=>{t.current=e}),t}var tE=typeof window>`u`?B.useEffect:B.useLayoutEffect;function nE(e){let t=B.useRef();return t.current===void 0&&(t.current=e()),t}function rE(e){let t=BT(),n=()=>e(t.snapshot());return B.useSyncExternalStore(t.subscribe,n,n)}function iE(e,t,n,r=[]){let i=B.useRef(),a=RT();return tE(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(FT,s),i.current=s}),i}var aE=()=>{let[e,t]=B.useState(),n=nE(()=>/* @__PURE__ */ new Map);return tE(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function oE(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function sE({asChild:e,children:t},n){return e&&B.isValidElement(t)?B.cloneElement(oE(t),{ref:t.ref},n(t.props.children)):n(t)}var cE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function lE(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function uE({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,B.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,V.jsxs)(_o,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,V.jsx)(yo,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted disabled:opacity-50`,l),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,V.jsx)(BC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:f,children:/* @__PURE__ */ (0,V.jsx)(To,{align:`start`,sideOffset:6,className:`z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsxs)(ZT,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,V.jsx)(ww,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(ZT.Input,{placeholder:a,className:`h-10 w-full bg-transparent text-[14px] outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,V.jsxs)(ZT.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,V.jsx)(ZT.Empty,{className:`px-3 py-6 text-center text-[13px] text-muted`,children:o}),lE(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,V.jsxs)(ZT.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-[14px] data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(MC,{className:E(`size-4 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num ml-auto shrink-0 text-[12px] text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,V.jsx)(ZT.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var dE=`__empty`;function fE({value:e,onChange:t,options:n,label:r,className:i}){return/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":r,value:e===``?dE:String(e),onValueChange:e=>{e&&t(e===dE?``:e)},className:E(`grid auto-cols-fr grid-flow-col rounded-lg bg-raise p-0.5`,i),children:n.map(e=>/* @__PURE__ */ (0,V.jsx)(Kc,{value:e.value===``?dE:String(e.value),className:`num h-8 rounded-md px-2 text-[13px] text-muted transition-colors hover:text-ink data-[state=on]:bg-panel data-[state=on]:text-ink data-[state=on]:shadow-[0_1px_2px_rgb(0_0_0/0.08)]`,children:e.label},e.value))})}var pE={BBL:`Bambu Lab`},mE=e=>pE[e]||e,hE=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function gE(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:mE(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:_E(e)})).sort(hE)})).sort(hE)}function _E(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||hE(e,t))}function vE(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var yE=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function bE(e){return e.isLoading?`Loading printers…`:e.error?`The full printer list didn’t load, so only our printers are listed.`:null}function xE({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=e.data,a=(0,B.useMemo)(()=>i&&n?vE(i,n):null,[i,n]),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``);(0,B.useEffect)(()=>{a?(s(a.brand.id),l(a.model.id)):n===``&&(s(``),l(``))},[a,n]);let u=i&&i.find(e=>e.id===o),d=u&&u.models.find(e=>e.id===c),f=(e,t=u)=>{let n=t.models.find(t=>t.id===e);l(e),r(yE(n).name)},p=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));s(e),l(``);let t=i.find(t=>t.id===e);t.models.length===1?f(t.models[0].id,t):r(null)},m=[...t.map(e=>({...e,group:`Our printers`})),...(i||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],h=bE(e),g=t.find(e=>e.value===`printer:${n}`),_=d?`${u.label} ${d.label}`:u?.label??g?.label;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:3,title:`Printer`,done:n!==null,aside:_,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Brand`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Printer brand`,value:a||!g?o:g.value,onChange:p,items:m,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!m.length})}),h&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:h}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:u&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Model`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Printer model`,value:c,onChange:e=>f(e),placeholder:`Choose a ${u.label} model`,items:u.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),d&&/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Nozzle size`,value:n||``,onChange:r,className:d.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:d.nozzles.map(e=>({value:e.name,label:e.label}))})})]},u.id)})]})})}var SE=`__empty`;function CE({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,V.jsxs)(Yo,{value:e===``?SE:e,onValueChange:e=>t(e===SE?``:e),children:[/* @__PURE__ */ (0,V.jsxs)(Zo,{"aria-label":r,className:E(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted`,a),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,V.jsx)($o,{})}),/* @__PURE__ */ (0,V.jsx)(es,{children:/* @__PURE__ */ (0,V.jsx)(PC,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,V.jsx)(rs,{container:o,children:/* @__PURE__ */ (0,V.jsx)(as,{position:`popper`,sideOffset:6,className:`z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,V.jsx)(_s,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,V.jsxs)(Cs,{value:e.value===``?SE:e.value,className:`relative flex cursor-pointer items-center rounded-md py-2 pr-2.5 pl-8 text-[14px] outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,V.jsx)(Ds,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,V.jsx)(MC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(Ts,{children:e.label})]},e.value))})})})]})}function wE({settings:e,onChange:t,options:n}){let[r,i]=(0,B.useState)(!1),a=n.data,o=a?a.materials:[e.material],s=o.map(e=>({value:e,label:e})),c=e.process||e.filament;return/* @__PURE__ */ (0,V.jsx)(Fw,{n:4,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Material`,children:o.length>8?/* @__PURE__ */ (0,V.jsx)(uE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:s,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,V.jsx)(CE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:s})}),a&&/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex items-center gap-1 text-[13px] font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,V.jsx)(IC,{className:E(`size-4 transition-transform`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,c&&!r?`, changed`:``]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Process`,children:/* @__PURE__ */ (0,V.jsx)(CE,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${a.defaultProcess?` (${a.defaultProcess})`:``}`},...a.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Filament`,hint:`${a.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,V.jsx)(uE,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...a.filaments.map(e=>({value:e.name,label:e.name}))]})})]})})})]})]})})}function TE({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:d?`num text-[13px] font-semibold`:`text-[13px] text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Back to default`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(gw,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,V.jsxs)(Ys,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,V.jsx)(nc,{className:`relative h-2 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(ic,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-valuetext":d?a(Number(n)):s,className:d?`block size-5 rounded-full border-2 border-accent bg-panel shadow-sm`:`block size-5 rounded-full border-2 border-rule bg-panel`})]}),c&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`grid text-[11px] text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,V.jsx)(`span`,{className:a,children:e},i)})})]})}var EE={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},DE=[10,15,20,30,40,50,60,70,80,90];function OE(e,t,n=[0,0,0]){let r={filename:e.name,size:e.size};for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`mode`])t[e]!=null&&t[e]!==``&&(r[e]=t[e]);return t.supports&&(r.supports=t.supports===`true`),t.gcode&&(r.gcode=!0),t.plate&&(r.plate=!0),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&(r[e]=n[t])}),r}var kE=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],AE=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],jE=[1,2,3,4,5,6],ME={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function NE(e){let t=kE.filter(t=>e.includes(t.id)),n=e.filter(e=>!kE.some(t=>t.id===e)).map(e=>({id:e,hint:``}));return[...t,...n]}var PE=(e,t)=>({uploading:`Uploading`,waiting:`Waiting for a free slot`})[e]||t;function FE(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function IE(e,t){return e===`ABS`&&FE(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}function LE(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function RE(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var zE=e=>Math.round(e*100)/100;function BE(e,t){return e==null?null:t?{low:Math.floor(zE(e)),high:Math.ceil(zE(e*(100+t)/100))}:{low:e,high:e}}function VE(e,t){if(!t)return{low:e,high:e};let n=BE(e/60,t);return{low:n.low*60,high:n.high*60}}function HE(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return e.low===e.high?n(e.low):`${n(e.low)} – ${n(e.high)}`}var UE=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function WE(e){return e.low===e.high?RE(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${RE(e.low)} – ${RE(e.high)}`}function GE(e,t,n,r){let i=zE(e.weightG*t),a=e.seconds*t,o=r&&r.range;return{grams:i,seconds:a,currency:n?n.currency:null,range:n?{low:n.min*t,high:n.max*t}:null,gramsRange:BE(i,o),secondsRange:VE(a,o)}}function KE(e,t){let n=e.map(e=>GE(e.stats,e.copies,e.price,t)),r=[...new Set(e.filter(e=>!e.price).map(e=>e.material))],i=e=>zE(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:n.map(e=>e.currency).find(Boolean)??null,unpriced:r,range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var qE=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],JE=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],YE=e=>`${e} ${e===1?`wall`:`walls`}`;function XE({settings:e,onChange:t}){return/* @__PURE__ */ (0,V.jsx)(Fw,{n:5,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:qE})}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Infill`,values:DE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Walls`,values:jE,value:e.walls,onChange:e=>t({walls:e}),format:YE,defaultValue:3,defaultLabel:`Printer default`}),/* @__PURE__ */ (0,V.jsx)(Iw,{label:`Supports`,children:/* @__PURE__ */ (0,V.jsx)(fE,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:JE})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Default keeps the printer’s own process, and the shop’s setting for supports.`})]})})}function ZE(e){let[t,n]=(0,B.useState)(()=>matchMedia(e).matches);return(0,B.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function QE({theme:e,onTheme:t}){let n=ZE(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`relative inline-flex h-7 w-[52px] shrink-0 items-center rounded-full bg-raise p-0.5 transition-colors hover:bg-rule`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{"aria-hidden":!0,className:E(`absolute top-0.5 left-0.5 size-6 rounded-full bg-accent transition-transform duration-200`,r&&`translate-x-6`)}),/* @__PURE__ */ (0,V.jsx)(Ew,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(fw,{className:E(`relative z-10 m-1 size-4 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function $E(e){let[t,n]=(0,B.useState)(Date.now);return(0,B.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function eD({plates:e,position:t,settings:n,onSettings:r,printers:i,ourPrinters:a=[],options:o,toSlice:s,slicingSince:c,phase:l,blocker:u,onSlice:d,onOpenGcode:f,theme:p,onTheme:m}){let h=$E(c);return/* @__PURE__ */ (0,V.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel md:min-h-0 md:w-[340px] md:shrink-0 md:border-r lg:w-[380px]`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`md:min-h-0 md:flex-1 md:overflow-y-auto`,children:[/* @__PURE__ */ (0,V.jsx)(lT,{...e}),/* @__PURE__ */ (0,V.jsx)(pT,{n:2,...t}),/* @__PURE__ */ (0,V.jsx)(xE,{printers:i,ourPrinters:a,printer:n.printer,onChange:e=>r({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,V.jsx)(wE,{settings:n,onChange:r,options:o}),/* @__PURE__ */ (0,V.jsx)(XE,{settings:n,onChange:r})]}),/* @__PURE__ */ (0,V.jsxs)(`footer`,{className:`sticky bottom-0 border-t border-rule bg-panel px-5 py-4`,children:[u&&!c&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-2.5 text-[13px] text-muted`,children:u}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Open G-code`,side:`top`,children:/* @__PURE__ */ (0,V.jsx)(zw,{size:`icon`,className:`size-11`,"aria-label":`Open G-code`,onClick:f,children:/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-[18px]`,"aria-hidden":!0})})}),m&&/* @__PURE__ */ (0,V.jsx)(QE,{theme:p,onTheme:m}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`primary`,size:`lg`,className:`min-w-0 flex-1 justify-center px-3`,disabled:!!u||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] shrink-0 animate-spin`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:PE(l,`Slicing`)}),` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[h,` s`]})]}):/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`size-[18px] shrink-0`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`truncate`,children:s>1?`Slice ${s} plates`:`Slice plate`})]})})]})]})]})}var tD=e=>{let t=ge.indexOf(e);return t<0?ge.length-1:t};function nD({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>tD(e.name)-tD(t.name)),s=e.map((e,t)=>t),c=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:E(`overflow-hidden rounded-xl border border-rule bg-panel/90 backdrop-blur`,r?`w-64`:`w-auto`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-[14px] font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,V.jsx)(PC,{className:E(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,V.jsx)(Uy,{initial:!1,children:r&&/* @__PURE__ */ (0,V.jsxs)(Ix.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.2,ease:`easeOut`},children:[/* @__PURE__ */ (0,V.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,V.jsx)(`li`,{children:/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:t=>c(t,e.i),"aria-pressed":!n,className:E(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`size-3 shrink-0 rounded-[3px]`,style:{background:me(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:he(e.name)}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[12px] text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,V.jsx)(XC,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,V.jsx)(QC,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`border-t border-rule px-3.5 py-2 text-[12px] text-muted`,children:t.size?/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function rD(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function iD({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-md bg-ink px-2 py-1 text-ink-contrast shadow-sm`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[11px] opacity-70`,children:[t.toFixed(2),` mm`]})]})}function aD({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,B.useMemo)(()=>rD(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,V.jsx)(`div`,{className:E(`flex rounded-xl border border-rule bg-panel/90 backdrop-blur`,i?`h-full w-16 flex-col items-center py-4`:`h-14 w-full items-center px-5`),children:/* @__PURE__ */ (0,V.jsxs)(Ys,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:E(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,V.jsx)(nc,{className:E(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,V.jsx)(ic,{className:E(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,V.jsxs)(`span`,{className:E(`pointer-events-none absolute flex items-center gap-1 text-[10px] text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:E(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,V.jsx)(iD,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,V.jsx)(dc,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,V.jsx)(iD,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var oD=e=>e==null?null:`${+e.toFixed(3)} mm`;function sD(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return[n&&`${n}h`,(n||r)&&`${r}m`,`${i}s`].filter(Boolean).join(` `)}function cD(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function lD({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num display text-[20px] leading-none font-semibold whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`ml-0.5 text-[13px] font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:n})]})}function uD({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,oD(n.layerHeight)],[`Nozzle`,oD(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,cD(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,V.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-[13px]`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,V.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,V.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function dD({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&sD(o.seconds);return/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-start gap-3 rounded-xl border border-rule bg-panel/90 px-4 py-3 backdrop-blur lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,V.jsx)(lD,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,V.jsx)(lD,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,V.jsx)(lD,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,V.jsx)(lD,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,V.jsxs)(_o,{children:[/* @__PURE__ */ (0,V.jsx)(j,{label:`Print details`,children:/* @__PURE__ */ (0,V.jsx)(yo,{asChild:!0,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`ml-auto grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-[18px]`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(To,{side:`top`,align:`start`,sideOffset:10,className:`z-50 w-80 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mb-3 text-[14px] font-semibold`,children:`Print details`}),n&&/* @__PURE__ */ (0,V.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-3 aspect-[4/3] w-full rounded-lg bg-viewer object-contain`}),/* @__PURE__ */ (0,V.jsx)(uD,{result:e,quote:t})]})})]})]})}function fD(){let{layout:e}=i(),[t,n]=(0,B.useState)(()=>({width:e.clientWidth,height:e.clientHeight}));return(0,B.useEffect)(()=>{let t=new ResizeObserver(()=>n(t=>t.width===e.clientWidth&&t.height===e.clientHeight?t:{width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[e]),t}var pD=(0,B.lazy)(()=>import(`./chunks/Viewer3D-MGmKZLAb.js`)),mD=(0,B.lazy)(()=>import(`./chunks/PlateEditor-BbouIi-O.js`)),hD=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function gD({children:e}){return/* @__PURE__ */ (0,V.jsx)(Ix.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2},className:`absolute top-1/2 left-1/2 z-20 w-[min(360px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-6 text-center`,children:e})}function _D({slicing:e}){let t=$E(e.since);return/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`mx-auto size-7 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold`,children:e.title}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:e.printer}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(Ix.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`num mt-2 text-[12px] text-muted`,children:[t,` s`]})]})}function vD({title:e,text:t,onChooseModel:n,onOpenGcode:r}){return/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`pointer-events-auto max-w-sm rounded-2xl bg-panel/85 p-5 text-center backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ow,{className:`mx-auto size-9 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`display mt-3 text-[18px] font-semibold`,children:e}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2 text-[14px] text-muted`,children:t}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-center gap-2`,children:[n&&/* @__PURE__ */ (0,V.jsxs)(zw,{variant:`primary`,onClick:n,children:[/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-4`,"aria-hidden":!0}),` Choose models`]}),/* @__PURE__ */ (0,V.jsxs)(zw,{onClick:r,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function yD({mode:e,onMode:t}){return/* @__PURE__ */ (0,V.jsx)(fE,{label:`Prepare or preview`,value:e,onChange:t,className:`w-[188px] border border-rule bg-panel/90 backdrop-blur`,options:[{value:`prepare`,label:`Prepare`},{value:`preview`,label:`Preview`}]})}function bD({label:e,pressed:t,onClick:n,children:r,...i}){return/* @__PURE__ */ (0,V.jsx)(j,{label:e,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,onClick:n,...i,className:E(`grid size-9 place-items-center rounded-lg border border-rule bg-panel/90 text-muted backdrop-blur hover:text-ink`,t&&`border-ink text-ink`),children:r})})}function xD({gcode:e,slicing:t,mode:n,onMode:r,editor:i,emptyPlate:a,note:o,onChooseModel:s,onOpenGcode:c}){let{status:l,result:u}=e,d=l===`ready`,f=fD(),p=f.width>=1024,m=f.height<520,h=f.width<768?Math.max(300,Math.round(Math.min(f.height,window.innerHeight)*.58)):void 0,g=ox(),[_,v]=(0,B.useState)([1,1]),[y,b]=(0,B.useState)(()=>/* @__PURE__ */ new Set),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(`iso`),[T,E]=(0,B.useState)(0),[D,O]=(0,B.useState)(p&&!m),k=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!u)return;let e=Math.max(1,u.layers.length);if(b(/* @__PURE__ */ new Set),w(`iso`),g||e<3){v([1,e]);return}v([1,1]);let t=Fx(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>v([1,Math.round(e)])});return k.current=t,()=>t.stop()},[u,g]);let A=n===`preview`,M=A&&d,N=(0,B.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,B.useEffect)(()=>()=>{N&&URL.revokeObjectURL(N)},[N]),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative flex min-h-0 flex-col md:h-full`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`relative overflow-hidden bg-viewer md:flex-1`,style:{height:h},children:[M&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(pD,{result:u,layerMin:_[0]-1,layerMax:_[1]-1,hidden:y,showTravels:x,view:C,fitKey:T})})}),!A&&i&&/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(mD,{...i})}),!A&&a&&!t&&/* @__PURE__ */ (0,V.jsx)(vD,{title:`Put models on the plate`,onChooseModel:s,onOpenGcode:c,text:`Drop models anywhere on the page (STL, 3MF, OBJ, STEP or IGES), or choose them. Each lands where there is room, then you can move it.`}),!A&&o&&!t&&/* @__PURE__ */ (0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-16 z-10 flex justify-center px-4`,children:/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-md rounded-xl bg-panel/90 px-4 py-2.5 text-center text-[13px] text-muted backdrop-blur`,children:o})}),A&&l===`empty`&&!t&&/* @__PURE__ */ (0,V.jsx)(vD,{title:`Slice a plate to see how it prints`,onOpenGcode:c,text:`Its G-code shows here, layer by layer. Already have G-code or a sliced 3MF? Open it to inspect it.`}),t&&/* @__PURE__ */ (0,V.jsx)(_D,{slicing:t}),A&&l===`loading`&&!t&&/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[15px] font-semibold`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),A&&l===`error`&&!t&&/* @__PURE__ */ (0,V.jsxs)(gD,{children:[/* @__PURE__ */ (0,V.jsx)(ne,{className:`mx-auto size-7 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[14px]`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(zw,{onClick:c,children:`Open another file`}),/* @__PURE__ */ (0,V.jsx)(zw,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 left-3 z-20 flex flex-col items-start gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(yD,{mode:n,onMode:r}),M&&/* @__PURE__ */ (0,V.jsx)(nD,{features:u.features,hidden:y,onHidden:b,open:D,onOpen:O})]}),M&&/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,V.jsx)(fE,{label:`View`,value:C,onChange:e=>{w(e),E(e=>e+1)},options:hD,className:`w-40 border border-rule bg-panel/90 backdrop-blur`}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,V.jsx)(bD,{label:x?`Hide travel moves`:`Show travel moves`,pressed:x,onClick:()=>S(e=>!e),children:/* @__PURE__ */ (0,V.jsx)(vw,{className:`size-[18px]`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(bD,{label:`Fit to model`,onClick:()=>E(e=>e+1),children:/* @__PURE__ */ (0,V.jsx)(Sw,{className:`size-[18px]`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:p?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,V.jsx)(aD,{layers:u.layers,fallbackZ:u.bounds?u.bounds.max[2]:0,value:_,vertical:p,onChange:e=>{k.current?.stop(),v(e)}})})]})]}),M&&/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-xl border border-rule bg-panel/90 py-1.5 pr-1.5 pl-3 backdrop-blur`,children:[/* @__PURE__ */ (0,V.jsx)(ew,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`max-w-[220px] truncate text-[13px] font-medium`,title:e.name,children:e.name}),N&&/* @__PURE__ */ (0,V.jsx)(j,{label:`Download G-code`,children:/* @__PURE__ */ (0,V.jsx)(`a`,{href:N,download:e.name,"aria-label":`Download G-code`,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(KC,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,V.jsx)(j,{label:`Close`,children:/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(Aw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,V.jsx)(dD,{result:u,quote:e.quote,thumbnail:e.thumbnail})]})]})}var SD=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function CD(e,{body:t,csrf:n,...r}={}){let i={Accept:`application/json`};t&&(i[`Content-Type`]=`application/json`),n&&(i[`X-CSRF-TOKEN`]=n);let a=await fetch(e,{...r,headers:i,...t&&{body:JSON.stringify(t)}}).catch(()=>{throw Error(`The server can’t be reached.`)}),o=null;try{o=await a.json()}catch{}if(!a.ok){let e=Number(a.headers.get(`Retry-After`))||void 0;throw Object.assign(Error(o&&o.message||`Request failed (HTTP ${a.status})`),{status:a.status,retryAfter:e})}return o}var wD=e=>({401:`Sign in to slice`,403:`Your account can’t slice models`,419:`Your session has expired. Reload the page`})[e]||null;function TD(e,t){return e?t.error?t.error.status===503?`Slicing is off on this server`:wD(t.error.status)||`The server can’t be reached`:t.data&&!t.data.slicer?`Slicing is off on this server`:null:`Slicing isn’t set up on this page`}var ED=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],DD=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function OD(e){if(typeof e!=`string`||!e.trim())return null;try{let{protocol:t}=new URL(e.trim(),`https://page.invalid/`);return t===`https:`||t===`http:`?e.trim():null}catch{return null}}function kD(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!DD(n))return t(`config must be an object`),{};let{realtime:r,staffApi:i,contact:a,defaultPrinter:o,defaults:s,cards:c,button:l,advanced:u,...d}=n;for(let e of Object.keys(d))t(`unknown config key "${e}" left out`);let f={};if(r!==void 0){let{key:e,host:n,port:i,cluster:a,tls:o}=DD(r)?r:{};typeof e==`string`&&e.trim()?(f.realtime={key:e.trim()},typeof n==`string`&&n.trim()&&(f.realtime.host=n.trim()),Number.isInteger(i)&&i>0&&(f.realtime.port=i),typeof a==`string`&&a.trim()&&(f.realtime.cluster=a.trim()),typeof o==`boolean`&&(f.realtime.tls=o)):t(`realtime left out: it needs a key`)}if(i!==void 0){let{url:e,csrfToken:n}=DD(i)?i:{};typeof e==`string`&&e.trim()?f.staffApi={url:e.trim(),csrfToken:typeof n==`string`?n.trim():``}:t(`staffApi left out: it needs a url`)}if(DD(a)&&(f.contact={},typeof a.name==`string`&&(f.contact.name=a.name.trim()),typeof a.email==`string`&&a.email.includes(`@`)?f.contact.email=a.email.trim():a.email!==void 0&&t(`contact.email "${a.email}" left out: it is not an email address`)),typeof o==`string`&&o.trim()&&(f.defaultPrinter=o.trim()),DD(s)){f.defaults={},typeof s.material==`string`&&(f.defaults.material=s.material.toUpperCase());let e=(e,n)=>{n.includes(s[e])?f.defaults[e]=s[e]:s[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,AE.map(e=>e.id)),e(`infill`,DE),e(`walls`,jE)}if(Array.isArray(c)){f.cards=c.filter(e=>ED.includes(e));for(let e of c)ED.includes(e)||t(`card "${e}" left out: it must be one of ${ED.join(`, `)}`);!f.cards.includes(`model`)&&!f.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),f.cards.push(`model`))}if(l!==void 0){let e=DD(l)&&typeof l.label==`string`?l.label.trim():``;if(!e||e.length>40)t(`button left out: it needs a label of 1 to 40 characters`);else if(f.button={label:e},l.url!==void 0){let e=OD(l.url);e?f.button.url=e:t(`button.url "${l.url}" left out: it must be an http(s) or relative address`)}}if(u!==void 0){let e=e=>{let n=DD(u)?u[e]:void 0;return typeof n==`string`&&n.trim()?n.trim():(t(`advanced.${e} must be a URL: Advanced stays closed until it is`),``)};f.advanced={authUrl:e(`authUrl`),verifyUrl:e(`verifyUrl`)}}return f}var AD=e=>new Set(e.cards||ED);function jD(e,t){return{...e,defaultPrinter:t.defaultPrinter||e.defaultPrinter||e.printers&&e.printers[0]||``,regularMode:{...e.regularMode},contact:{...e.contact,...t.contact}}}var MD=5e3,ND=3e4,PD=/* @__PURE__ */ new Map;async function FD({key:t,host:n,port:r=443,cluster:i=`mt1`,tls:a=!0}){let{default:o}=await import(`./chunks/pusher-BoV3x8Qs.js`).then(t=>/* @__PURE__ */ e(t.default,1));return new o(t,{cluster:i,wsHost:n,wsPort:r,wssPort:r,forceTLS:a,enabledTransports:[`ws`,`wss`],disableStats:!0})}function ID(e,t){let n=JSON.stringify(e),r=PD.get(n)||{pusher:t(e),users:0,idle:null};return PD.set(n,r),clearTimeout(r.idle),r.users++,{pusher:r.pusher,release:()=>{--r.users||(r.idle=setTimeout(()=>{PD.delete(n),r.pusher.then(e=>e.disconnect(),()=>{})},ND))}}}function LD(e,t,n,r,i=FD){if(!e)return{ready:Promise.resolve(!1),close:()=>{}};let{pusher:a,release:o}=ID(e,i),s=()=>{};return{ready:a.then(e=>new Promise(i=>{let a=e.subscribe(t),o=null,c=t=>{o!==null&&(clearTimeout(o),o=null,e.connection.bind(`connected`,r),i(t))};o=setTimeout(()=>c(!1),MD),a.bind(`quote.updated`,n),a.bind(`pusher:subscription_succeeded`,()=>c(!0)),a.bind(`pusher:subscription_error`,()=>c(!1)),s=()=>{e.connection.unbind(`connected`,r),a.unbind(),e.unsubscribe(t)}})).catch(()=>!1),close:()=>{s(),o()}}}var RD=6e4,zD=[1e3,2e3,4e3,8e3,15e3,3e4],BD=54e5,VD=60,HD=(e,t)=>t?RD:zD[e]??RD;async function UD(e,t,n,r){let i=()=>CD(e(`/quotes`),{method:`POST`,body:n,csrf:t});try{return await i()}catch(e){if(!e.retryAfter||e.retryAfter>VD)throw e;return r(`waiting`),await new Promise(t=>setTimeout(t,e.retryAfter*1e3)),i()}}async function WD({url:e,fields:t},n){let r=new FormData;Object.entries(t).forEach(([e,t])=>r.append(e,t)),r.append(`file`,n);let i=await fetch(e,{method:`POST`,body:r}).catch(()=>null);if(!i||!i.ok)throw Error(`The file could not be uploaded, please try again`)}async function GD({base:e,csrf:t,realtime:n,file:r,settings:i,rot:a,onStep:o=()=>{},watch:s=LD}){let c=t=>SD(e,t),l=await UD(c,t,OE(r,i,a),o);o(`uploading`);let u,d,f=new Promise((e,t)=>{u=e,d=t});f.catch(()=>{});let p=async()=>{try{let e=await CD(c(`/quotes/${l.id}`));(e.status===`done`||e.status===`failed`)&&u(e)}catch(e){e.status===404?d(/* @__PURE__ */ Error(`This quote has expired, please try again`)):e.status>=400&&e.status<500&&e.status!==429&&d(e)}},m=s(n,l.channel,p,p),h,g,_=!1,v=(e,t)=>{h=setTimeout(async()=>{await p(),_||v(e+1,t)},HD(e,t))};try{let e=await m.ready;e||console.warn(`slicer-studio: live updates are off, so prices are checked every few seconds at first, then each minute. Check the realtime option and connect-src.`),await WD(l.upload,r),o(`working`),await CD(c(`/quotes/${l.id}/start`),{method:`POST`,csrf:t}).catch(e=>{if(e.status!==409)throw e}),v(0,e),g=setTimeout(()=>d(/* @__PURE__ */ Error(`This is taking too long, please try again`)),BD);let n=await f;if(n.status===`failed`)throw Error(n.errorDetail||n.error||`This model could not be priced`);return n}finally{_=!0,clearTimeout(h),clearTimeout(g),m.close()}}async function KD(e,t){let n=await fetch(SD(e,`/quotes/${t}/gcode`)).catch(()=>null);if(!n||!n.ok)throw Error(`The G-code could not be downloaded`);return n.blob()}var qD=()=>{let{apiUrl:e}=i();return t=>SD(e,t)};function JD(){let e=qD(),{config:t}=i();return qt({queryKey:[`config`],queryFn:()=>CD(e(`/config`)),select:e=>jD(e,t)})}function YD(e){let t=qD();return qt({queryKey:[`materials`,e],queryFn:()=>CD(t(`/options?printer=${encodeURIComponent(e)}`)),enabled:!!e})}function XD(){let{apiUrl:e,config:t}=i();return Jt({mutationFn:({model:n,settings:r,rot:i,onStep:a})=>GD({base:e,realtime:t.realtime,file:n,settings:r,rot:i,onStep:a})})}function ZD(){let{staffApi:e}=i().config;return qt({queryKey:[`health`,e?.url],queryFn:()=>CD(SD(e.url,`/health`)),enabled:!!e,staleTime:6e4})}function QD(){let{staffApi:e}=i().config;return qt({queryKey:[`printers`,e?.url],queryFn:()=>CD(SD(e.url,`/printers`)),enabled:!!e,select:e=>gE(e.printers)})}function $D(e,t){let{staffApi:n}=i().config;return qt({queryKey:[`options`,n?.url,e,t],queryFn:()=>CD(SD(n.url,`/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`)),enabled:!!n&&!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}var eO=(e,t)=>({queryKey:[`bed`,e?.url,t],queryFn:()=>CD(SD(e.url,`/options?printer=${encodeURIComponent(t)}`)),enabled:!!e&&!!t});function tO(e){let{staffApi:t}=i().config,n=Gt({queries:e.map(e=>eO(t,e))}),r=e.map((e,t)=>[e,n[t].data&&n[t].data.bed]).filter(([,e])=>e),a=JSON.stringify(r);return(0,B.useMemo)(()=>Object.fromEntries(r),[a])}function nO(){let{staffApi:e,realtime:t}=i().config;return Jt({mutationFn:async({model:n,settings:r,rot:i,onStep:a})=>{let{url:o,csrfToken:s}=e,c=await GD({base:o,csrf:s,realtime:t,file:n,settings:{...r,mode:`exact`,gcode:!0},rot:i,onStep:a});if(!c.hasGcode)throw Error(`No G-code came back for this model`);return{...c,gcode:await KD(o,c.id)}}})}var rO='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),W=(1<<U)-1,ee=S(V,U,1),H=0;H<z;){var G=ee[O(e,g,W)];g+=G&15;var P=G>>4;if(P<16)B[H++]=P;else{var K=0,q=0;for(P==16?(q=3+O(e,g,3),g+=2,K=B[H-1]):P==17?(q=3+O(e,g,7),g+=3):P==18&&(q=11+O(e,g,127),g+=7);q--;)B[H++]=K}}var te=B.subarray(0,L),J=B.subarray(L);x=D(te),C=D(J),y=S(te,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var K=y[k(e,g)&ne],X=K>>4;if(g+=K&15,g>w){l&&N(0);break}if(K||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},W=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?ee(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},ee=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function G(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=W(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}Object.keys({stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`}).map(e=>`.`+e).join(`,`);function K(e,t,n=()=>{}){try{return G(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function q(e,t){let n=K(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=q(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',iO=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,rO],{type:`text/javascript;charset=utf-8`});function aO(e){let t;try{if(t=iO&&(self.URL||self.webkitURL).createObjectURL(iO),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(rO),{type:`module`,name:e?.name})}}function oO(){let[e,t]=(0,B.useState)({status:`empty`}),n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,B.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new aO;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,B.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,B.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var sO=52428800,cO=e=>Math.max(1,Math.ceil(e/2)),lO=e=>Math.floor(e/2),uO={items:[],selected:null},dO=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function fO(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return dO(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return dO(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return dO(e,t.id,e=>({...e,rot:t.rot}));case`result`:return dO(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return dO(e,t.id,e=>({...e,error:t.error}));default:return e}}var pO=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),mO=(e,t)=>!e.result||e.result.sig!==t||!!e.error,hO=[`printer`,`material`,`quality`,`infill`,`walls`,`supports`],gO=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _O(e,t,{isKnown:n,defaultPrinter:r},i,a){let o={...t};if(e===void 0)return o;if(!gO(e))return a(`${i}: settings left out: they must be an object`),o;let s=(t,n)=>a(`${i}: ${t} ${JSON.stringify(e[t])} left out: ${n}`);for(let t of Object.keys(e))hO.includes(t)||a(`${i}: unknown setting "${t}" left out`);let{printer:c,material:l,quality:u,infill:d,walls:f,supports:p}=e;if(c!==void 0){if(typeof c!=`string`||!c.trim())s(`printer`,`it must be a printer name`);else{let e=c.trim();n&&!n(e)&&(a(`${i}: printer "${e}" isn't on this server, so the shop's default is used`),e=r),e&&e!==t.printer&&Object.assign(o,{printer:e,process:``,filament:``})}}if(l!==void 0){let e=typeof l==`string`?l.trim().toUpperCase():``;e?e!==o.material&&Object.assign(o,{material:e,filament:``}):s(`material`,`it must be a material, such as PLA`)}return u!==void 0&&(AE.some(e=>e.id===u)?o.quality=u:s(`quality`,`it must be one of ${AE.map(e=>e.id).join(`, `)}`)),d!==void 0&&(DE.includes(d)?o.infill=d:s(`infill`,`it must be one of ${DE.join(`, `)}`)),f!==void 0&&(jE.includes(f)?o.walls=f:s(`walls`,`it must be one of ${jE.join(`, `)}`)),p!==void 0&&(typeof p==`boolean`?o.supports=String(p):s(`supports`,`it must be true or false`)),o}function vO(e,t,n,r=e=>console.warn(`slicer-studio: ${e}`)){if(!Array.isArray(e))throw TypeError(`slicer-studio: open() takes a list of { file, copies, settings }`);let i=[];return e.forEach((e,a)=>{let o=`open() item ${a+1}`;if(!gO(e)||!(e.file instanceof File)){r(`${o} left out: it needs a file, as a File`);return}let s=1;e.copies!==void 0&&(Number.isInteger(e.copies)&&e.copies>=1&&e.copies<=100?s=e.copies:r(`${o}: copies ${JSON.stringify(e.copies)} left out: it must be a whole number from 1 to 100`)),i.push({file:e.file,copies:s,settings:_O(e.settings,t,n,o,r)})}),i}function yO(e){let t=/* @__PURE__ */ new Map;for(let{file:n,copies:r,settings:i}of e){let e=JSON.stringify(Object.keys(i).sort().map(e=>[e,i[e]]));t.has(e)||t.set(e,{settings:i,items:[]}),t.get(e).items.push({file:n,copies:r})}return[...t.values()]}var bO=5e5,xO=e=>!!e&&[`step`,`iges`].includes(ye(e.name).format),SO={outside:`is off the bed`,excluded:`is in a part of the bed the printer keeps clear`,tall:`is taller than the printer can print`},CO=e=>e.toLocaleString(`en`);function wO({defaults:e,slice:t}){let[n,r]=(0,B.useReducer)(qw,Vw),a=tO([.../* @__PURE__ */ new Set([...n.plates.map(e=>e.settings.printer),e.printer])].filter(Boolean)),{staffApi:o}=i().config,s=we(),c=(0,B.useRef)(n);c.current=n;let l=(0,B.useRef)(0),u=e=>`${e}-${++l.current}`,[d,f]=(0,B.useState)({}),p=(0,B.useRef)(d);p.current={...d,...p.current};let m=(0,B.useRef)(/* @__PURE__ */ new Map),h=(0,B.useRef)(/* @__PURE__ */ new Set),g=(0,B.useRef)([]),[_,v]=(0,B.useState)([]),[y,b]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=new Set(n.plates.map(e=>e.id));g.current=g.current.filter(t=>!e.has(t.id)||(t.resolve(),!1))},[n.plates]),(0,B.useEffect)(()=>{for(let e of h.current)Object.hasOwn(n.files,e)&&h.current.delete(e);let e=new Set($w(Object.keys(p.current),n.files,h.current));if(!e.size)return;let t=t=>Object.fromEntries(Object.entries(t).filter(([t])=>!e.has(t)));p.current=t(p.current),f(t);for(let t of[...m.current.keys()])e.has(tT(t))&&m.current.delete(t)},[n.files,_]);let x=e=>se(e&&a[e.settings.printer]),S=(e,t)=>{let n=p.current[e];if(!n)return null;let r=eT(e,t);return m.current.has(r)||m.current.set(r,ue(n.positions,t)),m.current.get(r)},C=(e,t)=>{let n=S(e.fileId,e.orient);return n?ce(n.hull,e.spin,t.center[0]+e.x,t.center[1]+e.y):null},w=(e,t,n=null)=>e.objects.filter(e=>e.id!==n).map(e=>C(e,t)).filter(Boolean),T=e=>e.objects.reduce((e,t)=>e+(p.current[t.fileId]?.triangles||0),0),E=(e,t)=>e.objects.some(e=>xO(t[e.fileId])),D=e=>{for(let t of c.current.plates){let n=t.objects.find(t=>t.id===e);if(n)return{plate:t,o:n}}return{}},O=t=>{let n=/* @__PURE__ */ new Set,i=c.current,a={...i.files,...Object.fromEntries(t.map(e=>[e.fileId,e.file]))},o=i.plates.map(e=>({...e,objects:[...e.objects]})),s=o.find(e=>e.id===i.selected.plate)||null,l=[],d=()=>{if(o.length>=10)return null;let t={id:u(`plate`),settings:{...s?s.settings:e},objects:[]};return o.push(t),l.push({type:`addPlate`,id:t.id,settings:t.settings}),t};for(let e of t){let t=null,r=null;if(e.cad)t=s&&!s.objects.length?s:d(),r={x:0,y:0};else{let n=S(e.fileId,L),i=p.current[e.fileId].triangles;if(s&&!E(s,a)&&s.objects.length<50&&T(s)+i<=1e6){let e=x(s);r=re(n.hull,0,w(s,e),e),r&&(t=s)}t||(t=d(),t&&(r=re(n.hull,0,[],x(t))||{x:0,y:0}))}if(!t){$x.error(`Up to 10 plates. Remove one to add more.`);break}let i=Hw(u(`object`),e.fileId,r);t.objects.push(i),l.push({type:`addObjects`,plate:t.id,files:{[e.fileId]:e.file},objects:[i]}),n.add(e.fileId),s=t}return l.forEach(r),n},k=(e,t=e=>e)=>{let n=10-Object.keys(c.current.files).length;if(n<=0)return $x.error(`Up to 10 files at a time. Remove one to add another.`),[];let r=e.filter(e=>t(e).size>sO);r.length&&$x.error(`${r.map(e=>t(e).name).join(`, `)}: over the 50 MB limit. Please choose a smaller file.`);let i=e.filter(e=>t(e).size<=sO);return i.length>n&&$x.error(`Up to 10 files at a time, so ${i.length-n} ${i.length-n===1?`was`:`were`} left out.`),i.slice(0,n)},A=async e=>{let t=u(`file`);if(xO(e))return{fileId:t,file:e,cad:!0};v(t=>[...t,e.name]);try{let{loadMesh:n}=await import(`./chunks/plate-mesh-BoEG27Tx.js`),r=await n(e);return r.triangles>bO?($x.error(`${e.name} has ${CO(r.triangles)} triangles, and the slicer takes up to ${CO(bO)}.`),null):(p.current={...p.current,[t]:r},f(e=>({...e,[t]:r})),h.current.add(t),{fileId:t,file:e})}catch{return $x.error(`${e.name} could not be read. Is it a 3D model?`),null}finally{v(t=>{let n=t.indexOf(e.name);return n<0?t:[...t.slice(0,n),...t.slice(n+1)]})}},j=(e,t)=>{for(let n of e)t.has(n.fileId)||h.current.delete(n.fileId)},M=async e=>{let t=[];for(let n of k(e)){let e=await A(n);e&&t.push(e)}let n=/* @__PURE__ */ new Set;try{t.length&&(n=O(t))}finally{j(t,n)}},N=async e=>{let t=yO(k(e,e=>e.file)),n=/* @__PURE__ */ new Map;for(let e of t.flatMap(e=>e.items)){let t=await A(e.file);t&&n.set(e,t)}let i=e=>o&&e?s.fetchQuery(eO(o,e)).then(e=>e&&e.bed,()=>null):Promise.resolve(null),a=[],l=[],d=!1,f=(e,t,n)=>{let r=u(`plate`);l.push(r),a.push({type:`addPlate`,id:r,settings:{...e}}),a.push({type:`addObjects`,plate:r,files:Object.fromEntries(t.map(e=>[e.fileId,e.file])),objects:t.map(e=>Hw(e.id,e.fileId,n(e)))})},m=()=>10-c.current.plates.length-l.length;try{for(let e of t){let t=[],r=[];for(let i of e.items){let e=n.get(i);if(!e)continue;if(e.cad){r.push({id:u(`object`),...e});continue}let{hull:a}=S(e.fileId,L);for(let n=0;n<i.copies;n++)t.push({id:u(`object`),...e,points:a,triangles:p.current[e.fileId].triangles})}if(t.length){let n=nT(t,se(await i(e.settings.printer)),m());for(let r of n.plates)f(e.settings,r.ids.map(e=>t.find(t=>t.id===e)),e=>r.positions[e.id]);n.left.length&&(d=!0)}for(let t of r){if(m()<=0){d=!0;break}f(e.settings,[t],()=>({x:0,y:0}))}}return d&&$x.error(`Up to 10 plates. Remove one to add more.`),a.forEach(r),l.length?(r({type:`selectPlate`,id:l[0]}),await new Promise(e=>g.current.push({id:l[0],resolve:e})),l[0]):null}finally{j([...n.values()],new Set(a.filter(e=>e.type===`addObjects`).flatMap(e=>Object.keys(e.files))))}},P=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t);if(n<o.length){r({type:`removeObjects`,ids:o.slice(n).map(e=>e.id)});return}if(n===o.length||xO(i.files[t]))return;let s=x(a),l=o[o.length-1],d=S(t,l.orient),f=w(a,s),m=p.current[t].triangles,h=T(a),g=[];for(let e=o.length;e<n;e++){if(a.objects.length+g.length>=50){$x.error(`Up to 50 objects on a plate.`);break}if(h+m>1e6){$x.error(`A plate takes up to ${CO(Bw)} triangles, copies included.`);break}let e=re(d.hull,l.spin,f,s);if(!e){$x.error(`No room for another copy of ${i.files[t].name} on this plate.`);break}g.push(Hw(u(`object`),t,e,l.spin,l.orient)),f.push(ce(d.hull,l.spin,s.center[0]+e.x,s.center[1]+e.y)),h+=m}g.length&&r({type:`addObjects`,plate:e,files:{},objects:g})},F=(e,t)=>r({type:`updateObject`,id:e,patch:t}),I=(e,t,n)=>{let{plate:r}=D(e);if(!r)return;let i=x(r);F(e,{x:t-i.center[0],y:n-i.center[1]})},ee=(e,t,n)=>{let{o:r}=D(e);r&&F(e,{x:r.x+t,y:r.y+n})},te=(e,t)=>F(e,{spin:(Math.round(t*100)/100%360+360)%360}),ne=(e,t)=>{let{o:n}=D(e);n&&te(e,n.spin+t)},me=(e,t)=>{let{o:n}=D(e);n&&F(e,{orient:pe(t===`forward`?ae(90):oe(90),n.orient)})},he=(e,t)=>{let{o:n}=D(e);n&&F(e,{orient:le(n.orient,n.spin,de(t))})},ge=e=>F(e,{orient:L}),_e=e=>{let{o:t}=D(e),n=t&&S(t.fileId,t.orient);if(!n)return;let r=ce(n.hull,t.spin,0,0),i=r.map(e=>e[0]),a=r.map(e=>e[1]);F(e,{x:-(Math.min(...i)+Math.max(...i))/2,y:-(Math.min(...a)+Math.max(...a))/2})},ve=e=>{let t=c.current.plates.find(t=>t.id===e);if(!t)return;let n=x(t),i=t.objects.map(e=>({id:e.id,points:S(e.fileId,e.orient)?.hull,spin:e.spin})).filter(e=>e.points),{positions:a,overflow:o}=fe(i,n);if(r({type:`updateObjects`,patches:a}),!o.length)return;if(c.current.plates.length>=10){$x.error(`${o.length} ${o.length===1?`object doesn’t`:`objects don’t`} fit, and there are already 10 plates.`);return}let s=u(`plate`);r({type:`addPlate`,id:s,settings:{...t.settings}});let l=fe(i.filter(e=>o.includes(e.id)),n);r({type:`moveObjects`,ids:o,to:s,positions:l.positions}),$x(`${o.length} ${o.length===1?`object didn’t`:`objects didn’t`} fit, so ${o.length===1?`it`:`they`} moved to a new plate.`)},z=(e,t,n)=>{let i=c.current,a=i.plates.find(t=>t.id===e);if(!a)return;let o=a.objects.filter(e=>e.fileId===t),s;if(n===`new`){if(i.plates.length>=10){$x.error(`Up to 10 plates.`);return}s={id:u(`plate`),settings:{...a.settings},objects:[]},r({type:`addPlate`,id:s.id,settings:s.settings})}else s=i.plates.find(e=>e.id===n);if(!s)return;if(xO(i.files[t])||E(s,i.files)){if(s.objects.length){$x.error(`STEP and IGES files need a plate of their own.`);return}r({type:`moveObjects`,ids:o.map(e=>e.id),to:s.id,positions:{[o[0].id]:{x:0,y:0}}});return}let l=x(s),d=w(s,l),f={};for(let e of o){let n=S(e.fileId,e.orient),r=n&&re(n.hull,e.spin,d,l);if(!r){$x.error(`No room for ${Object.keys(f).length?`more copies of `:``}${i.files[t].name} on that plate.`);break}f[e.id]=r,d.push(ce(n.hull,e.spin,l.center[0]+r.x,l.center[1]+r.y))}let p=Object.keys(f);p.length&&r({type:`moveObjects`,ids:p,to:s.id,positions:f})},ye=()=>{if(c.current.plates.length>=10){$x.error(`Up to 10 plates.`);return}let t=c.current.plates.find(e=>e.id===c.current.selected.plate);r({type:`addPlate`,id:u(`plate`),settings:{...t?t.settings:e}})},be=(e,t)=>{if(!e.objects.length||E(e,t))return null;let n=c.current.plates.indexOf(e)+1,r=c.current.plates.length>1?` on plate ${n}`:``;if(e.objects.some(e=>!p.current[e.fileId]))return`A model${r} is still loading`;let i=x(e);if(i.standIn)return`The printer’s bed size hasn’t loaded yet${r?` for plate ${n}`:``}`;let a=T(e);if(a>1e6)return`Plate ${n} has ${CO(a)} triangles, and the limit is ${CO(Bw)}`;let o=R(e.objects.map(e=>({id:e.id,points:C(e,i),height:S(e.fileId,e.orient).size[2]})),i),s=e.objects.find(e=>o[e.id].problem);return s?`${t[s.fileId].name}${r} ${SO[o[s.id].problem]}`:null},xe=async(e,t,n)=>{let r=n[e.objects[0].fileId];if(xO(r))return{model:r,settings:e.settings};let{plate3mf:i}=await import(`./chunks/plate-3mf-GYeMGaLV.js`),a=x(e),o=[...new Set(e.objects.map(e=>e.fileId))],s=i(o.map((e,t)=>({id:t+1,name:n[e].name,...p.current[e]})),e.objects.map(e=>({objectId:o.indexOf(e.fileId)+1,...ie(e,S(e.fileId,e.orient).shift,a.center)})));return{model:new File([s],`plate-${t}.3mf`,{type:`model/3mf`}),settings:{...e.settings,plate:!0}}},Se=async()=>{let e=c.current,n=e.plates.filter(t=>Zw(t,e.files)),i=e.plates.find(t=>t.id===e.selected.plate),a=(n.length?n:i&&i.objects.length?[i]:[]).slice().sort((e,t)=>(t===i)-(e===i));if(!a.length)return;let o=Date.now(),s=0,l=null;for(let[n,i]of a.entries()){let c=e.plates.indexOf(i)+1,u=be(i,e.files);if(u)l=Error(u),r({type:`error`,plate:i.id,error:u});else{b({since:o,step:n+1,of:a.length,plate:c,printer:i.settings.printer,phase:`uploading`});try{let{model:n,settings:a}=await xe(i,c,e.files),o=await t.mutateAsync({model:n,settings:a,rot:[0,0,0],onStep:e=>b(t=>t&&{...t,phase:e})});r({type:`result`,plate:i.id,result:{stats:o.stats,used:o.used,price:o.price,quoteId:o.id,gcode:o.gcode||null,name:`plate-${c}.gcode`,sig:Xw(i,e.files)}}),s++}catch(e){l=e;let t=wD(e.status);if(r({type:`error`,plate:i.id,error:t||e.message}),t)break}}}b(null);let u=Math.max(1,Math.round((Date.now()-o)/1e3));l&&wD(l.status)?$x.error(wD(l.status)):s===a.length?$x.success(`Sliced ${a.length===1?`plate ${e.plates.indexOf(a[0])+1}`:`${a.length} plates`} in ${u} s`):a.length===1?$x.error(l.message):$x.error(s?`${s} of ${a.length} plates sliced. Each plate says what went wrong.`:`None of the ${a.length} plates could be sliced. Each plate says why.`)},{plates:V,files:Ce,selected:Te}=n,Ee=V.find(e=>e.id===Te.plate)||null,De=Ee&&Ee.objects.find(e=>e.id===Te.object)||null,Oe=(0,B.useMemo)(()=>x(Ee||{settings:e}),[Ee?Ee.settings.printer:e.printer,a]);return{plates:V,files:Ce,meshes:d,loading:_,slicing:y,plate:Ee,object:De,bed:Oe,scene:(0,B.useMemo)(()=>{if(!Ee)return[];let e=Ee.objects.map(e=>{let t=S(e.fileId,e.orient);return{o:e,f:t,points:t&&ce(t.hull,e.spin,Oe.center[0]+e.x,Oe.center[1]+e.y)}}),t=R(e.filter(e=>e.f).map(e=>({id:e.o.id,points:e.points,height:e.f.size[2]})),Oe);return e.map(({o:e,f:n})=>({id:e.id,fileId:e.fileId,name:Ce[e.fileId].name,cad:xO(Ce[e.fileId]),loaded:!!n,...n?ie(e,n.shift,Oe.center):{},size:n?n.size:null,at:[Oe.center[0]+e.x,Oe.center[1]+e.y],spin:e.spin,problem:t[e.id]?t[e.id].problem:null,overlap:!!(t[e.id]&&t[e.id].overlap)}))},[Ee,Oe,d,Ce]),plateFiles:Ee?Qw(Ee):[],toSlice:V.filter(e=>Zw(e,Ce)).length,stale:e=>Zw(e,Ce),blocker:()=>{for(let e of V.filter(e=>Zw(e,Ce))){let t=be(e,Ce);if(t)return t}return null},addFiles:M,openItems:N,setCopies:P,moveTo:I,moveBy:ee,setSpin:te,spinBy:ne,tip:me,layFlat:he,resetTurns:ge,centre:_e,arrangePlate:ve,moveFile:z,newPlate:ye,sliceAll:Se,selectPlate:e=>r({type:`selectPlate`,id:e}),selectObject:e=>r({type:`selectObject`,id:e}),removeFile:(e,t)=>{let n=c.current.plates.find(t=>t.id===e);n&&r({type:`removeObjects`,ids:n.objects.filter(e=>e.fileId===t).map(e=>e.id)})},removePlate:e=>r({type:`removePlate`,id:e}),setSettings:e=>Ee&&r({type:`settings`,plate:Ee.id,patch:e}),settingsForAll:()=>Ee&&r({type:`settingsForAll`,from:Ee.id})}}var TO=`print-preview.theme`,EO=()=>{try{return localStorage.getItem(TO)||`system`}catch{return`system`}};function DO(){let{root:e,theme:t}=i(),[n,r]=(0,B.useState)(EO),a=t||n;return(0,B.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,B.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(TO):localStorage.setItem(TO,n)}catch{}},[n,t]),[a,t?null:r]}var OO=`print-preview.printer`,kO=()=>{try{return localStorage.getItem(OO)||null}catch{return null}};function AO(e,t){return e.error?`failed`:e.result?t?`stale`:`sliced`:null}function jO(e,t){if(!e.objects.length)return null;if(e.error)return{text:e.error,warn:!0};if(!e.result)return{text:`Not sliced yet.`};if(t)return{text:`Changed since it was sliced. Slice it again to see the change.`,warn:!0};let{stats:n,price:r}=e.result;return{text:`${n.weightG} g, ${RE(n.seconds)}${r?`, ${HE({low:r.min,high:r.max},r.currency)}`:``}`}}function MO(){let[e,t]=DO(),{config:{staffApi:n},actions:r}=i(),a=ZD(),o=JD(),s=QD(),c=oO(),l=nO(),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(`prepare`),[m,h]=(0,B.useState)(!1),g=(0,B.useRef)(null),_=(0,B.useRef)(null),[v,y]=(0,B.useState)(()=>({...EE,printer:kO()??``})),b=(0,B.useRef)(kO()!==null),x=wO({defaults:v,slice:l}),{plate:S,object:C}=x,w=S?S.settings:v,T=e=>S?x.setSettings(e):y(t=>({...t,...e})),E=$D(w.printer,w.material);(0,B.useEffect)(()=>{if(w.printer)try{localStorage.setItem(OO,w.printer)}catch{}},[w.printer]),(0,B.useEffect)(()=>{!b.current&&o.data&&(b.current=!0,o.data.defaultPrinter&&T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data]),(0,B.useEffect)(()=>{o.data&&w.printer&&!s.isLoading&&(o.data.printers.includes(w.printer)||s.data&&vE(s.data,w.printer)||T({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data,s.data,s.isLoading,S&&S.id]);let D=E.data&&E.data.materials;(0,B.useEffect)(()=>{D&&D.length&&!D.includes(w.material)&&T({material:D.includes(`PLA`)?`PLA`:D[0],filament:``})},[D,w.material]);let O=!!(o.isError||o.data&&w.printer!==``)&&!s.isLoading,k=(0,B.useRef)(null);k.current={settings:w,openItems:x.openItems,shop:{isKnown:o.data?e=>o.data.printers.includes(e)||!!(s.data&&vE(s.data,e)):null,defaultPrinter:o.data?o.data.defaultPrinter:``}};let A=(0,B.useRef)(Promise.resolve());(0,B.useEffect)(()=>{if(O)return r.opener.set(e=>{let t=A.current.then(async()=>{let{settings:t,shop:n}=k.current,r=vO(e,t,n);r.length&&(p(`prepare`),h(!1),await k.current.openItems(r))});return A.current=t.catch(()=>{}),t}),()=>r.opener.set(null)},[O]);let j=(0,B.useRef)(!1),M=async e=>{let{models:t,others:n}=await z(e);if(t.length){p(`prepare`),x.addFiles(t),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0],a=(...e)=>{j.current=!1,c.open(...e),p(`preview`)};i.kind===`gcode`?a(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?a(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?d({file:r,plates:i.plates}):$x.error(`${r.name} is not a model or G-code file. Use STL, 3MF, OBJ, STEP, IGES or G-code.`)},N=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:M}),P=S&&S.result,F=(0,B.useRef)({plate:null,result:null});(0,B.useEffect)(()=>{let e=F.current;F.current={plate:S&&S.id,result:P},P&&P.gcode?(j.current=!0,c.open(P.gcode,P.name,{stats:P.stats,used:P.used}),e.plate===(S&&S.id)&&e.result!==P&&p(`preview`)):j.current&&(j.current=!1,c.close())},[S&&S.id,P]);let I=e=>(...t)=>{p(`prepare`),e(...t)},ee=TD(n,a),te=ee?`${ee}. You can still open G-code files.`:x.plates.some(e=>e.objects.length)?w.printer===null?`Choose a model for this brand.`:x.blocker():`Add a model to the plate.`,ne=x.slicing&&{...x.slicing,title:`${PE(x.slicing.phase,`Slicing`)} plate ${x.slicing.plate}${x.slicing.of>1?` (${x.slicing.step} of ${x.slicing.of})`:``}`,printer:x.slicing.printer||`The default printer`},re=C&&x.scene.find(e=>e.id===C.id),ie=C?S.objects.filter(e=>e.fileId===C.fileId):[],ae=x.scene.find(e=>e.cad),oe={plates:x.plates.map((e,t)=>({id:e.id,n:t+1,state:AO(e,x.stale(e))})),selected:S&&S.id,files:x.plateFiles.map(e=>{let t=x.scene.find(t=>t.id===e.objects[0].id);return{fileId:e.fileId,name:x.files[e.fileId].name,copies:e.objects.length,cad:t&&t.cad,size:t&&t.size,on:!!C&&C.fileId===e.fileId,firstId:e.objects[0].id}}),loading:x.loading,summary:S&&jO(S,x.stale(S)),onSelectPlate:x.selectPlate,onNewPlate:I(x.newPlate),onRemovePlate:x.removePlate,onSettingsForAll:()=>{x.settingsForAll(),$x.success(`Every plate now has these settings`)},onFiles:M,onChoose:()=>_.current.click(),onSelectFile:I(x.selectObject),onCopies:I((e,t)=>x.setCopies(S.id,e,t)),onMove:(e,t)=>x.moveFile(S.id,e,t),onRemove:e=>x.removeFile(S.id,e)},se={item:re,layMode:m,canArrange:!!S&&S.objects.length>0&&!ae,copy:C?{k:ie.indexOf(C)+1,of:ie.length}:null,problem:re&&(re.problem?`It ${SO[re.problem]}. Move it, or turn it.`:re.overlap?`It overlaps another object.`:null),onLayMode:I(h),onMoveTo:I((e,t)=>x.moveTo(C.id,e,t)),onSpin:I(e=>x.setSpin(C.id,e)),onSpinBy:I(e=>x.spinBy(C.id,e)),onTip:I(e=>x.tip(C.id,e)),onReset:I(()=>x.resetTurns(C.id)),onCentre:I(()=>x.centre(C.id)),onArrange:I(()=>x.arrangePlate(S.id))},ce={bed:x.bed,scene:x.scene,meshes:x.meshes,selected:C&&C.id,layMode:m,onSelect:e=>x.selectObject(e),onMove:(e,t,n)=>x.moveBy(e,t,n),onLay:(e,t)=>{x.layFlat(e,t),h(!1)},onLayMode:h};return/* @__PURE__ */ (0,V.jsxs)(`div`,{...N.getRootProps({className:`flex min-h-[max(100%,360px)] flex-col outline-none md:h-full`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:g,type:`file`,accept:be,hidden:!0,onChange:e=>{M([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`input`,{ref:_,type:`file`,accept:ve,multiple:!0,hidden:!0,onChange:e=>{M([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex flex-1 flex-col md:min-h-0 md:flex-row`,children:[/* @__PURE__ */ (0,V.jsx)(`main`,{className:`min-w-0 md:order-2 md:flex-1`,children:/* @__PURE__ */ (0,V.jsx)(xD,{gcode:c,slicing:ne,mode:f,onMode:p,editor:ce,emptyPlate:!S||!S.objects.length&&!x.loading.length,note:ae?`${ae.name} is placed by the slicer, in the middle of the bed. Its shape shows in Preview once it is sliced.`:null,onOpenGcode:()=>g.current.click(),onChooseModel:()=>_.current.click()})}),/* @__PURE__ */ (0,V.jsx)(`div`,{className:`md:order-1 md:flex md:min-h-0`,children:/* @__PURE__ */ (0,V.jsx)(eD,{plates:oe,position:se,settings:w,onSettings:T,printers:s,ourPrinters:LE(o.data),options:E,toSlice:x.toSlice,slicingSince:x.slicing&&x.slicing.since,phase:x.slicing&&x.slicing.phase,blocker:te,onSlice:x.sliceAll,onOpenGcode:()=>g.current.click(),theme:e,onTheme:t})})]}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:N.isDragActive,text:`Drop models to put them on the plate, or G-code to open it`}),/* @__PURE__ */ (0,V.jsx)(Nw,{pick:u,onClose:()=>d(null),onPick:e=>{j.current=!1,c.open(u.file,`${u.file.name}, plate ${e}`,null,{plate:e}),d(null),p(`preview`)}})]})}var NO=8e3;async function PO(e,t,n,r){n?.throwIfAborted();let i=new AbortController,a=()=>i.abort(),o=setTimeout(a,r);n?.addEventListener(`abort`,a);try{let n=await fetch(e,{...t,method:`POST`,headers:{"content-type":`application/json`},signal:i.signal});return n.status===200?await n.json():null}catch(e){if(e.name===`SyntaxError`)return null;throw e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}async function FO({authUrl:e,verifyUrl:t},n,r=NO){if(!e||!t)return`not-set-up`;try{let i=await PO(e,{credentials:`include`,body:`{}`},n,r);if(!i||typeof i.token!=`string`||!i.token)return`refused`;let a=await PO(t,{credentials:`omit`,body:JSON.stringify({token:i.token})},n,r);return a&&a.valid===!0?`granted`:`refused`}catch{return`unreachable`}}var IO={refused:`Advanced is for staff. Sign in and try again.`,unreachable:`We couldn’t check your access. Please try again.`,"not-set-up":`Advanced isn’t set up on this page.`};function LO(){return DO(),/* @__PURE__ */ (0,V.jsx)(`div`,{role:`status`,className:`flex h-full min-h-[240px] items-center justify-center text-[14px] text-muted`,children:`Checking your access…`})}function RO({reason:e,onRetry:t}){return DO(),/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`alert`,className:`flex h-full min-h-[240px] flex-col items-center justify-center gap-4 p-6 text-center`,children:[/* @__PURE__ */ (0,V.jsx)(`p`,{className:`max-w-sm text-[15px] font-medium`,children:IO[e]}),e!==`not-set-up`&&/* @__PURE__ */ (0,V.jsx)(zw,{onClick:t,children:`Try again`})]})}function zO(){let{config:e,emit:t,actions:n}=i(),{advanced:r}=e,a=r?JSON.stringify(r):null,[o,s]=(0,B.useState)(0),c=`${a} ${o}`,[l,u]=(0,B.useState)(null);(0,B.useEffect)(()=>{if(!a)return;let e=new AbortController;return FO(r,e.signal).then(n=>{e.signal.aborted||(u({asking:c,result:n}),n!==`granted`&&t(`advanceddenied`,{reason:n}))}),()=>e.abort()},[c]);let d=a&&l&&l.asking===c&&l.result!==`granted`?l.result:null;return(0,B.useEffect)(()=>{if(!d)return;let e=/* @__PURE__ */ Error(`slicer-studio: Advanced isn't open to this visitor (${d})`);return n.opener.fail(e),n.opener.set(()=>Promise.reject(e)),()=>n.opener.set(null)},[d]),a?!l||l.asking!==c?/* @__PURE__ */ (0,V.jsx)(LO,{}):l.result===`granted`?/* @__PURE__ */ (0,V.jsx)(MO,{}):/* @__PURE__ */ (0,V.jsx)(RO,{reason:l.result,onRetry:()=>s(e=>e+1)}):/* @__PURE__ */ (0,V.jsx)(MO,{})}function BO({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,V.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`font-display text-[16px] leading-tight font-semibold tracking-[-0.01em]`,children:e}),t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`min-w-0 text-right text-[11px] text-muted`,children:t}),n]})}function VO({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,V.jsxs)(`section`,{className:E(`min-w-0 rounded-[20px] bg-panel p-5`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,V.jsx)(BO,{title:t,aside:n,action:r}),a]})}function HO({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,V.jsxs)(Kc,{value:String(e.value),className:E(`flex min-h-10 items-center justify-between gap-3 rounded-[12px] bg-raise px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,V.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num text-[12px] font-normal opacity-75`,children:e.aside})]},e.value))})}var UO=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function WO(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
55
+ `)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function GO({id:e}){let t={width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,V.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,V.jsx)(`path`,{d:`M18 4h4`})]})}function KO({value:e,onChange:t,action:n}){let r=UO.find(t=>t.id===e);return/* @__PURE__ */ (0,V.jsxs)(VO,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,V.jsx)(Lc,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:UO.map(e=>/* @__PURE__ */ (0,V.jsxs)(Kc,{value:e.id,className:`flex flex-col items-start gap-2 rounded-[16px] bg-raise p-3 text-left outline-offset-2 transition-colors hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(GO,{id:e.id})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block font-display text-[18px] leading-none font-semibold`,children:e.id}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 block text-[12px] text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[13px] text-muted`,children:[r.hint,`.`,!r.priced&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink`,children:` Quoted by our team.`})]})]})}var qO=(0,B.lazy)(()=>import(`./chunks/ModelPreview-b3D28pKp.js`));function JO({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,V.jsx)(`section`,{style:{gridArea:`model`},className:E(`relative overflow-hidden rounded-[28px] lg:min-h-[480px]`,e?`min-h-[480px] bg-viewer`:`min-h-[360px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(B.Suspense,{fallback:null,children:/* @__PURE__ */ (0,V.jsx)(qO,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-3 bottom-3 rounded-xl bg-panel px-3.5 py-2 text-[13px] font-medium transition-colors hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[336px] w-full flex-col items-center justify-center gap-3 rounded-[20px] border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[456px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`28px 28px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-14 place-items-center rounded-2xl bg-accent text-accent-contrast transition-transform group-hover:-translate-y-0.5`,children:/* @__PURE__ */ (0,V.jsx)(Ow,{className:`size-6`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 font-display text-[24px] leading-tight font-semibold`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 text-[14px] text-muted`,children:[`or `,/* @__PURE__ */ (0,V.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. STL, 3MF, OBJ or STEP, up to `,t?`50 MB`:`10 files of 50 MB`]})]})})}function YO({icon:e,children:t}){return/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,V.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function XO({name:e,value:t,onChange:n}){let r=e=>n(t=>Math.min(50,Math.max(1,t+e))),i=`grid size-9 place-items-center rounded-lg text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,V.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-xl bg-raise p-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:t<=1,onClick:()=>r(-1),className:i,children:/* @__PURE__ */ (0,V.jsx)(uw,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num w-8 text-center text-[14px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:t>=50,onClick:()=>r(1),className:i,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]})}function ZO({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,V.jsxs)(Za,{children:[/* @__PURE__ */ (0,V.jsx)($a,{"aria-label":`More for ${e}`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,V.jsx)(JC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(eo,{container:r,children:/* @__PURE__ */ (0,V.jsxs)(no,{align:`end`,sideOffset:4,className:`z-50 min-w-[240px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t&&/* @__PURE__ */ (0,V.jsx)(ro,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,V.jsx)(ro,{className:E(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function QO({row:{item:e,stale:t},line:n,thumb:r,on:i,priced:a,onSelect:o,onRemove:s,onCopies:c,onApplyAll:l}){let u=e.file.name,d=e.result&&e.result.stats.sizeMm||r&&r.size,f=d?/* @__PURE__ */ (0,V.jsxs)(YO,{icon:bw,children:[d.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,V.jsx)(`span`,{children:_e(e.file.size)}),p=a&&n&&!t&&!e.error;return/* @__PURE__ */ (0,V.jsxs)(`li`,{className:E(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-2xl border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:o,className:`flex min-w-0 flex-1 basis-full items-center gap-3.5 rounded-xl text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-[62px] shrink-0 place-items-center overflow-hidden rounded-xl bg-raise`,children:r?/* @__PURE__ */ (0,V.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,V.jsx)(te,{className:`size-6 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:u,children:u}),e.error?/* @__PURE__ */ (0,V.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[13px] text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12px] text-muted`,children:[p&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:te,children:UE(n.gramsRange)}),p&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:WC,children:WE(n.secondsRange)}),f,a&&!n&&/* @__PURE__ */ (0,V.jsx)(`span`,{children:`Not priced yet`}),a&&t&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Changed, update the price`}),p&&e.result.stats.watertight===!1&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`text-warn`,children:`Has holes, so it may not print as expected`})]})]})]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[p&&n.range&&/* @__PURE__ */ (0,V.jsx)(`span`,{className:`num mr-auto text-[14px] font-semibold whitespace-nowrap @xl:mr-1`,children:HE(n.range,n.currency)}),a&&/* @__PURE__ */ (0,V.jsx)(XO,{name:u,value:e.copies,onChange:c}),/* @__PURE__ */ (0,V.jsx)(ZO,{name:u,onApplyAll:a?l:void 0,onRemove:s})]})]})}function $O({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`grid size-8 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink disabled:opacity-40 disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,V.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num text-[13px] text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,V.jsx)(RC,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:E(`num grid size-8 place-items-center rounded-lg text-[13px] font-medium transition-colors`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,V.jsx)(IC,{className:`size-4`,"aria-hidden":!0})})]})]})}function ek({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=cO(i),[o,s]=(0,B.useState)(0),c=Math.min(o,a-1);(0,B.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(lO(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num rounded-full border border-rule px-2.5 py-0.5 text-[13px] text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,V.jsx)(VO,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,V.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`flex w-full items-center gap-4 rounded-2xl border border-dashed border-rule p-2.5 text-left transition-colors hover:border-accent`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`grid size-12 shrink-0 place-items-center rounded-full bg-raise`,children:/* @__PURE__ */ (0,V.jsx)(mw,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,V.jsx)(`span`,{className:`block text-[14px] font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Upload STL, 3MF, OBJ or STEP (max `,e.max,` files)`]})]})]}),i>0&&/* @__PURE__ */ (0,V.jsx)(`ul`,{className:E(`space-y-2`,a>1&&`min-h-[284px] @xl:min-h-[188px]`),children:l.map(a=>/* @__PURE__ */ (0,V.jsx)(QO,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,V.jsx)($O,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function tk({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=IE(e.material,r),o=Math.max(0,AE.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,V.jsxs)(VO,{area:`material`,children:[/* @__PURE__ */ (0,V.jsx)(BO,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,V.jsx)(HO,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-2.5 text-[13px] text-warn`,children:a}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-5 border-t border-rule pt-4`,children:[/* @__PURE__ */ (0,V.jsx)(BO,{title:`Finish`,aside:`${AE[o].mm} mm layers`}),/* @__PURE__ */ (0,V.jsx)(TE,{bare:!0,label:`Finish`,values:AE.map((e,t)=>t),value:o,onChange:e=>t({quality:AE[e].id}),format:e=>AE[e].label,valueText:e=>`${AE[e].label}, ${AE[e].mm} mm layers`,captions:AE.map(e=>e.label)})]})]})}function nk({simple:e,onSimple:t}){return/* @__PURE__ */ (0,V.jsx)(VO,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,V.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,V.jsx)(TE,{label:`Infill`,values:DE,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,V.jsx)(TE,{label:`Walls`,values:jE,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[jE[0],jE[jE.length-1]]})]})})})}var rk=`silver-fill inline-flex h-11 w-full items-center justify-center gap-2 rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90 disabled:opacity-50`;function ik({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,V.jsxs)(_o,{children:[/* @__PURE__ */ (0,V.jsx)(yo,{"aria-label":`How this price is worked out`,className:`grid size-6 place-items-center rounded-full opacity-75 transition-opacity hover:opacity-100`,children:/* @__PURE__ */ (0,V.jsx)(iw,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,V.jsx)(Co,{container:t,children:/* @__PURE__ */ (0,V.jsx)(To,{side:`top`,sideOffset:4,collisionPadding:12,className:`z-50 max-w-[260px] space-y-1.5 rounded-xl border border-rule bg-panel p-3 text-[13px] text-ink shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:e})})]})}function ak({children:e}){return/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-hero-warn`,children:[/* @__PURE__ */ (0,V.jsx)(HC,{className:`mt-px size-4 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,V.jsx)(`span`,{children:e})]})}function ok({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,button:u,onEstimate:d,onButton:f}){let p=$E(c&&c.since),m=i+r>0,h=e&&e.range,g=s&&e&&!c;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-5 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,V.jsx)(`h2`,{className:`text-[14px] font-medium opacity-75`,children:`Estimated price`}),e&&(h||o)&&/* @__PURE__ */ (0,V.jsxs)(ik,{children:[h&&/* @__PURE__ */ (0,V.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,V.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[h?/* @__PURE__ */ (0,V.jsx)(Ix.p,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35},className:`num mt-1.5 font-display text-[34px] leading-[1.05] font-semibold tracking-[-0.02em] @sm:text-[40px]`,children:HE(h,e.currency)},`${h.low}-${h.high}`):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-1.5 font-display text-[24px] leading-tight font-semibold`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[13px] opacity-85`,children:[/* @__PURE__ */ (0,V.jsxs)(YO,{icon:te,children:[UE(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,V.jsxs)(YO,{icon:WC,children:[`About `,WE(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,V.jsxs)(YO,{icon:nw,children:[n,` files, `,a,` pieces`]}),o&&/* @__PURE__ */ (0,V.jsx)(YO,{icon:Mw,children:`Quick estimate`})]})]}):/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-1.5 text-[15px] opacity-85`,children:n?`Your files are ready. Get the price when your choices are set.`:`Upload a model, and its price shows here.`}),m&&!c&&e&&/* @__PURE__ */ (0,V.jsxs)(ak,{children:[r?`${r} ${r===1?`file has`:`files have`} no price yet.`:`Your choices changed.`,` Update the price to include `,r+i===1?`it`:`them`,`.`]}),l&&!c&&n>0&&/* @__PURE__ */ (0,V.jsx)(ak,{children:l})]}),g?u&&/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:rk,disabled:!h||e.unpriced.length>0,onClick:f,children:u.label}):/* @__PURE__ */ (0,V.jsx)(`button`,{type:`button`,className:rk,disabled:!n||!!l||!!c,onClick:d,children:c?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[/* @__PURE__ */ (0,V.jsx)(ee,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` `,PE(c.phase,`Working it out`),c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,V.jsxs)(`span`,{className:`num`,children:[p,` s`]})]}):e?`Update the price`:`Get the price`})]})}var sk={SLA:`Resin is cured layer by layer with light, for fine detail and smooth surfaces: miniatures, small precise parts, moulds.`,SLS:`A laser fuses nylon powder, for tough, functional parts with no supports: clips, hinges, housings that take a beating.`};function ck({process:e,contact:t,fileNames:n}){let r=UO.find(t=>t.id===e),i=WO(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,V.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-6 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,V.jsxs)(`h2`,{className:`font-display text-[24px] leading-tight font-semibold`,children:[r.id,` prints are quoted by our team`]}),/* @__PURE__ */ (0,V.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:sk[e]}),/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before you send it.`:``]})]}),i?/* @__PURE__ */ (0,V.jsxs)(`a`,{href:i,className:`silver-fill inline-flex h-11 items-center justify-center gap-2 self-start rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90`,children:[/* @__PURE__ */ (0,V.jsx)(cw,{className:`size-[18px]`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,V.jsxs)(`p`,{className:`text-[14px] font-medium`,children:[`Ask at `,a,` for a price.`]})]})}var lk=e=>e.replace(/\.\w+$/,``);function uk(e){let t=e.filter(e=>e.size<=sO),n=e.filter(e=>e.size>sO).map(e=>e.name);return n.length&&$x.error(`${n.join(`, `)}: over the 50 MB limit. Please choose a smaller file.`),t}function dk({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,B.useReducer)(fO,uO),a=(0,B.useRef)(0),[o,s]=(0,B.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>pO(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>mO(e,l(e))),f=t=>{let n=uk(t);if(!n.length)return;let o=10-r.items.length;if(o<=0)return $x.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:n.slice(0,o).map(e=>({id:`file-${++a.current}`,file:e}))});let s=n.length-o;s>0&&$x.error(`Up to 10 files at a time, so ${s} ${s===1?`was`:`were`} left out.`)},p=t=>{uk([t]).length&&i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t})},m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,file:r.file.name,printer:c.printer,phase:`uploading`});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot,onStep:e=>s(t=>t&&{...t,phase:e})}),n={stats:e.stats,used:e.used,price:e.price,quoteId:e.id,gcode:e.gcode||null,name:lk(r.file.name)+`.gcode`,material:c.material,sig:d};i({type:`result`,id:r.id,result:n}),u++}catch(e){f=e;let t=wD(e.status);if(i({type:`error`,id:r.id,error:t||e.message}),t)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&wD(f.status)?$x.error(wD(f.status)):u===a.length?$x.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?$x.error(f.message):$x.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),$x.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}function fk(e){let[t,n]=(0,B.useState)({}),r=(0,B.useRef)(/* @__PURE__ */ new Set),i=(0,B.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,B.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-RKI9IqqD.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var pk=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),mk=(e,t)=>Array(t).fill(e);function hk(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>mk(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:mk(e,4)):r?[mk(r,4)]:[],f=i?o?[[i,i,o,o]]:[mk(i,4)]:[];return{one:pk(s.map(e=>[e])),two:pk(l),four:pk([...d,...f])}}function gk(e,t){let n=KE(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=GE(e.result.stats,e.copies,e.result.price,t);return{name:e.file.name,file:e.file,quoteId:e.result.quoteId,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function _k(e,t,n){let r=new URL(e,n);return r.searchParams.set(`quotes`,t.map(e=>`${e.quoteId}:${e.copies}`).join(`,`)),r.href}function vk(){let{config:e,emit:t,actions:n}=i(),[r,a]=DO(),o=JD(),s=XD(),[c,l]=(0,B.useState)(`FDM`),[u,d]=(0,B.useState)(()=>({...ME,...e.defaults})),f=(0,B.useRef)(null),p=JSON.stringify(e.defaults);(0,B.useEffect)(()=>d(t=>({...t,...e.defaults})),[p]);let m=o.data,h=m?m.defaultPrinter:``,g=m?m.pricing:null,_=dk({defaults:u,slice:s,requestFor:e=>({...e.settings,printer:h})}),{selected:v}=_,y=v?v.settings:u,b=e=>v?_.setSettings(e):d(t=>({...t,...e})),x=fk(_.items),S=AD(e),C=!S.has(`files`),w=YD(h),T=NE(w.data?w.data.materials:kE.map(e=>e.id)),E=T.map(e=>e.id).join();(0,B.useEffect)(()=>{T.length&&!T.some(e=>e.id===y.material)&&b({material:T[0].id})},[E,y.material]);let D=async e=>{let{models:t,others:n}=await z(e);t.length&&(C?_.replace(t[0]):_.add(t)),n.length&&$x.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use STL, 3MF, OBJ, STEP or IGES.`)},O=OC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:D}),k=_.items.filter(e=>e.result),A=k.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material,price:e.result.price})),j=e=>GE(e.result.stats,e.copies,e.result.price,g),M=_.items.length?o.isError?`The server can’t be reached.`:w.error&&w.error.status===503?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,N={..._.list,onAdd:()=>f.current.click()},P=UO.find(e=>e.id===c).priced,F=hk(S,P),I=()=>_.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),ee=P&&k.length===_.items.length&&!_.todo.length&&!_.slicing&&_.items.length>0,te=(0,B.useRef)(null),ne=e=>{let n=gk(_.items,g),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==te.current)&&t(`estimate`,n),te.current=r};(0,B.useEffect)(()=>{ee&&ne(!1)});let re=()=>{if(!ee||!e.button)return;let n=gk(_.items,g);t(`buttonclick`,n,{cancelable:!0})&&e.button.url&&location.assign(_k(e.button.url,n.files,document.baseURI))};return(0,B.useEffect)(()=>{n.getPrice=()=>{if(P&&_.items.length&&!_.slicing&&!M)return _.todo.length?I():ne(!0)}}),/* @__PURE__ */ (0,V.jsxs)(`div`,{...O.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,V.jsx)(`input`,{ref:f,type:`file`,accept:ve,multiple:!C,hidden:!0,onChange:e=>{D([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,V.jsx)(`main`,{className:`mx-auto w-full p-3 sm:p-4`,children:/* @__PURE__ */ (0,V.jsxs)(`div`,{className:`bento`,style:{"--areas-one":F.one,"--areas-two":F.two,"--areas-four":F.four},children:[S.has(`process`)&&/* @__PURE__ */ (0,V.jsx)(KO,{value:c,onChange:l,action:a&&/* @__PURE__ */ (0,V.jsx)(QE,{theme:r,onTheme:a})}),S.has(`model`)&&/* @__PURE__ */ (0,V.jsx)(JO,{model:v&&v.file,single:C,onChoose:()=>f.current.click()}),S.has(`files`)&&/* @__PURE__ */ (0,V.jsx)(ek,{files:N,lineCost:j,thumbs:x,priced:P}),P?/* @__PURE__ */ (0,V.jsxs)(V.Fragment,{children:[S.has(`material`)&&/* @__PURE__ */ (0,V.jsx)(tk,{simple:y,onSimple:b,materials:T,printer:h}),S.has(`strength`)&&/* @__PURE__ */ (0,V.jsx)(nk,{simple:y,onSimple:b}),S.has(`cost`)&&/* @__PURE__ */ (0,V.jsx)(ok,{estimate:A.length?KE(A,g):null,percent:g?g.range:0,files:_.items.length,missing:_.items.length-k.length,stale:_.rows.filter(e=>e.stale).length,pieces:_.items.reduce((e,t)=>e+t.copies,0),quick:k.some(e=>e.result.stats.estimated),ready:!_.todo.length,slicing:_.slicing,blocker:M,button:e.button,onEstimate:I,onButton:re})]}):S.has(`contact`)&&/* @__PURE__ */ (0,V.jsx)(ck,{process:c,contact:m&&m.contact,fileNames:_.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,V.jsx)(Pw,{show:O.isDragActive,text:`Drop your models to get a price`})]})}var yk=()=>new Pt({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function bk({mode:e,...t}){let[n]=(0,B.useState)(yk);return/* @__PURE__ */ (0,V.jsx)(o.Provider,{value:t,children:/* @__PURE__ */ (0,V.jsx)(Te,{client:n,children:/* @__PURE__ */ (0,V.jsx)(Xy,{reducedMotion:`user`,children:/* @__PURE__ */ (0,V.jsxs)(S,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,V.jsx)(zO,{}):/* @__PURE__ */ (0,V.jsx)(vk,{}),(0,hn.createPortal)(/* @__PURE__ */ (0,V.jsx)(mS,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule`}}),t.portal)]})})})})}var xk=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
56
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);height:100%;min-height:0;color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;flex-direction:column;flex:auto;font-size:14px;line-height:1.45;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.-top-1{top:calc(var(--spacing) * -1)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-16{top:calc(var(--spacing) * 16)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.-right-1{right:calc(var(--spacing) * -1)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-14{left:calc(var(--spacing) * 14)}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-1{margin:var(--spacing)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-px{margin-top:1px}.mr-auto{margin-right:auto}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\\.5{margin-bottom:calc(var(--spacing) * 3.5)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[18px\\]{width:18px;height:18px}.size-\\[62px\\]{width:62px;height:62px}.size-full{width:100%;height:100%}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\\[240px\\]{min-height:240px}.min-h-\\[284px\\]{min-height:284px}.min-h-\\[336px\\]{min-height:336px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[480px\\]{min-height:480px}.min-h-\\[max\\(100\\%\\,360px\\)\\]{min-height:max(100%,360px)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[52px\\]{width:52px}.w-\\[104px\\]{width:104px}.w-\\[188px\\]{width:188px}.w-\\[min\\(360px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(360px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[240px\\]{min-width:240px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-panel{border-color:var(--panel)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink{background-color:var(--ink)}.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel,.bg-panel\\/85{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/85{background-color:color-mix(in oklab, var(--panel) 85%, transparent)}}.bg-panel\\/90{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/90{background-color:color-mix(in oklab, var(--panel) 90%, transparent)}}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[24px\\]{font-size:24px}.text-\\[34px\\]{font-size:34px}.leading-\\[1\\.05\\]{--tw-leading:1.05;line-height:1.05}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.display{letter-spacing:-.01em;font-stretch:118%}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:#f4f4f5;box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-warn{color:var(--warn)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.3\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.35\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_24px_64px_-24px_rgb\\(0_0_0\\/0\\.5\\)\\]{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,border-color\\,background-color\\]{transition-property:opacity,border-color,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\\:text-muted::placeholder{color:var(--muted)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-muted:focus-within{border-color:var(--muted)}@media (hover:hover){.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-ink:hover{background-color:var(--ink)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}}.disabled\\:text-muted:disabled{color:var(--muted)}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.data-\\[disabled\\]\\:cursor-default[data-disabled]{cursor:default}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.08\\)\\][data-state=on]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@sm\\:text-\\[40px\\]{font-size:40px}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[188px\\]{min-height:188px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}}@container studio (width>=640px){.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=768px){.md\\:order-1{order:1}.md\\:order-2{order:2}.md\\:flex{display:flex}.md\\:h-full{height:100%}.md\\:min-h-0{min-height:0}.md\\:w-\\[340px\\]{width:340px}.md\\:flex-1{flex:1}.md\\:shrink-0{flex-shrink:0}.md\\:flex-row{flex-direction:row}.md\\:overflow-y-auto{overflow-y:auto}.md\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:flex{display:flex}.lg\\:min-h-\\[456px\\]{min-height:456px}.lg\\:min-h-\\[480px\\]{min-height:480px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-\\[12px\\] [cmdk-group-heading]{font-size:12px}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * .05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`,Sk=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function Ck(e){let t=e.match(Sk)||[];return{shadow:e.replace(Sk,``),page:t.join(``)}}var wk=e=>e===`advanced`?`advanced`:`simple`;function Tk(){let e=null,t=[],n=e=>{let n=t;t=[],n.forEach(e)};return{get:()=>e?Promise.resolve(e):new Promise((e,n)=>t.push({resolve:e,reject:n})),set:t=>{e=t||null,e&&n(t=>t.resolve(e))},fail:e=>n(t=>t.reject(e))}}var Ek=[`light`,`dark`,`system`],Dk=`slicer-studio: open() works in advanced mode only`,Ok=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},kk=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},Ak=null;function jk(){if(Ak)return Ak;let{shadow:e,page:t}=Ck(xk);return Ak=Ok(e),kk(Ok(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>kk(Ok(e))),Ak}function Mk(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={opener:Tk()};get config(){return this.#r}set config(e){this.#r=kD(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}open(e){return wk(this.getAttribute(`mode`))===`advanced`?this.#i.opener.get().then(t=>t(e)):Promise.reject(/* @__PURE__ */ Error(Dk))}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,gn.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`mode`&&wk(n)!==`advanced`&&this.#i.opener.fail(/* @__PURE__ */ Error(Dk)),e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[jk()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,B.createElement)(B.StrictMode,null,(0,B.createElement)(bk,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:wk(this.getAttribute(`mode`)),theme:Ek.includes(t)?t:null,emit:(e,t,{cancelable:n=!1}={})=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:n}))})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&Mk();